Subversion Repositories SvarDOS

Rev

Rev 1513 | Rev 1523 | Go to most recent revision | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 1513 Rev 1520
Line 30... Line 30...
30
 
30
 
31
<select name="hwcpu">
31
<select name="hwcpu">
32
 
32
 
33
<?php
33
<?php
34
  // build form with list of CPUs + preselect the current CPU (if any)
34
  // build form with list of CPUs + preselect the current CPU (if any)
35
  $cpus = array('586', '486', '186', '8086');
35
  $cpus = array('586', '486', '386', '286', '186', '8086');
36
  foreach ($cpus as $cpu) {
36
  foreach ($cpus as $cpu) {
37
    $sel = '';
37
    $sel = '';
38
    if (array_search($cpu, $hw) !== false) $sel = ' selected';
38
    if (array_search($cpu, $hw) !== false) $sel = ' selected';
39
    echo "<option{$sel}>{$cpu}</option>\n";
39
    echo "<option{$sel}>{$cpu}</option>\n";
40
  }
40
  }
Line 53... Line 53...
53
?>
53
?>
54
</select>
54
</select>
55
 
55
 
56
<select name="hwvid">
56
<select name="hwvid">
57
<?php
57
<?php
58
  // build form with list of CPUs + preselect the current CPU (if any)
58
  // build form with list of graphic cards + preselect the current card (if any)
59
  $vids = array('SVGA', 'VGA', 'MCGA', 'EGA', 'CGA', 'MDA', 'HGC');
59
  $vids = array('SVGA', 'VGA', 'MCGA', 'EGA', 'CGA', 'MDA');
60
  foreach ($vids as $v) {
60
  foreach ($vids as $v) {
61
    $sel = '';
61
    $sel = '';
62
    if (array_search(strtolower($v), $hw) !== false) $sel = ' selected';
62
    if (array_search(strtolower($v), $hw) !== false) $sel = ' selected';
63
    echo "<option{$sel}>{$v}</option>\n";
63
    echo "<option{$sel}>{$v}</option>\n";
64
  }
64
  }
Line 139... Line 139...
139
    $hw[] = 'mda';
139
    $hw[] = 'mda';
140
  }
140
  }
141
  if ($h == 'cga') {
141
  if ($h == 'cga') {
142
    $hw[] = 'mda';
142
    $hw[] = 'mda';
143
  }
143
  }
144
  if ($h == 'hgc') {
-
 
145
    $hw[] = 'mda';
-
 
146
  }
-
 
147
 
-
 
148
}
144
}
149
 
145
 
150
 
146
 
151
$db = json_decode(file_get_contents('../packages/_index.json'), true);
147
$db = json_decode(file_get_contents('../packages/_index.json'), true);
152
 
148
 
Line 161... Line 157...
161
  $desc = $meta['desc'];
157
  $desc = $meta['desc'];
162
  check_next_ver:
158
  check_next_ver:
163
  $pref = array_shift($meta['versions']); // get first version (that's the preferred one)
159
  $pref = array_shift($meta['versions']); // get first version (that's the preferred one)
164
  if (empty($pref)) continue; // no more versions
160
  if (empty($pref)) continue; // no more versions
165
  $hwhint = '';
161
  $hwhint = '';
166
  if (!empty($pref['hwreq']) && (!empty($hw))) {
162
  if (!empty($pref['hwreq'])) {
-
 
163
    $hwhint = ' title="' . htmlspecialchars(strtoupper($pref['hwreq'])) . '"';
-
 
164
 
167
    /* if hw filter present, make sure it fullfills package's requirements */
165
    /* if hw filter present, make sure it fullfills package's requirements */
-
 
166
    if (!empty($hw)) {
168
    foreach (explode(' ', $pref['hwreq']) as $req) {
167
      foreach (explode(' ', $pref['hwreq']) as $req) {
169
      if (array_search($req, $hw, true) === false) goto check_next_ver;
168
        if (array_search($req, $hw, true) === false) goto check_next_ver;
-
 
169
      }
170
    }
170
    }
171
 
-
 
172
    $hwhint = ' title="' . htmlspecialchars(strtoupper($pref['hwreq'])) . '"';
-
 
173
  }
171
  }
174
  $ver = $pref['ver'];
172
  $ver = $pref['ver'];
175
  $bsum = $pref['bsum'];
173
  $bsum = $pref['bsum'];
176
 
174
 
177
  echo "<tr><td><a{$hwhint} href=\"repo/?a=pull&amp;p={$pkg}\">{$pkg}</a></td><td>{$ver}</td><td>{$desc}</td></tr>\n";
175
  echo "<tr><td><a{$hwhint} href=\"repo/?a=pull&amp;p={$pkg}\">{$pkg}</a></td><td>{$ver}</td><td>{$desc}</td></tr>\n";