[ Index ]
 

Code source de SPIP Agora 1.4

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

title

Body

[fermer]

/Agora1-4/ -> inc-debug.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  // Ce fichier ne sera execute qu'une fois
  20  if (defined("_INC_DEBUG"))
  21      return;
  22  
  23  define("_INC_DEBUG", "1");
  24  
  25  //
  26  // Fonctions debug
  27  //
  28  
  29  function affval ($val) {
  30      echo entites_html($val);
  31  }
  32  
  33  function afftable ($table) {
  34      if (!$table)
  35          return;
  36  
  37      reset ($table);
  38      echo "<UL>";
  39  
  40      while (list($key, $val) = each($table)) {
  41          echo "<LI>";
  42  
  43          switch ($val->type) {
  44              case 'boucle':
  45                  echo "<font color='red'><b>Boucle" . $val->id_boucle . "</b>: " . entites_html($val->commande);
  46                  echo "<br><i><small>" . entites_html($val->requete). "</small></i></font>";
  47                  break;
  48  
  49              case 'texte':
  50                  echo entites_html($val->texte);
  51                  break;
  52  
  53              case 'champ':
  54                  echo "<font color='blue'><i>#" . $val->nom_champ;
  55                  if ($val->fonctions)
  56                      echo " <small>(" . join(',', $val->fonctions). ")</small>";
  57                  echo "</i></font>";
  58                  echo "<ul><li>";
  59                  echo afftable($val->cond_avant);
  60                  echo "</li><li>";
  61                  echo afftable($val->cond_apres);
  62                  echo "</li></ul>";
  63                  break;
  64          }
  65          echo "</LI>";
  66      }
  67  
  68      echo "</UL>\n";
  69  }
  70  
  71  function affboucle ($val) {
  72      echo "<hr>";
  73      echo "<b>Boucle" . $val->id_boucle . "</b>";
  74      echo "<ul><li>";
  75      echo afftable($val->avant);
  76      echo "</li><li>";
  77      echo afftable($val->cond_avant);
  78      echo "</li><li>";
  79      echo afftable($val->milieu);
  80      echo "</li><li>";
  81      echo afftable($val->cond_apres);
  82      echo "</li><li>";
  83      echo afftable($val->cond_altern);
  84      echo "</li><li>";
  85      echo affval($val->fin);
  86      echo "</li></ul>";
  87      echo "\n";
  88  }
  89  
  90  function affboucles () {
  91      global $boucles;
  92      reset ($boucles);
  93  
  94      while (list($key, $val) = each($boucles))
  95          affboucle ($val);
  96  }
  97  
  98  afftable ($GLOBALS['racine']);
  99  affboucles();
 100  ?>


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