From a5edf3bc316568c1f01ad0ebefb1a4014a61a0e4 Mon Sep 17 00:00:00 2001 From: Antoine Pitrou <pitrou@free.fr> Date: Sun, 17 Nov 2002 18:28:41 +0000 Subject: [PATCH] modif graphique admin restreint (suite) --- ecrire/inc_presentation.php3 | 34 +++++++++++++++------------------- ecrire/naviguer.php3 | 6 +++--- 2 files changed, 18 insertions(+), 22 deletions(-) diff --git a/ecrire/inc_presentation.php3 b/ecrire/inc_presentation.php3 index 8d88f4496b..2b156d525a 100644 --- a/ecrire/inc_presentation.php3 +++ b/ecrire/inc_presentation.php3 @@ -1949,31 +1949,27 @@ fin_grand_cadre(); // // Afficher la hierarchie des rubriques // -function afficher_parents($collection){ +function afficher_parents($id_rubrique) { global $parents, $couleur_foncee; - global $coll; - $parents=ereg_replace("(~+)","\\1~",$parents); - if ($collection!=0){ - $query2="SELECT * FROM spip_rubriques WHERE id_rubrique=\"$collection\""; - $result2=spip_query($query2); + $parents = ereg_replace("(~+)","\\1~",$parents); + if ($id_rubrique) { + $query = "SELECT id_rubrique, id_parent, titre FROM spip_rubriques WHERE id_rubrique=$id_rubrique"; + $result = spip_query($query); - while($row=spip_fetch_array($result2)){ + while ($row = spip_fetch_array($result)) { $id_rubrique = $row['id_rubrique']; $id_parent = $row['id_parent']; $titre = $row['titre']; - - if (acces_restreint_rubrique($id_rubrique)) { - $parents="~ <IMG SRC='img_pack/triangle-anim.gif' WIDTH=16 HEIGHT=14 BORDER=0> <FONT SIZE=3 FACE='Verdana,Arial,Helvetica,sans-serif'><a href='naviguer.php3?coll=$id_rubrique'><font color='$couleur_foncee'>$titre</font></a></FONT><BR>\n$parents"; - } - else { - if ($id_parent == "0"){ - $parents="~ <IMG SRC='img_pack/secteur-24.gif' alt='' WIDTH=24 HEIGHT=24 BORDER=0 align='middle'> <FONT SIZE=3 FACE='Verdana,Arial,Helvetica,sans-serif'><a href='naviguer.php3?coll=$id_rubrique'><font color='$couleur_foncee'>$titre</font></a></FONT><BR>\n$parents"; - } else { - $parents="~ <IMG SRC='img_pack/rubrique-24.gif' alt='' WIDTH=24 HEIGHT=24 BORDER=0 align='middle'> <FONT SIZE=3 FACE='Verdana,Arial,Helvetica,sans-serif'><a href='naviguer.php3?coll=$id_rubrique'><font color='$couleur_foncee'>$titre</font></a></FONT><BR>\n$parents"; - } - } + + $parents = " <FONT SIZE=3 FACE='Verdana,Arial,Helvetica,sans-serif'><a href='naviguer.php3?coll=$id_rubrique'><font color='$couleur_foncee'>$titre</font></a></FONT><BR>\n".$parents; + if (acces_restreint_rubrique($id_rubrique)) + $parents = " <img src='img_pack/admin-12.gif' alt='' width='12' height='12' title='Vous pouvez administrer cette rubrique et ses sous-rubriques'> ".$parents; + if (!$id_parent) + $parents = "~ <IMG SRC='img_pack/secteur-24.gif' alt='' WIDTH=24 HEIGHT=24 BORDER=0 align='middle'> ".$parents; + else + $parents = "~ <IMG SRC='img_pack/rubrique-24.gif' alt='' WIDTH=24 HEIGHT=24 BORDER=0 align='middle'> ".$parents; } - afficher_parents($id_parent); + afficher_parents($id_parent); } } diff --git a/ecrire/naviguer.php3 b/ecrire/naviguer.php3 index 8a47694f74..ce6bc1d2f4 100644 --- a/ecrire/naviguer.php3 +++ b/ecrire/naviguer.php3 @@ -32,9 +32,9 @@ function enfant($collection){ if (strlen($les_sous_enfants) > 0){ $les_enfants.= $bouton_layer; } - if (acces_restreint_rubrique($id_rubrique)) + if (acces_restreint_rubrique($id_rubrique)) $les_enfants.= "<img src='img_pack/admin-12.gif' alt='' width='12' height='12' title='Vous pouvez administrer cette rubrique et ses sous-rubriques'> "; - + $les_enfants.= "<B><A HREF='naviguer.php3?coll=$id_rubrique'><font color='$couleur_foncee'>".typo($titre)."</font></A></B>"; if (strlen($descriptif)>1) $les_enfants.="<BR><FONT SIZE=1>$descriptif</FONT>"; @@ -151,7 +151,7 @@ if ($titre) { $texte = addslashes($texte); $query = "UPDATE spip_rubriques SET $change_parent titre=\"$titre\", descriptif=\"$descriptif\", texte=\"$texte\" WHERE id_rubrique=$coll"; $result = spip_query($query); - + calculer_rubriques(); if (lire_meta('activer_moteur') == 'oui') { -- GitLab