[ Index ]
 

Code source de SPIP 1.9.2c

Accédez au Source d'autres logiciels libres

title

Body

[fermer]

/ecrire/inc/ -> plonger.php (source)

   1  <?php
   2  
   3  /***************************************************************************\
   4   *  SPIP, Systeme de publication pour l'internet                           *
   5   *                                                                         *
   6   *  Copyright (c) 2001-2007                                                *
   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  if (!defined("_ECRIRE_INC_VERSION")) return;
  14  
  15  // http://doc.spip.org/@inc_plonger_dist
  16  function inc_plonger_dist($id_rubrique, $idom="", $list=array(), $col = 1, $exclu=0) {
  17      global  $spip_lang_left;
  18      
  19      if ($list) $id_rubrique = $list[$col-1];
  20      
  21      $ret = '';
  22  
  23      # recherche les filles et petites-filles de la rubrique donnee
  24      $ordre = array();
  25      $rub = array();
  26  
  27      $res = spip_query("SELECT rub1.id_rubrique, rub1.titre, rub1.id_parent, rub1.lang, rub1.langue_choisie FROM spip_rubriques AS rub1, spip_rubriques AS rub2 WHERE ((rub1.id_parent = $id_rubrique) OR (rub2.id_parent = $id_rubrique AND rub1.id_parent=rub2.id_rubrique)) AND rub1.id_rubrique!=$exclu GROUP BY rub1.id_rubrique");
  28  
  29      while ($row = spip_fetch_array($res)) {
  30          if (autoriser('voir','rubrique',$row['id_rubrique'])){
  31              $rub[$row['id_parent']]['enfants'] = true;
  32              if ($row['id_parent'] == $id_rubrique)
  33                  $ordre[$row['id_rubrique']]= trim(typo($row['titre']))
  34                  . (($row['langue_choisie'] != 'oui')
  35                     ? '' : (' [' . $row['lang'] . ']'));
  36          }
  37      }
  38      $next = isset($list[$col]) ? $list[$col] : 0;
  39      if ($ordre) {
  40          asort($ordre);
  41          $rec = generer_url_ecrire('plonger',"rac=$idom&exclus=$exclu&col=".($col+1));
  42          $info = generer_url_ecrire('informer', "type=rubrique&rac=$idom&id=");
  43          $args = "'$idom',this,$col,'$spip_lang_left','$info',event";
  44          while (list($id, $titrebrut) = each($ordre)) {
  45  
  46              $titre = supprimer_numero($titrebrut);
  47  
  48              $classe1 = $id_rubrique ? 'petite-rubrique' : "petit-secteur";
  49              if (isset($rub[$id]["enfants"])) {
  50                  $classe2 = " class='rub-ouverte'";
  51                  $url = "\nhref='$rec&amp;id=$id'" ;
  52              } else {  $url = $classe2 = '' ; }
  53  
  54              $click = "\nonclick=\"changerhighlight(this.parentNode.parentNode.parentNode);\nreturn "
  55              . (!is_array($list) ? ' false' 
  56                 : "aff_selection_provisoire($id,$args)")
  57  # ce lien provoque la selection (directe) de la rubrique cliquee
  58  # et l'affichage de son titre dans le bandeau
  59              . "\"\nondblclick=\""
  60              . "aff_selection_titre(this."
  61              . "firstChild.nodeValue,"
  62              . $id
  63              . ",'selection_rubrique','id_parent');"
  64              . "\nreturn aff_selection_provisoire($id,$args);"
  65              . "\"";
  66  
  67              $ret .= "<div class='"
  68              . (($id == $next) ? "highlight" : "pashighlight")
  69              . "'><div class='"
  70              . $classe1
  71              . "'><div$classe2><a"
  72              . $url
  73              . $click
  74              . ">"
  75              . $titre
  76              . "</a></div></div></div>";
  77          }
  78      }
  79  
  80      $idom2 = $idom . "_col_".($col+1);
  81      $left = ($col*150);
  82  
  83      return http_img_pack("searching.gif", "*", "style='visibility: hidden; position: absolute; $spip_lang_left: "
  84      . ($left-30)
  85      . "px; top: 2px; z-index: 2;' id='img_$idom2'")
  86      . "<div style='width: 150px; height: 100%; overflow: auto; position: absolute; top: 0px; $spip_lang_left: "
  87      .($left-150)
  88      ."px;'>"
  89      . $ret
  90      . "\n</div>\n<div id='$idom2'>"
  91      . ($next
  92         ? inc_plonger_dist($id_rubrique, $idom, $list, $col+1, $exclu)
  93         : "")
  94      . "\n</div>";
  95  }
  96  
  97  ?>


Généré le : Wed Nov 21 10:20:27 2007 par Balluche grâce à PHPXref 0.7
  Clicky Web Analytics