diff options
Diffstat (limited to 'downloads.php')
-rw-r--r-- | downloads.php | 83 |
1 files changed, 58 insertions, 25 deletions
diff --git a/downloads.php b/downloads.php index f9d8c184d..9fc6d51c2 100644 --- a/downloads.php +++ b/downloads.php @@ -10,7 +10,7 @@ include 'downloads_locales.php'; if (!array_key_exists($locale, $_t)) $locale = 'en'; -$_t = $_t[$locale]; +$_t = array_merge($_t['en'], $_t[$locale]); $prods = parse_ini_file('downloads.ini', true); $countries = array( @@ -43,50 +43,83 @@ $s = ''; $glob = array_shift($prods); $popularity = array_shift($prods); $i = 0; + +$prods2 = array(); foreach ($prods as $k => $p) { if (isset($p['hidden'])) { continue; } - $iso = sprintf('%s-%s', $glob['prefix'], $k); + $prods2[$p['flavour']][$k] = $p; +} + +$s1 = null; +$s2 = null; +$s3 = null; +foreach ($prods2 as $flavour => $prods) { - $dl_link = sprintf('/%s/downloads/dl.php?product=%s', $locale, $iso); - $bt_link = isset($p['torrent']) ? - sprintf('/%s/downloads/dl.php?product=%s&torrent=1', $locale, $iso) : - null; + $flavour = sprintf('<td rowspan="%d">%s</td>', count($prods), $flavour); + foreach ($prods as $k => $p) { + $iso = sprintf('%s-%s', $glob['prefix'], $k); - $pop = array_key_exists($k, $popularity) ? $popularity[$k] : 0; + $dl_link = sprintf('/%s/downloads/dl.php?product=%s', $locale, $iso); + $bt_link = isset($p['torrent']) ? + sprintf('/%s/downloads/dl.php?product=%s&torrent=1', $locale, $iso) : + null; - $s .= sprintf($tmpl, - '', //($i == 0) ? ' class="reco"' : '', - $p['name'], $_t[$p['lang']], $p['size'], - $pop, $pop, - $dl_link, $_t['download'], - $bt_link, - !is_null($bt_link) ? $_t['download'] : '' - ); + $pop = array_key_exists($k, $popularity) ? $popularity[$k] : 0; - $i++; + $s = sprintf($tmpl, + '', + //$flavour, + $p['name'], $_t[$p['lang']], $p['size'], + $pop, $pop, + $dl_link, $_t['download'], + $bt_link, + !is_null($bt_link) ? $_t['download'] : '' + ); + $flavour = null; + $i++; + + if ($p['flavour'] == 'LiveCD 32bit') + $s2 .= $s; + elseif ($p['flavour'] == 'DVD' + || $p['flavour'] == 'CD') + $s1 .= $s; + else + $s3 .= $s; + } } -$dl_table = <<<T +$table_tmpl = <<<T +<h3>%s</h3> <table class="dlt2"> <thead> <tr> - <th>{$_t['flavour']}</th> + <th style="width: 12em;">{$_t['flavour']}</th> <th>{$_t['language']}</th> <th class="size">{$_t['size']}</th> - <th>Popularity</th> + <th>{$_t['popularity']}</th> <th>{$_t['link']}</th> <th>BitTorrent</th> </tr> </thead> - <tbody> - {$s} - </tbody> + <tbody>%s</tbody> </table> -<p class="dlinfo">{$_t['all_languages']}</p> -<p class="dlinfo">{$_t['limited_languages']}</p> -<p class="dlinfo">{$_t['euro_languages']}</p> +T; + +$dl_table = sprintf($table_tmpl, $_t['for_full_install'], $s1) + . "<p class='dlinfo'>{$_t['all_languages']}</p> + <p class='dlinfo'>{$_t['limited_languages']}</p><br>" + + . sprintf($table_tmpl, $_t['for_test_live'], $s2) + . "<p class='dlinfo'>{$_t['def-Europa set 1']}</p> + <p class='dlinfo'>{$_t['def-Europa set 2']}</p> + <p class='dlinfo'>{$_t['def-Asia set']}</p> + <p class='dlinfo'>{$_t['def-Africa/India set']}</p><br>" + + . sprintf($table_tmpl, $_t['for_network'], $s3); + +$dl_table .= <<<T <p class="dlinfo">Not sure of what ISO to download? This may still be a bit verbose, but you may want to <a href="http://www.mageia.org/wiki/doku.php?id=mageia_installation_media">read this article detailing our different install media</a>.</p> |