Subversion Repositories Sites.tela-botanica.org

Rev

Details | Last modification | View Log | RSS feed

Rev Author Line No. Line
4 david 1
<?php
2
 
3
//
4
// Ce fichier ne sera execute qu'une fois
5
if (defined("_INC_DEBUG")) return;
6
define("_INC_DEBUG", "1");
7
 
8
//
9
// Fonctions debug
10
//
11
 
12
function affval($val) {
13
 
14
	echo entites_html($val);
15
 
16
}
17
 
18
function afftable($table) {
19
 
20
	if (!$table) return;
21
	reset($table);
22
	echo "<UL>";
23
	while (list($key, $val) = each($table)) {
24
		echo "<LI>";
25
		switch ($val->type) {
26
		case 'boucle':
27
			echo "<font color='red'><b>Boucle".$val->id_boucle."</b>: ".entites_html($val->commande);
28
			echo "<br><i><small>".entites_html($val->requete)."</small></i></font>";
29
			break;
30
		case 'texte':
31
			echo entites_html($val->texte);
32
			break;
33
		case 'champ':
34
			echo "<font color='blue'><i>#".$val->nom_champ;
35
			if ($val->fonctions) echo " <small>(".join(',', $val->fonctions).")</small>";
36
			echo "</i></font>";
37
			echo "<ul><li>";
38
			echo afftable($val->cond_avant);
39
			echo "</li><li>";
40
			echo afftable($val->cond_apres);
41
			echo "</li></ul>";
42
			break;
43
		}
44
		echo "</LI>";
45
	}
46
	echo "</UL>\n";
47
}
48
 
49
function affboucle($val) {
50
	echo "<hr>";
51
	echo "<b>Boucle".$val->id_boucle."</b>";
52
	echo "<ul><li>";
53
	echo afftable($val->avant);
54
	echo "</li><li>";
55
	echo afftable($val->cond_avant);
56
	echo "</li><li>";
57
	echo afftable($val->milieu);
58
	echo "</li><li>";
59
	echo afftable($val->cond_apres);
60
	echo "</li><li>";
61
	echo afftable($val->cond_altern);
62
	echo "</li><li>";
63
	echo affval($val->fin);
64
	echo "</li></ul>";
65
	echo "\n";
66
}
67
 
68
function affboucles() {
69
	global $boucles;
70
	reset($boucles);
71
	while (list($key, $val) = each($boucles)) affboucle($val);
72
}
73
 
74
afftable($GLOBALS['racine']);
75
affboucles();
76
 
77
 
78
?>