[ Index ] |
|
Code source de SPIP Agora 1.4 |
1 <?php 2 /***************************************************** 3 * This file is part of Agora, web based content management system. 4 * 5 * Agora is free software; you can redistribute it and/or modify 6 * it under the terms of the GNU General Public License as published by 7 * the Free Software Foundation; version 2 of the License. 8 * 9 * Agora is distributed in the hope that it will be useful, 10 * but WITHOUT ANY WARRANTY; without even the implied warranty of 11 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 12 * GNU General Public License for more details (file "COPYING"). 13 * 14 * Copyright © Arnaud Martin, Antoine Pitrou et Philippe Rivière. 15 * List of authors detailed in "copyright_fr.html" file. 16 * E-mail : agora@sig.premier-ministre.gouv.fr 17 * Web site : http://www.agora.gouv.fr 18 *****************************************************/ 19 include ("inc.php"); 20 21 include_ecrire ("inc_config.php"); 22 23 function mySel ($varaut, $variable) { 24 $retour = " VALUE=\"$varaut\""; 25 26 if ($variable == $varaut) { 27 $retour .= " SELECTED"; 28 } 29 30 return $retour; 31 } 32 33 lire_metas(); 34 35 debut_page(_T('titre_page_config_contenu'), "administration", "langues"); 36 37 echo "<br><br><br>"; 38 gros_titre(_T('info_langues')); 39 40 $authorization = &recuperer_instance_authorization('configurerMultiLang', 41 $GLOBALS['connect_id_auteur'], 42 array('connect_toutes_rubriques' => $connect_toutes_rubriques)); 43 44 if (!$authorization->isAuthorizedAction()) { 45 echo _T('avis_non_acces_page'); 46 fin_page(); 47 exit; 48 } 49 50 init_config(); 51 52 if ($changer_config == 'oui') { 53 appliquer_modifs_config(); 54 // calculer_langues_rubriques(); 55 } 56 57 barre_onglets("config_lang", "multi"); 58 59 debut_gauche(); 60 61 debut_droite(); 62 63 $authorization = &recuperer_instance_authorization('configurerLang', 64 $GLOBALS['connect_id_auteur'], 65 array('connect_toutes_rubriques' => $connect_toutes_rubriques)); 66 67 if (!$authorization->isAuthorizedAction()) { 68 echo _T('avis_non_acces_page'); 69 fin_page(); 70 exit; 71 } 72 73 echo "<form action='config-multilang.php' method='post'>\n"; 74 echo "<input type='hidden' name='changer_config' value='oui'>"; 75 76 debut_cadre_relief("traductions-24.gif"); 77 echo "<TABLE BORDER=0 CELLSPACING=1 CELLPADDING=3 WIDTH=\"100%\">\n"; 78 echo "<TR><TD BGCOLOR='#EEEECC' BACKGROUND='img_pack/rien.gif' COLSPAN=2>" 79 ."<B><FONT FACE='Verdana,Arial,Sans,sans-serif' SIZE=3 COLOR='black'>" 80 ._T('info_multilinguisme')."</FONT></B>"."</TD>\n</TR>\n"; 81 82 echo "<TR>\n<TD BACKGROUND='img_pack/rien.gif' COLSPAN='2' class='verdana2'>"; 83 echo _T('texte_multilinguisme'); 84 echo "</TD>\n</TR>\n"; 85 86 echo "<TR>\n"; 87 echo "<TD ALIGN='$spip_lang_left' class='verdana2'>"; 88 echo _T('info_multi_articles'); 89 echo "</TD>\n"; 90 echo "<TD ALIGN='$spip_lang_left' class='verdana2'>"; 91 afficher_choix('multi_articles', 92 lire_meta('multi_articles'), 93 array('oui' => _T('item_oui'), 'non' => _T('item_non')), 94 " "); 95 echo "</TD>\n</TR>\n"; 96 echo "<TR>\n"; 97 echo "<TD ALIGN='$spip_lang_left' class='verdana2'>"; 98 echo _T('info_multi_rubriques'); 99 echo "</TD>\n"; 100 echo "<TD ALIGN='$spip_lang_left' class='verdana2'>"; 101 afficher_choix('multi_rubriques', 102 lire_meta('multi_rubriques'), 103 array('oui' => _T('item_oui'), 'non' => _T('item_non')), 104 " "); 105 echo "</TD>\n</TR>\n"; 106 107 if (lire_meta('multi_rubriques') == 'oui') { 108 echo "<TR>"; 109 echo "<TD ALIGN='$spip_lang_left' class='verdana2'>"; 110 echo _T('info_multi_secteurs'); 111 echo "</TD>"; 112 echo "<TD ALIGN='$spip_lang_left' class='verdana2'>"; 113 afficher_choix('multi_secteurs', 114 lire_meta('multi_secteurs'), 115 array('oui' => _T('item_oui'), 'non' => _T('item_non')), 116 " "); 117 echo "</TD>\n</TR>\n"; 118 } 119 else 120 echo "<input type='hidden' name='multi_secteurs' value='" . lire_meta('multi_secteurs'). "'>"; 121 122 if ((lire_meta('multi_rubriques') == 'oui') OR (lire_meta('multi_articles') == 'oui')) { 123 echo "<TR><TD BACKGROUND='img_pack/rien.gif' COLSPAN='2' class='verdana2'><hr />\n"; 124 echo _T('texte_multilinguisme_trad'); 125 echo "</TD>\n</TR>\n"; 126 127 echo "<TR>"; 128 echo "<TD ALIGN='$spip_lang_left' class='verdana2'>"; 129 echo _T('info_gerer_trad'); 130 echo "</TD>\n"; 131 echo "<TD ALIGN='$spip_lang_left' class='verdana2'>"; 132 afficher_choix('gerer_trad', 133 lire_meta('gerer_trad'), 134 array('oui' => _T('item_oui'), 'non' => _T('item_non')), 135 " "); 136 echo "</TD>\n</TR>\n"; 137 } 138 else 139 echo "<input type='hidden' name='gerer_trad' value='" . lire_meta('gerer_trad'). "'>"; 140 141 echo "<TR><TD style='text-align:$spip_lang_right;' COLSPAN=2>"; 142 echo "<INPUT TYPE='submit' NAME='Valider' VALUE='" . _T('bouton_valider'). "' CLASS='fondo'>"; 143 echo "</TD></TR>"; 144 echo "</TABLE>"; 145 146 fin_cadre_relief(); 147 148 if (lire_meta('multi_articles') == "oui" OR lire_meta('multi_rubriques') == "oui") { 149 echo "<p>"; 150 debut_cadre_relief("langues-24.gif"); 151 echo "<p class='verdana2'>"; 152 echo _T('info_multi_langues_choisies'); 153 echo '</p>'; 154 155 $langues = $GLOBALS['codes_langues']; 156 $cesure = floor((count($langues) + 1) / 2); 157 $langues_installees = explode(',', $GLOBALS['all_langs']); 158 $langues_autorisees = explode(',', lire_meta('langues_multilingue')); 159 160 while (list(, $l) = each($langues_installees)) { 161 $langues_trad[$l] = true; 162 } 163 164 while (list(, $l) = each($langues_autorisees)) { 165 $langues_auth[$l] = true; 166 } 167 168 $langues_bloquees[lire_meta('langue_site')] = 1; 169 $articleMetier = &recuperer_instance_article(); 170 $langs = $articleMetier->getLangUsed(); 171 172 if (PEAR::isError($langues)) { 173 die($langues->getMessage()); 174 } 175 176 while (list(, $langue) = each($langs)) { 177 $langues_bloquees[$langue] = 1; 178 } 179 180 $breveMetier = &recuperer_instance_breve(); 181 $langs = $breveMetier->getLangUsed(); 182 183 if (PEAR::isError($langues)) { 184 die($langues->getMessage()); 185 } 186 187 while (list(, $langue) = each($langs)) { 188 $langues_bloquees[$langue] = 1; 189 } 190 191 $rubriqueMetier = &recuperer_instance_rubrique(); 192 $langs = $rubriqueMetier->getLangUsed(); 193 194 if (PEAR::isError($langues)) { 195 die($langues->getMessage()); 196 } 197 198 while (list(, $langue) = each($langs)) { 199 $langues_bloquees[$langue] = 1; 200 } 201 202 echo "<table width='100%' cellspacing='10'>\n<tr>\n" 203 ."<td width='50%' align='top'><font size='2' face='Verdana,Arial,Sans,sans-serif'>"; 204 205 ksort($langues_bloquees); 206 207 while (list($code_langue, ) = each($langues_bloquees)) { 208 $i++; 209 echo "<div>"; 210 $nom_langue = $langues[$code_langue]; 211 212 if ($langues_trad[$code_langue]) 213 $nom_langue = "<u>$nom_langue</u>"; 214 215 $nom_langue = "<b><font color='$couleur_foncee'>$nom_langue</font></b>"; 216 echo "<input type='hidden' name='langues_auth[]' value='$code_langue' id='langue_auth_$code_langue'>"; 217 echo "<input type='checkbox' checked disabled>"; 218 echo " $nom_langue <font color='#777777'>[$code_langue]</font>"; 219 echo "</div>\n"; 220 if ($i == $cesure) 221 echo "</font></td>\n<td width='50%' align='top'><font size='2' face='Verdana,Arial,Sans,sans-serif'>"; 222 } 223 224 echo "<div> </div>\n"; 225 226 while (list($code_langue, $nom_langue) = each($langues)) { 227 if ($langues_bloquees[$code_langue]) 228 continue; 229 230 $i++; 231 echo "<div>"; 232 233 if ($langues_trad[$code_langue]) 234 $nom_langue = "<u>$nom_langue</u>"; 235 236 if ($langues_auth[$code_langue]) { 237 echo "<input type='checkbox' name='langues_auth[]' value='$code_langue' id='langue_auth_$code_langue' checked>"; 238 $nom_langue = "<b>$nom_langue</b>"; 239 } 240 else { 241 echo "<input type='checkbox' name='langues_auth[]' value='$code_langue' id='langue_auth_$code_langue'>"; 242 } 243 244 echo " <label for='langue_auth_$code_langue'>$nom_langue</label> <font color='#777777'>[$code_langue]</font>"; 245 246 echo "</div>\n"; 247 if ($i == $cesure) 248 echo "</font></td><td width='50%' align='top'><font size='2' face='Verdana,Arial,Sans,sans-serif'>"; 249 } 250 251 echo "</font></td>\n</tr>\n"; 252 echo "<tr>\n<td style='text-align:$spip_lang_right;' COLSPAN=2>"; 253 echo "<INPUT TYPE='submit' NAME='Valider' VALUE='" . _T('bouton_valider'). "' CLASS='fondo'>"; 254 echo "</td>\n</tr>\n</table>\n"; 255 256 echo "<div class='verdana1'>" . _T("info_multi_langues_soulignees"). "</div>\n"; 257 258 fin_cadre_relief(); 259 } 260 261 echo "</form>\n"; 262 263 fin_page(); 264 ?>
titre
Description
Corps
titre
Description
Corps
titre
Description
Corps
titre
Corps
Généré le : Sat Feb 24 14:40:03 2007 | par Balluche grâce à PHPXref 0.7 |