diff options
Diffstat (limited to 'langs.php')
-rw-r--r-- | langs.php | 84 |
1 files changed, 84 insertions, 0 deletions
diff --git a/langs.php b/langs.php new file mode 100644 index 000000000..3aadfabba --- /dev/null +++ b/langs.php @@ -0,0 +1,84 @@ +<?php +/** +*/ + +if (isset($_SERVER['APP_MODE']) && $_SERVER['APP_MODE'] !== 'prod') { + ini_set('error_reporting', E_ALL); + ini_set('show_errors', true); + ini_set('display_errors', true); +} else { + ini_set('error_reporting', FALSE); + ini_set('show_errors', FALSE); + ini_set('display_errors', FALSE); + ini_set('log_errors', FALSE); +} + +if ($_SERVER['HTTP_HOST'] == 'www-test.mageia.org') { + ini_set('error_reporting', E_ALL&~E_DEPRECATED); + ini_set('show_errors', true); + ini_set('display_errors', true); + ini_set('log_errors', true); +} + +//$g_app_root = realpath(dirname(__FILE__)); +//define('G_APP_ROOT', $g_app_root); + +$g_donate_amount = '--'; +$g_amount_remain = 'EUR 10,244.46'; + +$G_coord_assos = <<<T + Assocation Mageia.Org + 6 rue du chateau d'eau + 78650 BEYNES + FRANCE +T; +$G_coord_assos_bank = <<<T + CIC BEYNES + 18 RUE DE LA REPUBLIQUE + 78650 BEYNES + FRANCE + + IBAN : FR76 3006 6103 1600 0202 1370 139 + BIC: CMCIFRPP +T; + +require_once 'langs.inc.php'; + +$sru = trim($_SERVER['REQUEST_URI']); +$sel = explode('/', $sru); +array_shift($sel); +if (!isset($locale)) + $locale = array_shift($sel); + +$page = count($sel) > 0 ? implode('/', $sel) : null; +$list_langs = array(); +$options = array(); + +foreach ($langs as $k => $v) { + $list_langs[] = sprintf('<a href="/%s"%s>%s</a>', + $page != null ? implode('/', array($k, $page)) : $k, + $k == $locale ? ' class="sel"' : '', + $v); + + $options[] = sprintf('<option value="%s"%s>%s</option>', + $k, + $k == $locale ? ' selected="selected"' : '', + $v); +} + +$options = implode($options); +$langsForm = <<<H +<form id="lang_form" dir="ltr" method="get" action="/"> + <input type="hidden" name="furl" value="{$_SERVER['REQUEST_URI']}" /> + <select id="flang" name="flang" dir="ltr" onchange="this.form.submit()"> + {$options} + </select> + <noscript><div><input type="submit" id="lang_submit" value="Hop!" /></div></noscript> +</form> +H; + +$hsnav = _mgnav_style() . _mgnav_html(true, $locale, $langsForm, $_SERVER['HTTP_HOST']); +$hsfoot = ''; + +if (!defined('HLANG')) + echo $hsnav; |