@@ -52,7 +52,7 @@ discard block |
||
| 52 | 52 | $apl_constant = '_Z_AJAX_PARALLEL_LOAD'; |
| 53 | 53 | $page = _SPIP_PAGE; |
| 54 | 54 | $echafauder = charger_fonction('echafauder', 'public', true); |
| 55 | - define('_ZCORE_EXCLURE_PATH', '\bprive|\bsquelettes-dist' . (defined('_DIR_PLUGIN_DIST') ? '|\b' . rtrim( |
|
| 55 | + define('_ZCORE_EXCLURE_PATH', '\bprive|\bsquelettes-dist'.(defined('_DIR_PLUGIN_DIST') ? '|\b'.rtrim( |
|
| 56 | 56 | _DIR_PLUGIN_DIST, |
| 57 | 57 | '/' |
| 58 | 58 | ) : '')); |
@@ -76,7 +76,7 @@ discard block |
||
| 76 | 76 | && in_array($dir, $z_blocs) // verifier deja qu'on est dans un bloc Z |
| 77 | 77 | && defined($apl_constant) |
| 78 | 78 | && in_array($dir, explode(',', constant($apl_constant))) // et dans un demande en APL |
| 79 | - && ($pipe = z_trouver_bloc($prefix_path . $prepend, $dir, 'z_apl', $ext)) // et qui contient le squelette APL |
|
| 79 | + && ($pipe = z_trouver_bloc($prefix_path.$prepend, $dir, 'z_apl', $ext)) // et qui contient le squelette APL |
|
| 80 | 80 | ) { |
| 81 | 81 | $flux['data'] = $pipe; |
| 82 | 82 | |
@@ -89,7 +89,7 @@ discard block |
||
| 89 | 89 | $echafauder = ''; |
| 90 | 90 | } |
| 91 | 91 | if ($prepend) { |
| 92 | - $squelette = substr(find_in_path($prefix_path . $prepend . "$fond.$ext"), 0, -strlen(".$ext")); |
|
| 92 | + $squelette = substr(find_in_path($prefix_path.$prepend."$fond.$ext"), 0, -strlen(".$ext")); |
|
| 93 | 93 | if ($squelette) { |
| 94 | 94 | $flux['data'] = $squelette; |
| 95 | 95 | } |
@@ -109,11 +109,11 @@ discard block |
||
| 109 | 109 | // se brancher sur contenu/xx si il existe |
| 110 | 110 | // ou si c'est un objet spip, associe a une table, utiliser le fond homonyme |
| 111 | 111 | if (!isset($disponible[$fond])) { |
| 112 | - $disponible[$fond] = z_contenu_disponible($prefix_path . $prepend, $z_contenu, $fond, $ext, $echafauder); |
|
| 112 | + $disponible[$fond] = z_contenu_disponible($prefix_path.$prepend, $z_contenu, $fond, $ext, $echafauder); |
|
| 113 | 113 | } |
| 114 | 114 | |
| 115 | 115 | if ($disponible[$fond]) { |
| 116 | - $flux['data'] = substr(find_in_path($prefix_path . "page.$ext"), 0, -strlen(".$ext")); |
|
| 116 | + $flux['data'] = substr(find_in_path($prefix_path."page.$ext"), 0, -strlen(".$ext")); |
|
| 117 | 117 | } |
| 118 | 118 | } |
| 119 | 119 | |
@@ -126,7 +126,7 @@ discard block |
||
| 126 | 126 | $type = $flux['args']['contexte'][$page]; |
| 127 | 127 | } |
| 128 | 128 | if (!isset($disponible[$type])) { |
| 129 | - $disponible[$type] = z_contenu_disponible($prefix_path . $prepend, $z_contenu, $type, $ext, $echafauder); |
|
| 129 | + $disponible[$type] = z_contenu_disponible($prefix_path.$prepend, $z_contenu, $type, $ext, $echafauder); |
|
| 130 | 130 | } |
| 131 | 131 | if (is_string($disponible[$type])) { |
| 132 | 132 | $flux['data'] = $disponible[$type]; |
@@ -141,7 +141,7 @@ discard block |
||
| 141 | 141 | $flux['data'] = $echafauder($type, $is[0], $is[1], $is[2], $ext); |
| 142 | 142 | } else { |
| 143 | 143 | $flux['data'] = ($disponible['404'] = z_contenu_disponible( |
| 144 | - $prefix_path . $prepend, |
|
| 144 | + $prefix_path.$prepend, |
|
| 145 | 145 | $z_contenu, |
| 146 | 146 | '404', |
| 147 | 147 | $ext, |
@@ -165,10 +165,10 @@ discard block |
||
| 165 | 165 | $type = $flux['args']['contexte'][$page]; |
| 166 | 166 | } |
| 167 | 167 | if ($type !== 'page' && !isset($disponible[$type])) { |
| 168 | - $disponible[$type] = z_contenu_disponible($prefix_path . $prepend, $z_contenu, $type, $ext, $echafauder); |
|
| 168 | + $disponible[$type] = z_contenu_disponible($prefix_path.$prepend, $z_contenu, $type, $ext, $echafauder); |
|
| 169 | 169 | } |
| 170 | 170 | if ($type == 'page' || $disponible[$type]) { |
| 171 | - $flux['data'] = z_trouver_bloc($prefix_path . $prepend, $dir, 'dist', $ext); |
|
| 171 | + $flux['data'] = z_trouver_bloc($prefix_path.$prepend, $dir, 'dist', $ext); |
|
| 172 | 172 | } |
| 173 | 173 | } |
| 174 | 174 | } |
@@ -183,8 +183,8 @@ discard block |
||
| 183 | 183 | if ( |
| 184 | 184 | isset($flux['args']['contexte']['type-page']) |
| 185 | 185 | && ( |
| 186 | - isset($flux['args']['contexte']['composition']) && file_exists(($f = $squelette . '-' . $flux['args']['contexte']['type-page'] . '-' . $flux['args']['contexte']['composition']) . ".$ext") |
|
| 187 | - || file_exists(($f = $squelette . '-' . $flux['args']['contexte']['type-page']) . ".$ext") |
|
| 186 | + isset($flux['args']['contexte']['composition']) && file_exists(($f = $squelette.'-'.$flux['args']['contexte']['type-page'].'-'.$flux['args']['contexte']['composition']).".$ext") |
|
| 187 | + || file_exists(($f = $squelette.'-'.$flux['args']['contexte']['type-page']).".$ext") |
|
| 188 | 188 | ) |
| 189 | 189 | ) { |
| 190 | 190 | $flux['data'] = $f; |
@@ -192,7 +192,7 @@ discard block |
||
| 192 | 192 | } elseif ( |
| 193 | 193 | $fond == 'structure' |
| 194 | 194 | && z_sanitize_var_zajax() |
| 195 | - && ($f = find_in_path($prefix_path . $prepend . 'ajax' . ".$ext")) |
|
| 195 | + && ($f = find_in_path($prefix_path.$prepend.'ajax'.".$ext")) |
|
| 196 | 196 | ) { |
| 197 | 197 | $flux['data'] = substr($f, 0, -strlen(".$ext")); |
| 198 | 198 | } // chercher le fond correspondant a la composition |
@@ -203,7 +203,7 @@ discard block |
||
| 203 | 203 | && ($dir = explode('/', $dir)) |
| 204 | 204 | && ($dir = reset($dir)) |
| 205 | 205 | && in_array($dir, $z_blocs) |
| 206 | - && ($f = find_in_path($prefix_path . $prepend . $fond . '-' . $flux['args']['contexte']['composition'] . ".$ext")) |
|
| 206 | + && ($f = find_in_path($prefix_path.$prepend.$fond.'-'.$flux['args']['contexte']['composition'].".$ext")) |
|
| 207 | 207 | ) { |
| 208 | 208 | $flux['data'] = substr($f, 0, -strlen(".$ext")); |
| 209 | 209 | } |
@@ -263,7 +263,7 @@ discard block |
||
| 263 | 263 | * `true` si on peut l'utiliser, `false` sinon. |
| 264 | 264 | **/ |
| 265 | 265 | function z_fond_valide($squelette) { |
| 266 | - return !_ZCORE_EXCLURE_PATH || !preg_match(',(' . _ZCORE_EXCLURE_PATH . ')/,', $squelette); |
|
| 266 | + return !_ZCORE_EXCLURE_PATH || !preg_match(',('._ZCORE_EXCLURE_PATH.')/,', $squelette); |
|
| 267 | 267 | } |
| 268 | 268 | |
| 269 | 269 | /** |
@@ -378,23 +378,23 @@ discard block |
||
| 378 | 378 | } |
| 379 | 379 | $dir = z_blocs(test_espace_prive()); |
| 380 | 380 | $dir = reset($dir); |
| 381 | - $scaffold = "<INCLURE{fond=prive/echafaudage/$dir/" . $fond . ',objet=' . $type . ',id_objet=#' . strtoupper($primary) . ',env}>'; |
|
| 381 | + $scaffold = "<INCLURE{fond=prive/echafaudage/$dir/".$fond.',objet='.$type.',id_objet=#'.strtoupper($primary).',env}>'; |
|
| 382 | 382 | } // page objets |
| 383 | 383 | elseif (($type = $desc_exec) && !str_contains($type, '/')) { |
| 384 | 384 | $dir = z_blocs(test_espace_prive()); |
| 385 | 385 | $dir = reset($dir); |
| 386 | - $scaffold = "<INCLURE{fond=prive/echafaudage/$dir/objets,objet=" . $type . ',env} />'; |
|
| 386 | + $scaffold = "<INCLURE{fond=prive/echafaudage/$dir/objets,objet=".$type.',env} />'; |
|
| 387 | 387 | } |
| 388 | 388 | // morceau d'objet : on fournit le fond de sibstitution dans $desc_exec |
| 389 | 389 | // et objet et tire de $table |
| 390 | 390 | elseif ($fond = $desc_exec) { |
| 391 | 391 | $dir = md5(dirname($fond)); |
| 392 | - $scaffold = "<INCLURE{fond=$fond,objet=" . objet_type($table) . ',env} />'; |
|
| 392 | + $scaffold = "<INCLURE{fond=$fond,objet=".objet_type($table).',env} />'; |
|
| 393 | 393 | } |
| 394 | 394 | |
| 395 | 395 | $base_dir = sous_repertoire(_DIR_CACHE, 'scaffold', false); |
| 396 | 396 | $base_dir = sous_repertoire($base_dir, $dir, false); |
| 397 | - $f = $base_dir . "$exec"; |
|
| 397 | + $f = $base_dir."$exec"; |
|
| 398 | 398 | ecrire_fichier("$f.$ext", $scaffold); |
| 399 | 399 | |
| 400 | 400 | return $f; |
@@ -26,36 +26,36 @@ discard block |
||
| 26 | 26 | |
| 27 | 27 | function format_inclure_html($file, $args, $prof) { |
| 28 | 28 | if (!str_contains($file, '#')) { |
| 29 | - $t = $file ? ('(' . $file . ')') : ''; |
|
| 29 | + $t = $file ? ('('.$file.')') : ''; |
|
| 30 | 30 | } else { |
| 31 | - $t = '{fond=' . $file . '}'; |
|
| 31 | + $t = '{fond='.$file.'}'; |
|
| 32 | 32 | } |
| 33 | - $args = $args ? '{' . implode(', ', $args) . '}' : (''); |
|
| 33 | + $args = $args ? '{'.implode(', ', $args).'}' : (''); |
|
| 34 | 34 | |
| 35 | - return ('<INCLURE' . $t . $args . '>'); |
|
| 35 | + return ('<INCLURE'.$t.$args.'>'); |
|
| 36 | 36 | } |
| 37 | 37 | |
| 38 | 38 | function format_polyglotte_html($args, $prof) { |
| 39 | 39 | $contenu = []; |
| 40 | 40 | foreach ($args as $l => $t) { |
| 41 | - $contenu[] = ($l ? "[$l]" : '') . $t; |
|
| 41 | + $contenu[] = ($l ? "[$l]" : '').$t; |
|
| 42 | 42 | } |
| 43 | 43 | |
| 44 | - return ('<multi>' . implode(' ', $contenu) . '</multi>'); |
|
| 44 | + return ('<multi>'.implode(' ', $contenu).'</multi>'); |
|
| 45 | 45 | } |
| 46 | 46 | |
| 47 | 47 | function format_idiome_html($nom, $module, $args, $filtres, $prof) { |
| 48 | 48 | foreach ($args as $k => $v) { |
| 49 | 49 | $args[$k] = "$k=$v"; |
| 50 | 50 | } |
| 51 | - $args = ($args ? '{' . implode(',', $args) . '}' : ('')); |
|
| 51 | + $args = ($args ? '{'.implode(',', $args).'}' : ('')); |
|
| 52 | 52 | |
| 53 | - return ('<:' . ($module ? "$module:" : '') . $nom . $args . $filtres . ':>'); |
|
| 53 | + return ('<:'.($module ? "$module:" : '').$nom.$args.$filtres.':>'); |
|
| 54 | 54 | } |
| 55 | 55 | |
| 56 | 56 | function format_champ_html($nom, $boucle, $etoile, $avant, $apres, $args, $filtres, $prof) { |
| 57 | 57 | $nom = '#' |
| 58 | - . ($boucle ? ($boucle . ':') : '') |
|
| 58 | + . ($boucle ? ($boucle.':') : '') |
|
| 59 | 59 | . $nom |
| 60 | 60 | . $etoile |
| 61 | 61 | . $args |
@@ -84,12 +84,12 @@ discard block |
||
| 84 | 84 | $critere[$k] = $crit_s; |
| 85 | 85 | } |
| 86 | 86 | |
| 87 | - return ($critere ? '{' . implode(',', $critere) . '}' : ('')); |
|
| 87 | + return ($critere ? '{'.implode(',', $critere).'}' : ('')); |
|
| 88 | 88 | } |
| 89 | 89 | |
| 90 | 90 | function format_liste_html($fonc, $args, $prof) { |
| 91 | 91 | return ((($fonc !== '') ? "|$fonc" : $fonc) |
| 92 | - . ($args ? '{' . implode(',', $args) . '}' : (''))); |
|
| 92 | + . ($args ? '{'.implode(',', $args).'}' : (''))); |
|
| 93 | 93 | } |
| 94 | 94 | |
| 95 | 95 | // Concatenation sans separateur: verifier qu'on ne cree pas de faux lexemes |
@@ -106,7 +106,7 @@ discard block |
||
| 106 | 106 | // si un texte se termine par ( et est suivi d'un champ |
| 107 | 107 | // ou assimiles, forcer la notation pleine |
| 108 | 108 | if ($c1 == '(' && str_starts_with($texte2, '#')) { |
| 109 | - $args[$i + 1][0] = '[(' . $texte2 . ')]'; |
|
| 109 | + $args[$i + 1][0] = '[('.$texte2.')]'; |
|
| 110 | 110 | } |
| 111 | 111 | } else { |
| 112 | 112 | if ($type == 'texte') { |
@@ -119,7 +119,7 @@ discard block |
||
| 119 | 119 | $c1 == '}' && str_starts_with(ltrim($texte2), '|') |
| 120 | 120 | || preg_match('/[\w\d_*]/', $c1) && preg_match('/^[\w\d_*{|]/', $texte2) |
| 121 | 121 | ) { |
| 122 | - $args[$i][0] = '[(' . $texte . ')]'; |
|
| 122 | + $args[$i][0] = '[('.$texte.')]'; |
|
| 123 | 123 | } |
| 124 | 124 | } |
| 125 | 125 | } |
@@ -78,7 +78,7 @@ discard block |
||
| 78 | 78 | } else { |
| 79 | 79 | // Preparer l'appel de la fonction principale du squelette |
| 80 | 80 | |
| 81 | - spip_timer($a = 'calcul page ' . random_int(0, 1000)); |
|
| 81 | + spip_timer($a = 'calcul page '.random_int(0, 1000)); |
|
| 82 | 82 | |
| 83 | 83 | // On cree un marqueur de notes unique lie a cette composition |
| 84 | 84 | // et on enregistre l'etat courant des globales de notes... |
@@ -110,8 +110,8 @@ discard block |
||
| 110 | 110 | try { |
| 111 | 111 | $page = $fonc(['cache' => $cache], [$contexte]); |
| 112 | 112 | } catch (Throwable $e) { |
| 113 | - $msg = _T('zbug_erreur_execution_page') . " $sourcefile"; |
|
| 114 | - $full_msg = $msg . ' | File ' . $e->getFile() . ' Line ' . $e->getLine() . ' : ' . $e->getMessage(); |
|
| 113 | + $msg = _T('zbug_erreur_execution_page')." $sourcefile"; |
|
| 114 | + $full_msg = $msg.' | File '.$e->getFile().' Line '.$e->getLine().' : '.$e->getMessage(); |
|
| 115 | 115 | $full_msg = str_replace(_ROOT_RACINE, '[…]/', $full_msg); |
| 116 | 116 | $corps = "<pre>$msg</pre>"; |
| 117 | 117 | $page = analyse_resultat_skel($fond, ['cache' => $cache], $corps, $sourcefile); |
@@ -142,17 +142,17 @@ discard block |
||
| 142 | 142 | |
| 143 | 143 | $profile = spip_timer($a); |
| 144 | 144 | spip_log("calcul ($profile) [$skel] $infos" |
| 145 | - . ' (' . strlen($page['texte']) . ' octets)'); |
|
| 145 | + . ' ('.strlen($page['texte']).' octets)'); |
|
| 146 | 146 | |
| 147 | 147 | if (defined('_CALCUL_PROFILER') && (int) $profile > _CALCUL_PROFILER) { |
| 148 | 148 | spip_log("calcul ($profile) [$skel] $infos" |
| 149 | - . ' (' . strlen($page['texte']) . ' octets) | ' . $_SERVER['REQUEST_URI'], 'profiler' . _LOG_AVERTISSEMENT); |
|
| 149 | + . ' ('.strlen($page['texte']).' octets) | '.$_SERVER['REQUEST_URI'], 'profiler'._LOG_AVERTISSEMENT); |
|
| 150 | 150 | } |
| 151 | 151 | |
| 152 | 152 | if ($debug) { |
| 153 | 153 | // si c'est ce que demande le debusqueur, lui passer la main |
| 154 | 154 | $t = strlen($page['texte']) ? $page['texte'] : ' '; |
| 155 | - $GLOBALS['debug_objets']['resultat'][$fonc . 'tout'] = $t; |
|
| 155 | + $GLOBALS['debug_objets']['resultat'][$fonc.'tout'] = $t; |
|
| 156 | 156 | $GLOBALS['debug_objets']['courant'] = $courant; |
| 157 | 157 | $GLOBALS['debug_objets']['profile'][$sourcefile] = $profile; |
| 158 | 158 | if ( |
@@ -183,7 +183,7 @@ discard block |
||
| 183 | 183 | if (defined('_VAR_INCLURE') && _VAR_INCLURE) { |
| 184 | 184 | $page['sourcefile'] = $sourcefile; |
| 185 | 185 | $page['texte'] = |
| 186 | - "<div class='inclure_blocs'><h6>" . $page['sourcefile'] . '</h6>' . $page['texte'] . '</div>' |
|
| 186 | + "<div class='inclure_blocs'><h6>".$page['sourcefile'].'</h6>'.$page['texte'].'</div>' |
|
| 187 | 187 | . ($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>"); |
| 188 | 188 | $js_inclus = true; |
| 189 | 189 | } |
@@ -220,14 +220,14 @@ discard block |
||
| 220 | 220 | $val = ''; |
| 221 | 221 | } elseif (is_array($val)) { |
| 222 | 222 | if ($profondeur_max > 0) { |
| 223 | - $val = 'array:' . count($val) . '(' . presenter_contexte($val, $profondeur_max - 1, 3) . ')'; |
|
| 223 | + $val = 'array:'.count($val).'('.presenter_contexte($val, $profondeur_max - 1, 3).')'; |
|
| 224 | 224 | } else { |
| 225 | - $val = 'array:' . count($val); |
|
| 225 | + $val = 'array:'.count($val); |
|
| 226 | 226 | } |
| 227 | 227 | } elseif (is_object($val)) { |
| 228 | 228 | $val = $val::class; |
| 229 | 229 | } elseif (strlen("$val") > 30) { |
| 230 | - $val = substr("$val", 0, 29) . '…'; |
|
| 230 | + $val = substr("$val", 0, 29).'…'; |
|
| 231 | 231 | if (strstr($val, ' ')) { |
| 232 | 232 | $val = "'$val'"; |
| 233 | 233 | } |
@@ -236,7 +236,7 @@ discard block |
||
| 236 | 236 | } elseif (!strlen($val)) { |
| 237 | 237 | $val = "''"; |
| 238 | 238 | } |
| 239 | - $infos[] = $var . '=' . $val; |
|
| 239 | + $infos[] = $var.'='.$val; |
|
| 240 | 240 | } |
| 241 | 241 | return implode(', ', $infos); |
| 242 | 242 | } |
@@ -304,7 +304,7 @@ discard block |
||
| 304 | 304 | . "?php include_spip('inc/headers');redirige_par_entete('" |
| 305 | 305 | . texte_script($url) |
| 306 | 306 | . "','',$status);" |
| 307 | - . '?' . '>', |
|
| 307 | + . '?'.'>', |
|
| 308 | 308 | 'process_ins' => 'php', |
| 309 | 309 | 'status' => $status |
| 310 | 310 | ]; |
@@ -146,7 +146,7 @@ discard block |
||
| 146 | 146 | if (!$fonc) { |
| 147 | 147 | $fonc = $GLOBALS['debug_objets']['principal']; |
| 148 | 148 | } |
| 149 | - $titre = $mode ? $mode . (isset($GLOBALS['debug_objets']['sourcefile'][$fonc]) ? ' ' . $GLOBALS['debug_objets']['sourcefile'][$fonc] : '') : ($fonc); |
|
| 149 | + $titre = $mode ? $mode.(isset($GLOBALS['debug_objets']['sourcefile'][$fonc]) ? ' '.$GLOBALS['debug_objets']['sourcefile'][$fonc] : '') : ($fonc); |
|
| 150 | 150 | } |
| 151 | 151 | if ($message === false) { |
| 152 | 152 | lang_select(); |
@@ -169,7 +169,7 @@ discard block |
||
| 169 | 169 | $fond = $GLOBALS['fond'] ?? ''; |
| 170 | 170 | // une erreur critique sort $message en array |
| 171 | 171 | $debug = is_array($msg) ? $msg[1] : $msg; |
| 172 | - spip_log('Debug: ' . $debug . ' (' . $fond . ')'); |
|
| 172 | + spip_log('Debug: '.$debug.' ('.$fond.')'); |
|
| 173 | 173 | |
| 174 | 174 | return $msg; |
| 175 | 175 | } |
@@ -177,7 +177,7 @@ discard block |
||
| 177 | 177 | function debusquer_bandeau($erreurs) { |
| 178 | 178 | |
| 179 | 179 | if (!empty($erreurs)) { |
| 180 | - $n = [(is_countable($erreurs) ? count($erreurs) : 0) . ' ' . _T('zbug_erreur_squelette')]; |
|
| 180 | + $n = [(is_countable($erreurs) ? count($erreurs) : 0).' '._T('zbug_erreur_squelette')]; |
|
| 181 | 181 | |
| 182 | 182 | return debusquer_navigation($erreurs, $n); |
| 183 | 183 | } elseif (!empty($GLOBALS['tableau_des_temps'])) { |
@@ -210,25 +210,25 @@ discard block |
||
| 210 | 210 | $valeur_simple = []; |
| 211 | 211 | foreach ($valeur as $v) { |
| 212 | 212 | if (is_array($v)) { |
| 213 | - $valeur_simple[] = 'array:' . count($v); |
|
| 213 | + $valeur_simple[] = 'array:'.count($v); |
|
| 214 | 214 | } elseif (is_object($v)) { |
| 215 | 215 | $valeur_simple[] = $v::class; |
| 216 | 216 | } elseif (is_string($v)) { |
| 217 | - $valeur_simple[] = "'" . $v . "'"; |
|
| 217 | + $valeur_simple[] = "'".$v."'"; |
|
| 218 | 218 | } else { |
| 219 | 219 | $valeur_simple[] = $v; |
| 220 | 220 | } |
| 221 | 221 | } |
| 222 | 222 | $n = count($valeur); |
| 223 | - $valeur = (($n > 3) ? 'array:' . $n . ' ' : ''); |
|
| 224 | - $valeur .= '[' . implode(', ', $valeur_simple) . ']'; |
|
| 223 | + $valeur = (($n > 3) ? 'array:'.$n.' ' : ''); |
|
| 224 | + $valeur .= '['.implode(', ', $valeur_simple).']'; |
|
| 225 | 225 | } elseif (is_object($valeur)) { |
| 226 | 226 | $valeur = $valeur::class; |
| 227 | 227 | } elseif (is_string($valeur)) { |
| 228 | - $valeur = "'" . $valeur . "'"; |
|
| 228 | + $valeur = "'".$valeur."'"; |
|
| 229 | 229 | } |
| 230 | - $res .= "\n<tr><td><strong>" . nl2br((string) entites_html($nom)) |
|
| 231 | - . '</strong></td><td>: ' . nl2br((string) entites_html($valeur)) |
|
| 230 | + $res .= "\n<tr><td><strong>".nl2br((string) entites_html($nom)) |
|
| 231 | + . '</strong></td><td>: '.nl2br((string) entites_html($valeur)) |
|
| 232 | 232 | . "</td></tr>\n"; |
| 233 | 233 | } |
| 234 | 234 | |
@@ -253,7 +253,7 @@ discard block |
||
| 253 | 253 | if ($ligne) { |
| 254 | 254 | $msg .= " L$ligne"; |
| 255 | 255 | } |
| 256 | - spip_log($msg, 'debusquer' . _LOG_ERREUR); |
|
| 256 | + spip_log($msg, 'debusquer'._LOG_ERREUR); |
|
| 257 | 257 | } |
| 258 | 258 | |
| 259 | 259 | |
@@ -278,10 +278,10 @@ discard block |
||
| 278 | 278 | $nom_code = $lieu->descr['nom']; |
| 279 | 279 | $skel = $lieu->descr['sourcefile']; |
| 280 | 280 | $h2 = parametre_url($href, 'var_mode_objet', $nom_code); |
| 281 | - $h3 = parametre_url($h2, 'var_mode_affiche', 'squelette') . '#L' . $ligne; |
|
| 281 | + $h3 = parametre_url($h2, 'var_mode_affiche', 'squelette').'#L'.$ligne; |
|
| 282 | 282 | $skel = "<a href='$h3'><b>$skel</b></a>"; |
| 283 | 283 | if ($boucle) { |
| 284 | - $h3 = parametre_url($h2 . $boucle, 'var_mode_affiche', 'boucle'); |
|
| 284 | + $h3 = parametre_url($h2.$boucle, 'var_mode_affiche', 'boucle'); |
|
| 285 | 285 | $boucle = "<a href='$h3'><b>$boucle</b></a>"; |
| 286 | 286 | } |
| 287 | 287 | } |
@@ -370,7 +370,7 @@ discard block |
||
| 370 | 370 | } |
| 371 | 371 | |
| 372 | 372 | // Requete erronee |
| 373 | - $err = '<b>' . _T('avis_erreur_mysql') . " $errno</b><br /><tt>\n" |
|
| 373 | + $err = '<b>'._T('avis_erreur_mysql')." $errno</b><br /><tt>\n" |
|
| 374 | 374 | . spip_htmlspecialchars($msg) |
| 375 | 375 | . "\n<br /><span style='color: red'><b>" |
| 376 | 376 | . spip_htmlspecialchars($query) |
@@ -384,7 +384,7 @@ discard block |
||
| 384 | 384 | |
| 385 | 385 | function trouve_boucle_debug($n, $nom, $debut = 0, $boucle = '') { |
| 386 | 386 | |
| 387 | - $id = $nom . $boucle; |
|
| 387 | + $id = $nom.$boucle; |
|
| 388 | 388 | if (is_array($GLOBALS['debug_objets']['sequence'][$id])) { |
| 389 | 389 | foreach ($GLOBALS['debug_objets']['sequence'][$id] as $v) { |
| 390 | 390 | if (!preg_match('/^(.*)(<\?.*\?>)(.*)$/s', $v[0], $r)) { |
@@ -432,7 +432,7 @@ discard block |
||
| 432 | 432 | ) { |
| 433 | 433 | $reg[1] = 'inconnu'; |
| 434 | 434 | } |
| 435 | - $incl = ',' . $reg[1] . '[.]\w$,'; |
|
| 435 | + $incl = ','.$reg[1].'[.]\w$,'; |
|
| 436 | 436 | |
| 437 | 437 | foreach ($GLOBALS['debug_objets']['sourcefile'] as $k => $v) { |
| 438 | 438 | if (preg_match($incl, $v)) { |
@@ -448,16 +448,14 @@ discard block |
||
| 448 | 448 | |
| 449 | 449 | if (!$boucle) { |
| 450 | 450 | return $ligne |
| 451 | - ? ' (' . |
|
| 452 | - (($nom != $skel) ? _T('squelette_inclus_ligne') : |
|
| 453 | - _T('squelette_ligne')) . |
|
| 451 | + ? ' ('. |
|
| 452 | + (($nom != $skel) ? _T('squelette_inclus_ligne') : _T('squelette_ligne')). |
|
| 454 | 453 | " <a href='$self&var_mode_objet=$skel&var_mode_affiche=squelette&var_mode_ligne=$ligne#L$ligne'>$ligne</a>)" |
| 455 | 454 | : ''; |
| 456 | 455 | } else { |
| 457 | 456 | $self .= "&var_mode_objet=$skel$boucle&var_mode_affiche=boucle"; |
| 458 | 457 | |
| 459 | - return $ligne ? " (boucle $boucle ligne\n<a href='$self&var_mode_ligne=$ligne#L$ligne'>$ligne</a>)" : |
|
| 460 | - " (boucle\n<a href='$self#$skel$boucle'>$boucle</a>)"; |
|
| 458 | + return $ligne ? " (boucle $boucle ligne\n<a href='$self&var_mode_ligne=$ligne#L$ligne'>$ligne</a>)" : " (boucle\n<a href='$self#$skel$boucle'>$boucle</a>)"; |
|
| 461 | 459 | } |
| 462 | 460 | } |
| 463 | 461 | |
@@ -479,14 +477,14 @@ discard block |
||
| 479 | 477 | |
| 480 | 478 | $s = preg_replace( |
| 481 | 479 | ',<(\w[^<>]*)>([^<]*)<br />([^<]*)</\1>,', |
| 482 | - '<\1>\2</\1><br />' . "\n" . '<\1>\3</\1>', |
|
| 480 | + '<\1>\2</\1><br />'."\n".'<\1>\3</\1>', |
|
| 483 | 481 | $s |
| 484 | 482 | ); |
| 485 | 483 | |
| 486 | 484 | |
| 487 | 485 | $tableau = explode('<br />', $s); |
| 488 | 486 | |
| 489 | - $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" . (string) @strlen(count($tableau)) . "d</a></span> %s<br />\n"; |
|
| 487 | + $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".(string) @strlen(count($tableau))."d</a></span> %s<br />\n"; |
|
| 490 | 488 | |
| 491 | 489 | $format10 = str_replace('white', 'lightgrey', $format); |
| 492 | 490 | $formaterr = 'color: red;'; |
@@ -530,7 +528,7 @@ discard block |
||
| 530 | 528 | . '" style="cursor: pointer;">' |
| 531 | 529 | . ($nocpt ? '' : _T('info_numero_abbreviation')) |
| 532 | 530 | . '</div> |
| 533 | - ' . $res . "</div>\n"; |
|
| 531 | + ' . $res."</div>\n"; |
|
| 534 | 532 | } |
| 535 | 533 | |
| 536 | 534 | // l'environnement graphique du debuggueur |
@@ -552,14 +550,14 @@ discard block |
||
| 552 | 550 | if (!empty($GLOBALS['debug_objets'][$mode][$fonc])) { |
| 553 | 551 | [$legend, $texte, $res2] = debusquer_source($fonc, $mode); |
| 554 | 552 | $texte .= $res2; |
| 555 | - } elseif (!empty($GLOBALS['debug_objets'][$mode][$fonc . 'tout'])) { |
|
| 556 | - $legend = _T('zbug_' . $mode); |
|
| 557 | - $texte = $GLOBALS['debug_objets'][$mode][$fonc . 'tout']; |
|
| 553 | + } elseif (!empty($GLOBALS['debug_objets'][$mode][$fonc.'tout'])) { |
|
| 554 | + $legend = _T('zbug_'.$mode); |
|
| 555 | + $texte = $GLOBALS['debug_objets'][$mode][$fonc.'tout']; |
|
| 558 | 556 | $texte = ancre_texte($texte, ['', '']); |
| 559 | 557 | } |
| 560 | 558 | } else { |
| 561 | 559 | if (strlen(trim($res))) { |
| 562 | - 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>"; |
|
| 560 | + 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>"; |
|
| 563 | 561 | } else { |
| 564 | 562 | // cas de l'appel sur erreur: montre la page |
| 565 | 563 | return $GLOBALS['debug_objets']['resultat']['tout'] ?? ''; |
@@ -567,7 +565,7 @@ discard block |
||
| 567 | 565 | } |
| 568 | 566 | } else { |
| 569 | 567 | $valider = charger_fonction('valider', 'xml'); |
| 570 | - $val = $valider($GLOBALS['debug_objets']['validation'][$fonc . 'tout']); |
|
| 568 | + $val = $valider($GLOBALS['debug_objets']['validation'][$fonc.'tout']); |
|
| 571 | 569 | // Si erreur, signaler leur nombre dans le formulaire admin |
| 572 | 570 | $GLOBALS['debug_objets']['validation'] = $val->err ? count($val->err) : ''; |
| 573 | 571 | [$texte, $err] = emboite_texte($val, $fonc, $self); |
@@ -578,14 +576,14 @@ discard block |
||
| 578 | 576 | } else { |
| 579 | 577 | $err = ": $err"; |
| 580 | 578 | } |
| 581 | - $legend = _T('validation') . ' ' . $err; |
|
| 579 | + $legend = _T('validation').' '.$err; |
|
| 582 | 580 | $res = $id = ''; |
| 583 | 581 | } |
| 584 | 582 | |
| 585 | 583 | return trim($texte) |
| 586 | - ? "<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" |
|
| 584 | + ? "<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" |
|
| 587 | 585 | . "<div id='debug_boucle'><fieldset$id><legend>" |
| 588 | - . "<a href='" . $self . '#f_' . substr($fonc, 0, 37) . "'> ↑ " |
|
| 586 | + . "<a href='".$self.'#f_'.substr($fonc, 0, 37)."'> ↑ " |
|
| 589 | 587 | . ($legend ?: $mode) |
| 590 | 588 | . '</a></legend>' |
| 591 | 589 | . $texte |
@@ -597,7 +595,7 @@ discard block |
||
| 597 | 595 | |
| 598 | 596 | function emboite_texte($res, $fonc = '', $self = '') { |
| 599 | 597 | $errs = $res->err; |
| 600 | - $texte = $res->entete . ($errs ? '' : $res->page); |
|
| 598 | + $texte = $res->entete.($errs ? '' : $res->page); |
|
| 601 | 599 | |
| 602 | 600 | if (!$texte && !$errs) { |
| 603 | 601 | return [ancre_texte('', ['', '']), false]; |
@@ -653,7 +651,7 @@ discard block |
||
| 653 | 651 | $err = "<h2 style='text-align: center'>" |
| 654 | 652 | . $i |
| 655 | 653 | . "<a href='#fin_err'>" |
| 656 | - . ' ' . _T('erreur_texte') |
|
| 654 | + . ' '._T('erreur_texte') |
|
| 657 | 655 | . "</a></h2><table id='debut_err' style='width: 100%'>" |
| 658 | 656 | . $err |
| 659 | 657 | . " </table><a id='fin_err'></a>"; |
@@ -663,9 +661,9 @@ discard block |
||
| 663 | 661 | [$msg, $fermant, $ouvrant] = $errs[0]; |
| 664 | 662 | $rf = reference_boucle_debug($fermant, $fonc, $self); |
| 665 | 663 | $ro = reference_boucle_debug($ouvrant, $fonc, $self); |
| 666 | - $err = $msg . |
|
| 667 | - "<a href='#L" . $fermant . "'>$fermant</a>$rf<br />" . |
|
| 668 | - "<a href='#L" . $ouvrant . "'>$ouvrant</a>$ro"; |
|
| 664 | + $err = $msg. |
|
| 665 | + "<a href='#L".$fermant."'>$fermant</a>$rf<br />". |
|
| 666 | + "<a href='#L".$ouvrant."'>$ouvrant</a>$ro"; |
|
| 669 | 667 | |
| 670 | 668 | return [ancre_texte($texte, [[$ouvrant], [$fermant]]), $err]; |
| 671 | 669 | } |
@@ -698,7 +696,7 @@ discard block |
||
| 698 | 696 | ['time' => $GLOBALS['debug_objets']['profile'][$sourcefile]] |
| 699 | 697 | ) : ''; |
| 700 | 698 | |
| 701 | - $res .= "<fieldset id='f_" . $nom . "'><legend>" |
|
| 699 | + $res .= "<fieldset id='f_".$nom."'><legend>" |
|
| 702 | 700 | . $t_skel |
| 703 | 701 | . ' ' |
| 704 | 702 | . $sourcefile |
@@ -713,7 +711,7 @@ discard block |
||
| 713 | 711 | . "'>" |
| 714 | 712 | . _T('zbug_calcul') |
| 715 | 713 | . '</a></legend>' |
| 716 | - . ($temps ? "\n<span style='display:block;float:" . $GLOBALS['spip_lang_right'] . "'>$temps</span><br />" : ('')) |
|
| 714 | + . ($temps ? "\n<span style='display:block;float:".$GLOBALS['spip_lang_right']."'>$temps</span><br />" : ('')) |
|
| 717 | 715 | . debusquer_contexte($contexte[$sourcefile]) |
| 718 | 716 | . ($nav ? "<table width='100%'>\n$nav</table>\n" : ('')) |
| 719 | 717 | . "</fieldset>\n"; |
@@ -734,33 +732,33 @@ discard block |
||
| 734 | 732 | $nom = $boucle->id_boucle; |
| 735 | 733 | $req = $boucle->type_requete; |
| 736 | 734 | $crit = public_decompiler($boucle, $gram, 0, 'criteres'); |
| 737 | - $self2 = $self . '&var_mode_objet=' . $objet; |
|
| 738 | - |
|
| 739 | - $res .= "\n<tr style='background-color: " . |
|
| 740 | - ($i % 2 ? '#e0e0f0' : '#f8f8ff') . |
|
| 741 | - "'><td align='right'>$i</td><td>\n" . |
|
| 742 | - "<a class='debug_link_boucle' href='" . |
|
| 743 | - $self2 . |
|
| 744 | - "&var_mode_affiche=boucle#f_$nom_skel'>" . |
|
| 745 | - _T('zbug_boucle') . |
|
| 746 | - "</a></td><td>\n<a class='debug_link_boucle' href='" . |
|
| 747 | - $self2 . |
|
| 748 | - "&var_mode_affiche=resultat#f_$nom_skel'>" . |
|
| 749 | - _T('zbug_resultat') . |
|
| 750 | - "</a></td><td>\n<a class='debug_link_resultat' href='" . |
|
| 751 | - $self2 . |
|
| 752 | - "&var_mode_affiche=code#f_$nom_skel'>" . |
|
| 753 | - _T('zbug_code') . |
|
| 754 | - "</a></td><td>\n<a class='debug_link_resultat' href='" . |
|
| 755 | - str_replace('var_mode=', 'var_profile=', $self2) . |
|
| 756 | - "'>" . |
|
| 757 | - _T('zbug_calcul') . |
|
| 758 | - "</a></td><td>\n" . |
|
| 759 | - (($var_mode_objet == $objet) ? "<b>$nom</b>" : $nom) . |
|
| 760 | - "</td><td>\n" . |
|
| 761 | - $req . |
|
| 762 | - "</td><td>\n" . |
|
| 763 | - spip_htmlspecialchars($crit) . |
|
| 735 | + $self2 = $self.'&var_mode_objet='.$objet; |
|
| 736 | + |
|
| 737 | + $res .= "\n<tr style='background-color: ". |
|
| 738 | + ($i % 2 ? '#e0e0f0' : '#f8f8ff'). |
|
| 739 | + "'><td align='right'>$i</td><td>\n". |
|
| 740 | + "<a class='debug_link_boucle' href='". |
|
| 741 | + $self2. |
|
| 742 | + "&var_mode_affiche=boucle#f_$nom_skel'>". |
|
| 743 | + _T('zbug_boucle'). |
|
| 744 | + "</a></td><td>\n<a class='debug_link_boucle' href='". |
|
| 745 | + $self2. |
|
| 746 | + "&var_mode_affiche=resultat#f_$nom_skel'>". |
|
| 747 | + _T('zbug_resultat'). |
|
| 748 | + "</a></td><td>\n<a class='debug_link_resultat' href='". |
|
| 749 | + $self2. |
|
| 750 | + "&var_mode_affiche=code#f_$nom_skel'>". |
|
| 751 | + _T('zbug_code'). |
|
| 752 | + "</a></td><td>\n<a class='debug_link_resultat' href='". |
|
| 753 | + str_replace('var_mode=', 'var_profile=', $self2). |
|
| 754 | + "'>". |
|
| 755 | + _T('zbug_calcul'). |
|
| 756 | + "</a></td><td>\n". |
|
| 757 | + (($var_mode_objet == $objet) ? "<b>$nom</b>" : $nom). |
|
| 758 | + "</td><td>\n". |
|
| 759 | + $req. |
|
| 760 | + "</td><td>\n". |
|
| 761 | + spip_htmlspecialchars($crit). |
|
| 764 | 762 | '</td></tr>'; |
| 765 | 763 | } |
| 766 | 764 | } |
@@ -787,7 +785,7 @@ discard block |
||
| 787 | 785 | } |
| 788 | 786 | // permettre le copier/coller facile |
| 789 | 787 | // $res = ancre_texte($req, array(), true); |
| 790 | - $res = "<div id='T" . md5($req) . "'>\n<pre>\n" . $req . "</pre>\n</div>\n"; |
|
| 788 | + $res = "<div id='T".md5($req)."'>\n<pre>\n".$req."</pre>\n</div>\n"; |
|
| 791 | 789 | // formatage et affichage des resultats bruts de la requete |
| 792 | 790 | $ress_req = spip_query($req); |
| 793 | 791 | $brut_sql = ''; |
@@ -797,10 +795,10 @@ discard block |
||
| 797 | 795 | $max_aff = defined('_MAX_DEBUG_AFF') ? _MAX_DEBUG_AFF : 50; |
| 798 | 796 | while ($retours_sql = sql_fetch($ress_req)) { |
| 799 | 797 | if ($num <= $max_aff) { |
| 800 | - $brut_sql .= '<h3>' . ($num == 1 ? $num . ' sur ' . sql_count($ress_req) : $num) . '</h3>'; |
|
| 798 | + $brut_sql .= '<h3>'.($num == 1 ? $num.' sur '.sql_count($ress_req) : $num).'</h3>'; |
|
| 801 | 799 | $brut_sql .= '<p>'; |
| 802 | 800 | foreach ($retours_sql as $key => $val) { |
| 803 | - $brut_sql .= '<strong>' . $key . '</strong> => ' . spip_htmlspecialchars(couper($val, 150)) . "<br />\n"; |
|
| 801 | + $brut_sql .= '<strong>'.$key.'</strong> => '.spip_htmlspecialchars(couper($val, 150))."<br />\n"; |
|
| 804 | 802 | } |
| 805 | 803 | $brut_sql .= '</p>'; |
| 806 | 804 | } |
@@ -811,14 +809,14 @@ discard block |
||
| 811 | 809 | // ne pas afficher les $contexte_inclus |
| 812 | 810 | $view = preg_replace(',<\?php.+\?[>],Uims', '', $view); |
| 813 | 811 | if ($view) { |
| 814 | - $res2 .= "\n<br /><fieldset>" . interdire_scripts($view) . '</fieldset>'; |
|
| 812 | + $res2 .= "\n<br /><fieldset>".interdire_scripts($view).'</fieldset>'; |
|
| 815 | 813 | } |
| 816 | 814 | } |
| 817 | 815 | } elseif ($affiche == 'code') { |
| 818 | 816 | $legend = $nom; |
| 819 | - $res = ancre_texte('<' . "?php\n" . $quoi . "\n?" . '>'); |
|
| 817 | + $res = ancre_texte('<'."?php\n".$quoi."\n?".'>'); |
|
| 820 | 818 | } elseif ($affiche == 'boucle') { |
| 821 | - $legend = _T('zbug_boucle') . ' ' . $nom; |
|
| 819 | + $legend = _T('zbug_boucle').' '.$nom; |
|
| 822 | 820 | // Le compilateur prefixe le nom des boucles par l'extension du fichier source. |
| 823 | 821 | $gram = preg_match('/^([^_]+)_/', $objet, $r) ? $r[1] : ''; |
| 824 | 822 | $res = ancre_texte(public_decompiler($quoi, $gram, 0, 'boucle')); |
@@ -836,23 +834,23 @@ discard block |
||
| 836 | 834 | include_spip('public/assembler'); // pour inclure_balise_dynamique |
| 837 | 835 | include_spip('inc/texte'); // pour corriger_typo |
| 838 | 836 | |
| 839 | - return _DOCTYPE_ECRIRE . |
|
| 840 | - html_lang_attributes() . |
|
| 841 | - "<head>\n<title>" . |
|
| 842 | - ('SPIP ' . $GLOBALS['spip_version_affichee'] . ' ' . |
|
| 843 | - _T('admin_debug') . ' ' . spip_htmlspecialchars($titre) . ' (' . |
|
| 844 | - supprimer_tags(corriger_typo($GLOBALS['meta']['nom_site']))) . |
|
| 845 | - ")</title>\n" . |
|
| 846 | - "<meta http-equiv='Content-Type' content='text/html" . |
|
| 847 | - (($c = $GLOBALS['meta']['charset']) ? "; charset=$c" : '') . |
|
| 848 | - "' />\n" . |
|
| 837 | + return _DOCTYPE_ECRIRE. |
|
| 838 | + html_lang_attributes(). |
|
| 839 | + "<head>\n<title>". |
|
| 840 | + ('SPIP '.$GLOBALS['spip_version_affichee'].' '. |
|
| 841 | + _T('admin_debug').' '.spip_htmlspecialchars($titre).' ('. |
|
| 842 | + supprimer_tags(corriger_typo($GLOBALS['meta']['nom_site']))). |
|
| 843 | + ")</title>\n". |
|
| 844 | + "<meta http-equiv='Content-Type' content='text/html". |
|
| 845 | + (($c = $GLOBALS['meta']['charset']) ? "; charset=$c" : ''). |
|
| 846 | + "' />\n". |
|
| 849 | 847 | http_script('', 'jquery.js') |
| 850 | - . "<link rel='stylesheet' href='" . url_absolue(find_in_path('spip_admin.css')) |
|
| 851 | - . "' type='text/css' />" . |
|
| 852 | - "</head>\n" . |
|
| 853 | - "<body style='margin:0 10px;'>\n" . |
|
| 854 | - "<div id='spip-debug-header'>" . |
|
| 855 | - $corps . |
|
| 856 | - inclure_balise_dynamique(balise_FORMULAIRE_ADMIN_dyn('spip-admin-float', $GLOBALS['debug_objets']), false) . |
|
| 848 | + . "<link rel='stylesheet' href='".url_absolue(find_in_path('spip_admin.css')) |
|
| 849 | + . "' type='text/css' />". |
|
| 850 | + "</head>\n". |
|
| 851 | + "<body style='margin:0 10px;'>\n". |
|
| 852 | + "<div id='spip-debug-header'>". |
|
| 853 | + $corps. |
|
| 854 | + inclure_balise_dynamique(balise_FORMULAIRE_ADMIN_dyn('spip-admin-float', $GLOBALS['debug_objets']), false). |
|
| 857 | 855 | '</div></body></html>'; |
| 858 | 856 | } |
@@ -55,7 +55,7 @@ discard block |
||
| 55 | 55 | $id_lier = sql_getfetsel( |
| 56 | 56 | 'id_trad', |
| 57 | 57 | $table_objet_sql, |
| 58 | - "$id_table_objet=" . (int) $id_trad . " AND NOT($id_table_objet=" . (int) $id_objet . ')' |
|
| 58 | + "$id_table_objet=".(int) $id_trad." AND NOT($id_table_objet=".(int) $id_objet.')' |
|
| 59 | 59 | ); |
| 60 | 60 | if ($id_lier === null) { |
| 61 | 61 | spip_log("echec lien de trad vers objet $objet/$id_objet incorrect ($id_trad)"); |
@@ -74,18 +74,18 @@ discard block |
||
| 74 | 74 | sql_updateq($table_objet_sql, ['id_trad' => $id_trad], "id_trad = $id_lier"); |
| 75 | 75 | } // sinon ajouter notre objet dans le groupe |
| 76 | 76 | else { |
| 77 | - sql_updateq($table_objet_sql, ['id_trad' => $id_lier], "$id_table_objet=" . (int) $id_objet); |
|
| 77 | + sql_updateq($table_objet_sql, ['id_trad' => $id_lier], "$id_table_objet=".(int) $id_objet); |
|
| 78 | 78 | } |
| 79 | 79 | } // on a fourni un id_trad nul : sortir id_objet du groupe de trad |
| 80 | 80 | else { |
| 81 | - $old_id_trad = sql_getfetsel('id_trad', $table_objet_sql, "$id_table_objet=" . (int) $id_objet); |
|
| 81 | + $old_id_trad = sql_getfetsel('id_trad', $table_objet_sql, "$id_table_objet=".(int) $id_objet); |
|
| 82 | 82 | // supprimer le lien de traduction |
| 83 | - sql_updateq($table_objet_sql, ['id_trad' => 0], "$id_table_objet=" . (int) $id_objet); |
|
| 83 | + sql_updateq($table_objet_sql, ['id_trad' => 0], "$id_table_objet=".(int) $id_objet); |
|
| 84 | 84 | |
| 85 | 85 | // Verifier si l'ancien groupe ne comporte plus qu'un seul objet. Alors mettre a zero. |
| 86 | - $cpt = sql_countsel($table_objet_sql, 'id_trad=' . (int) $old_id_trad); |
|
| 86 | + $cpt = sql_countsel($table_objet_sql, 'id_trad='.(int) $old_id_trad); |
|
| 87 | 87 | if ($cpt == 1) { |
| 88 | - sql_updateq($table_objet_sql, ['id_trad' => 0], 'id_trad=' . (int) $old_id_trad); |
|
| 88 | + sql_updateq($table_objet_sql, ['id_trad' => 0], 'id_trad='.(int) $old_id_trad); |
|
| 89 | 89 | } |
| 90 | 90 | } |
| 91 | 91 | |
@@ -42,7 +42,7 @@ discard block |
||
| 42 | 42 | } else { |
| 43 | 43 | # Attention GD sait lire le gif mais pas forcement l'ecrire |
| 44 | 44 | if (function_exists('ImageCreateFromGIF')) { |
| 45 | - $srcImage = @ImageCreateFromGIF(_ROOT_IMG_PACK . 'test.gif'); |
|
| 45 | + $srcImage = @ImageCreateFromGIF(_ROOT_IMG_PACK.'test.gif'); |
|
| 46 | 46 | if ($srcImage) { |
| 47 | 47 | $gd_formats_read_gif = ',gif'; |
| 48 | 48 | ImageDestroy($srcImage); |
@@ -66,28 +66,28 @@ discard block |
||
| 66 | 66 | # les formats disponibles en ecriture... (cf. inc_logos) |
| 67 | 67 | |
| 68 | 68 | if (function_exists('ImageCreateFromJPEG')) { |
| 69 | - $srcImage = @ImageCreateFromJPEG(_ROOT_IMG_PACK . 'test.jpg'); |
|
| 69 | + $srcImage = @ImageCreateFromJPEG(_ROOT_IMG_PACK.'test.jpg'); |
|
| 70 | 70 | if ($srcImage) { |
| 71 | 71 | $gd_formats[] = 'jpg'; |
| 72 | 72 | ImageDestroy($srcImage); |
| 73 | 73 | } |
| 74 | 74 | } |
| 75 | 75 | if (function_exists('ImageCreateFromGIF')) { |
| 76 | - $srcImage = @ImageCreateFromGIF(_ROOT_IMG_PACK . 'test.gif'); |
|
| 76 | + $srcImage = @ImageCreateFromGIF(_ROOT_IMG_PACK.'test.gif'); |
|
| 77 | 77 | if ($srcImage) { |
| 78 | 78 | $gd_formats[] = 'gif'; |
| 79 | 79 | ImageDestroy($srcImage); |
| 80 | 80 | } |
| 81 | 81 | } |
| 82 | 82 | if (function_exists('ImageCreateFromPNG')) { |
| 83 | - $srcImage = @ImageCreateFromPNG(_ROOT_IMG_PACK . 'test.png'); |
|
| 83 | + $srcImage = @ImageCreateFromPNG(_ROOT_IMG_PACK.'test.png'); |
|
| 84 | 84 | if ($srcImage) { |
| 85 | 85 | $gd_formats[] = 'png'; |
| 86 | 86 | ImageDestroy($srcImage); |
| 87 | 87 | } |
| 88 | 88 | } |
| 89 | 89 | if (function_exists('ImageCreateFromWEBP')) { |
| 90 | - $srcImage = @ImageCreateFromWEBP(_ROOT_IMG_PACK . 'test.webp'); |
|
| 90 | + $srcImage = @ImageCreateFromWEBP(_ROOT_IMG_PACK.'test.webp'); |
|
| 91 | 91 | if ($srcImage) { |
| 92 | 92 | $gd_formats[] = 'webp'; |
| 93 | 93 | ImageDestroy($srcImage); |
@@ -95,10 +95,10 @@ discard block |
||
| 95 | 95 | } |
| 96 | 96 | } |
| 97 | 97 | |
| 98 | - if (! empty($gd_formats)) { |
|
| 98 | + if (!empty($gd_formats)) { |
|
| 99 | 99 | $gd_formats = implode(',', $gd_formats); |
| 100 | 100 | } |
| 101 | - ecrire_meta('gd_formats_read', $gd_formats . $gd_formats_read_gif); |
|
| 101 | + ecrire_meta('gd_formats_read', $gd_formats.$gd_formats_read_gif); |
|
| 102 | 102 | ecrire_meta('gd_formats', $gd_formats); |
| 103 | 103 | } // verifier les formats netpbm |
| 104 | 104 | else { |
@@ -122,9 +122,9 @@ discard block |
||
| 122 | 122 | _PNMSCALE_COMMAND |
| 123 | 123 | ); |
| 124 | 124 | |
| 125 | - $vignette = _ROOT_IMG_PACK . 'test.jpg'; |
|
| 126 | - $dest = _DIR_VAR . 'test-jpg.jpg'; |
|
| 127 | - $commande = "$jpegtopnm_command $vignette | " . _PNMSCALE_COMMAND . " -width 10 | $pnmtojpeg_command > $dest"; |
|
| 125 | + $vignette = _ROOT_IMG_PACK.'test.jpg'; |
|
| 126 | + $dest = _DIR_VAR.'test-jpg.jpg'; |
|
| 127 | + $commande = "$jpegtopnm_command $vignette | "._PNMSCALE_COMMAND." -width 10 | $pnmtojpeg_command > $dest"; |
|
| 128 | 128 | spip_log($commande); |
| 129 | 129 | exec($commande); |
| 130 | 130 | if (($taille = @getimagesize($dest)) && $taille[1] == 10) { |
@@ -132,9 +132,9 @@ discard block |
||
| 132 | 132 | } |
| 133 | 133 | $giftopnm_command = str_replace('pnmscale', 'giftopnm', _PNMSCALE_COMMAND); |
| 134 | 134 | $pnmtojpeg_command = str_replace('pnmscale', 'pnmtojpeg', _PNMSCALE_COMMAND); |
| 135 | - $vignette = _ROOT_IMG_PACK . 'test.gif'; |
|
| 136 | - $dest = _DIR_VAR . 'test-gif.jpg'; |
|
| 137 | - $commande = "$giftopnm_command $vignette | " . _PNMSCALE_COMMAND . " -width 10 | $pnmtojpeg_command > $dest"; |
|
| 135 | + $vignette = _ROOT_IMG_PACK.'test.gif'; |
|
| 136 | + $dest = _DIR_VAR.'test-gif.jpg'; |
|
| 137 | + $commande = "$giftopnm_command $vignette | "._PNMSCALE_COMMAND." -width 10 | $pnmtojpeg_command > $dest"; |
|
| 138 | 138 | spip_log($commande); |
| 139 | 139 | exec($commande); |
| 140 | 140 | if (($taille = @getimagesize($dest)) && $taille[1] == 10) { |
@@ -142,9 +142,9 @@ discard block |
||
| 142 | 142 | } |
| 143 | 143 | |
| 144 | 144 | $pngtopnm_command = str_replace('pnmscale', 'pngtopnm', _PNMSCALE_COMMAND); |
| 145 | - $vignette = _ROOT_IMG_PACK . 'test.png'; |
|
| 146 | - $dest = _DIR_VAR . 'test-gif.jpg'; |
|
| 147 | - $commande = "$pngtopnm_command $vignette | " . _PNMSCALE_COMMAND . " -width 10 | $pnmtojpeg_command > $dest"; |
|
| 145 | + $vignette = _ROOT_IMG_PACK.'test.png'; |
|
| 146 | + $dest = _DIR_VAR.'test-gif.jpg'; |
|
| 147 | + $commande = "$pngtopnm_command $vignette | "._PNMSCALE_COMMAND." -width 10 | $pnmtojpeg_command > $dest"; |
|
| 148 | 148 | spip_log($commande); |
| 149 | 149 | exec($commande); |
| 150 | 150 | if (($taille = @getimagesize($dest)) && $taille[1] == 10) { |
@@ -160,9 +160,9 @@ discard block |
||
| 160 | 160 | include_spip('inc/filtres'); |
| 161 | 161 | include_spip('inc/filtres_images_mini'); |
| 162 | 162 | $taille_preview = 150; |
| 163 | - $image = _image_valeurs_trans(_DIR_IMG_PACK . 'test_image.jpg', "reduire-$taille_preview-$taille_preview", 'jpg'); |
|
| 163 | + $image = _image_valeurs_trans(_DIR_IMG_PACK.'test_image.jpg', "reduire-$taille_preview-$taille_preview", 'jpg'); |
|
| 164 | 164 | |
| 165 | - $image['fichier_dest'] = _DIR_VAR . "test_$arg"; |
|
| 165 | + $image['fichier_dest'] = _DIR_VAR."test_$arg"; |
|
| 166 | 166 | |
| 167 | 167 | if ( |
| 168 | 168 | ($preview = _image_creer_vignette($image, $taille_preview, $taille_preview, $arg, true)) && $preview['width'] * $preview['height'] > 0 |
@@ -75,7 +75,7 @@ discard block |
||
| 75 | 75 | $t = ($GLOBALS['taille_min'] * $GLOBALS['taille_min']); |
| 76 | 76 | if ($GLOBALS['taille_min'] !== $GLOBALS['taille_max']) { |
| 77 | 77 | $t *= 0.9; // marge de securite |
| 78 | - echo round($t / 1_000_000, 3) . ' Mpx'; |
|
| 78 | + echo round($t / 1_000_000, 3).' Mpx'; |
|
| 79 | 79 | } else { |
| 80 | 80 | // c'est un cas "on a reussi la borne max initiale, donc on a pas de limite connue" |
| 81 | 81 | $t = 0; |
@@ -111,19 +111,19 @@ discard block |
||
| 111 | 111 | $image_source = chemin_image('test.png'); |
| 112 | 112 | $GLOBALS['redirect'] = generer_url_action( |
| 113 | 113 | 'tester_taille', |
| 114 | - "i=$i&arg=" . $GLOBALS['taille_min'] . '-' . $GLOBALS['taille_test'] |
|
| 114 | + "i=$i&arg=".$GLOBALS['taille_min'].'-'.$GLOBALS['taille_test'] |
|
| 115 | 115 | ); |
| 116 | 116 | |
| 117 | 117 | ob_start('action_tester_taille_error_handler'); |
| 118 | 118 | filtrer('image_recadre', $image_source, $taille, $taille); |
| 119 | - $GLOBALS['redirect'] = generer_url_action('tester_taille', "i=$i&arg=$taille-" . $GLOBALS['taille_max']); |
|
| 119 | + $GLOBALS['redirect'] = generer_url_action('tester_taille', "i=$i&arg=$taille-".$GLOBALS['taille_max']); |
|
| 120 | 120 | |
| 121 | 121 | // si la valeur intermediaire a reussi, on teste la valeur maxi qui est peut etre sous estimee |
| 122 | 122 | // si $GLOBALS['taille_min']==0 (car on est au premier coup) |
| 123 | 123 | if ($GLOBALS['taille_min'] == 0) { |
| 124 | 124 | $taille = $GLOBALS['taille_max']; |
| 125 | 125 | filtrer('image_recadre', $image_source, $taille, $taille); |
| 126 | - $GLOBALS['redirect'] = generer_url_action('tester_taille', "i=$i&arg=$taille-" . $GLOBALS['taille_max']); |
|
| 126 | + $GLOBALS['redirect'] = generer_url_action('tester_taille', "i=$i&arg=$taille-".$GLOBALS['taille_max']); |
|
| 127 | 127 | } |
| 128 | 128 | ob_end_clean(); |
| 129 | 129 | |
@@ -19,7 +19,7 @@ discard block |
||
| 19 | 19 | return; |
| 20 | 20 | } |
| 21 | 21 | |
| 22 | -include_spip('inc/charsets'); # pour le nom de fichier |
|
| 22 | +include_spip('inc/charsets'); # pour le nom de fichier |
|
| 23 | 23 | |
| 24 | 24 | /** |
| 25 | 25 | * Effacer une rubrique |
@@ -35,19 +35,19 @@ discard block |
||
| 35 | 35 | } |
| 36 | 36 | |
| 37 | 37 | if ((int) $id_rubrique) { |
| 38 | - sql_delete('spip_rubriques', 'id_rubrique=' . (int) $id_rubrique); |
|
| 38 | + sql_delete('spip_rubriques', 'id_rubrique='.(int) $id_rubrique); |
|
| 39 | 39 | // Les admin restreints qui n'administraient que cette rubrique |
| 40 | 40 | // deviennent redacteurs |
| 41 | 41 | // (il y a sans doute moyen de faire ca avec un having) |
| 42 | 42 | |
| 43 | - $q = sql_select('id_auteur', 'spip_auteurs_liens', "objet='rubrique' AND id_objet=" . (int) $id_rubrique); |
|
| 43 | + $q = sql_select('id_auteur', 'spip_auteurs_liens', "objet='rubrique' AND id_objet=".(int) $id_rubrique); |
|
| 44 | 44 | while ($r = sql_fetch($q)) { |
| 45 | 45 | $id_auteur = $r['id_auteur']; |
| 46 | 46 | // degrader avant de supprimer la restriction d'admin |
| 47 | 47 | // section critique sur les droits |
| 48 | 48 | $n = sql_countsel( |
| 49 | 49 | 'spip_auteurs_liens', |
| 50 | - "objet='rubrique' AND id_objet!=" . (int) $id_rubrique . ' AND id_auteur=' . (int) $id_auteur |
|
| 50 | + "objet='rubrique' AND id_objet!=".(int) $id_rubrique.' AND id_auteur='.(int) $id_auteur |
|
| 51 | 51 | ); |
| 52 | 52 | if (!$n) { |
| 53 | 53 | include_spip('action/editer_auteur'); |
@@ -55,7 +55,7 @@ discard block |
||
| 55 | 55 | } |
| 56 | 56 | sql_delete( |
| 57 | 57 | 'spip_auteurs_liens', |
| 58 | - "objet='rubrique' AND id_objet=" . (int) $id_rubrique . ' AND id_auteur=' . (int) $id_auteur |
|
| 58 | + "objet='rubrique' AND id_objet=".(int) $id_rubrique.' AND id_auteur='.(int) $id_auteur |
|
| 59 | 59 | ); |
| 60 | 60 | } |
| 61 | 61 | // menu_rubriques devra recalculer |
@@ -37,7 +37,7 @@ |
||
| 37 | 37 | && $_SERVER['REQUEST_METHOD'] == 'POST' |
| 38 | 38 | ) { |
| 39 | 39 | include_spip('inc/session'); |
| 40 | - session_set('session_' . $var, $val = _request('val')); |
|
| 40 | + session_set('session_'.$var, $val = _request('val')); |
|
| 41 | 41 | #spip_log("autosave:$var:$val",'autosave'); |
| 42 | 42 | } |
| 43 | 43 | |