From 7814a70128b986d3e7d4180d6bf4ff404f58ea61 Mon Sep 17 00:00:00 2001 From: Cerdic <cedric@yterium.com> Date: Wed, 10 Feb 2010 21:21:24 +0000 Subject: [PATCH] report de [15142] --- .gitattributes | 1 + ecrire/balise/formulaire_admin.php | 1 + ecrire/inc/utils.php | 10 ++++-- ecrire/public.php | 6 ++-- ecrire/public/debusquer.php | 3 +- ecrire/public/tracer.php | 2 ++ prive/images/fond-inclure.png | Bin 0 -> 135 bytes prive/spip_admin.css | 47 ++++++++++++++++++++++++----- 8 files changed, 55 insertions(+), 15 deletions(-) create mode 100644 prive/images/fond-inclure.png diff --git a/.gitattributes b/.gitattributes index d477f208b6..b0ae1f98d6 100644 --- a/.gitattributes +++ b/.gitattributes @@ -547,6 +547,7 @@ prive/images/fond-calendrier.gif -text prive/images/fond-fondo.gif -text prive/images/fond-grille.gif -text prive/images/fond-gris-anim.gif -text +prive/images/fond-inclure.png -text prive/images/fond-stats.gif -text prive/images/formulaire-editer.jpg -text prive/images/forum-admin-24.gif -text diff --git a/ecrire/balise/formulaire_admin.php b/ecrire/balise/formulaire_admin.php index 6adf4ac83a..c97ff8cf0d 100644 --- a/ecrire/balise/formulaire_admin.php +++ b/ecrire/balise/formulaire_admin.php @@ -72,6 +72,7 @@ function balise_FORMULAIRE_ADMIN_dyn($float='', $debug='') { $env['calcul'] = (_request('var_mode') ? 'recalcul' : 'calcul'); $env['debug'] = $var_preview ? "" : admin_debug(); $env['analyser'] = (!$env['debug'] AND !$GLOBALS['xhtml']) ? '' : admin_valider(); + $env['inclure'] = ($GLOBALS['var_inclure']?'inclure':''); if (!$use_cache) $env['use_cache'] = ' *'; diff --git a/ecrire/inc/utils.php b/ecrire/inc/utils.php index c23e829c0e..465118b5e8 100644 --- a/ecrire/inc/utils.php +++ b/ecrire/inc/utils.php @@ -1700,6 +1700,7 @@ function erreur_squelette($message='', $lieu='') { */ // http://doc.spip.org/@recuperer_fond function recuperer_fond($fond, $contexte=array(), $options = array(), $connect='') { + static $var_inclure=false; include_spip('public/assembler'); // assurer la compat avec l'ancienne syntaxe // (trim etait le 3eme argument, par defaut a true) @@ -1736,8 +1737,13 @@ function recuperer_fond($fond, $contexte=array(), $options = array(), $connect=' if (isset($options['ajax'])AND $options['ajax']) $page['texte'] = encoder_contexte_ajax(array_merge($contexte,array('fond'=>$f)),'',$page['texte']); - if ($GLOBALS['var_inclure']) - $page['texte'] = "<fieldset class='blocs'><legend>".$page['sourcefile']."</legend>".$page['texte']."</fieldset>"; + if ($GLOBALS['var_inclure']){ + $page['texte'] = + "<div class='inclure_blocs'><h6>".$page['sourcefile']."</h6>".$page['texte']."</div>" + . ($var_inclure?"":"<script type='text/javascript'>jQuery(function(){jQuery('.inclure_blocs > h6:first-child').hover(function(){jQuery(this).parent().addClass('hover')},function(){jQuery(this).parent().removeClass('hover')})});</script>"); + $var_inclure = true; + } + $page = pipeline('recuperer_fond',array( 'args'=>array('fond'=>$fond,'contexte'=>$contexte,'options'=>$options,'connect'=>$connect), 'data'=>$page diff --git a/ecrire/public.php b/ecrire/public.php index fabc50b37c..2bcba062f6 100644 --- a/ecrire/public.php +++ b/ecrire/public.php @@ -201,10 +201,10 @@ if (isset($GLOBALS['_INC_PUBLIC'])) { // (c'est ici qu'on fait var_recherche, validation, boutons d'admin, // cf. public/assembler.php) - $page['texte'] = pipeline('affichage_final', $page['texte']); + echo pipeline('affichage_final', $page['texte']); // Appel au debusqueur en cas d'erreurs ou de demande de trace - + // at last if ($debug) { if ($affiche_boutons_admin) { $var_mode_affiche = _request('var_mode_affiche'); @@ -212,8 +212,6 @@ if (isset($GLOBALS['_INC_PUBLIC'])) { echo erreur_squelette(); } } else { - // at last - echo $page['texte']; if (isset($GLOBALS['meta']['date_prochain_postdate']) AND $GLOBALS['meta']['date_prochain_postdate'] <= time()) { diff --git a/ecrire/public/debusquer.php b/ecrire/public/debusquer.php index 5fdc28cc37..65b3a6b373 100644 --- a/ecrire/public/debusquer.php +++ b/ecrire/public/debusquer.php @@ -411,7 +411,8 @@ function debusquer_squelette ($fonc, $mode, $self) { $texte = $debug_objets[$mode][$fonc . 'tout']; $texte = ancre_texte($texte, array('','')); } - } else return "<div id='spip-debug'>$res</div>"; + } else + return strlen(trim($res))?"<div id='spip-debug'>$res</div>":""; } else { $valider = charger_fonction('valider', 'xml'); $val = $valider($debug_objets['validation'][$fonc . 'tout']); diff --git a/ecrire/public/tracer.php b/ecrire/public/tracer.php index bda01fca0c..711cbcbe08 100644 --- a/ecrire/public/tracer.php +++ b/ecrire/public/tracer.php @@ -81,6 +81,8 @@ function chrono_requete($temps) $d[$boucle]+= $dt; if ($boucle) @++$n[$boucle]; + if (!is_array($explain)) + $explain = array(); foreach($explain as $k => $v) { $explain[$k] = "<tr><td>$k</td><td>" . str_replace(';','<br />',$v) diff --git a/prive/images/fond-inclure.png b/prive/images/fond-inclure.png new file mode 100644 index 0000000000000000000000000000000000000000..ec245f9d5c9a2666ca9d2565deaa5fe8eb5b7183 GIT binary patch literal 135 zcmeAS@N?(olHy`uVBq!ia0vp^AT}2V8<6ZZI=>f4NtU=qlmzFem6RtIr7}3C<R_&n zc;+Uirv{}arc@T5Otk?j()4t345_%4w5R%e9y7C)fQX2Tcv3==f)LLFC$Sv9`v3p_ fPWZy((7?!0I*~15qHlB;P!ofvtDnm{r-UW|6cr}# literal 0 HcmV?d00001 diff --git a/prive/spip_admin.css b/prive/spip_admin.css index 29fe0cd9a1..42b9317531 100644 --- a/prive/spip_admin.css +++ b/prive/spip_admin.css @@ -2,12 +2,12 @@ .spip-admin-float { position: absolute; right: 20px; top: 0; background-color: transparent; z-index: 100; } /* Couleurs et design des boutons d'admin */ -a.spip-admin-boutons { border-top: 1px solid #cecece; border-bottom: 2px solid #4A4A4A; border-left: 1px solid #cecece; border-right: 1px solid #cecece; text-decoration: none; text-align: center; margin: 0; padding: 1px .5em; font-family: helvetica,arial, sans-serif; font-size: 10px; font-weight: bold; background-color: #fff; color: #0C479D; } -a:hover.spip-admin-boutons { background-color: #fc3; border-bottom: 2px solid #36F; } -a:active.spip-admin-boutons { background-color: #ccc; border-bottom: 2px solid #f00; } +.spip-admin-boutons { border-top: 1px solid #cecece; border-bottom: 2px solid #4A4A4A; border-left: 1px solid #cecece; border-right: 1px solid #cecece; text-decoration: none; text-align: center; margin: 0 2px; padding: 1px .5em; font-family: helvetica,arial, sans-serif; font-size: 10px; font-weight: bold; background-color: #fff; color: #0C479D; display:block;float:left; } +a:hover.spip-admin-boutons,.spip-admin-boutons a:hover { background-color: #fc3; border-bottom: 2px solid #36F; } +a:active.spip-admin-boutons,.spip-admin-boutons a:active { background-color: #ccc; border-bottom: 2px solid #f00; } /* Style pour le mode debug */ -#spip-debug { background-color: #f0f0f0; font-family: Verdana, Geneva, Helvetica, sans-serif; position:relative;z-index:10000; font-size:1em; } +#spip-debug { background-color: #f0f0f0; font-family: Verdana, Geneva, Helvetica, sans-serif; position:absolute;top:20px;left:0;width:100%;height:100%;z-index:10000; font-size:1em; text-align:left; } #spip-debug ul table { font-size: 80%; } #spip-debug fieldset { background-color: #fff; font-family: Courier, "Courier New", monospace; font-size: 12px; margin-bottom: 1em; } #spip-debug fieldset fieldset { background-color: #ccf; font-family: Verdana, Geneva, Helvetica, sans-serif; font-size: 80%; } @@ -24,12 +24,43 @@ a:active.spip-admin-boutons { background-color: #ccc; border-bottom: 2px solid # .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; } -fieldset.blocs { -border:1px dashed blue !important; +.inclure_blocs { + padding:0 !important; + margin:0 !important; + border:0 !important; + border-bottom:2px solid #FEFF7F !important; + background:url(images/fond-inclure.png) repeat top left !important; +} +.inclure_blocs > h6 {background:#FEFF7F;margin:0;padding:2px;margin-bottom:2px;font-family: Courier;font-size: 0.8em;} +.inclure_blocs > h6:hover, +.inclure_blocs.hover { + background-color: #FDFF1F !important; } -.spip-debug-arg {font-family: Courier, "Courier New", monospace; font-size: 16px; font-weight: bold } -#debug-nav {border:0; background:#f0d9d9; padding:20px; filter:alpha(opacity=90); -moz-opacity:0.9; opacity: 0.90; z-index: 1000; text-align: left; } +#debug-nav {position:absolute;top:90px;left:10px;width:200px;border:0; background:#f0d9d9; padding:20px; filter:alpha(opacity=90); -moz-opacity:0.9; opacity: 0.90; z-index: 1000; text-align: left; } #debug-nav caption {background:red;color:#fff;font-size:1.3em;font-weight;bold;padding:7px;} #debug-nav td,#debug-nav th {border-collapse: collapse;border:1px solid #999;} #debug-nav th {background:#000;color:#fff;font-weight:bold;border-color:#333;} + + +#debug-profile {font-size:0.8em;position:absolute;top:0px;width:100%;border:1px; background:#eee; padding:20px; filter:alpha(opacity=90); -moz-opacity:0.9; opacity: 0.90; z-index: 1000; text-align: left; } +#debug-profile > caption {background:#ccc;color:#000;font-size:1.3em;font-weight:bold;padding:7px;} +#debug-profile > caption table {font-size:0.7em;background:#fff;color:#333;padding:10px;margin-top:10px;} +#debug-profile > caption table td {border-bottom:1px solid #999;} +#debug-profile > caption table td.time {padding:0 5px;} + +#debug-profile > tbody > tr > th {border-bottom:1px solid #999;} +#debug-profile > tbody > tr > td {vertical-align: top;border-bottom:1px solid #999;border-right:1px solid #999;} +#debug-profile > tbody table caption {} +#debug-nav td,#debug-nav th {border-collapse: collapse;border:1px solid #999;} +#debug-nav th {background:#000;color:#fff;font-weight:bold;border-color:#333;} + +#debug-profile table.explain {font-size:0.8em;width:100%;background:#e0e0e0;} +#debug-profile table.explain caption {font-size:1.1em;background:#fff;text-align:left;padding:5px;font-weight:bold;} +#debug-profile table.explain caption br {display:none;} + +#debug-profile table.explain td,#debug-profile table.explain th {border-bottom:1px solid #999;padding:0 5px;} +#debug-profile table.explain th {padding:0 5px;color:#444;} + +.spip-debug-arg {font-family: Courier, "Courier New", monospace; font-weight: bold;} +.liste-reqs .spip-debug-arg {display:block;float:left;width:3em;text-align:right;} \ No newline at end of file -- GitLab