Completed
Push — master ( 1e6dd3...980817 )
by cam
01:15
created
ecrire/public/decompiler.php 1 patch
Spacing   +18 added lines, -19 removed lines patch added patch discarded remove patch
@@ -29,7 +29,7 @@  discard block
 block discarded – undo
29 29
 	$type .= ($struct->type_requete ?: $struct->table_optionnelle);
30 30
 
31 31
 	if ($struct->jointures_explicites) {
32
-		$type .= ' ' . $struct->jointures_explicites;
32
+		$type .= ' '.$struct->jointures_explicites;
33 33
 	}
34 34
 	if ($struct->table_optionnelle) {
35 35
 		$type .= '?';
@@ -38,11 +38,11 @@  discard block
 block discarded – undo
38 38
 
39 39
 	$crit = $struct->param;
40 40
 	if ($crit and !is_array($crit[0])) {
41
-		$type = strtolower($type) . array_shift($crit);
41
+		$type = strtolower($type).array_shift($crit);
42 42
 	}
43 43
 	$crit = decompiler_criteres($struct, $fmt, $prof);
44 44
 
45
-	$f = 'format_boucle_' . $fmt;
45
+	$f = 'format_boucle_'.$fmt;
46 46
 
47 47
 	return $f($preaff, $avant, $nom, $type, $crit, $milieu, $apres, $altern, $postaff, $prof);
48 48
 }
@@ -55,21 +55,20 @@  discard block
 block discarded – undo
55 55
 			$res[] = decompiler_($v, $fmt, $prof);
56 56
 		}
57 57
 	}
58
-	$file = is_string($struct->texte) ? $struct->texte :
59
-		decompiler_($struct->texte, $fmt, $prof);
60
-	$f = 'format_inclure_' . $fmt;
58
+	$file = is_string($struct->texte) ? $struct->texte : decompiler_($struct->texte, $fmt, $prof);
59
+	$f = 'format_inclure_'.$fmt;
61 60
 
62 61
 	return $f($file, $res, $prof);
63 62
 }
64 63
 
65 64
 function decompiler_texte($struct, $fmt = '', $prof = 0) {
66
-	$f = 'format_texte_' . $fmt;
65
+	$f = 'format_texte_'.$fmt;
67 66
 
68 67
 	return strlen($struct->texte) ? $f($struct->texte, $prof) : '';
69 68
 }
70 69
 
71 70
 function decompiler_polyglotte($struct, $fmt = '', $prof = 0) {
72
-	$f = 'format_polyglotte_' . $fmt;
71
+	$f = 'format_polyglotte_'.$fmt;
73 72
 
74 73
 	return $f($struct->traductions, $prof);
75 74
 }
@@ -82,7 +81,7 @@  discard block
 block discarded – undo
82 81
 
83 82
 	$filtres = decompiler_liste($struct->param, $fmt, $prof);
84 83
 
85
-	$f = 'format_idiome_' . $fmt;
84
+	$f = 'format_idiome_'.$fmt;
86 85
 
87 86
 	return $f($struct->nom_champ, $struct->module, $args, $filtres, $prof);
88 87
 }
@@ -97,7 +96,7 @@  discard block
 block discarded – undo
97 96
 		}
98 97
 		$filtres = decompiler_liste($p, $fmt, $prof);
99 98
 	}
100
-	$f = 'format_champ_' . $fmt;
99
+	$f = 'format_champ_'.$fmt;
101 100
 
102 101
 	return $f($struct->nom_champ, $struct->nom_boucle, $struct->etoile, $avant, $apres, $args, $filtres, $prof);
103 102
 }
@@ -106,7 +105,7 @@  discard block
 block discarded – undo
106 105
 	if (!is_array($sources)) {
107 106
 		return '';
108 107
 	}
109
-	$f = 'format_liste_' . $fmt;
108
+	$f = 'format_liste_'.$fmt;
110 109
 	$res = '';
111 110
 	foreach ($sources as $arg) {
112 111
 		if (!is_array($arg)) {
@@ -123,7 +122,7 @@  discard block
 block discarded – undo
123 122
 				and (strlen($v[0]->apres) == 1)
124 123
 				and $v[0]->apres == $v[0]->avant
125 124
 			) {
126
-				$args[] = $v[0]->avant . $v[0]->texte . $v[0]->apres;
125
+				$args[] = $v[0]->avant.$v[0]->texte.$v[0]->apres;
127 126
 			} else {
128 127
 				$args[] = decompiler_($v, $fmt, 0 - $prof);
129 128
 			}
@@ -146,7 +145,7 @@  discard block
 block discarded – undo
146 145
 		return '';
147 146
 	}
148 147
 	$res = '';
149
-	$f = 'format_critere_' . $fmt;
148
+	$f = 'format_critere_'.$fmt;
150 149
 	foreach ($sources as $crit) {
151 150
 		if (!is_array($crit)) {
152 151
 			continue;
@@ -159,13 +158,13 @@  discard block
 block discarded – undo
159 158
 				and $v[0]->type == 'texte'
160 159
 				and $v[0]->apres
161 160
 			) {
162
-				$args[] = [['texte', ($v[0]->apres . $v[0]->texte . $v[0]->apres)]];
161
+				$args[] = [['texte', ($v[0]->apres.$v[0]->texte.$v[0]->apres)]];
163 162
 			} else {
164 163
 				$res2 = [];
165 164
 				foreach ($v as $k => $p) {
166 165
 					if (
167 166
 						isset($p->type)
168
-						and function_exists($d = 'decompiler_' . $p->type)
167
+						and function_exists($d = 'decompiler_'.$p->type)
169 168
 					) {
170 169
 						$r = $d($p, $fmt, (0 - $prof));
171 170
 						$res2[] = [$p->type, $r];
@@ -193,7 +192,7 @@  discard block
 block discarded – undo
193 192
 		if (!isset($p->type)) {
194 193
 			continue;
195 194
 		} #??????
196
-		$d = 'decompiler_' . $p->type;
195
+		$d = 'decompiler_'.$p->type;
197 196
 		$next = $liste[$k + 1] ?? false;
198 197
 		// Forcer le champ etendu si son source (pas les reecritures)
199 198
 		// contenait des args et s'il est suivi d'espaces,
@@ -218,16 +217,16 @@  discard block
 block discarded – undo
218 217
 		}
219 218
 		$contenu[] = [$d($p, $fmt, $prof2), $p->type];
220 219
 	}
221
-	$f = 'format_suite_' . $fmt;
220
+	$f = 'format_suite_'.$fmt;
222 221
 
223 222
 	return $f($contenu);
224 223
 }
225 224
 
226 225
 function public_decompiler($liste, $fmt = '', $prof = 0, $quoi = '') {
227
-	if (!include_spip('public/format_' . $fmt)) {
226
+	if (!include_spip('public/format_'.$fmt)) {
228 227
 		return "'$fmt'?";
229 228
 	}
230
-	$f = 'decompiler_' . $quoi;
229
+	$f = 'decompiler_'.$quoi;
231 230
 
232 231
 	return $f($liste, $fmt, $prof);
233 232
 }
Please login to merge, or discard this patch.
ecrire/public/debusquer.php 1 patch
Spacing   +86 added lines, -89 removed lines patch added patch discarded remove patch
@@ -137,7 +137,7 @@  discard block
 block discarded – undo
137 137
 		if (!$fonc) {
138 138
 			$fonc = $GLOBALS['debug_objets']['principal'];
139 139
 		}
140
-		$titre = !$mode ? $fonc : ($mode . (isset($GLOBALS['debug_objets']['sourcefile'][$fonc]) ? ' ' . $GLOBALS['debug_objets']['sourcefile'][$fonc] : ''));
140
+		$titre = !$mode ? $fonc : ($mode.(isset($GLOBALS['debug_objets']['sourcefile'][$fonc]) ? ' '.$GLOBALS['debug_objets']['sourcefile'][$fonc] : ''));
141 141
 	}
142 142
 	if ($message === false) {
143 143
 		lang_select();
@@ -166,7 +166,7 @@  discard block
 block discarded – undo
166 166
 	$fond = $GLOBALS['fond'] ?? '';
167 167
 	// une erreur critique sort $message en array
168 168
 	$debug = is_array($msg) ? $msg[1] : $msg;
169
-	spip_log('Debug: ' . $debug . ' (' . $fond . ')');
169
+	spip_log('Debug: '.$debug.' ('.$fond.')');
170 170
 
171 171
 	return $msg;
172 172
 }
@@ -174,7 +174,7 @@  discard block
 block discarded – undo
174 174
 function debusquer_bandeau($erreurs) {
175 175
 
176 176
 	if (!empty($erreurs)) {
177
-		$n = [(is_countable($erreurs) ? count($erreurs) : 0) . ' ' . _T('zbug_erreur_squelette')];
177
+		$n = [(is_countable($erreurs) ? count($erreurs) : 0).' '._T('zbug_erreur_squelette')];
178 178
 
179 179
 		return debusquer_navigation($erreurs, $n);
180 180
 	} elseif (!empty($GLOBALS['tableau_des_temps'])) {
@@ -207,25 +207,25 @@  discard block
 block discarded – undo
207 207
 			$valeur_simple = [];
208 208
 			foreach ($valeur as $v) {
209 209
 				if (is_array($v)) {
210
-					$valeur_simple[] = 'array:' . count($v);
210
+					$valeur_simple[] = 'array:'.count($v);
211 211
 				} elseif (is_object($v)) {
212 212
 					$valeur_simple[] = get_class($v);
213 213
 				} elseif (is_string($v)) {
214
-					$valeur_simple[] = "'" . $v . "'";
214
+					$valeur_simple[] = "'".$v."'";
215 215
 				} else {
216 216
 					$valeur_simple[] = $v;
217 217
 				}
218 218
 			}
219 219
 			$n = count($valeur);
220
-			$valeur = (($n > 3) ? 'array:' . $n . ' ' : '');
221
-			$valeur .= '[' . join(', ', $valeur_simple) . ']';
220
+			$valeur = (($n > 3) ? 'array:'.$n.' ' : '');
221
+			$valeur .= '['.join(', ', $valeur_simple).']';
222 222
 		} elseif (is_object($valeur)) {
223 223
 			$valeur = get_class($valeur);
224 224
 		} elseif (is_string($valeur)) {
225
-			$valeur = "'" . $valeur . "'";
225
+			$valeur = "'".$valeur."'";
226 226
 		}
227
-		$res .= "\n<tr><td><strong>" . nl2br((string) entites_html($nom))
228
-			. '</strong></td><td>:&nbsp;' . nl2br((string) entites_html($valeur))
227
+		$res .= "\n<tr><td><strong>".nl2br((string) entites_html($nom))
228
+			. '</strong></td><td>:&nbsp;'.nl2br((string) entites_html($valeur))
229 229
 			. "</td></tr>\n";
230 230
 	}
231 231
 
@@ -253,10 +253,10 @@  discard block
 block discarded – undo
253 253
 				$nom_code = $lieu->descr['nom'];
254 254
 				$skel = $lieu->descr['sourcefile'];
255 255
 				$h2 = parametre_url($href, 'var_mode_objet', $nom_code);
256
-				$h3 = parametre_url($h2, 'var_mode_affiche', 'squelette') . '#L' . $ligne;
256
+				$h3 = parametre_url($h2, 'var_mode_affiche', 'squelette').'#L'.$ligne;
257 257
 				$skel = "<a href='$h3'><b>$skel</b></a>";
258 258
 				if ($boucle) {
259
-					$h3 = parametre_url($h2 . $boucle, 'var_mode_affiche', 'boucle');
259
+					$h3 = parametre_url($h2.$boucle, 'var_mode_affiche', 'boucle');
260 260
 					$boucle = "<a href='$h3'><b>$boucle</b></a>";
261 261
 				}
262 262
 			}
@@ -345,7 +345,7 @@  discard block
 block discarded – undo
345 345
 	}
346 346
 
347 347
 	// Requete erronee
348
-	$err = '<b>' . _T('avis_erreur_mysql') . " $errno</b><br /><tt>\n"
348
+	$err = '<b>'._T('avis_erreur_mysql')." $errno</b><br /><tt>\n"
349 349
 		. spip_htmlspecialchars($msg)
350 350
 		. "\n<br /><span style='color: red'><b>"
351 351
 		. spip_htmlspecialchars($query)
@@ -359,7 +359,7 @@  discard block
 block discarded – undo
359 359
 
360 360
 function trouve_boucle_debug($n, $nom, $debut = 0, $boucle = '') {
361 361
 
362
-	$id = $nom . $boucle;
362
+	$id = $nom.$boucle;
363 363
 	if (is_array($GLOBALS['debug_objets']['sequence'][$id])) {
364 364
 		foreach ($GLOBALS['debug_objets']['sequence'][$id] as $v) {
365 365
 			if (!preg_match('/^(.*)(<\?.*\?>)(.*)$/s', $v[0], $r)) {
@@ -405,7 +405,7 @@  discard block
 block discarded – undo
405 405
 		}
406 406
 	}
407 407
 	}
408
-	$incl = ',' . $reg[1] . '[.]\w$,';
408
+	$incl = ','.$reg[1].'[.]\w$,';
409 409
 
410 410
 	foreach ($GLOBALS['debug_objets']['sourcefile'] as $k => $v) {
411 411
 		if (preg_match($incl, $v)) {
@@ -420,16 +420,13 @@  discard block
 block discarded – undo
420 420
 	[$skel, $boucle, $ligne] = trouve_boucle_debug($n, $nom);
421 421
 
422 422
 	if (!$boucle) {
423
-		return !$ligne ? '' :
424
-			(' (' .
425
-				(($nom != $skel) ? _T('squelette_inclus_ligne') :
426
-					_T('squelette_ligne')) .
423
+		return !$ligne ? '' : (' ('.
424
+				(($nom != $skel) ? _T('squelette_inclus_ligne') : _T('squelette_ligne')).
427 425
 				" <a href='$self&amp;var_mode_objet=$skel&amp;var_mode_affiche=squelette&amp;var_mode_ligne=$ligne#L$ligne'>$ligne</a>)");
428 426
 	} else {
429 427
 		$self .= "&amp;var_mode_objet=$skel$boucle&amp;var_mode_affiche=boucle";
430 428
 
431
-		return !$ligne ? " (boucle\n<a href='$self#$skel$boucle'>$boucle</a>)" :
432
-			" (boucle $boucle ligne\n<a href='$self&amp;var_mode_ligne=$ligne#L$ligne'>$ligne</a>)";
429
+		return !$ligne ? " (boucle\n<a href='$self#$skel$boucle'>$boucle</a>)" : " (boucle $boucle ligne\n<a href='$self&amp;var_mode_ligne=$ligne#L$ligne'>$ligne</a>)";
433 430
 	}
434 431
 }
435 432
 
@@ -451,14 +448,14 @@  discard block
 block discarded – undo
451 448
 
452 449
 	$s = preg_replace(
453 450
 		',<(\w[^<>]*)>([^<]*)<br />([^<]*)</\1>,',
454
-		'<\1>\2</\1><br />' . "\n" . '<\1>\3</\1>',
451
+		'<\1>\2</\1><br />'."\n".'<\1>\3</\1>',
455 452
 		$s
456 453
 	);
457 454
 
458 455
 
459 456
 	$tableau = explode('<br />', $s);
460 457
 
461
-	$format = "<span style='float:left;display:block;width:50px;height:1px'><a id='L%d' style='background-color: white; visibility: " . ($nocpt ? 'hidden' : 'visible') . ";%s' href='#T%s' title=\"%s\">%0" . strval(@strlen(count($tableau))) . "d</a></span> %s<br />\n";
458
+	$format = "<span style='float:left;display:block;width:50px;height:1px'><a id='L%d' style='background-color: white; visibility: ".($nocpt ? 'hidden' : 'visible').";%s' href='#T%s' title=\"%s\">%0".strval(@strlen(count($tableau)))."d</a></span> %s<br />\n";
462 459
 
463 460
 	$format10 = str_replace('white', 'lightgrey', $format);
464 461
 	$formaterr = 'color: red;';
@@ -502,7 +499,7 @@  discard block
 block discarded – undo
502 499
 	. '" style="cursor: pointer;">'
503 500
 	. ($nocpt ? '' : _T('info_numero_abbreviation'))
504 501
 	. '</div>
505
-	' . $res . "</div>\n";
502
+	' . $res."</div>\n";
506 503
 }
507 504
 
508 505
 // l'environnement graphique du debuggueur
@@ -524,14 +521,14 @@  discard block
 block discarded – undo
524 521
 			if (!empty($GLOBALS['debug_objets'][$mode][$fonc])) {
525 522
 				[$legend, $texte, $res2] = debusquer_source($fonc, $mode);
526 523
 				$texte .= $res2;
527
-			} elseif (!empty($GLOBALS['debug_objets'][$mode][$fonc . 'tout'])) {
528
-				$legend = _T('zbug_' . $mode);
529
-				$texte = $GLOBALS['debug_objets'][$mode][$fonc . 'tout'];
524
+			} elseif (!empty($GLOBALS['debug_objets'][$mode][$fonc.'tout'])) {
525
+				$legend = _T('zbug_'.$mode);
526
+				$texte = $GLOBALS['debug_objets'][$mode][$fonc.'tout'];
530 527
 				$texte = ancre_texte($texte, ['', '']);
531 528
 			}
532 529
 		} else {
533 530
 			if (strlen(trim($res))) {
534
-				return "<img src='" . chemin_image('debug-xx.svg') . "' alt='afficher-masquer le debug' id='spip-debug-toggle' onclick=\"var x = document.getElementById('spip-debug'); (x.style.display == '' ? x.style.display = 'none' : x.style.display = '');\" /><div id='spip-debug'>$res</div>";
531
+				return "<img src='".chemin_image('debug-xx.svg')."' alt='afficher-masquer le debug' id='spip-debug-toggle' onclick=\"var x = document.getElementById('spip-debug'); (x.style.display == '' ? x.style.display = 'none' : x.style.display = '');\" /><div id='spip-debug'>$res</div>";
535 532
 			} else {
536 533
 				// cas de l'appel sur erreur: montre la page
537 534
 				return $GLOBALS['debug_objets']['resultat']['tout'] ?? '';
@@ -539,7 +536,7 @@  discard block
 block discarded – undo
539 536
 		}
540 537
 	} else {
541 538
 		$valider = charger_fonction('valider', 'xml');
542
-		$val = $valider($GLOBALS['debug_objets']['validation'][$fonc . 'tout']);
539
+		$val = $valider($GLOBALS['debug_objets']['validation'][$fonc.'tout']);
543 540
 		// Si erreur, signaler leur nombre dans le formulaire admin
544 541
 		$GLOBALS['debug_objets']['validation'] = $val->err ? count($val->err) : '';
545 542
 		[$texte, $err] = emboite_texte($val, $fonc, $self);
@@ -550,14 +547,14 @@  discard block
 block discarded – undo
550 547
 		} else {
551 548
 			$err = ": $err";
552 549
 		}
553
-		$legend = _T('validation') . ' ' . $err;
550
+		$legend = _T('validation').' '.$err;
554 551
 		$res = $id = '';
555 552
 	}
556 553
 
557 554
 	return !trim($texte) ? '' : (
558
-		"<img src='" . chemin_image('debug-xx.svg') . "' alt='afficher-masquer le debug' id='spip-debug-toggle' onclick=\"var x = document.getElementById('spip-debug'); (x.style.display == '' ? x.style.display = 'none' : x.style.display = '');\" /><div id='spip-debug'>$res"
555
+		"<img src='".chemin_image('debug-xx.svg')."' alt='afficher-masquer le debug' id='spip-debug-toggle' onclick=\"var x = document.getElementById('spip-debug'); (x.style.display == '' ? x.style.display = 'none' : x.style.display = '');\" /><div id='spip-debug'>$res"
559 556
 		. "<div id='debug_boucle'><fieldset$id><legend>"
560
-		. "<a href='" . $self . '#f_' . substr($fonc, 0, 37) . "'> &#8593; "
557
+		. "<a href='".$self.'#f_'.substr($fonc, 0, 37)."'> &#8593; "
561 558
 		. ($legend ?: $mode)
562 559
 		. '</a></legend>'
563 560
 		. $texte
@@ -568,7 +565,7 @@  discard block
 block discarded – undo
568 565
 
569 566
 function emboite_texte($res, $fonc = '', $self = '') {
570 567
 	$errs = $res->err;
571
-	$texte = $res->entete . ($errs ? '' : $res->page);
568
+	$texte = $res->entete.($errs ? '' : $res->page);
572 569
 
573 570
 	if (!$texte and !$errs) {
574 571
 		return [ancre_texte('', ['', '']), false];
@@ -624,7 +621,7 @@  discard block
 block discarded – undo
624 621
 		$err = "<h2 style='text-align: center'>"
625 622
 			. $i
626 623
 			. "<a href='#fin_err'>"
627
-			. ' ' . _T('erreur_texte')
624
+			. ' '._T('erreur_texte')
628 625
 			. "</a></h2><table id='debut_err' style='width: 100%'>"
629 626
 			. $err
630 627
 			. " </table><a id='fin_err'></a>";
@@ -634,9 +631,9 @@  discard block
 block discarded – undo
634 631
 		[$msg, $fermant, $ouvrant] = $errs[0];
635 632
 		$rf = reference_boucle_debug($fermant, $fonc, $self);
636 633
 		$ro = reference_boucle_debug($ouvrant, $fonc, $self);
637
-		$err = $msg .
638
-			"<a href='#L" . $fermant . "'>$fermant</a>$rf<br />" .
639
-			"<a href='#L" . $ouvrant . "'>$ouvrant</a>$ro";
634
+		$err = $msg.
635
+			"<a href='#L".$fermant."'>$fermant</a>$rf<br />".
636
+			"<a href='#L".$ouvrant."'>$ouvrant</a>$ro";
640 637
 
641 638
 		return [ancre_texte($texte, [[$ouvrant], [$fermant]]), $err];
642 639
 	}
@@ -669,7 +666,7 @@  discard block
 block discarded – undo
669 666
 			['time' => $GLOBALS['debug_objets']['profile'][$sourcefile]]
670 667
 		);
671 668
 
672
-		$res .= "<fieldset id='f_" . $nom . "'><legend>"
669
+		$res .= "<fieldset id='f_".$nom."'><legend>"
673 670
 			. $t_skel
674 671
 			. ' '
675 672
 			. $sourcefile
@@ -684,7 +681,7 @@  discard block
 block discarded – undo
684 681
 			. "'>"
685 682
 			. _T('zbug_calcul')
686 683
 			. '</a></legend>'
687
-			. (!$temps ? '' : ("\n<span style='display:block;float:" . $GLOBALS['spip_lang_right'] . "'>$temps</span><br />"))
684
+			. (!$temps ? '' : ("\n<span style='display:block;float:".$GLOBALS['spip_lang_right']."'>$temps</span><br />"))
688 685
 			. debusquer_contexte($contexte[$sourcefile])
689 686
 		. (!$nav ? '' : ("<table width='100%'>\n$nav</table>\n"))
690 687
 		. "</fieldset>\n";
@@ -705,33 +702,33 @@  discard block
 block discarded – undo
705 702
 			$nom = $boucle->id_boucle;
706 703
 			$req = $boucle->type_requete;
707 704
 			$crit = public_decompiler($boucle, $gram, 0, 'criteres');
708
-			$self2 = $self . '&amp;var_mode_objet=' . $objet;
709
-
710
-			$res .= "\n<tr style='background-color: " .
711
-				($i % 2 ? '#e0e0f0' : '#f8f8ff') .
712
-				"'><td  align='right'>$i</td><td>\n" .
713
-				"<a  class='debug_link_boucle' href='" .
714
-				$self2 .
715
-				"&amp;var_mode_affiche=boucle#f_$nom_skel'>" .
716
-				_T('zbug_boucle') .
717
-				"</a></td><td>\n<a class='debug_link_boucle' href='" .
718
-				$self2 .
719
-				"&amp;var_mode_affiche=resultat#f_$nom_skel'>" .
720
-				_T('zbug_resultat') .
721
-				"</a></td><td>\n<a class='debug_link_resultat' href='" .
722
-				$self2 .
723
-				"&amp;var_mode_affiche=code#f_$nom_skel'>" .
724
-				_T('zbug_code') .
725
-				"</a></td><td>\n<a class='debug_link_resultat' href='" .
726
-				str_replace('var_mode=', 'var_profile=', $self2) .
727
-				"'>" .
728
-				_T('zbug_calcul') .
729
-				"</a></td><td>\n" .
730
-				(($var_mode_objet == $objet) ? "<b>$nom</b>" : $nom) .
731
-				"</td><td>\n" .
732
-				$req .
733
-				"</td><td>\n" .
734
-				spip_htmlspecialchars($crit) .
705
+			$self2 = $self.'&amp;var_mode_objet='.$objet;
706
+
707
+			$res .= "\n<tr style='background-color: ".
708
+				($i % 2 ? '#e0e0f0' : '#f8f8ff').
709
+				"'><td  align='right'>$i</td><td>\n".
710
+				"<a  class='debug_link_boucle' href='".
711
+				$self2.
712
+				"&amp;var_mode_affiche=boucle#f_$nom_skel'>".
713
+				_T('zbug_boucle').
714
+				"</a></td><td>\n<a class='debug_link_boucle' href='".
715
+				$self2.
716
+				"&amp;var_mode_affiche=resultat#f_$nom_skel'>".
717
+				_T('zbug_resultat').
718
+				"</a></td><td>\n<a class='debug_link_resultat' href='".
719
+				$self2.
720
+				"&amp;var_mode_affiche=code#f_$nom_skel'>".
721
+				_T('zbug_code').
722
+				"</a></td><td>\n<a class='debug_link_resultat' href='".
723
+				str_replace('var_mode=', 'var_profile=', $self2).
724
+				"'>".
725
+				_T('zbug_calcul').
726
+				"</a></td><td>\n".
727
+				(($var_mode_objet == $objet) ? "<b>$nom</b>" : $nom).
728
+				"</td><td>\n".
729
+				$req.
730
+				"</td><td>\n".
731
+				spip_htmlspecialchars($crit).
735 732
 				'</td></tr>';
736 733
 		}
737 734
 	}
@@ -758,7 +755,7 @@  discard block
 block discarded – undo
758 755
 		}
759 756
 		//  permettre le copier/coller facile
760 757
 		// $res = ancre_texte($req, array(), true);
761
-		$res = "<div id='T" . md5($req) . "'>\n<pre>\n" . $req . "</pre>\n</div>\n";
758
+		$res = "<div id='T".md5($req)."'>\n<pre>\n".$req."</pre>\n</div>\n";
762 759
 		//  formatage et affichage des resultats bruts de la requete
763 760
 		$ress_req = spip_query($req);
764 761
 		$brut_sql = '';
@@ -768,10 +765,10 @@  discard block
 block discarded – undo
768 765
 		$max_aff = defined('_MAX_DEBUG_AFF') ? _MAX_DEBUG_AFF : 50;
769 766
 		while ($retours_sql = sql_fetch($ress_req)) {
770 767
 			if ($num <= $max_aff) {
771
-				$brut_sql .= '<h3>' . ($num == 1 ? $num . ' sur ' . sql_count($ress_req) : $num) . '</h3>';
768
+				$brut_sql .= '<h3>'.($num == 1 ? $num.' sur '.sql_count($ress_req) : $num).'</h3>';
772 769
 				$brut_sql .= '<p>';
773 770
 				foreach ($retours_sql as $key => $val) {
774
-					$brut_sql .= '<strong>' . $key . '</strong> => ' . spip_htmlspecialchars(couper($val, 150)) . "<br />\n";
771
+					$brut_sql .= '<strong>'.$key.'</strong> => '.spip_htmlspecialchars(couper($val, 150))."<br />\n";
775 772
 				}
776 773
 				$brut_sql .= '</p>';
777 774
 			}
@@ -782,14 +779,14 @@  discard block
 block discarded – undo
782 779
 			//  ne pas afficher les $contexte_inclus
783 780
 			$view = preg_replace(',<\?php.+\?[>],Uims', '', $view);
784 781
 			if ($view) {
785
-				$res2 .= "\n<br /><fieldset>" . interdire_scripts($view) . '</fieldset>';
782
+				$res2 .= "\n<br /><fieldset>".interdire_scripts($view).'</fieldset>';
786 783
 			}
787 784
 		}
788 785
 	} elseif ($affiche == 'code') {
789 786
 		$legend = $nom;
790
-		$res = ancre_texte('<' . "?php\n" . $quoi . "\n?" . '>');
787
+		$res = ancre_texte('<'."?php\n".$quoi."\n?".'>');
791 788
 	} elseif ($affiche == 'boucle') {
792
-		$legend = _T('zbug_boucle') . ' ' . $nom;
789
+		$legend = _T('zbug_boucle').' '.$nom;
793 790
 		// Le compilateur prefixe le nom des boucles par l'extension du fichier source.
794 791
 		$gram = preg_match('/^([^_]+)_/', $objet, $r) ? $r[1] : '';
795 792
 		$res = ancre_texte(public_decompiler($quoi, $gram, 0, 'boucle'));
@@ -807,23 +804,23 @@  discard block
 block discarded – undo
807 804
 	include_spip('public/assembler'); // pour inclure_balise_dynamique
808 805
 	include_spip('inc/texte'); // pour corriger_typo
809 806
 
810
-	return _DOCTYPE_ECRIRE .
811
-	html_lang_attributes() .
812
-	"<head>\n<title>" .
813
-	('SPIP ' . $GLOBALS['spip_version_affichee'] . ' ' .
814
-		_T('admin_debug') . ' ' . $titre . ' (' .
815
-		supprimer_tags(corriger_typo($GLOBALS['meta']['nom_site']))) .
816
-	")</title>\n" .
817
-	"<meta http-equiv='Content-Type' content='text/html" .
818
-	(($c = $GLOBALS['meta']['charset']) ? "; charset=$c" : '') .
819
-	"' />\n" .
807
+	return _DOCTYPE_ECRIRE.
808
+	html_lang_attributes().
809
+	"<head>\n<title>".
810
+	('SPIP '.$GLOBALS['spip_version_affichee'].' '.
811
+		_T('admin_debug').' '.$titre.' ('.
812
+		supprimer_tags(corriger_typo($GLOBALS['meta']['nom_site']))).
813
+	")</title>\n".
814
+	"<meta http-equiv='Content-Type' content='text/html".
815
+	(($c = $GLOBALS['meta']['charset']) ? "; charset=$c" : '').
816
+	"' />\n".
820 817
 	http_script('', 'jquery.js')
821
-	. "<link rel='stylesheet' href='" . url_absolue(find_in_path('spip_admin.css'))
822
-	. "' type='text/css' />" .
823
-	"</head>\n" .
824
-	"<body style='margin:0 10px;'>\n" .
825
-	"<div id='spip-debug-header'>" .
826
-	$corps .
827
-	inclure_balise_dynamique(balise_FORMULAIRE_ADMIN_dyn('spip-admin-float', $GLOBALS['debug_objets']), false) .
818
+	. "<link rel='stylesheet' href='".url_absolue(find_in_path('spip_admin.css'))
819
+	. "' type='text/css' />".
820
+	"</head>\n".
821
+	"<body style='margin:0 10px;'>\n".
822
+	"<div id='spip-debug-header'>".
823
+	$corps.
824
+	inclure_balise_dynamique(balise_FORMULAIRE_ADMIN_dyn('spip-admin-float', $GLOBALS['debug_objets']), false).
828 825
 	'</div></body></html>';
829 826
 }
Please login to merge, or discard this patch.