1 |
<?php |
2 |
/** |
3 |
*/ |
4 |
|
5 |
$g_app_root = realpath(dirname(__FILE__)); |
6 |
define('G_APP_ROOT', $g_app_root); |
7 |
|
8 |
$g_donate_amount = '8770,62 €'; |
9 |
|
10 |
$G_coord_assos = <<<T |
11 |
Assocation Mageia.Org |
12 |
8B rue de la Terrasse |
13 |
75017 Paris |
14 |
France |
15 |
T; |
16 |
$G_coord_assos_bank = <<<T |
17 |
CIC Paris Villiers |
18 |
14 avenue de Villiers |
19 |
75017 Paris |
20 |
France |
21 |
|
22 |
IBAN: FR76 3006 6108 7600 0200 6450 123 |
23 |
BIC: CMCIFRPP |
24 |
T; |
25 |
|
26 |
require_once 'langs.inc.php'; |
27 |
|
28 |
$sru = trim($_SERVER['REQUEST_URI']); |
29 |
$sel = explode('/', $sru); |
30 |
array_shift($sel); |
31 |
$locale = array_shift($sel); |
32 |
$page = count($sel) > 0 ? implode('/', $sel) : null; |
33 |
|
34 |
$list_langs = array(); |
35 |
$options = array(); |
36 |
|
37 |
foreach ($langs as $k => $v) |
38 |
{ |
39 |
$list_langs[] = sprintf('<a href="/%s"%s>%s</a>', |
40 |
$page != null ? implode('/', array($k, $page)) : $k, |
41 |
$k == $locale ? ' class="sel"' : '', |
42 |
$v); |
43 |
|
44 |
$options[] = sprintf('<option value="%s"%s>%s</option>', |
45 |
$k, |
46 |
$k == $locale ? ' selected="selected"' : '', |
47 |
$v); |
48 |
} |
49 |
|
50 |
// global nav |
51 |
$nav_list = array( |
52 |
"/{$locale}/" => 'Mageia', |
53 |
"http://blog.mageia.org/{$locale}" => array( |
54 |
'el' => 'Ιστολόγιο', |
55 |
'en' => 'Blog', |
56 |
'et' => 'Ajaveeb', |
57 |
'tr' => 'Web Günlüğü' |
58 |
), |
59 |
'/wiki' => 'Wiki', |
60 |
"/{$locale}/faq/" => array( |
61 |
'en' => 'FAQ', |
62 |
'es' => 'Preguntas Frecuentes', |
63 |
'et' => 'KKK', |
64 |
'tr' => 'S.S.S.', |
65 |
'ro' => 'Întrebări frecvente' |
66 |
), |
67 |
"/{$locale}/donate/" => array( |
68 |
//"http://donate.mageia.org/{$locale}/" => array( |
69 |
'de' => 'Spenden', |
70 |
'el' => 'Δωρεές', |
71 |
'en' => 'Donations', |
72 |
'es' => 'Donaciones', |
73 |
'et' => 'Annetused', |
74 |
'fr' => 'Dons', |
75 |
'tr' => 'Bağışlar', |
76 |
'ro' => 'Donații' |
77 |
), |
78 |
"http://mageia.org/wiki/doku.php?id=press" => array( |
79 |
'de' => 'Presse', |
80 |
'el' => 'Τύπος', |
81 |
'en' => 'Press', |
82 |
'es' => 'Prensa', |
83 |
'et' => 'Ajakirjandus', |
84 |
'fr' => 'Presse', |
85 |
'ro' => 'Presă', |
86 |
'tr' => 'Basın' |
87 |
), |
88 |
"/{$locale}/about/values/" => array( |
89 |
'de' => 'Werte', |
90 |
'el' => 'Αξίες', |
91 |
'en' => 'Values', |
92 |
'es' => 'Valores', |
93 |
'et' => 'Väärtused', |
94 |
'fr' => 'Valeurs', |
95 |
'tr' => 'Değerler', |
96 |
'ro' => 'Valori' |
97 |
), |
98 |
"/{$locale}/about/code-of-conduct/" => array( |
99 |
'de' => 'Verhaltenskodex', |
100 |
'el' => 'Κώδικας συμπεριφοράς', |
101 |
'en' => 'Code of Conduct', |
102 |
'es' => 'Código de Conducta', |
103 |
'et' => 'Käitumisjuhised', |
104 |
'fr' => 'Code de conduite', |
105 |
'tr' => 'Temel İlkeler', |
106 |
'ro' => 'Codul de conduită' |
107 |
) |
108 |
); |
109 |
|
110 |
$list_menu = array(); |
111 |
foreach ($nav_list as $k => $v) |
112 |
{ |
113 |
if (is_array($v)) |
114 |
$title = array_key_exists($locale, $v) ? $v[$locale] : $v['en']; |
115 |
else |
116 |
$title = $v; |
117 |
|
118 |
$list_menu[] = sprintf('<a href="%s"%s>%s</a>', |
119 |
$k, |
120 |
$k == $sru ? ' class="sel"' : '', |
121 |
$title); |
122 |
} |
123 |
|
124 |
echo sprintf('<div class="nav"><!--googleoff: all--><div class="nav2"><p class="loc">%s</p>', implode(' | ', $list_menu)); |
125 |
|
126 |
$options = implode($options); |
127 |
echo <<<H |
128 |
<form id="lang_form" dir="ltr" method="get" action="/"> |
129 |
<!--<label for="flang">Autres langues :</label>--> |
130 |
<input type="hidden" name="furl" value="{$_SERVER['REQUEST_URI']}" /> |
131 |
<select id="flang" name="flang" dir="ltr" onchange="this.form.submit()"> |
132 |
{$options} |
133 |
</select> |
134 |
<noscript><div><input type="submit" id="lang_submit" value="Hop!" /></div></noscript> |
135 |
</form> |
136 |
</div><!--googleon: all--></div> |
137 |
H; |
138 |
/* |
139 |
echo sprintf('<p class="loc">%s</p>', implode(' | ', $list_langs)); |
140 |
*/ |