/[web]/www/trunk/langs.php
ViewVC logotype

Contents of /www/trunk/langs.php

Parent Directory Parent Directory | Revision Log Revision Log


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

Properties

Name Value
svn:keywords Id,Author,Date,Rev

  ViewVC Help
Powered by ViewVC 1.1.30