From c34df53d1bcce168b1360cda7a15d5f2950c06bd Mon Sep 17 00:00:00 2001 From: Fil <fil@rezo.net> Date: Sat, 19 Mar 2005 14:41:41 +0000 Subject: [PATCH] =?UTF-8?q?modifs=20pr=C3=A9sentation=20debuggueur=20(Jacq?= =?UTF-8?q?ues)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ecrire/inc_debug_sql.php3 | 49 ++++++++++++++++----------------- spip_admin.css | 58 +++++++++++++++++++++++++++++++++++++-- 2 files changed, 79 insertions(+), 28 deletions(-) diff --git a/ecrire/inc_debug_sql.php3 b/ecrire/inc_debug_sql.php3 index 7ad4e69e4e..fe9dfd017e 100644 --- a/ecrire/inc_debug_sql.php3 +++ b/ecrire/inc_debug_sql.php3 @@ -23,19 +23,20 @@ function afficher_debug_contexte($env) { if (is_array($env_tab = @unserialize($env))) $env = $env_tab; - $env_texte="<div id='spip-env'>" - . bouton_block_invisible("env$n") - . "<b>#ENV</b>\n" - . debut_block_invisible("env$n") - . "<table>\n"; - foreach ($env as $nom => $valeur) { - $env_texte .= "<tr><td><strong>".nl2br(entites_html($nom)) - . "</strong></td>"; - $env_texte .= "<td>: ".nl2br(entites_html($valeur)) - . "</td></tr>\n"; + $env_texte=""; + if (count($env)>0) { + $env_texte="<div class='spip-env'>" + . "<fieldset><legend>#ENV</legend>\n" + . "<div><table>\n"; + foreach ($env as $nom => $valeur) { + $env_texte .= "<tr><td><strong>".nl2br(entites_html($nom)) + . "</strong></td>"; + $env_texte .= "<td>: ".nl2br(entites_html($valeur)) + . "</td></tr>\n"; + } + $env_texte .= "\n</table></div>\n"; + $env_texte .= "</fieldset></div>\n"; } - $env_texte .= "\n</table>\n"; - $env_texte .= fin_block()."</div>\n"; return $env_texte; } @@ -51,6 +52,7 @@ function affiche_erreurs_page($tableau_des_erreurs) { } return "<div id='spip-debug' style='" . "position: absolute; top: 20px; left: 20px; z-index: 1000;" + . "filter:alpha(opacity=60); -moz-opacity:0.6; opacity: 0.6;" . "'><ul><li>" . _T('zbug_erreur_squelette') ## aide locale courte a ecrire, avec lien vers une grosse page de documentation @@ -207,23 +209,20 @@ function debug_dumpfile ($texte, $fonc, $type) { echo debut_entete('Spip ' . _T('admin_debug')), "<link rel='stylesheet' href='spip_admin.css' type='text/css' />", - "</head>\n<body>", - "<div id='spip-debug' style='position: absolute; top: 20px; z-index: 1000;'><ul>\n"; - - include_ecrire('inc_layer.php3'); - echo $GLOBALS['browser_layer']; + "</head>\n<body style='margin:0 10px;'>", + "<div id='spip-debug' style='position: absolute; top: 22px; z-index: 1000;height:97%;left:10px;right:10px;'><div id='spip-boucles'>\n"; foreach ($debug_objets['sourcefile'] as $nom_skel => $sourcefile) { - echo "<li><b>",$sourcefile,"</b>"; - echo " <a href='",$self, "&var_mode_objet=$nom_skel&var_mode_affiche=resultat'>"._T('zbug_resultat')."</a>"; - echo " <a href='", $self, "&var_mode_objet=$nom_skel&var_mode_affiche=code'>"._T('zbug_code')."</a>"; + echo "<fieldset><legend>",$sourcefile," : "; + echo " <a href='",$self, "&var_mode_objet=$nom_skel&var_mode_affiche=resultat'>"._T('zbug_resultat')."</a>"; + echo " <a href='", $self, "&var_mode_objet=$nom_skel&var_mode_affiche=code'>"._T('zbug_code')."</a></legend>"; if (is_array($contexte = $debug_objets['contexte'][$nom_skel])) echo afficher_debug_contexte($contexte); echo "<table width='100%'>\n"; $i = 0; - $colors = array('#c0c0c0', '#c0cad4'); + $colors = array('#e0e0f0', '#f8f8ff'); if (is_array($debug_objets['pretty'])) foreach ($debug_objets['pretty'] as $nom => $pretty) if (substr($nom, 0, strlen($nom_skel)) == $nom_skel) { @@ -231,18 +230,18 @@ function debug_dumpfile ($texte, $fonc, $type) { $aff = "<".$pretty.">"; if ($var_mode_objet == $nom) $aff = "<b>$aff</b>"; - echo "<tr bgcolor='" . $colors[$i%2] . "'><td align='right'>$i</td><td><a href='",$self,"&var_mode_objet=$nom&var_mode_affiche=boucle' class='debug_link_boucle'>"._T('zbug_boucle')."</a></td><td><a href='",$self, "&var_mode_objet=$nom&var_mode_affiche=resultat' class='debug_link_resultat'>"._T('zbug_resultat')."</a></td><td><a href='", $self, "&var_mode_objet=$nom&var_mode_affiche=code' class='debug_link_code'>"._T('zbug_code')."</a></td><td>$aff</td></tr>"; + echo "<tr bgcolor='" . $colors[$i%2] . "'><td align='right'>$i</td><td><a href='",$self,"&var_mode_objet=$nom&var_mode_affiche=boucle' class='debug_link_boucle'>"._T('zbug_boucle')."</a></td><td><a href='",$self, "&var_mode_objet=$nom&var_mode_affiche=resultat' class='debug_link_resultat'>"._T('zbug_resultat')."</a></td><td><a href='", $self, "&var_mode_objet=$nom&var_mode_affiche=code' class='debug_link_code'>"._T('zbug_code')."</a></td><td>$aff</td></tr>"; } - echo "</table>\n</li>\n"; + echo "</table>\n</fieldset>\n"; } - echo "</ul>\n"; + echo "</div>\n"; if ($var_mode_objet && ($res = $debug_objets[$var_mode_affiche][$var_mode_objet])) { if ($var_mode_affiche == 'resultat') { echo "<div id=\"debug_boucle\"><fieldset><legend>",$debug_objets['pretty'][$var_mode_objet],"</legend>"; highlight_string($debug_objets['requete'][$var_mode_objet]); # echo "<p class='spip-admin-bloc'>les premiers appels à cette boucle ont donné :</p>"; foreach ($res as $view) - if ($res) echo "<br><fieldset>",interdire_scripts($view),"</fieldset>"; + if ($res) echo "<br /><fieldset>",interdire_scripts($view),"</fieldset>"; echo "</fieldset></div>"; } else if ($var_mode_affiche == 'code') { diff --git a/spip_admin.css b/spip_admin.css index 9a68e077c4..e5157281da 100644 --- a/spip_admin.css +++ b/spip_admin.css @@ -55,14 +55,22 @@ a:active.spip-admin-boutons { background-color: #f0f0f0; font-family: Verdana, Geneva, Arial, Helvetica, sans-serif; } + #spip-debug ul table { font-size: 80%; } #spip-debug fieldset { background-color: #FFF; - font-family: "Courier New", Courier, monospace; + font-family: Courier, "Courier New", monospace; font-size: 12px; + margin-bottom: 1em; +} + +#spip-debug fieldset fieldset { + background-color: #CCF; + font-family: Verdana, Geneva, Arial, Helvetica, sans-serif; + font-size: 80%; } #spip-debug legend { @@ -73,10 +81,54 @@ a:active.spip-admin-boutons { font-weight: bold; } -#spip-debug ul table a { +#spip-debug fieldset fieldset legend { + border: solid 1px #00F; + font-weight: normal; +} + +#spip-debug a { text-decoration: none; } -#spip-debug ul table a:hover { +#spip-debug a:hover { text-decoration: underline; } + +#debug_boucle fieldset { + background-color: #CCF; +} +#debug_boucle fieldset fieldset { + background-color: #FFF; + font-family: Verdana, Geneva, Arial, Helvetica, sans-serif; + padding: 0.5em 1.5em; +} + +#spip-boucles { + min-height: 200px; + max-height:50%; + margin: 0 0 1em 0; + padding: .5em 0; + overflow: -moz-scrollbars-vertical; + overflow-y: auto; + border-top: 1px solid #3399FF; + border-bottom: 2px solid #666666; +} + +.spip-env fieldset { + background-color: #FFF; + border: solid 1px #008; + margin: 2px 2em; +} + +.spip-env legend { + background-color: #FFF; + border: solid 1px #F00; + padding: 1px 1em; + font-weight: bold; +} + +.spip-env fieldset div { + max-height: 10em; + overflow: auto; +} + -- GitLab