@@ -24,11 +24,10 @@ discard block |
||
| 24 | 24 | $milieu = decompiler_($struct->milieu, $fmt, $prof); |
| 25 | 25 | |
| 26 | 26 | $type = $struct->sql_serveur ? "$struct->sql_serveur:" : ''; |
| 27 | - $type .= ($struct->type_requete ? $struct->type_requete : |
|
| 28 | - $struct->table_optionnelle); |
|
| 27 | + $type .= ($struct->type_requete ? $struct->type_requete : $struct->table_optionnelle); |
|
| 29 | 28 | |
| 30 | 29 | if ($struct->jointures_explicites) { |
| 31 | - $type .= " " . $struct->jointures_explicites; |
|
| 30 | + $type .= " ".$struct->jointures_explicites; |
|
| 32 | 31 | } |
| 33 | 32 | if ($struct->table_optionnelle) { |
| 34 | 33 | $type .= "?"; |
@@ -37,11 +36,11 @@ discard block |
||
| 37 | 36 | |
| 38 | 37 | $crit = $struct->param; |
| 39 | 38 | if ($crit and !is_array($crit[0])) { |
| 40 | - $type = strtolower($type) . array_shift($crit); |
|
| 39 | + $type = strtolower($type).array_shift($crit); |
|
| 41 | 40 | } |
| 42 | 41 | $crit = decompiler_criteres($struct, $fmt, $prof); |
| 43 | 42 | |
| 44 | - $f = 'format_boucle_' . $fmt; |
|
| 43 | + $f = 'format_boucle_'.$fmt; |
|
| 45 | 44 | |
| 46 | 45 | return $f($avant, $nom, $type, $crit, $milieu, $apres, $altern, $prof); |
| 47 | 46 | } |
@@ -54,21 +53,20 @@ discard block |
||
| 54 | 53 | $res[] = decompiler_($v, $fmt, $prof); |
| 55 | 54 | } |
| 56 | 55 | } |
| 57 | - $file = is_string($struct->texte) ? $struct->texte : |
|
| 58 | - decompiler_($struct->texte, $fmt, $prof); |
|
| 59 | - $f = 'format_inclure_' . $fmt; |
|
| 56 | + $file = is_string($struct->texte) ? $struct->texte : decompiler_($struct->texte, $fmt, $prof); |
|
| 57 | + $f = 'format_inclure_'.$fmt; |
|
| 60 | 58 | |
| 61 | 59 | return $f($file, $res, $prof); |
| 62 | 60 | } |
| 63 | 61 | |
| 64 | 62 | function decompiler_texte($struct, $fmt = '', $prof = 0) { |
| 65 | - $f = 'format_texte_' . $fmt; |
|
| 63 | + $f = 'format_texte_'.$fmt; |
|
| 66 | 64 | |
| 67 | 65 | return strlen($struct->texte) ? $f($struct->texte, $prof) : ''; |
| 68 | 66 | } |
| 69 | 67 | |
| 70 | 68 | function decompiler_polyglotte($struct, $fmt = '', $prof = 0) { |
| 71 | - $f = 'format_polyglotte_' . $fmt; |
|
| 69 | + $f = 'format_polyglotte_'.$fmt; |
|
| 72 | 70 | |
| 73 | 71 | return $f($struct->traductions, $prof); |
| 74 | 72 | } |
@@ -81,7 +79,7 @@ discard block |
||
| 81 | 79 | |
| 82 | 80 | $filtres = decompiler_liste($struct->param, $fmt, $prof); |
| 83 | 81 | |
| 84 | - $f = 'format_idiome_' . $fmt; |
|
| 82 | + $f = 'format_idiome_'.$fmt; |
|
| 85 | 83 | |
| 86 | 84 | return $f($struct->nom_champ, $struct->module, $args, $filtres, $prof); |
| 87 | 85 | } |
@@ -96,7 +94,7 @@ discard block |
||
| 96 | 94 | } |
| 97 | 95 | $filtres = decompiler_liste($p, $fmt, $prof); |
| 98 | 96 | } |
| 99 | - $f = 'format_champ_' . $fmt; |
|
| 97 | + $f = 'format_champ_'.$fmt; |
|
| 100 | 98 | |
| 101 | 99 | return $f($struct->nom_champ, $struct->nom_boucle, $struct->etoile, $avant, $apres, $args, $filtres, $prof); |
| 102 | 100 | } |
@@ -105,7 +103,7 @@ discard block |
||
| 105 | 103 | if (!is_array($sources)) { |
| 106 | 104 | return ''; |
| 107 | 105 | } |
| 108 | - $f = 'format_liste_' . $fmt; |
|
| 106 | + $f = 'format_liste_'.$fmt; |
|
| 109 | 107 | $res = ''; |
| 110 | 108 | foreach ($sources as $arg) { |
| 111 | 109 | if (!is_array($arg)) { |
@@ -121,7 +119,7 @@ discard block |
||
| 121 | 119 | and (strlen($v[0]->apres) == 1) |
| 122 | 120 | and $v[0]->apres == $v[0]->avant |
| 123 | 121 | ) { |
| 124 | - $args[] = $v[0]->avant . $v[0]->texte . $v[0]->apres; |
|
| 122 | + $args[] = $v[0]->avant.$v[0]->texte.$v[0]->apres; |
|
| 125 | 123 | } else { |
| 126 | 124 | $args[] = decompiler_($v, $fmt, 0 - $prof); |
| 127 | 125 | } |
@@ -144,7 +142,7 @@ discard block |
||
| 144 | 142 | return ''; |
| 145 | 143 | } |
| 146 | 144 | $res = ''; |
| 147 | - $f = 'format_critere_' . $fmt; |
|
| 145 | + $f = 'format_critere_'.$fmt; |
|
| 148 | 146 | foreach ($sources as $crit) { |
| 149 | 147 | if (!is_array($crit)) { |
| 150 | 148 | continue; |
@@ -156,12 +154,12 @@ discard block |
||
| 156 | 154 | and $v[0]->type == 'texte' |
| 157 | 155 | and $v[0]->apres |
| 158 | 156 | ) { |
| 159 | - $args[] = array(array('texte', ($v[0]->apres . $v[0]->texte . $v[0]->apres))); |
|
| 157 | + $args[] = array(array('texte', ($v[0]->apres.$v[0]->texte.$v[0]->apres))); |
|
| 160 | 158 | } else { |
| 161 | 159 | $res2 = array(); |
| 162 | 160 | foreach ($v as $k => $p) { |
| 163 | 161 | if (isset($p->type) |
| 164 | - and function_exists($d = 'decompiler_' . $p->type) |
|
| 162 | + and function_exists($d = 'decompiler_'.$p->type) |
|
| 165 | 163 | ) { |
| 166 | 164 | $r = $d($p, $fmt, (0 - $prof), @$v[$k + 1]); |
| 167 | 165 | $res2[] = array($p->type, $r); |
@@ -189,7 +187,7 @@ discard block |
||
| 189 | 187 | if (!isset($p->type)) { |
| 190 | 188 | continue; |
| 191 | 189 | } #?????? |
| 192 | - $d = 'decompiler_' . $p->type; |
|
| 190 | + $d = 'decompiler_'.$p->type; |
|
| 193 | 191 | $next = isset($liste[$k + 1]) ? $liste[$k + 1] : false; |
| 194 | 192 | // Forcer le champ etendu si son source (pas les reecritures) |
| 195 | 193 | // contenait des args et s'il est suivi d'espaces, |
@@ -214,16 +212,16 @@ discard block |
||
| 214 | 212 | $contenu[] = array($d($p, $fmt, $prof2), $p->type); |
| 215 | 213 | |
| 216 | 214 | } |
| 217 | - $f = 'format_suite_' . $fmt; |
|
| 215 | + $f = 'format_suite_'.$fmt; |
|
| 218 | 216 | |
| 219 | 217 | return $f($contenu); |
| 220 | 218 | } |
| 221 | 219 | |
| 222 | 220 | function public_decompiler($liste, $fmt = '', $prof = 0, $quoi = '') { |
| 223 | - if (!include_spip('public/format_' . $fmt)) { |
|
| 221 | + if (!include_spip('public/format_'.$fmt)) { |
|
| 224 | 222 | return "'$fmt'?"; |
| 225 | 223 | } |
| 226 | - $f = 'decompiler_' . $quoi; |
|
| 224 | + $f = 'decompiler_'.$quoi; |
|
| 227 | 225 | |
| 228 | 226 | return $f($liste, $fmt, $prof); |
| 229 | 227 | } |
@@ -15,11 +15,11 @@ discard block |
||
| 15 | 15 | } |
| 16 | 16 | |
| 17 | 17 | function securiser_redirect_action($redirect) { |
| 18 | - if ((tester_url_absolue($redirect) or preg_match(',^\w+:,',trim($redirect))) |
|
| 18 | + if ((tester_url_absolue($redirect) or preg_match(',^\w+:,', trim($redirect))) |
|
| 19 | 19 | and !defined('_AUTORISER_ACTION_ABS_REDIRECT')) { |
| 20 | 20 | // si l'url est une url du site, on la laisse passer sans rien faire |
| 21 | 21 | // c'est encore le plus simple |
| 22 | - $base = $GLOBALS['meta']['adresse_site'] . "/"; |
|
| 22 | + $base = $GLOBALS['meta']['adresse_site']."/"; |
|
| 23 | 23 | if (strlen($base) and strncmp($redirect, $base, strlen($base)) == 0) { |
| 24 | 24 | return $redirect; |
| 25 | 25 | } |
@@ -138,7 +138,7 @@ discard block |
||
| 138 | 138 | if ($ancre = _request('var_ajax_ancre')) { |
| 139 | 139 | // pas n'importe quoi quand meme dans la variable ! |
| 140 | 140 | $ancre = str_replace(array('<', '"', "'"), array('<', '"', ''), $ancre); |
| 141 | - $texte = "<a href='#$ancre' name='ajax_ancre' style='display:none;'>anchor</a>" . $texte; |
|
| 141 | + $texte = "<a href='#$ancre' name='ajax_ancre' style='display:none;'>anchor</a>".$texte; |
|
| 142 | 142 | } |
| 143 | 143 | } else { |
| 144 | 144 | include_spip('inc/headers'); |
@@ -292,7 +292,7 @@ discard block |
||
| 292 | 292 | // on ajoute un br en display none en tete du retour ajax pour regler un bug dans IE6/7 |
| 293 | 293 | // sans cela le formulaire n'est pas actif apres le hit ajax |
| 294 | 294 | // la classe ajax-form-is-ok sert a s'assurer que le retour ajax s'est bien passe |
| 295 | - $retour = "<br class='bugajaxie ajax-form-is-ok' style='display:none;'/>" . $retour; |
|
| 295 | + $retour = "<br class='bugajaxie ajax-form-is-ok' style='display:none;'/>".$retour; |
|
| 296 | 296 | ajax_retour($retour, false); |
| 297 | 297 | |
| 298 | 298 | return true; // on a fini le hit |
@@ -36,7 +36,7 @@ discard block |
||
| 36 | 36 | return sql_getfetsel( |
| 37 | 37 | 'virtuel', |
| 38 | 38 | 'spip_articles', |
| 39 | - array('id_article=' . intval($id_article), "statut='publie'"), |
|
| 39 | + array('id_article='.intval($id_article), "statut='publie'"), |
|
| 40 | 40 | '', |
| 41 | 41 | '', |
| 42 | 42 | '', |
@@ -78,7 +78,7 @@ discard block |
||
| 78 | 78 | $cache_quete[$connect][$table][$id] = sql_fetsel( |
| 79 | 79 | $cache_quete[$connect][$table]['_select'], |
| 80 | 80 | $table, |
| 81 | - $cache_quete[$connect][$table]['_id'] . '=' . intval($id), |
|
| 81 | + $cache_quete[$connect][$table]['_id'].'='.intval($id), |
|
| 82 | 82 | '', |
| 83 | 83 | '', |
| 84 | 84 | '', |
@@ -171,7 +171,7 @@ discard block |
||
| 171 | 171 | return |
| 172 | 172 | (isset($GLOBALS['meta']['date_prochain_postdate']) |
| 173 | 173 | and $GLOBALS['meta']['date_prochain_postdate'] > time()) |
| 174 | - ? "$champ_date<" . sql_quote(date('Y-m-d H:i:s', $GLOBALS['meta']['date_prochain_postdate']), $serveur) |
|
| 174 | + ? "$champ_date<".sql_quote(date('Y-m-d H:i:s', $GLOBALS['meta']['date_prochain_postdate']), $serveur) |
|
| 175 | 175 | : '1=1'; |
| 176 | 176 | } |
| 177 | 177 | |
@@ -229,7 +229,7 @@ discard block |
||
| 229 | 229 | and $id_table = reset($objet) |
| 230 | 230 | and $objet = objet_type($id_table) |
| 231 | 231 | ) { |
| 232 | - $w = "$mstatut<>" . sql_quote($v); |
|
| 232 | + $w = "$mstatut<>".sql_quote($v); |
|
| 233 | 233 | |
| 234 | 234 | // retrouver l’id_auteur qui a filé un lien de prévisu éventuellement, |
| 235 | 235 | // sinon l’auteur en session |
@@ -243,22 +243,22 @@ discard block |
||
| 243 | 243 | } |
| 244 | 244 | |
| 245 | 245 | // dans ce cas (admin en general), pas de filtrage sur ce statut |
| 246 | - if (!autoriser('previsualiser' . $v, $objet, '', $id_auteur)) { |
|
| 246 | + if (!autoriser('previsualiser'.$v, $objet, '', $id_auteur)) { |
|
| 247 | 247 | // si pas d'auteur identifie pas de sous-requete car pas d'article qui matche |
| 248 | 248 | if (!$id_auteur) { |
| 249 | 249 | $where[] = $w; |
| 250 | 250 | } else { |
| 251 | 251 | $primary = id_table_objet($objet); |
| 252 | - $where[] = "($w OR $id_table.$primary IN (" . sql_get_select( |
|
| 252 | + $where[] = "($w OR $id_table.$primary IN (".sql_get_select( |
|
| 253 | 253 | 'ssss.id_objet', |
| 254 | 254 | 'spip_auteurs_liens AS ssss', |
| 255 | - 'ssss.objet=' . sql_quote($objet) . ' AND ssss.id_auteur=' . intval($id_auteur), |
|
| 255 | + 'ssss.objet='.sql_quote($objet).' AND ssss.id_auteur='.intval($id_auteur), |
|
| 256 | 256 | '', |
| 257 | 257 | '', |
| 258 | 258 | '', |
| 259 | 259 | '', |
| 260 | 260 | $serveur |
| 261 | - ) . '))'; |
|
| 261 | + ).'))'; |
|
| 262 | 262 | } |
| 263 | 263 | } |
| 264 | 264 | } // ignorer ce statut si on ne sait pas comment le filtrer |
@@ -296,7 +296,7 @@ discard block |
||
| 296 | 296 | * @return array|bool|null |
| 297 | 297 | */ |
| 298 | 298 | function quete_fichier($id_document, $serveur = '') { |
| 299 | - return sql_getfetsel('fichier', 'spip_documents', ('id_document=' . intval($id_document)), '', array(), '', '', $serveur); |
|
| 299 | + return sql_getfetsel('fichier', 'spip_documents', ('id_document='.intval($id_document)), '', array(), '', '', $serveur); |
|
| 300 | 300 | } |
| 301 | 301 | |
| 302 | 302 | /** |
@@ -307,7 +307,7 @@ discard block |
||
| 307 | 307 | * @return array|bool |
| 308 | 308 | */ |
| 309 | 309 | function quete_document($id_document, $serveur = '') { |
| 310 | - return sql_fetsel('*', 'spip_documents', ('id_document=' . intval($id_document)), '', array(), '', '', $serveur); |
|
| 310 | + return sql_fetsel('*', 'spip_documents', ('id_document='.intval($id_document)), '', array(), '', '', $serveur); |
|
| 311 | 311 | } |
| 312 | 312 | |
| 313 | 313 | /** |
@@ -318,7 +318,7 @@ discard block |
||
| 318 | 318 | * @return array|bool|null |
| 319 | 319 | */ |
| 320 | 320 | function quete_meta($nom, $serveur) { |
| 321 | - return sql_getfetsel('valeur', 'spip_meta', 'nom=' . sql_quote($nom), '', '', '', '', $serveur); |
|
| 321 | + return sql_getfetsel('valeur', 'spip_meta', 'nom='.sql_quote($nom), '', '', '', '', $serveur); |
|
| 322 | 322 | } |
| 323 | 323 | |
| 324 | 324 | /** |
@@ -372,9 +372,9 @@ discard block |
||
| 372 | 372 | // qui permet de distinguer le changement de logo |
| 373 | 373 | // et placer un expire sur le dossier IMG/ |
| 374 | 374 | $res = array( |
| 375 | - $on['chemin'] . ($on['timestamp'] ? "?{$on['timestamp']}" : ''), |
|
| 376 | - ($off ? $off['chemin'] . ($off['timestamp'] ? "?{$off['timestamp']}" : '') : ''), |
|
| 377 | - (!$taille ? '' : (' ' . $taille[3])) |
|
| 375 | + $on['chemin'].($on['timestamp'] ? "?{$on['timestamp']}" : ''), |
|
| 376 | + ($off ? $off['chemin'].($off['timestamp'] ? "?{$off['timestamp']}" : '') : ''), |
|
| 377 | + (!$taille ? '' : (' '.$taille[3])) |
|
| 378 | 378 | ); |
| 379 | 379 | $res['src'] = $res[0]; |
| 380 | 380 | $res['logo_on'] = $res[0]; |
@@ -470,7 +470,7 @@ discard block |
||
| 470 | 470 | // si c'est une vignette type doc, la renvoyer direct |
| 471 | 471 | if (strcmp($logo, _DIR_PLUGINS) == 0 |
| 472 | 472 | or strcmp($logo, _DIR_PLUGINS_DIST) == 0 |
| 473 | - or strcmp($logo, _DIR_RACINE . 'prive/') == 0 |
|
| 473 | + or strcmp($logo, _DIR_RACINE.'prive/') == 0 |
|
| 474 | 474 | ) { |
| 475 | 475 | return $logo; |
| 476 | 476 | } |
@@ -589,8 +589,7 @@ discard block |
||
| 589 | 589 | // qu'une fois (par squelette) et on conserve le resultat |
| 590 | 590 | // en static. |
| 591 | 591 | if (!isset($exposer[$m = md5(serialize($reference))][$prim])) { |
| 592 | - $principal = isset($reference[$type]) ? $reference[$type] : |
|
| 593 | - // cas de la pagination indecte @xx qui positionne la page avec l'id xx |
|
| 592 | + $principal = isset($reference[$type]) ? $reference[$type] : // cas de la pagination indecte @xx qui positionne la page avec l'id xx |
|
| 594 | 593 | // et donne la reference dynamique @type=xx dans le contexte |
| 595 | 594 | (isset($reference["@$type"]) ? $reference["@$type"] : ''); |
| 596 | 595 | // le parent fournit en argument est le parent de $id, pas celui de $principal |
@@ -618,7 +617,7 @@ discard block |
||
| 618 | 617 | $exposer[$m][$type][$principal] = true; |
| 619 | 618 | if ($type == 'id_mot') { |
| 620 | 619 | if (!$parent) { |
| 621 | - $parent = sql_getfetsel('id_groupe', 'spip_mots', 'id_mot=' . intval($principal), '', '', '', '', $connect); |
|
| 620 | + $parent = sql_getfetsel('id_groupe', 'spip_mots', 'id_mot='.intval($principal), '', '', '', '', $connect); |
|
| 622 | 621 | } |
| 623 | 622 | if ($parent) { |
| 624 | 623 | $exposer[$m]['id_groupe'][$parent] = true; |
@@ -20,7 +20,7 @@ discard block |
||
| 20 | 20 | // donc il faut l'inclure "en globals" |
| 21 | 21 | if ($f = find_in_path('mes_fonctions.php')) { |
| 22 | 22 | global $dossier_squelettes; |
| 23 | - include_once(_ROOT_CWD . $f); |
|
| 23 | + include_once(_ROOT_CWD.$f); |
|
| 24 | 24 | } |
| 25 | 25 | |
| 26 | 26 | if (@is_readable(_CACHE_PLUGINS_FCT)) { |
@@ -96,7 +96,7 @@ discard block |
||
| 96 | 96 | } else { |
| 97 | 97 | // Preparer l'appel de la fonction principale du squelette |
| 98 | 98 | |
| 99 | - spip_timer($a = 'calcul page ' . rand(0, 1000)); |
|
| 99 | + spip_timer($a = 'calcul page '.rand(0, 1000)); |
|
| 100 | 100 | |
| 101 | 101 | // On cree un marqueur de notes unique lie a cette composition |
| 102 | 102 | // et on enregistre l'etat courant des globales de notes... |
@@ -152,28 +152,28 @@ discard block |
||
| 152 | 152 | $val = serialize($val); |
| 153 | 153 | } |
| 154 | 154 | if (strlen("$val") > 30) { |
| 155 | - $val = substr("$val", 0, 27) . '..'; |
|
| 155 | + $val = substr("$val", 0, 27).'..'; |
|
| 156 | 156 | } |
| 157 | 157 | if (strstr($val, ' ')) { |
| 158 | 158 | $val = "'$val'"; |
| 159 | 159 | } |
| 160 | - $infos[] = $var . '=' . $val; |
|
| 160 | + $infos[] = $var.'='.$val; |
|
| 161 | 161 | } |
| 162 | 162 | $profile = spip_timer($a); |
| 163 | 163 | spip_log("calcul ($profile) [$skel] " |
| 164 | 164 | . join(', ', $infos) |
| 165 | - . ' (' . strlen($page['texte']) . ' octets)'); |
|
| 165 | + . ' ('.strlen($page['texte']).' octets)'); |
|
| 166 | 166 | |
| 167 | - if (defined('_CALCUL_PROFILER') AND intval($profile)>_CALCUL_PROFILER){ |
|
| 167 | + if (defined('_CALCUL_PROFILER') AND intval($profile) > _CALCUL_PROFILER) { |
|
| 168 | 168 | spip_log("calcul ($profile) [$skel] " |
| 169 | 169 | . join(', ', $infos) |
| 170 | - .' ('.strlen($page['texte']).' octets) | '.$_SERVER['REQUEST_URI'],"profiler"._LOG_AVERTISSEMENT); |
|
| 170 | + .' ('.strlen($page['texte']).' octets) | '.$_SERVER['REQUEST_URI'], "profiler"._LOG_AVERTISSEMENT); |
|
| 171 | 171 | } |
| 172 | 172 | |
| 173 | 173 | if ($debug) { |
| 174 | 174 | // si c'est ce que demande le debusqueur, lui passer la main |
| 175 | 175 | $t = strlen($page['texte']) ? $page['texte'] : " "; |
| 176 | - $GLOBALS['debug_objets']['resultat'][$fonc . 'tout'] = $t; |
|
| 176 | + $GLOBALS['debug_objets']['resultat'][$fonc.'tout'] = $t; |
|
| 177 | 177 | $GLOBALS['debug_objets']['courant'] = $courant; |
| 178 | 178 | $GLOBALS['debug_objets']['profile'][$sourcefile] = $profile; |
| 179 | 179 | if ($GLOBALS['debug_objets']['sourcefile'] |
@@ -203,7 +203,7 @@ discard block |
||
| 203 | 203 | if (defined('_VAR_INCLURE') and _VAR_INCLURE) { |
| 204 | 204 | $page['sourcefile'] = $sourcefile; |
| 205 | 205 | $page['texte'] = |
| 206 | - "<div class='inclure_blocs'><h6>" . $page['sourcefile'] . "</h6>" . $page['texte'] . "</div>" |
|
| 206 | + "<div class='inclure_blocs'><h6>".$page['sourcefile']."</h6>".$page['texte']."</div>" |
|
| 207 | 207 | . ($js_inclus ? "" : "<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>"); |
| 208 | 208 | $js_inclus = true; |
| 209 | 209 | } |
@@ -283,7 +283,7 @@ discard block |
||
| 283 | 283 | . "?php include_spip('inc/headers');redirige_par_entete('" |
| 284 | 284 | . texte_script($url) |
| 285 | 285 | . "','',$status);" |
| 286 | - . "?" . ">", |
|
| 286 | + . "?".">", |
|
| 287 | 287 | 'process_ins' => 'php', |
| 288 | 288 | 'status' => $status |
| 289 | 289 | ); |
@@ -95,7 +95,7 @@ discard block |
||
| 95 | 95 | $select = true |
| 96 | 96 | ) { |
| 97 | 97 | if (!is_string($defaut)) { |
| 98 | - $defaut = '@$Pile[0][\'' . strtolower($nom_champ) . '\']'; |
|
| 98 | + $defaut = '@$Pile[0][\''.strtolower($nom_champ).'\']'; |
|
| 99 | 99 | } |
| 100 | 100 | |
| 101 | 101 | $i = 0; |
@@ -123,7 +123,7 @@ discard block |
||
| 123 | 123 | if ($select and !in_array($t, $boucles[$idb]->select)) { |
| 124 | 124 | $boucles[$idb]->select[] = $t; |
| 125 | 125 | } |
| 126 | - $champ = '$Pile[$SP' . ($i ? "-$i" : "") . '][\'' . $c . '\']'; |
|
| 126 | + $champ = '$Pile[$SP'.($i ? "-$i" : "").'][\''.$c.'\']'; |
|
| 127 | 127 | if (!$joker) { |
| 128 | 128 | return index_compose($conditionnel, $champ); |
| 129 | 129 | } |
@@ -164,7 +164,7 @@ discard block |
||
| 164 | 164 | function index_compose($conditionnel, $defaut) { |
| 165 | 165 | while ($c = array_pop($conditionnel)) { |
| 166 | 166 | // si on passe defaut = '', ne pas générer d'erreur de compilation. |
| 167 | - $defaut = "($c:(" . ($defaut ? $defaut : "''") . "))"; |
|
| 167 | + $defaut = "($c:(".($defaut ? $defaut : "''")."))"; |
|
| 168 | 168 | } |
| 169 | 169 | |
| 170 | 170 | return $defaut; |
@@ -211,7 +211,7 @@ discard block |
||
| 211 | 211 | if (!$r) { |
| 212 | 212 | $joker = false; // indiquer a l'appelant |
| 213 | 213 | # continuer pour chercher l'erreur suivante |
| 214 | - return array("'#" . $r . ':' . $nom_champ . "'", ''); |
|
| 214 | + return array("'#".$r.':'.$nom_champ."'", ''); |
|
| 215 | 215 | } |
| 216 | 216 | |
| 217 | 217 | $desc = $boucles[$idb]->show; |
@@ -311,8 +311,8 @@ discard block |
||
| 311 | 311 | $t = $index_exception_derogatoire($boucle, $desc, $nom_champ, $excep); |
| 312 | 312 | } |
| 313 | 313 | if ($t == null) { |
| 314 | - list($e, $x) = $excep; #PHP4 affecte de gauche a droite |
|
| 315 | - $excep = $x; #PHP5 de droite a gauche ! |
|
| 314 | + list($e, $x) = $excep; #PHP4 affecte de gauche a droite |
|
| 315 | + $excep = $x; #PHP5 de droite a gauche ! |
|
| 316 | 316 | $j = $trouver_table($e, $boucle->sql_serveur); |
| 317 | 317 | if (!$j) { |
| 318 | 318 | return array('', ''); |
@@ -324,7 +324,7 @@ discard block |
||
| 324 | 324 | $l = (preg_split('/\s*,\s*/', $k)); |
| 325 | 325 | $k = $desc['key']['PRIMARY KEY']; |
| 326 | 326 | if (!in_array($k, $l)) { |
| 327 | - spip_log("jointure impossible $e " . join(',', $l)); |
|
| 327 | + spip_log("jointure impossible $e ".join(',', $l)); |
|
| 328 | 328 | |
| 329 | 329 | return array('', ''); |
| 330 | 330 | } |
@@ -340,7 +340,7 @@ discard block |
||
| 340 | 340 | // demander a SQL de gerer le synonyme |
| 341 | 341 | // ca permet que excep soit dynamique (Cedric, 2/3/06) |
| 342 | 342 | if ($excep != $nom_champ) { |
| 343 | - $excep .= ' AS ' . $nom_champ; |
|
| 343 | + $excep .= ' AS '.$nom_champ; |
|
| 344 | 344 | } |
| 345 | 345 | |
| 346 | 346 | return array("$t.$excep", $nom_champ); |
@@ -573,7 +573,7 @@ discard block |
||
| 573 | 573 | join(',', $collecte), |
| 574 | 574 | ($collecte ? $param : substr($param, 1)), # virer la virgule |
| 575 | 575 | memoriser_contexte_compil($p), |
| 576 | - (!$supp ? '' : (', ' . join(',', $supp)))); |
|
| 576 | + (!$supp ? '' : (', '.join(',', $supp)))); |
|
| 577 | 577 | |
| 578 | 578 | $p->interdire_scripts = false; |
| 579 | 579 | |
@@ -668,7 +668,7 @@ discard block |
||
| 668 | 668 | $nom = $p->id_boucle; |
| 669 | 669 | |
| 670 | 670 | if ($nom and trouver_nom_serveur_distant($p)) { |
| 671 | - spip_log($nom . ':' . $p->nom_champ . ' ' . _T('zbug_distant_interdit')); |
|
| 671 | + spip_log($nom.':'.$p->nom_champ.' '._T('zbug_distant_interdit')); |
|
| 672 | 672 | |
| 673 | 673 | return false; |
| 674 | 674 | } |
@@ -737,7 +737,7 @@ discard block |
||
| 737 | 737 | (strpos($ps, 'typo') !== false) |
| 738 | 738 | ) |
| 739 | 739 | ) { |
| 740 | - $ps = 'traiter_doublons_documents($doublons, ' . $ps . ')'; |
|
| 740 | + $ps = 'traiter_doublons_documents($doublons, '.$ps.')'; |
|
| 741 | 741 | } |
| 742 | 742 | |
| 743 | 743 | // La protection des champs par |safehtml est assuree par les extensions |
@@ -855,7 +855,7 @@ discard block |
||
| 855 | 855 | function compose_filtres_args($p, $args, $sep) { |
| 856 | 856 | $arglist = ""; |
| 857 | 857 | foreach ($args as $arg) { |
| 858 | - $arglist .= $sep . |
|
| 858 | + $arglist .= $sep. |
|
| 859 | 859 | calculer_liste($arg, $p->descr, $p->boucles, $p->id_boucle); |
| 860 | 860 | } |
| 861 | 861 | |
@@ -906,7 +906,7 @@ discard block |
||
| 906 | 906 | while ($b != '') { |
| 907 | 907 | foreach ($p->boucles[$b]->criteres as $critere) { |
| 908 | 908 | if ($critere->op == $motif) { |
| 909 | - $p->code = '$Pile[$SP' . (($n == 0) ? "" : "-$n") . |
|
| 909 | + $p->code = '$Pile[$SP'.(($n == 0) ? "" : "-$n"). |
|
| 910 | 910 | "]['$champ']"; |
| 911 | 911 | $b = ''; |
| 912 | 912 | break 2; |
@@ -44,44 +44,44 @@ discard block |
||
| 44 | 44 | } |
| 45 | 45 | ob_start(); |
| 46 | 46 | if (strpos($page['texte'], '?xml') !== false) { |
| 47 | - $page['texte'] = str_replace('<' . '?xml', "<\1?xml", $page['texte']); |
|
| 47 | + $page['texte'] = str_replace('<'.'?xml', "<\1?xml", $page['texte']); |
|
| 48 | 48 | } |
| 49 | 49 | |
| 50 | 50 | try { |
| 51 | - $res = eval('?' . '>' . $page['texte']); |
|
| 51 | + $res = eval('?'.'>'.$page['texte']); |
|
| 52 | 52 | // error catching 5.2<=PHP<7 |
| 53 | 53 | if ($res === false |
| 54 | 54 | and function_exists('error_get_last') |
| 55 | - and ($erreur = error_get_last()) ) { |
|
| 55 | + and ($erreur = error_get_last())) { |
|
| 56 | 56 | $code = $page['texte']; |
| 57 | 57 | $GLOBALS['numero_ligne_php'] = 1; |
| 58 | - if (!function_exists('numerote_ligne_php')){ |
|
| 59 | - function numerote_ligne_php($match){ |
|
| 58 | + if (!function_exists('numerote_ligne_php')) { |
|
| 59 | + function numerote_ligne_php($match) { |
|
| 60 | 60 | $GLOBALS['numero_ligne_php']++; |
| 61 | - return "\n/*".str_pad($GLOBALS['numero_ligne_php'],3,"0",STR_PAD_LEFT)."*/"; |
|
| 61 | + return "\n/*".str_pad($GLOBALS['numero_ligne_php'], 3, "0", STR_PAD_LEFT)."*/"; |
|
| 62 | 62 | } |
| 63 | 63 | } |
| 64 | - $code = "/*001*/".preg_replace_callback(",\n,","numerote_ligne_php",$code); |
|
| 65 | - $code = trim(highlight_string($code,true)); |
|
| 66 | - erreur_squelette("L".$erreur['line'].": ".$erreur['message']."<br />".$code,array($page['source'],'',$erreur['file'],'',$GLOBALS['spip_lang'])); |
|
| 64 | + $code = "/*001*/".preg_replace_callback(",\n,", "numerote_ligne_php", $code); |
|
| 65 | + $code = trim(highlight_string($code, true)); |
|
| 66 | + erreur_squelette("L".$erreur['line'].": ".$erreur['message']."<br />".$code, array($page['source'], '', $erreur['file'], '', $GLOBALS['spip_lang'])); |
|
| 67 | 67 | $page['texte'] = "<!-- Erreur -->"; |
| 68 | 68 | } |
| 69 | 69 | else { |
| 70 | 70 | $page['texte'] = ob_get_contents(); |
| 71 | 71 | } |
| 72 | 72 | } |
| 73 | - catch (Exception $e){ |
|
| 73 | + catch (Exception $e) { |
|
| 74 | 74 | $code = $page['texte']; |
| 75 | 75 | $GLOBALS['numero_ligne_php'] = 1; |
| 76 | - if (!function_exists('numerote_ligne_php')){ |
|
| 77 | - function numerote_ligne_php($match){ |
|
| 76 | + if (!function_exists('numerote_ligne_php')) { |
|
| 77 | + function numerote_ligne_php($match) { |
|
| 78 | 78 | $GLOBALS['numero_ligne_php']++; |
| 79 | - return "\n/*".str_pad($GLOBALS['numero_ligne_php'],3,"0",STR_PAD_LEFT)."*/"; |
|
| 79 | + return "\n/*".str_pad($GLOBALS['numero_ligne_php'], 3, "0", STR_PAD_LEFT)."*/"; |
|
| 80 | 80 | } |
| 81 | 81 | } |
| 82 | - $code = "/*001*/".preg_replace_callback(",\n,","numerote_ligne_php",$code); |
|
| 83 | - $code = trim(highlight_string($code,true)); |
|
| 84 | - erreur_squelette("L".$e->getLine().": ".$e->getMessage()."<br />".$code,array($page['source'],'',$e->getFile(),'',$GLOBALS['spip_lang'])); |
|
| 82 | + $code = "/*001*/".preg_replace_callback(",\n,", "numerote_ligne_php", $code); |
|
| 83 | + $code = trim(highlight_string($code, true)); |
|
| 84 | + erreur_squelette("L".$e->getLine().": ".$e->getMessage()."<br />".$code, array($page['source'], '', $e->getFile(), '', $GLOBALS['spip_lang'])); |
|
| 85 | 85 | $page['texte'] = "<!-- Erreur -->"; |
| 86 | 86 | } |
| 87 | 87 | ob_end_clean(); |
@@ -89,7 +89,7 @@ discard block |
||
| 89 | 89 | $page['process_ins'] = 'html'; |
| 90 | 90 | |
| 91 | 91 | if (strpos($page['texte'], '?xml') !== false) { |
| 92 | - $page['texte'] = str_replace("<\1?xml", '<' . '?xml', $page['texte']); |
|
| 92 | + $page['texte'] = str_replace("<\1?xml", '<'.'?xml', $page['texte']); |
|
| 93 | 93 | } |
| 94 | 94 | } |
| 95 | 95 | |
@@ -53,7 +53,7 @@ discard block |
||
| 53 | 53 | $p->etoile = '*'; |
| 54 | 54 | spip_log("filtre de logo obsolete $nom", 'vieilles_defs'); |
| 55 | 55 | |
| 56 | - } elseif (preg_match("/^" . NOM_DE_CHAMP . '(.*)$/sS', $nom, $m)) { |
|
| 56 | + } elseif (preg_match("/^".NOM_DE_CHAMP.'(.*)$/sS', $nom, $m)) { |
|
| 57 | 57 | $champ = new Champ(); |
| 58 | 58 | $champ->nom_boucle = $m[2]; |
| 59 | 59 | $champ->nom_champ = $m[3]; |
@@ -131,7 +131,7 @@ discard block |
||
| 131 | 131 | $p->param[0][1] = array($c); |
| 132 | 132 | $p->param[0][0] = ''; |
| 133 | 133 | $p->fonctions = array(); |
| 134 | - spip_log('FORMULAIRE_RECHERCHE avec filtre ' . $c->texte, 'vieilles_defs'); |
|
| 134 | + spip_log('FORMULAIRE_RECHERCHE avec filtre '.$c->texte, 'vieilles_defs'); |
|
| 135 | 135 | } |
| 136 | 136 | } |
| 137 | 137 | |
@@ -77,13 +77,13 @@ discard block |
||
| 77 | 77 | |
| 78 | 78 | function chrono_requete($temps) { |
| 79 | 79 | $total = 0; |
| 80 | - $hors = "<i>" . _T('zbug_hors_compilation') . "</i>"; |
|
| 80 | + $hors = "<i>"._T('zbug_hors_compilation')."</i>"; |
|
| 81 | 81 | $t = $q = $n = $d = array(); |
| 82 | 82 | // Totaliser les temps et completer le Explain |
| 83 | 83 | foreach ($temps as $key => $v) { |
| 84 | 84 | list($dt, $nb, $boucle, $query, $explain, $res, $contexte) = $v; |
| 85 | 85 | if (is_array($contexte)) { |
| 86 | - $k = ($contexte[0] . " $boucle"); |
|
| 86 | + $k = ($contexte[0]." $boucle"); |
|
| 87 | 87 | include_spip('public/compiler'); |
| 88 | 88 | $env = reconstruire_contexte_compil($contexte); |
| 89 | 89 | } else { |
@@ -129,7 +129,7 @@ discard block |
||
| 129 | 129 | // Fabriquer les liens de navigations dans le tableau des temps |
| 130 | 130 | foreach ($temps as $k => $v) { |
| 131 | 131 | $titre = strip_tags($v[2]); |
| 132 | - $href = quote_amp($GLOBALS['REQUEST_URI']) . "#req$i"; |
|
| 132 | + $href = quote_amp($GLOBALS['REQUEST_URI'])."#req$i"; |
|
| 133 | 133 | |
| 134 | 134 | if (!isset($t[$v[2]])) { |
| 135 | 135 | $t[$v[2]] = array(); |
@@ -149,7 +149,7 @@ discard block |
||
| 149 | 149 | unset($d['']); |
| 150 | 150 | // Fabriquer le tableau des liens de navigation dans le grand tableau |
| 151 | 151 | foreach ($d as $k => $v) { |
| 152 | - $d[$k] = $n[$k] . "</td><td>$k</td><td class='time'>$v</td><td class='liste-reqs'>" |
|
| 152 | + $d[$k] = $n[$k]."</td><td>$k</td><td class='time'>$v</td><td class='liste-reqs'>" |
|
| 153 | 153 | . join('', $t[$k]); |
| 154 | 154 | } |
| 155 | 155 | |
@@ -159,7 +159,7 @@ discard block |
||
| 159 | 159 | . join("</td></tr>\n<tr><td>", $d) |
| 160 | 160 | . "</td></tr>\n" |
| 161 | 161 | . (# _request('var_mode_objet') ? '' : |
| 162 | - ("<tr><td>" . count($temps) . "</td><td>" . _T('info_total') . '</td><td class="time">' . $total . "</td><td></td></tr>")) |
|
| 162 | + ("<tr><td>".count($temps)."</td><td>"._T('info_total').'</td><td class="time">'.$total."</td><td></td></tr>")) |
|
| 163 | 163 | ); |
| 164 | 164 | |
| 165 | 165 | return array($temps, $navigation); |
@@ -147,7 +147,7 @@ discard block |
||
| 147 | 147 | if (!$fonc) { |
| 148 | 148 | $fonc = $GLOBALS['debug_objets']['principal']; |
| 149 | 149 | } |
| 150 | - $titre = !$mode ? $fonc : ($mode . (isset($GLOBALS['debug_objets']['sourcefile'][$fonc]) ? " " . $GLOBALS['debug_objets']['sourcefile'][$fonc] : "")); |
|
| 150 | + $titre = !$mode ? $fonc : ($mode.(isset($GLOBALS['debug_objets']['sourcefile'][$fonc]) ? " ".$GLOBALS['debug_objets']['sourcefile'][$fonc] : "")); |
|
| 151 | 151 | } |
| 152 | 152 | if ($message === false) { |
| 153 | 153 | lang_select(); |
@@ -176,7 +176,7 @@ discard block |
||
| 176 | 176 | $fond = isset($GLOBALS['fond']) ? $GLOBALS['fond'] : ""; |
| 177 | 177 | // une erreur critique sort $message en array |
| 178 | 178 | $debug = is_array($msg) ? $msg[1] : $msg; |
| 179 | - spip_log("Debug: " . $debug . " (" . $fond . ")"); |
|
| 179 | + spip_log("Debug: ".$debug." (".$fond.")"); |
|
| 180 | 180 | |
| 181 | 181 | return $msg; |
| 182 | 182 | } |
@@ -184,7 +184,7 @@ discard block |
||
| 184 | 184 | function debusquer_bandeau($erreurs) { |
| 185 | 185 | |
| 186 | 186 | if (!empty($erreurs)) { |
| 187 | - $n = array(count($erreurs) . ' ' . _T('zbug_erreur_squelette')); |
|
| 187 | + $n = array(count($erreurs).' '._T('zbug_erreur_squelette')); |
|
| 188 | 188 | |
| 189 | 189 | return debusquer_navigation($erreurs, $n); |
| 190 | 190 | } elseif (!empty($GLOBALS['tableau_des_temps'])) { |
@@ -217,12 +217,12 @@ discard block |
||
| 217 | 217 | if (is_array($valeur)) { |
| 218 | 218 | $valeur_simple = array(); |
| 219 | 219 | foreach ($valeur as $v) { |
| 220 | - $valeur_simple[] = is_array($v) ? 'array(size=' . count($v) . ')' : $v; |
|
| 220 | + $valeur_simple[] = is_array($v) ? 'array(size='.count($v).')' : $v; |
|
| 221 | 221 | } |
| 222 | - $valeur = '(' . count($valeur) . ' items) [' . join(',', $valeur_simple) . ']'; |
|
| 222 | + $valeur = '('.count($valeur).' items) ['.join(',', $valeur_simple).']'; |
|
| 223 | 223 | } |
| 224 | - $res .= "\n<tr><td><strong>" . nl2br(entites_html($nom)) |
|
| 225 | - . "</strong></td><td>: " . nl2br(entites_html($valeur)) |
|
| 224 | + $res .= "\n<tr><td><strong>".nl2br(entites_html($nom)) |
|
| 225 | + . "</strong></td><td>: ".nl2br(entites_html($valeur)) |
|
| 226 | 226 | . "</td></tr>\n"; |
| 227 | 227 | } |
| 228 | 228 | |
@@ -250,10 +250,10 @@ discard block |
||
| 250 | 250 | $nom_code = $lieu->descr['nom']; |
| 251 | 251 | $skel = $lieu->descr['sourcefile']; |
| 252 | 252 | $h2 = parametre_url($href, 'var_mode_objet', $nom_code); |
| 253 | - $h3 = parametre_url($h2, 'var_mode_affiche', 'squelette') . '#L' . $ligne; |
|
| 253 | + $h3 = parametre_url($h2, 'var_mode_affiche', 'squelette').'#L'.$ligne; |
|
| 254 | 254 | $skel = "<a href='$h3'><b>$skel</b></a>"; |
| 255 | 255 | if ($boucle) { |
| 256 | - $h3 = parametre_url($h2 . $boucle, 'var_mode_affiche', 'boucle'); |
|
| 256 | + $h3 = parametre_url($h2.$boucle, 'var_mode_affiche', 'boucle'); |
|
| 257 | 257 | $boucle = "<a href='$h3'><b>$boucle</b></a>"; |
| 258 | 258 | } |
| 259 | 259 | } |
@@ -340,7 +340,7 @@ discard block |
||
| 340 | 340 | } |
| 341 | 341 | |
| 342 | 342 | // Requete erronee |
| 343 | - $err = "<b>" . _T('avis_erreur_mysql') . " $errno</b><br /><tt>\n" |
|
| 343 | + $err = "<b>"._T('avis_erreur_mysql')." $errno</b><br /><tt>\n" |
|
| 344 | 344 | . spip_htmlspecialchars($msg) |
| 345 | 345 | . "\n<br /><span style='color: red'><b>" |
| 346 | 346 | . spip_htmlspecialchars($query) |
@@ -355,7 +355,7 @@ discard block |
||
| 355 | 355 | // http://code.spip.net/@trouve_boucle_debug |
| 356 | 356 | function trouve_boucle_debug($n, $nom, $debut = 0, $boucle = "") { |
| 357 | 357 | |
| 358 | - $id = $nom . $boucle; |
|
| 358 | + $id = $nom.$boucle; |
|
| 359 | 359 | if (is_array($GLOBALS['debug_objets']['sequence'][$id])) { |
| 360 | 360 | foreach ($GLOBALS['debug_objets']['sequence'][$id] as $v) { |
| 361 | 361 | |
@@ -406,7 +406,7 @@ discard block |
||
| 406 | 406 | } |
| 407 | 407 | } |
| 408 | 408 | } |
| 409 | - $incl = ',' . $reg[1] . '[.]\w$,'; |
|
| 409 | + $incl = ','.$reg[1].'[.]\w$,'; |
|
| 410 | 410 | |
| 411 | 411 | foreach ($GLOBALS['debug_objets']['sourcefile'] as $k => $v) { |
| 412 | 412 | if (preg_match($incl, $v)) { |
@@ -422,16 +422,13 @@ discard block |
||
| 422 | 422 | list($skel, $boucle, $ligne) = trouve_boucle_debug($n, $nom); |
| 423 | 423 | |
| 424 | 424 | if (!$boucle) { |
| 425 | - return !$ligne ? "" : |
|
| 426 | - (" (" . |
|
| 427 | - (($nom != $skel) ? _T('squelette_inclus_ligne') : |
|
| 428 | - _T('squelette_ligne')) . |
|
| 425 | + return !$ligne ? "" : (" (". |
|
| 426 | + (($nom != $skel) ? _T('squelette_inclus_ligne') : _T('squelette_ligne')). |
|
| 429 | 427 | " <a href='$self&var_mode_objet=$skel&var_mode_affiche=squelette&var_mode_ligne=$ligne#L$ligne'>$ligne</a>)"); |
| 430 | 428 | } else { |
| 431 | 429 | $self .= "&var_mode_objet=$skel$boucle&var_mode_affiche=boucle"; |
| 432 | 430 | |
| 433 | - return !$ligne ? " (boucle\n<a href='$self#$skel$boucle'>$boucle</a>)" : |
|
| 434 | - " (boucle $boucle ligne\n<a href='$self&var_mode_ligne=$ligne#L$ligne'>$ligne</a>)"; |
|
| 431 | + return !$ligne ? " (boucle\n<a href='$self#$skel$boucle'>$boucle</a>)" : " (boucle $boucle ligne\n<a href='$self&var_mode_ligne=$ligne#L$ligne'>$ligne</a>)"; |
|
| 435 | 432 | } |
| 436 | 433 | } |
| 437 | 434 | |
@@ -453,13 +450,13 @@ discard block |
||
| 453 | 450 | } |
| 454 | 451 | |
| 455 | 452 | $s = preg_replace(',<(\w[^<>]*)>([^<]*)<br />([^<]*)</\1>,', |
| 456 | - '<\1>\2</\1><br />' . "\n" . '<\1>\3</\1>', |
|
| 453 | + '<\1>\2</\1><br />'."\n".'<\1>\3</\1>', |
|
| 457 | 454 | $s); |
| 458 | 455 | |
| 459 | 456 | |
| 460 | 457 | $tableau = explode("<br />", $s); |
| 461 | 458 | |
| 462 | - $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"; |
|
| 459 | + $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"; |
|
| 463 | 460 | |
| 464 | 461 | $format10 = str_replace('white', 'lightgrey', $format); |
| 465 | 462 | $formaterr = "color: red;"; |
@@ -503,7 +500,7 @@ discard block |
||
| 503 | 500 | . '" style="cursor: pointer;">' |
| 504 | 501 | . ($nocpt ? '' : _T('info_numero_abbreviation')) |
| 505 | 502 | . "</div> |
| 506 | - " . $res . "</div>\n"; |
|
| 503 | + " . $res."</div>\n"; |
|
| 507 | 504 | } |
| 508 | 505 | |
| 509 | 506 | // l'environnement graphique du debuggueur |
@@ -524,14 +521,14 @@ discard block |
||
| 524 | 521 | if (!empty($GLOBALS['debug_objets'][$mode][$fonc])) { |
| 525 | 522 | list($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, array('', '')); |
| 531 | 528 | } |
| 532 | 529 | } else { |
| 533 | 530 | if (strlen(trim($res))) { |
| 534 | - return "<img src='" . chemin_image('compat-16.png') . "' 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('compat-16.png')."' 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 isset($GLOBALS['debug_objets']['resultat']['tout']) |
@@ -541,7 +538,7 @@ discard block |
||
| 541 | 538 | } |
| 542 | 539 | } else { |
| 543 | 540 | $valider = charger_fonction('valider', 'xml'); |
| 544 | - $val = $valider($GLOBALS['debug_objets']['validation'][$fonc . 'tout']); |
|
| 541 | + $val = $valider($GLOBALS['debug_objets']['validation'][$fonc.'tout']); |
|
| 545 | 542 | // Si erreur, signaler leur nombre dans le formulaire admin |
| 546 | 543 | $GLOBALS['debug_objets']['validation'] = $val->err ? count($val->err) : ''; |
| 547 | 544 | list($texte, $err) = emboite_texte($val, $fonc, $self); |
@@ -552,14 +549,14 @@ discard block |
||
| 552 | 549 | } else { |
| 553 | 550 | $err = ": $err"; |
| 554 | 551 | } |
| 555 | - $legend = _T('validation') . ' ' . $err; |
|
| 552 | + $legend = _T('validation').' '.$err; |
|
| 556 | 553 | $res = $id = ''; |
| 557 | 554 | } |
| 558 | 555 | |
| 559 | 556 | return !trim($texte) ? '' : ( |
| 560 | - "<img src='" . chemin_image('compat-16.png') . "' 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" |
|
| 557 | + "<img src='".chemin_image('compat-16.png')."' 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" |
|
| 561 | 558 | . "<div id='debug_boucle'><fieldset$id><legend>" |
| 562 | - . "<a href='" . $self . "#f_" . substr($fonc, 0, 37) . "'> ↑ " |
|
| 559 | + . "<a href='".$self."#f_".substr($fonc, 0, 37)."'> ↑ " |
|
| 563 | 560 | . ($legend ? $legend : $mode) |
| 564 | 561 | . "</a></legend>" |
| 565 | 562 | . $texte |
@@ -571,7 +568,7 @@ discard block |
||
| 571 | 568 | // http://code.spip.net/@emboite_texte |
| 572 | 569 | function emboite_texte($res, $fonc = '', $self = '') { |
| 573 | 570 | $errs = $res->err; |
| 574 | - $texte = $res->entete . ($errs ? '' : $res->page); |
|
| 571 | + $texte = $res->entete.($errs ? '' : $res->page); |
|
| 575 | 572 | |
| 576 | 573 | if (!$texte and !$errs) { |
| 577 | 574 | return array(ancre_texte('', array('', '')), false); |
@@ -628,7 +625,7 @@ discard block |
||
| 628 | 625 | $err = "<h2 style='text-align: center'>" |
| 629 | 626 | . $i |
| 630 | 627 | . "<a href='#fin_err'>" |
| 631 | - . " " . _T('erreur_texte') |
|
| 628 | + . " "._T('erreur_texte') |
|
| 632 | 629 | . "</a></h2><table id='debut_err' style='width: 100%'>" |
| 633 | 630 | . $err |
| 634 | 631 | . " </table><a id='fin_err'></a>"; |
@@ -638,9 +635,9 @@ discard block |
||
| 638 | 635 | list($msg, $fermant, $ouvrant) = $errs[0]; |
| 639 | 636 | $rf = reference_boucle_debug($fermant, $fonc, $self); |
| 640 | 637 | $ro = reference_boucle_debug($ouvrant, $fonc, $self); |
| 641 | - $err = $msg . |
|
| 642 | - "<a href='#L" . $fermant . "'>$fermant</a>$rf<br />" . |
|
| 643 | - "<a href='#L" . $ouvrant . "'>$ouvrant</a>$ro"; |
|
| 638 | + $err = $msg. |
|
| 639 | + "<a href='#L".$fermant."'>$fermant</a>$rf<br />". |
|
| 640 | + "<a href='#L".$ouvrant."'>$ouvrant</a>$ro"; |
|
| 644 | 641 | |
| 645 | 642 | return array(ancre_texte($texte, array(array($ouvrant), array($fermant))), $err); |
| 646 | 643 | } |
@@ -672,7 +669,7 @@ discard block |
||
| 672 | 669 | $temps = !isset($GLOBALS['debug_objets']['profile'][$sourcefile]) ? '' : _T('zbug_profile', |
| 673 | 670 | array('time' => $GLOBALS['debug_objets']['profile'][$sourcefile])); |
| 674 | 671 | |
| 675 | - $res .= "<fieldset id='f_" . $nom . "'><legend>" |
|
| 672 | + $res .= "<fieldset id='f_".$nom."'><legend>" |
|
| 676 | 673 | . $t_skel |
| 677 | 674 | . ' ' |
| 678 | 675 | . $sourcefile |
@@ -687,7 +684,7 @@ discard block |
||
| 687 | 684 | . "'>" |
| 688 | 685 | . _T('zbug_calcul') |
| 689 | 686 | . "</a></legend>" |
| 690 | - . (!$temps ? '' : ("\n<span style='display:block;float:" . $GLOBALS['spip_lang_right'] . "'>$temps</span><br />")) |
|
| 687 | + . (!$temps ? '' : ("\n<span style='display:block;float:".$GLOBALS['spip_lang_right']."'>$temps</span><br />")) |
|
| 691 | 688 | . debusquer_contexte($contexte[$sourcefile]) |
| 692 | 689 | . (!$nav ? '' : ("<table width='100%'>\n$nav</table>\n")) |
| 693 | 690 | . "</fieldset>\n"; |
@@ -708,33 +705,33 @@ discard block |
||
| 708 | 705 | $nom = $boucle->id_boucle; |
| 709 | 706 | $req = $boucle->type_requete; |
| 710 | 707 | $crit = public_decompiler($boucle, $gram, 0, 'criteres'); |
| 711 | - $self2 = $self . "&var_mode_objet=" . $objet; |
|
| 712 | - |
|
| 713 | - $res .= "\n<tr style='background-color: " . |
|
| 714 | - ($i % 2 ? '#e0e0f0' : '#f8f8ff') . |
|
| 715 | - "'><td align='right'>$i</td><td>\n" . |
|
| 716 | - "<a class='debug_link_boucle' href='" . |
|
| 717 | - $self2 . |
|
| 718 | - "&var_mode_affiche=boucle#f_$nom_skel'>" . |
|
| 719 | - _T('zbug_boucle') . |
|
| 720 | - "</a></td><td>\n<a class='debug_link_boucle' href='" . |
|
| 721 | - $self2 . |
|
| 722 | - "&var_mode_affiche=resultat#f_$nom_skel'>" . |
|
| 723 | - _T('zbug_resultat') . |
|
| 724 | - "</a></td><td>\n<a class='debug_link_resultat' href='" . |
|
| 725 | - $self2 . |
|
| 726 | - "&var_mode_affiche=code#f_$nom_skel'>" . |
|
| 727 | - _T('zbug_code') . |
|
| 728 | - "</a></td><td>\n<a class='debug_link_resultat' href='" . |
|
| 729 | - str_replace('var_mode=', 'var_profile=', $self2) . |
|
| 730 | - "'>" . |
|
| 731 | - _T('zbug_calcul') . |
|
| 732 | - "</a></td><td>\n" . |
|
| 733 | - (($var_mode_objet == $objet) ? "<b>$nom</b>" : $nom) . |
|
| 734 | - "</td><td>\n" . |
|
| 735 | - $req . |
|
| 736 | - "</td><td>\n" . |
|
| 737 | - spip_htmlspecialchars($crit) . |
|
| 708 | + $self2 = $self."&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 | + "&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 | + "&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 | + "&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). |
|
| 738 | 735 | "</td></tr>"; |
| 739 | 736 | } |
| 740 | 737 | } |
@@ -761,7 +758,7 @@ discard block |
||
| 761 | 758 | } |
| 762 | 759 | // permettre le copier/coller facile |
| 763 | 760 | // $res = ancre_texte($req, array(), true); |
| 764 | - $res = "<div id='T" . md5($req) . "'>\n<pre>\n" . $req . "</pre>\n</div>\n"; |
|
| 761 | + $res = "<div id='T".md5($req)."'>\n<pre>\n".$req."</pre>\n</div>\n"; |
|
| 765 | 762 | // formatage et affichage des resultats bruts de la requete |
| 766 | 763 | $ress_req = spip_query($req); |
| 767 | 764 | $brut_sql = ''; |
@@ -771,10 +768,10 @@ discard block |
||
| 771 | 768 | $max_aff = defined('_MAX_DEBUG_AFF') ? _MAX_DEBUG_AFF : 50; |
| 772 | 769 | while ($retours_sql = sql_fetch($ress_req)) { |
| 773 | 770 | if ($num <= $max_aff) { |
| 774 | - $brut_sql .= "<h3>" . ($num == 1 ? $num . " sur " . sql_count($ress_req) : $num) . "</h3>"; |
|
| 771 | + $brut_sql .= "<h3>".($num == 1 ? $num." sur ".sql_count($ress_req) : $num)."</h3>"; |
|
| 775 | 772 | $brut_sql .= "<p>"; |
| 776 | 773 | foreach ($retours_sql as $key => $val) { |
| 777 | - $brut_sql .= "<strong>" . $key . "</strong> => " . spip_htmlspecialchars(couper($val, 150)) . "<br />\n"; |
|
| 774 | + $brut_sql .= "<strong>".$key."</strong> => ".spip_htmlspecialchars(couper($val, 150))."<br />\n"; |
|
| 778 | 775 | } |
| 779 | 776 | $brut_sql .= "</p>"; |
| 780 | 777 | } |
@@ -785,15 +782,15 @@ discard block |
||
| 785 | 782 | // ne pas afficher les $contexte_inclus |
| 786 | 783 | $view = preg_replace(",<\?php.+\?[>],Uims", "", $view); |
| 787 | 784 | if ($view) { |
| 788 | - $res2 .= "\n<br /><fieldset>" . interdire_scripts($view) . "</fieldset>"; |
|
| 785 | + $res2 .= "\n<br /><fieldset>".interdire_scripts($view)."</fieldset>"; |
|
| 789 | 786 | } |
| 790 | 787 | } |
| 791 | 788 | |
| 792 | 789 | } elseif ($affiche == 'code') { |
| 793 | 790 | $legend = $nom; |
| 794 | - $res = ancre_texte("<" . "?php\n" . $quoi . "\n?" . ">"); |
|
| 791 | + $res = ancre_texte("<"."?php\n".$quoi."\n?".">"); |
|
| 795 | 792 | } elseif ($affiche == 'boucle') { |
| 796 | - $legend = _T('zbug_boucle') . ' ' . $nom; |
|
| 793 | + $legend = _T('zbug_boucle').' '.$nom; |
|
| 797 | 794 | // Le compilateur prefixe le nom des boucles par l'extension du fichier source. |
| 798 | 795 | $gram = preg_match('/^([^_]+)_/', $objet, $r) ? $r[1] : ''; |
| 799 | 796 | $res = ancre_texte(public_decompiler($quoi, $gram, 0, 'boucle')); |
@@ -812,23 +809,23 @@ discard block |
||
| 812 | 809 | include_spip('public/assembler'); // pour inclure_balise_dynamique |
| 813 | 810 | include_spip('inc/texte'); // pour corriger_typo |
| 814 | 811 | |
| 815 | - return _DOCTYPE_ECRIRE . |
|
| 816 | - html_lang_attributes() . |
|
| 817 | - "<head>\n<title>" . |
|
| 818 | - ('SPIP ' . $GLOBALS['spip_version_affichee'] . ' ' . |
|
| 819 | - _T('admin_debug') . ' ' . $titre . ' (' . |
|
| 820 | - supprimer_tags(corriger_typo($GLOBALS['meta']['nom_site']))) . |
|
| 821 | - ")</title>\n" . |
|
| 822 | - "<meta http-equiv='Content-Type' content='text/html" . |
|
| 823 | - (($c = $GLOBALS['meta']['charset']) ? "; charset=$c" : '') . |
|
| 824 | - "' />\n" . |
|
| 812 | + return _DOCTYPE_ECRIRE. |
|
| 813 | + html_lang_attributes(). |
|
| 814 | + "<head>\n<title>". |
|
| 815 | + ('SPIP '.$GLOBALS['spip_version_affichee'].' '. |
|
| 816 | + _T('admin_debug').' '.$titre.' ('. |
|
| 817 | + supprimer_tags(corriger_typo($GLOBALS['meta']['nom_site']))). |
|
| 818 | + ")</title>\n". |
|
| 819 | + "<meta http-equiv='Content-Type' content='text/html". |
|
| 820 | + (($c = $GLOBALS['meta']['charset']) ? "; charset=$c" : ''). |
|
| 821 | + "' />\n". |
|
| 825 | 822 | http_script('', 'jquery.js') |
| 826 | - . "<link rel='stylesheet' href='" . url_absolue(find_in_path('spip_admin.css')) |
|
| 827 | - . "' type='text/css' />" . |
|
| 828 | - "</head>\n" . |
|
| 829 | - "<body style='margin:0 10px;'>\n" . |
|
| 830 | - "<div id='spip-debug-header'>" . |
|
| 831 | - $corps . |
|
| 832 | - inclure_balise_dynamique(balise_FORMULAIRE_ADMIN_dyn('spip-admin-float', $GLOBALS['debug_objets']), false) . |
|
| 823 | + . "<link rel='stylesheet' href='".url_absolue(find_in_path('spip_admin.css')) |
|
| 824 | + . "' type='text/css' />". |
|
| 825 | + "</head>\n". |
|
| 826 | + "<body style='margin:0 10px;'>\n". |
|
| 827 | + "<div id='spip-debug-header'>". |
|
| 828 | + $corps. |
|
| 829 | + inclure_balise_dynamique(balise_FORMULAIRE_ADMIN_dyn('spip-admin-float', $GLOBALS['debug_objets']), false). |
|
| 833 | 830 | '</div></body></html>'; |
| 834 | 831 | } |