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 |
|
|
|
17 |
function enfant($leparent){
|
|
|
18 |
global $id_parent;
|
|
|
19 |
global $id_rubrique;
|
|
|
20 |
global $connect_toutes_rubriques;
|
|
|
21 |
global $i;
|
|
|
22 |
global $couleur_claire, $spip_lang_left;
|
|
|
23 |
global $browser_name, $browser_version;
|
|
|
24 |
|
|
|
25 |
$i++;
|
|
|
26 |
$query="SELECT * FROM spip_rubriques WHERE id_parent='$leparent' ORDER BY 0+titre,titre";
|
|
|
27 |
$result=spip_query($query);
|
|
|
28 |
|
|
|
29 |
while($row=spip_fetch_array($result)){
|
|
|
30 |
$my_rubrique=$row['id_rubrique'];
|
|
|
31 |
$titre=typo($row['titre']);
|
|
|
32 |
$statut_rubrique = $row['statut'];
|
|
|
33 |
$lang_rub = $row['lang'];
|
|
|
34 |
$langue_choisie_rub = $row['langue_choisie'];
|
|
|
35 |
$style = "";
|
|
|
36 |
$espace = "";
|
|
|
37 |
|
|
|
38 |
if ($my_rubrique != $id_rubrique){
|
|
|
39 |
|
|
|
40 |
if (eregi("mozilla", $browser_name)) {
|
|
|
41 |
//$style .= "padding-$spip_lang_left: 16px; ";
|
|
|
42 |
$style .= "margin-$spip_lang_left: ".($i*16)."px;";
|
|
|
43 |
} else {
|
|
|
44 |
for ($count = 0; $count <= $i; $count ++) $espace .= " ";
|
|
|
45 |
}
|
|
|
46 |
|
|
|
47 |
if ($i > 3) $style .= "color: #666666;";
|
|
|
48 |
if ($i > 4) $style .= "font-style: italic;";
|
|
|
49 |
if ($i < 3) $style .= "font-weight:bold; ";
|
|
|
50 |
if ($i==1) {
|
|
|
51 |
$style .= "background-image: url(" . _DIR_IMG_PACK . 'secteur-12.gif);';
|
|
|
52 |
$style .= "background-color: $couleur_claire;";
|
|
|
53 |
$style .= "font-weight: bold;";
|
|
|
54 |
}
|
|
|
55 |
else if ($i==2) {
|
|
|
56 |
$style .= "border-bottom: 1px solid $couleur_claire;";
|
|
|
57 |
$style .= "font-weight: bold;";
|
|
|
58 |
}
|
|
|
59 |
else {
|
|
|
60 |
}
|
|
|
61 |
|
|
|
62 |
if ($statut_rubrique!='publie') $titre = "($titre)";
|
|
|
63 |
if (lire_meta('multi_rubriques') == 'oui' AND $langue_choisie_rub == "oui") $titre = $titre." [".traduire_nom_langue($lang_rub)."]";
|
|
|
64 |
|
|
|
65 |
$selec_rub = "selec_rub";
|
|
|
66 |
if ($browser_name == "MSIE" AND floor($browser_version) == "5") $selec_rub = ""; // Bug de MSIE MacOs 9.0
|
|
|
67 |
|
|
|
68 |
if (acces_rubrique($my_rubrique)) {
|
|
|
69 |
echo "<option".mySel($my_rubrique,$id_parent)." class='$selec_rub' style=\"$style\">$espace".supprimer_tags($titre)."\n";
|
|
|
70 |
}
|
|
|
71 |
enfant($my_rubrique);
|
|
|
72 |
}
|
|
|
73 |
|
|
|
74 |
}
|
|
|
75 |
$i=$i-1;
|
|
|
76 |
}
|
|
|
77 |
|
|
|
78 |
|
|
|
79 |
if ($new == "oui") {
|
|
|
80 |
if (($connect_statut=='0minirezo') AND acces_rubrique($id_parent)) {
|
|
|
81 |
$id_parent = intval($id_parent);
|
|
|
82 |
$id_rubrique = 0;
|
|
|
83 |
$titre = filtrer_entites(_T('titre_nouvelle_rubrique'));
|
|
|
84 |
$onfocus = " onfocus=\"if(!antifocus){this.value='';antifocus=true;}\"";
|
|
|
85 |
$descriptif = "";
|
|
|
86 |
$texte = "";
|
|
|
87 |
}
|
|
|
88 |
else {
|
|
|
89 |
echo _T('avis_acces_interdit');
|
|
|
90 |
exit;
|
|
|
91 |
}
|
|
|
92 |
}
|
|
|
93 |
else {
|
|
|
94 |
$query = "SELECT * FROM spip_rubriques WHERE id_rubrique='$id_rubrique'";
|
|
|
95 |
$result = spip_query($query);
|
|
|
96 |
while ($row = spip_fetch_array($result)) {
|
|
|
97 |
$id_rubrique = $row['id_rubrique'];
|
|
|
98 |
$id_parent = $row['id_parent'];
|
|
|
99 |
$titre = $row['titre'];
|
|
|
100 |
$descriptif = $row['descriptif'];
|
|
|
101 |
$texte = $row['texte'];
|
|
|
102 |
$id_secteur = $row['id_secteur'];
|
|
|
103 |
$extra = $row["extra"];
|
|
|
104 |
}
|
|
|
105 |
}
|
|
|
106 |
|
|
|
107 |
debut_page(_T('info_modifier_titre', array('titre' => $titre)), "documents", "rubriques");
|
|
|
108 |
|
|
|
109 |
if ($id_parent == 0) $ze_logo = "secteur-24.gif";
|
|
|
110 |
else $ze_logo = "rubrique-24.gif";
|
|
|
111 |
|
|
|
112 |
if ($id_parent == 0) $logo_parent = "racine-site-24.gif";
|
|
|
113 |
else {
|
|
|
114 |
$query = "SELECT id_parent FROM spip_rubriques WHERE id_rubrique='$id_parent'";
|
|
|
115 |
$result=spip_query($query);
|
|
|
116 |
while($row=spip_fetch_array($result)){
|
|
|
117 |
$parent_parent=$row['id_parent'];
|
|
|
118 |
}
|
|
|
119 |
if ($parent_parent == 0) $logo_parent = "secteur-24.gif";
|
|
|
120 |
else $logo_parent = "rubrique-24.gif";
|
|
|
121 |
}
|
|
|
122 |
|
|
|
123 |
|
|
|
124 |
|
|
|
125 |
debut_grand_cadre();
|
|
|
126 |
|
|
|
127 |
afficher_hierarchie($id_parent);
|
|
|
128 |
|
|
|
129 |
fin_grand_cadre();
|
|
|
130 |
|
|
|
131 |
debut_gauche();
|
|
|
132 |
//////// parents
|
|
|
133 |
|
|
|
134 |
|
|
|
135 |
|
|
|
136 |
debut_droite();
|
|
|
137 |
|
|
|
138 |
debut_cadre_formulaire();
|
|
|
139 |
|
|
|
140 |
echo "\n<table cellpadding=0 cellspacing=0 border=0 width='100%'>";
|
|
|
141 |
echo "<tr width='100%'>";
|
|
|
142 |
echo "<td>";
|
|
|
143 |
|
|
|
144 |
if ($id_rubrique) icone(_T('icone_retour'), "naviguer.php3?id_rubrique=$id_rubrique", $ze_logo, "rien.gif");
|
|
|
145 |
else icone(_T('icone_retour'), "naviguer.php3?id_rubrique=$id_parent", $ze_logo, "rien.gif");
|
|
|
146 |
|
|
|
147 |
echo "</td>";
|
|
|
148 |
echo "<td>". http_img_pack('rien.gif', " ", "width='10'") . "</td>\n";
|
|
|
149 |
echo "<td width='100%'>";
|
|
|
150 |
echo _T('info_modifier_rubrique');
|
|
|
151 |
gros_titre($titre);
|
|
|
152 |
echo "</td></tr></table>";
|
|
|
153 |
echo "<p>";
|
|
|
154 |
|
|
|
155 |
if ($id_rubrique>0)
|
|
|
156 |
echo "<FORM ACTION='naviguer.php3?id_rubrique=$id_rubrique' METHOD='post'>";
|
|
|
157 |
else
|
|
|
158 |
echo "<FORM ACTION='naviguer.php3' METHOD='post'>";
|
|
|
159 |
|
|
|
160 |
echo "<INPUT TYPE='Hidden' NAME='id_rubrique' VALUE=\"$id_rubrique\">";
|
|
|
161 |
if ($new == "oui") echo "<INPUT TYPE='Hidden' NAME='new' VALUE=\"oui\">";
|
|
|
162 |
|
|
|
163 |
$titre = entites_html($titre);
|
|
|
164 |
|
|
|
165 |
echo _T('entree_titre_obligatoire');
|
|
|
166 |
echo "<INPUT TYPE='text' CLASS='formo' NAME='titre' VALUE=\"$titre\" SIZE='40' $onfocus><P>";
|
|
|
167 |
|
|
|
168 |
|
|
|
169 |
debut_cadre_couleur("$logo_parent", false, '', _T('entree_interieur_rubrique').aide ("rubrub"));
|
|
|
170 |
|
|
|
171 |
// Integrer la recherche de rubrique au clavier
|
|
|
172 |
echo "<script language='JavaScript' type='text/javascript' src='filtery.js'></script>\n";
|
|
|
173 |
echo "<input type='text' size='10' style='font-size: 90%; width: 15%;' onkeyup=\"filtery(this.value,this.form.id_parent);\" onChange=\"filtery(this.value,this.form.id_parent);\"> ";
|
|
|
174 |
|
|
|
175 |
echo "<SELECT NAME='id_parent' style='font-size: 90%; width:80%; font-face:verdana,arial,helvetica,sans-serif; max-height: 24px;' SIZE=1>\n";
|
|
|
176 |
|
|
|
177 |
if ($connect_toutes_rubriques) {
|
|
|
178 |
echo "<OPTION".mySel("0",$id_parent). http_style_background('racine-site-12.gif', "$spip_lang_left no-repeat; background-color:$couleur_foncee; padding-$spip_lang_left: 16px; font-weight:bold; color:white") .'>'._T('info_racine_site')."\n";
|
|
|
179 |
} else {
|
|
|
180 |
echo "<OPTION".mySel("0",$id_parent).">"._T('info_non_deplacer')."\n";
|
|
|
181 |
}
|
|
|
182 |
|
|
|
183 |
if (lire_meta('multi_rubriques') == 'oui') echo " [".traduire_nom_langue(lire_meta('langue_site'))."]";
|
|
|
184 |
|
|
|
185 |
// si le parent ne fait pas partie des rubriques restreintes, modif impossible
|
|
|
186 |
if (acces_rubrique($id_parent)) {
|
|
|
187 |
enfant(0);
|
|
|
188 |
}
|
|
|
189 |
echo "</SELECT>\n";
|
|
|
190 |
|
|
|
191 |
// si c'est une rubrique-secteur contenant des breves, ne pas proposer de deplacer
|
|
|
192 |
$query = "SELECT COUNT(*) AS cnt FROM spip_breves WHERE id_rubrique='$id_rubrique'";
|
|
|
193 |
$row = spip_fetch_array(spip_query($query));
|
|
|
194 |
$contient_breves = $row['cnt'];
|
|
|
195 |
if ($contient_breves > 0) {
|
|
|
196 |
$scb = ($contient_breves>1? 's':'');
|
|
|
197 |
echo "<div><font size='2'><input type='checkbox' name='confirme_deplace' value='oui' id='confirme-deplace'><label for='confirme-deplace'> "._T('avis_deplacement_rubrique', array('contient_breves' => $contient_breves, 'scb' => $scb))."</font></label></div>\n";
|
|
|
198 |
}
|
|
|
199 |
fin_cadre_couleur();
|
|
|
200 |
|
|
|
201 |
echo "<P>";
|
|
|
202 |
|
|
|
203 |
|
|
|
204 |
if ($options == "avancees" OR $descriptif) {
|
|
|
205 |
echo "<B>"._T('texte_descriptif_rapide')."</B><BR>";
|
|
|
206 |
echo _T('entree_contenu_rubrique')."<BR>";
|
|
|
207 |
echo "<TEXTAREA NAME='descriptif' CLASS='forml' ROWS='4' COLS='40' wrap=soft>";
|
|
|
208 |
echo $descriptif;
|
|
|
209 |
echo "</TEXTAREA><P>\n";
|
|
|
210 |
}
|
|
|
211 |
else {
|
|
|
212 |
echo "<INPUT TYPE='Hidden' NAME='descriptif' VALUE=\"".entites_html($descriptif)."\">";
|
|
|
213 |
}
|
|
|
214 |
|
|
|
215 |
echo "<B>"._T('info_texte_explicatif')."</B>";
|
|
|
216 |
echo aide ("raccourcis");
|
|
|
217 |
echo "<BR><TEXTAREA NAME='texte' ROWS='15' CLASS='formo' COLS='40' wrap=soft>";
|
|
|
218 |
echo $texte;
|
|
|
219 |
echo "</TEXTAREA>\n";
|
|
|
220 |
|
|
|
221 |
if ($champs_extra) {
|
|
|
222 |
include_ecrire("inc_extra.php3");
|
|
|
223 |
extra_saisie($extra, 'rubriques', $id_secteur);
|
|
|
224 |
}
|
|
|
225 |
|
|
|
226 |
echo "<P align='right'><INPUT TYPE='submit' NAME='Valider' VALUE='"._T('bouton_enregistrer')."' CLASS='fondo'>";
|
|
|
227 |
echo "</FORM>";
|
|
|
228 |
fin_cadre_formulaire();
|
|
|
229 |
|
|
|
230 |
fin_page();
|
|
|
231 |
|
|
|
232 |
?>
|