4 |
david |
1 |
<?php
|
|
|
2 |
|
|
|
3 |
/***************************************************************************\
|
|
|
4 |
* SPIP, Systeme de publication pour l'internet *
|
|
|
5 |
* *
|
|
|
6 |
* Copyright (c) 2001-2005 *
|
|
|
7 |
* Arnaud Martin, Antoine Pitrou, Philippe Riviere, Emmanuel Saint-James *
|
|
|
8 |
* *
|
|
|
9 |
* Ce programme est un logiciel libre distribue sous licence GNU/GPL. *
|
|
|
10 |
* Pour plus de details voir le fichier COPYING.txt ou l'aide en ligne. *
|
|
|
11 |
\***************************************************************************/
|
|
|
12 |
|
|
|
13 |
|
|
|
14 |
include ("inc.php3");
|
|
|
15 |
|
|
|
16 |
include_ecrire ("inc_config.php3");
|
|
|
17 |
|
|
|
18 |
lire_metas();
|
|
|
19 |
|
|
|
20 |
debut_page(_T('titre_page_config_contenu'), "administration", "langues");
|
|
|
21 |
|
|
|
22 |
echo "<br><br><br>";
|
|
|
23 |
gros_titre(_T('info_langues'));
|
|
|
24 |
|
|
|
25 |
|
|
|
26 |
if ($connect_statut != '0minirezo' OR !$connect_toutes_rubriques) {
|
|
|
27 |
echo _T('avis_non_acces_page');
|
|
|
28 |
fin_page();
|
|
|
29 |
exit;
|
|
|
30 |
}
|
|
|
31 |
|
|
|
32 |
init_config();
|
|
|
33 |
if ($changer_config == 'oui') {
|
|
|
34 |
appliquer_modifs_config();
|
|
|
35 |
calculer_langues_rubriques();
|
|
|
36 |
}
|
|
|
37 |
|
|
|
38 |
|
|
|
39 |
barre_onglets("config_lang", "multi");
|
|
|
40 |
|
|
|
41 |
|
|
|
42 |
debut_gauche();
|
|
|
43 |
|
|
|
44 |
|
|
|
45 |
|
|
|
46 |
debut_droite();
|
|
|
47 |
|
|
|
48 |
|
|
|
49 |
|
|
|
50 |
|
|
|
51 |
echo "<form action='config-multilang.php3' method='post'>";
|
|
|
52 |
echo "<input type='hidden' name='changer_config' value='oui'>";
|
|
|
53 |
|
|
|
54 |
debut_cadre_couleur("traductions-24.gif", false, "", _T('info_multilinguisme'));
|
|
|
55 |
echo "<p>"._T('texte_multilinguisme')."</p>";
|
|
|
56 |
|
|
|
57 |
echo "<div>";
|
|
|
58 |
echo _T('info_multi_articles');
|
|
|
59 |
echo "<div style='text-align: $spip_lang_right';>";
|
|
|
60 |
afficher_choix('multi_articles', lire_meta('multi_articles'),
|
|
|
61 |
array('oui' => _T('item_oui'), 'non' => _T('item_non')), " ");
|
|
|
62 |
echo "</div>";
|
|
|
63 |
echo "</div>";
|
|
|
64 |
|
|
|
65 |
echo "<div>";
|
|
|
66 |
echo _T('info_multi_rubriques');
|
|
|
67 |
echo "<div style='text-align: $spip_lang_right';>";
|
|
|
68 |
afficher_choix('multi_rubriques', lire_meta('multi_rubriques'),
|
|
|
69 |
array('oui' => _T('item_oui'), 'non' => _T('item_non')), " ");
|
|
|
70 |
echo "</div>";
|
|
|
71 |
echo "</div>";
|
|
|
72 |
|
|
|
73 |
if (lire_meta('multi_rubriques') == 'oui') {
|
|
|
74 |
echo "<div>";
|
|
|
75 |
echo _T('info_multi_secteurs');
|
|
|
76 |
echo "<div style='text-align: $spip_lang_right';>";
|
|
|
77 |
afficher_choix('multi_secteurs', lire_meta('multi_secteurs'),
|
|
|
78 |
array('oui' => _T('item_oui'), 'non' => _T('item_non')), " ");
|
|
|
79 |
echo "</div>";
|
|
|
80 |
echo "</div>";
|
|
|
81 |
} else
|
|
|
82 |
echo "<input type='hidden' name='multi_secteurs' value='".lire_meta('multi_secteurs')."'>";
|
|
|
83 |
|
|
|
84 |
if ((lire_meta('multi_rubriques') == 'oui') OR (lire_meta('multi_articles') == 'oui')) {
|
|
|
85 |
echo "<hr>";
|
|
|
86 |
echo "<p>"._T('texte_multilinguisme_trad')."</p>";
|
|
|
87 |
|
|
|
88 |
echo _T('info_gerer_trad');
|
|
|
89 |
echo "<div style='text-align: $spip_lang_right';>";
|
|
|
90 |
afficher_choix('gerer_trad', lire_meta('gerer_trad'),
|
|
|
91 |
array('oui' => _T('item_oui'), 'non' => _T('item_non')), " ");
|
|
|
92 |
echo "</div>";
|
|
|
93 |
} else
|
|
|
94 |
echo "<input type='hidden' name='gerer_trad' value='".lire_meta('gerer_trad')."'>";
|
|
|
95 |
|
|
|
96 |
|
|
|
97 |
echo "<div style='text-align: $spip_lang_right;'><INPUT TYPE='submit' NAME='Valider' VALUE='"._T('bouton_valider')."' CLASS='fondo'></div>";
|
|
|
98 |
|
|
|
99 |
fin_cadre_couleur();
|
|
|
100 |
|
|
|
101 |
if (lire_meta('multi_articles') == "oui" OR lire_meta('multi_rubriques') == "oui") {
|
|
|
102 |
echo "<p>";
|
|
|
103 |
debut_cadre_relief("langues-24.gif");
|
|
|
104 |
echo "<p class='verdana2'>";
|
|
|
105 |
echo _T('info_multi_langues_choisies');
|
|
|
106 |
echo '</p>';
|
|
|
107 |
|
|
|
108 |
init_codes_langues();
|
|
|
109 |
$langues = $GLOBALS['codes_langues'];
|
|
|
110 |
$cesure = floor((count($langues) + 1) / 2);
|
|
|
111 |
|
|
|
112 |
$langues_installees = explode(',', $GLOBALS['all_langs']);
|
|
|
113 |
$langues_autorisees = explode(',', lire_meta('langues_multilingue'));
|
|
|
114 |
|
|
|
115 |
while (list(,$l) = each ($langues_installees)) {
|
|
|
116 |
$langues_trad[$l] = true;
|
|
|
117 |
}
|
|
|
118 |
|
|
|
119 |
while (list(,$l) = each ($langues_autorisees)) {
|
|
|
120 |
$langues_auth[$l] = true;
|
|
|
121 |
}
|
|
|
122 |
|
|
|
123 |
$langues_bloquees[lire_meta('langue_site')] = 1;
|
|
|
124 |
$query = "SELECT DISTINCT lang FROM spip_articles WHERE statut='publie'";
|
|
|
125 |
$result = spip_query($query);
|
|
|
126 |
while ($row = spip_fetch_array($result)) {
|
|
|
127 |
$langues_bloquees[$row['lang']] = 1;
|
|
|
128 |
}
|
|
|
129 |
$query = "SELECT DISTINCT lang FROM spip_breves WHERE statut='publie'";
|
|
|
130 |
$result = spip_query($query);
|
|
|
131 |
while ($row = spip_fetch_array($result)) {
|
|
|
132 |
$langues_bloquees[$row['lang']] = 1;
|
|
|
133 |
}
|
|
|
134 |
$query = "SELECT DISTINCT lang FROM spip_rubriques WHERE statut='publie'";
|
|
|
135 |
$result = spip_query($query);
|
|
|
136 |
while ($row = spip_fetch_array($result)) {
|
|
|
137 |
$langues_bloquees[$row['lang']] = 1;
|
|
|
138 |
}
|
|
|
139 |
|
|
|
140 |
echo "<table width = '100%' cellspacing='10'><tr><td width='50%' align='top' class='verdana1'>";
|
|
|
141 |
|
|
|
142 |
ksort($langues_bloquees);
|
|
|
143 |
while (list($code_langue, ) = each($langues_bloquees)) {
|
|
|
144 |
$i++;
|
|
|
145 |
echo "<div>";
|
|
|
146 |
$nom_langue = $langues[$code_langue];
|
|
|
147 |
if ($langues_trad[$code_langue]) $nom_langue = "<u>$nom_langue</u>";
|
|
|
148 |
$nom_langue = "<b><font color='$couleur_foncee'>$nom_langue</font></b>";
|
|
|
149 |
echo "<input type='hidden' name='langues_auth[]' value='$code_langue' id='langue_auth_$code_langue'>";
|
|
|
150 |
echo "<input type='checkbox' checked disabled>";
|
|
|
151 |
echo " $nom_langue <font color='#777777'>[$code_langue]</font>";
|
|
|
152 |
echo "</div>\n";
|
|
|
153 |
|
|
|
154 |
if ($i == $cesure) echo "</td><td width='50%' align='top' class='verdana1'>";
|
|
|
155 |
}
|
|
|
156 |
|
|
|
157 |
echo "<div> </div>";
|
|
|
158 |
|
|
|
159 |
while (list($code_langue, $nom_langue) = each($langues)) {
|
|
|
160 |
if ($langues_bloquees[$code_langue]) continue;
|
|
|
161 |
$i++;
|
|
|
162 |
echo "<div>";
|
|
|
163 |
if ($langues_trad[$code_langue]) $nom_langue = "<u>$nom_langue</u>";
|
|
|
164 |
|
|
|
165 |
if ($langues_auth[$code_langue]) {
|
|
|
166 |
echo "<input type='checkbox' name='langues_auth[]' value='$code_langue' id='langue_auth_$code_langue' checked>";
|
|
|
167 |
$nom_langue = "<b>$nom_langue</b>";
|
|
|
168 |
}
|
|
|
169 |
else {
|
|
|
170 |
echo "<input type='checkbox' name='langues_auth[]' value='$code_langue' id='langue_auth_$code_langue'>";
|
|
|
171 |
}
|
|
|
172 |
echo " <label for='langue_auth_$code_langue'>$nom_langue</label> <font color='#777777'>[$code_langue]</font>";
|
|
|
173 |
|
|
|
174 |
echo "</div>\n";
|
|
|
175 |
|
|
|
176 |
if ($i == $cesure) echo "</font></td><td width='50%' align='top' class='verdana1'>";
|
|
|
177 |
}
|
|
|
178 |
|
|
|
179 |
echo "</td></tr>";
|
|
|
180 |
echo "<tr><td style='text-align:$spip_lang_right;' COLSPAN=2>";
|
|
|
181 |
echo "<INPUT TYPE='submit' NAME='Valider' VALUE='"._T('bouton_valider')."' CLASS='fondo'>";
|
|
|
182 |
echo "</td></tr></table>";
|
|
|
183 |
|
|
|
184 |
|
|
|
185 |
echo "<div class='verdana1'>"._T("info_multi_langues_soulignees")."</div>";
|
|
|
186 |
|
|
|
187 |
fin_cadre_relief();
|
|
|
188 |
}
|
|
|
189 |
|
|
|
190 |
|
|
|
191 |
|
|
|
192 |
echo "</form>";
|
|
|
193 |
|
|
|
194 |
fin_page();
|
|
|
195 |
|
|
|
196 |
?>
|