*
* Sert pour les tests unitaires
*/
-define('_DEBUG_MAX_SQUELETTE_ERREURS', 9);
+defined('_DEBUG_MAX_SQUELETTE_ERREURS') || define('_DEBUG_MAX_SQUELETTE_ERREURS', 9);
//
// Point d'entree general,
function debusquer_bandeau($erreurs){
if (!empty($erreurs)){
- $n = count($erreurs) . ' ' . _T('zbug_erreur_squelette');
+ $n = array(count($erreurs) . ' ' . _T('zbug_erreur_squelette'));
return debusquer_navigation($erreurs, $n);
}
elseif (!empty($GLOBALS['tableau_des_temps'])) {
// Affichage du tableau des erreurs ou des temps de calcul
// Cliquer sur les numeros en premiere colonne permet de voir le code
-function debusquer_navigation($tableau, $caption = '', $id = 'debug-nav'){
+function debusquer_navigation($tableau, $caption = array(), $id = 'debug-nav'){
if (_request('exec')=='valider_xml') return '';
$GLOBALS['bouton_admin_debug'] = true;
}
return "\n<table id='$id'>"
- . "<caption>"
- . $caption
+ . "<caption onclick=\"x = document.getElementById('$id'); (x.style.display == '' ? x.style.display = 'none' : x.style.display = '');\">"
+ . $caption[0]
## aide locale courte a ecrire, avec lien vers une grosse page de documentation
# aide('erreur_compilation'),
. "</caption>"
+ // fausse caption du chrono (mais vraie nav)
+ . (!empty($caption[1]) ? $caption[1] : '')
. "<tr><th>"
. _T('numero')
. "</th><th>"
- . _T('message')
+ . _T('public:message')
. "</th><th>"
. _T('squelette')
. "</th><th>"
// http://doc.spip.org/@ancre_texte
function ancre_texte($texte, $fautifs = array(), $nocpt = false){
+
$var_mode_ligne = _request('var_mode_ligne');
if ($var_mode_ligne) $fautifs[] = array($var_mode_ligne);
$res = '';
- $s = highlight_string(str_replace('</script>', '</@@@@@>', $texte), true);
-
- $s = str_replace('/@@@@@', '/script', // bug de highlight_string
- str_replace('</font>', '</span>',
- str_replace('<font color="', '<span style="color: ', $s)));
+ $s = highlight_string($texte, true);
if (substr($s, 0, 6)=='<code>'){
$s = substr($s, 6);
$res = '<code>';
// tentative de pointer sur la colonne fautive;
// marche pas car highlight_string rajoute des entites. A revoir.
// $m = $flignes[$i][0];
- // $ligne = substr($ligne, 0, $m-1) .
- // sprintf($formaterr, substr($ligne,$m));
+ // $ligne = substr($ligne, 0, $m-1) .
+ // sprintf($formaterr, substr($ligne,$m));
$bg = $formaterr;
} else {
$indexmesg = $ancre;
}
return "<div id='T$ancre'>"
- . '<div onclick="javascript:'
- . "\$(this).parent().find('a').toggle();"
+ . '<div onclick="'
+ . "jQuery(this).parent().find('a').toggle();"
. '" title="'
. _T('masquer_colonne')
. '" style="cursor: pointer;">'
}
else
return strlen(trim($res))
- ? "<div id='spip-debug'>$res</div>"
+ ? "<img src='".chemin_image('compat-16.png')."' alt='afficher-masquer le debug' id='spip-debug-toggle' onclick=\"x = document.getElementById('spip-debug'); (x.style.display == '' ? x.style.display = 'none' : x.style.display = '');\" /><div id='spip-debug'>$res</div>"
// cas de l'appel sur erreur: montre la page
: $GLOBALS['debug_objets']['resultat']['tout'];
}
$res = $id = '';
}
return !trim($texte) ? '' : (
- "<div id='spip-debug'>$res"
+ "<img src='".chemin_image('compat-16.png')."' alt='afficher-masquer le debug' id='spip-debug-toggle' onclick=\"x = document.getElementById('spip-debug'); (x.style.display == '' ? x.style.display = 'none' : x.style.display = '');\" /><div id='spip-debug'>$res"
. "<div id='debug_boucle'><fieldset$id><legend>"
. "<a href='".$self."#f_".substr($fonc, 0, 37)."'> ↑ "
. ($legend ? $legend : $mode)
"</td><td>\n" .
$req .
"</td><td>\n" .
- $crit .
+ htmlspecialchars($crit) .
"</td></tr>";
}
}
. "' type='text/css' />" .
"</head>\n" .
"<body style='margin:0 10px;'>\n" .
- "<div id='spip-debug-hide' style='position: absolute; top: 0px; z-index: 1000; right:0px;'>" .
- "<a href='#' onClick=\"x = document.getElementById('spip-debug-header'); (x.style.display == '' ? x.style.display = 'none' : x.style.display = ''); return false;\"> + / - </a>" .
- "</div>" .
- "<div id='spip-debug-header' style='position: absolute; top: 22px; z-index: 1000;height:97%;left:0px;right:10px;'>" .
+ "<div id='spip-debug-header'>" .
$corps .
inclure_balise_dynamique(balise_FORMULAIRE_ADMIN_dyn('spip-admin-float', $debug_objets), false) .
'</div></body></html>';