inc-calcul-outils.php3 1.19 1.20

Update of /home/spip-cvs/spip
In directory alan:/tmp/cvs-serv16206

Modified Files:
  inc-calcul-outils.php3
Log Message:
ça corrige le bug de #LOGO_RUBRIQUE qui ne retourne pas rubon0.gif
mais est-ce que ça marche encore dans les autres cas, mystère... à vérifier

Index: inc-calcul-outils.php3

RCS file: /home/spip-cvs/spip/inc-calcul-outils.php3,v
retrieving revision 1.19
retrieving revision 1.20
diff -u -d -r1.19 -r1.20
--- inc-calcul-outils.php3 26 Oct 2004 10:22:43 -0000 1.19
+++ inc-calcul-outils.php3 26 Oct 2004 11:46:52 -0000 1.20
@@ -29,38 +29,42 @@
//

function calcule_logo($type, $onoff, $id, $id_rubrique, $lien, $align, $ff){
- $table_logos = array (
+ $table_logos = array (
   'ARTICLE' => 'art',
   'AUTEUR' => 'aut',
   'BREVE' => 'breve',
   'MOT' => 'mot',
   'RUBRIQUE' => 'rub',
   'SITE' => 'site'
-);
- $type = $table_logos[$type];
- # attention au cas $id = '0' pour LOGO_SITE_SPIP
- # utiliser intval et toujours faire au moins un essai
- while (1) {
- $on = cherche_image_nommee($type . $onoff . intval($id));
- if ($on)
- { if ($ff)
- return ("$on[1].$on[2]");
- else
- {
- $off = ($onoff == 'off') ? '' : cherche_image_nommee($type . 'off' . $id);
- return affiche_logos(("$on[0]$on[1].$on[2]"),
- ($off ? ("$off[0]$off[1].$off[2]") : ''),
- $lien,
- $align);
- }
- }
- else if ($id_rubrique !== false)
- {$type = 'rub'; $id = $id_rubrique; $id_rubrique = 0;}
- else if ($type = 'rub') $id = sql_parent($id);
- if (!$id) return '';
- }
+ );
+ $type = $table_logos[$type];
+
+ # attention au cas $id = '0' pour LOGO_SITE_SPIP : utiliser intval()
+ while (1) {
+ $on = cherche_image_nommee($type . $onoff . intval($id));
+ if ($on) {
+ if ($ff)
+ return ("$on[1].$on[2]");
+ else {
+ $off = ($onoff == 'off') ? '' :
+ cherche_image_nommee($type . 'off' . $id);
+ return affiche_logos(("$on[0]$on[1].$on[2]"),
+ ($off ? ("$off[0]$off[1].$off[2]") : ''),
+ $lien,
+ $align);
+ }
+ }
+ else if ($id_rubrique) {
+ $type = 'rub';
+ $id = $id_rubrique;
+ $id_rubrique = 0;
+ } else if ($id AND $type == 'rub')
+ $id = sql_parent($id);
+ else return '';
+ }
}

+
// Renvoie le code html pour afficher le logo, avec ou sans survol, avec ou sans lien, etc.
function affiche_logos($arton, $artoff, $lien, $align) {
   global $num_survol;