|
|
|
@ -2,19 +2,39 @@
|
|
|
|
|
|
|
|
|
|
if (!defined('_ECRIRE_INC_VERSION')) return; |
|
|
|
|
|
|
|
|
|
// Une fonction pour joliment afficher les variables de #ENV, #GET, #SESSION... |
|
|
|
|
// à utiliser avec [(#ENV|bel_env)], [(#GET|bel_env)], [(#SESSION|bel_env)] |
|
|
|
|
/** |
|
|
|
|
* Une fonction récursive pour joliment afficher #ENV, #GET, #SESSION... |
|
|
|
|
* en squelette : [(#ENV|bel_env)], [(#GET|bel_env)], [(#SESSION|bel_env)] |
|
|
|
|
* ou encore [(#ARRAY{0,1, a,#SESSION, 1,#ARRAY{x,y}}|bel_env)] |
|
|
|
|
* |
|
|
|
|
* @param string|array $env |
|
|
|
|
* si une string est passée elle doit être le serialize d'un array |
|
|
|
|
* |
|
|
|
|
* @return string |
|
|
|
|
* une chaîne html affichant une <table> |
|
|
|
|
**/ |
|
|
|
|
function bel_env($env) { |
|
|
|
|
$env = str_replace(array('"', '''), array('"', '\''), $env); |
|
|
|
|
if (is_array($env_tab = @unserialize($env))) $env = $env_tab; |
|
|
|
|
if (!$env) return ''; |
|
|
|
|
$res = "\n"; |
|
|
|
|
foreach ($env as $nom => $valeur) { |
|
|
|
|
if (is_array($valeur)) $valeur = bel_env($valeur); |
|
|
|
|
else $valeur = entites_html($valeur); |
|
|
|
|
$res .= "|". entites_html($nom). " : |{" .$valeur. "}|\n"; |
|
|
|
|
} |
|
|
|
|
return "\n<fieldset>\n" .propre($res). "</fieldset>\n"; |
|
|
|
|
$env = str_replace(array('"', '''), array('"', '\''), $env); |
|
|
|
|
if (is_array($env_tab = @unserialize($env))) { |
|
|
|
|
$env = $env_tab; |
|
|
|
|
} |
|
|
|
|
if (!is_array($env)) { |
|
|
|
|
return ''; |
|
|
|
|
} |
|
|
|
|
$style = " style='border:1px solid #ddd;'"; |
|
|
|
|
$res = "<table style='border-collapse:collapse;'>\n"; |
|
|
|
|
foreach ($env as $nom => $val) { |
|
|
|
|
if (is_array($val) || is_array(@unserialize($val))) { |
|
|
|
|
$val = bel_env($val); |
|
|
|
|
} |
|
|
|
|
else { |
|
|
|
|
$val = entites_html($val); |
|
|
|
|
} |
|
|
|
|
$res .= "<tr>\n<td$style><strong>". entites_html($nom). |
|
|
|
|
" : </strong></td><td$style>" .$val. "</td>\n</tr>\n"; |
|
|
|
|
} |
|
|
|
|
$res .= "</table>"; |
|
|
|
|
return $res; |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
?> |