[ Index ]
 

Code source de SPIP Agora 1.4

Accédez au Source d'autres logiciels libresSoutenez Angelica Josefina !

title

Body

[fermer]

/Agora1-4/ecrire/ -> brouteur_select_rubrique.php (source)

   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  // Permet de selectionner une rubrique à la maniere du brouteur existant dans SPIP
  20  
  21  include  ("inc.php");
  22  
  23  //debut_page(_T('titre_page_articles_tous'), "asuivre", "tout-site");
  24  debut_html();
  25  
  26  echo "<div>&nbsp;</div>";
  27  
  28  //$largeur_table = 974;
  29  $largeur_table = 874;
  30  $hauteur_table = 400;
  31  $nb_col = 4;
  32  
  33  $largeur_col = round($largeur_table / $nb_col);
  34  
  35  echo "<table border='0' cellpadding='0' cellspacing='2' width='$largeur_table'>";
  36  
  37  if ($id_rubrique) {
  38      $j = $nb_col;
  39  
  40      while ($id_rubrique > 0) {
  41          $rubriqueMetier = &recuperer_instance_rubrique();
  42          $loadOK = $rubriqueMetier->load($id_rubrique);
  43          if (PEAR::isError($loadOK)) {
  44              die ($loadOK->getMessage());
  45          }
  46          else {
  47              $j = $j - 1;
  48              $ze_rubrique = $rubriqueMetier->getRubriqueId();
  49              // ajout Olivier : verif de l'authorisation 
  50              $authorization = &recuperer_instance_authorization('isManagedRubriqueByAuteurId', $GLOBALS['connect_id_auteur'], array('rubriqueId' => $id_rubrique));
  51  
  52              if ($authorization->isAuthorizedAction()) {
  53                  $titre = $rubriqueMetier->getTitre();
  54                  $dest[$j] = $ze_rubrique;
  55              }
  56              $id_rubrique = $rubriqueMetier->getParentId();
  57          // fin ajout 
  58          }
  59      }
  60  
  61      $dest[$j - 1] = 0;
  62  
  63      while (!$dest[1]) {
  64          for ($i = 0; $i < $nb_col; $i++) {
  65              $dest[$i] = $dest[$i + 1];
  66          }
  67      }
  68      if ($dest[0] > 0 AND $parent = $dest[$nb_col - 2]) {
  69          // Afficher la hierarchie pour "remonter"
  70          echo "<tr><td colspan='$nb_col' style='text-align: $spip_lang_left;'>";
  71          $la_rubrique = $dest[0];
  72          /**************** Modification elebescond@clever-age.com ******************/
  73          $rubriqueMetier = &recuperer_instance_rubrique();
  74          $loadOK = $rubriqueMetier->load($la_rubrique);
  75  
  76          if (PEAR::isError($loadOK)) {
  77              die ($loadOK->getMessage());
  78          }
  79          else {
  80              $la_rubrique = $rubriqueMetier->getParentId();
  81          }
  82  
  83          while ($la_rubrique > 0) {
  84              $rubriqueMetier = &recuperer_instance_rubrique();
  85              $loadOK = $rubriqueMetier->load($la_rubrique);
  86              if (PEAR::isError($loadOK)) {
  87                  die ($loadOK->getMessage());
  88              }
  89              else {
  90                  $authorization = &recuperer_instance_authorization('isManagedRubriqueByAuteurId', $GLOBALS['connect_id_auteur'], array('rubriqueId' => $la_rubrique));
  91  
  92                  if ($authorization->isAuthorizedAction()) {
  93                      $compteur = $compteur + 1;
  94                      $ze_rubrique = $rubriqueMetier->getRubriqueId();
  95                      $titre = $rubriqueMetier->getTitre();
  96                      $lien = $dest[$nb_col - $compteur - 1];
  97                  }
  98  
  99                  $la_rubrique = $rubriqueMetier->getParentId();
 100  
 101                  if ($la_rubrique == 0)
 102                      $icone = "secteur-24.gif";
 103                  else
 104                      $icone = "rubrique-24.gif";
 105                  $ret = "<div style='padding-top: 5px; padding-bottom: 5px; padding-$spip_lang_left: 28px; background: url(img_pack/$icone) $spip_lang_left no-repeat;'><a href='brouteur_select_rubrique.php?id_rubrique=$lien'>$titre</a></div><div style='margin-$spip_lang_left: 28px;'>$ret</div>";
 106              }
 107          }
 108  
 109          $lien = $dest[$nb_col - $compteur - 2];
 110          $icone = "racine-site-24.gif";
 111          $ret = "<div style='padding-top: 5px; padding-bottom: 5px; padding-$spip_lang_left: 28px; background: url(img_pack/$icone) $spip_lang_left no-repeat;'><a href='brouteur_select_rubrique.php?id_rubrique=$lien'>" . _T('info_racine_site'). "</a></div><div style='margin-$spip_lang_left: 28px;'>$ret</div>";
 112          echo $ret;
 113          echo "</td></tr>";
 114      }
 115  }
 116  else {
 117      $id_rubrique = 0;
 118      $dest[0] = "$id_rubrique";
 119  }
 120  
 121  echo "<tr width='$largeur_table'>";
 122  
 123  for ($i = 0; $i < $nb_col; $i++) {
 124      echo "<td valign='top' width='$largeur_col'>";
 125  
 126      echo "<iframe width='100%' id='iframe$i' name='iframe$i' src='brouteur_select_rubrique_frame.php?id_rubrique=" . $dest[$i]. "&frame=$i' height='$hauteur_table' style='background-color: #eeeeee; border-right: 1px solid white; border-bottom: 1px solid white; border-left: 1px solid #cccccc; border-top: 1px solid #cccccc;'></iframe>";
 127  
 128      echo "</td>";
 129  }
 130  
 131  echo "</tr>";
 132  echo "</table>";
 133  ?>


Généré le : Sat Feb 24 14:40:03 2007 par Balluche grâce à PHPXref 0.7