@@ -63,9 +63,9 @@ discard block |
||
| 63 | 63 | " class='picto_err'", |
| 64 | 64 | _T('plugin_info_erreur_xml') |
| 65 | 65 | ) |
| 66 | - . "<div class='erreur'>" . join('<br >', $info['erreur']) . '</div>'; |
|
| 66 | + . "<div class='erreur'>".join('<br >', $info['erreur']).'</div>'; |
|
| 67 | 67 | $checkable = false; |
| 68 | - } elseif (isset($GLOBALS['erreurs_activation_raw'][$dir_plugins . $plug_file])) { |
|
| 68 | + } elseif (isset($GLOBALS['erreurs_activation_raw'][$dir_plugins.$plug_file])) { |
|
| 69 | 69 | $class_li .= ' error'; |
| 70 | 70 | $erreur = http_img_pack( |
| 71 | 71 | 'plugin-err-32.png', |
@@ -73,10 +73,10 @@ discard block |
||
| 73 | 73 | " class='picto_err'", |
| 74 | 74 | _T('plugin_impossible_activer', ['plugin' => $nom]) |
| 75 | 75 | ) |
| 76 | - . "<div class='erreur'>" . implode( |
|
| 76 | + . "<div class='erreur'>".implode( |
|
| 77 | 77 | '<br />', |
| 78 | - $GLOBALS['erreurs_activation_raw'][$dir_plugins . $plug_file] |
|
| 79 | - ) . '</div>'; |
|
| 78 | + $GLOBALS['erreurs_activation_raw'][$dir_plugins.$plug_file] |
|
| 79 | + ).'</div>'; |
|
| 80 | 80 | } else { |
| 81 | 81 | $cfg = $actif ? plugin_bouton_config($plug_file, $info, $dir_plugins) : ''; |
| 82 | 82 | if (defined('_DEV_VERSION_SPIP_COMPAT') and !plugin_version_compatible($info['compatibilite'], $GLOBALS['spip_version_branche'])) { |
@@ -93,11 +93,11 @@ discard block |
||
| 93 | 93 | // numerotons les occurrences d'un meme prefix |
| 94 | 94 | $versions[$prefix] = $id = isset($versions[$prefix]) ? intval($versions[$prefix]) + 1 : ''; |
| 95 | 95 | |
| 96 | - $class_li .= ($actif ? ' actif' : '') . ($expose ? ' on' : ''); |
|
| 96 | + $class_li .= ($actif ? ' actif' : '').($expose ? ' on' : ''); |
|
| 97 | 97 | |
| 98 | 98 | return "<li id='$prefix$id' class='$class_li'>" |
| 99 | 99 | . ((!$checkable and !$checked) |
| 100 | - ? '' : plugin_checkbox(++$id_input, $dir_plugins . $plug_file, $checked)) |
|
| 100 | + ? '' : plugin_checkbox(++$id_input, $dir_plugins.$plug_file, $checked)) |
|
| 101 | 101 | . plugin_resume($info, $dir_plugins, $plug_file, $url_page) |
| 102 | 102 | . $cfg |
| 103 | 103 | . $erreur |
@@ -116,9 +116,9 @@ discard block |
||
| 116 | 116 | // si paquet.xml fournit un squelette, le prendre |
| 117 | 117 | if (isset($infos['config']) and $infos['config']) { |
| 118 | 118 | return recuperer_fond( |
| 119 | - "$dir$nom/" . $infos['config'], |
|
| 119 | + "$dir$nom/".$infos['config'], |
|
| 120 | 120 | [ |
| 121 | - 'script' => 'configurer_' . $prefix, |
|
| 121 | + 'script' => 'configurer_'.$prefix, |
|
| 122 | 122 | 'nom' => $nom |
| 123 | 123 | ] |
| 124 | 124 | ); |
@@ -137,7 +137,7 @@ discard block |
||
| 137 | 137 | return recuperer_fond( |
| 138 | 138 | 'prive/squelettes/inclure/cfg', |
| 139 | 139 | [ |
| 140 | - 'script' => 'configurer_' . $prefix, |
|
| 140 | + 'script' => 'configurer_'.$prefix, |
|
| 141 | 141 | 'nom' => $nom |
| 142 | 142 | ] |
| 143 | 143 | ); |
@@ -153,7 +153,7 @@ discard block |
||
| 153 | 153 | . "<input type='checkbox' name='s$name' id='label_$id_input'" |
| 154 | 154 | . ($actif ? " checked='checked'" : '') |
| 155 | 155 | . " class='checkbox' value='O' />" |
| 156 | - . "\n<label for='label_$id_input'>" . _T('activer_plugin') . '</label>' |
|
| 156 | + . "\n<label for='label_$id_input'>"._T('activer_plugin').'</label>' |
|
| 157 | 157 | . '</div>'; |
| 158 | 158 | } |
| 159 | 159 | |
@@ -208,11 +208,11 @@ discard block |
||
| 208 | 208 | . "<h3><a href='$url' rel='info'>" |
| 209 | 209 | . $nom |
| 210 | 210 | . '</a></h3>' |
| 211 | - . " <span class='version'>" . $info['version'] . '</span>' |
|
| 211 | + . " <span class='version'>".$info['version'].'</span>' |
|
| 212 | 212 | . " <span class='etat'> - " |
| 213 | 213 | . plugin_etat_en_clair($info['etat']) |
| 214 | 214 | . '</span>' |
| 215 | - . "<div class='short'>" . $slogan . '</div>' |
|
| 215 | + . "<div class='short'>".$slogan.'</div>' |
|
| 216 | 216 | . $i |
| 217 | 217 | . '</div>'; |
| 218 | 218 | } |
@@ -227,7 +227,7 @@ discard block |
||
| 227 | 227 | $text2 = _T('info_desinstaller_plugin'); |
| 228 | 228 | $file = basename($plug_file); |
| 229 | 229 | |
| 230 | - return "<div class='actions'>[" . |
|
| 230 | + return "<div class='actions'>[". |
|
| 231 | 231 | "<a href='$action' |
| 232 | 232 | onclick='return confirm(\"$text $nom ?\\n$text2\")'>" |
| 233 | 233 | . $text |
@@ -249,7 +249,7 @@ discard block |
||
| 249 | 249 | $etat = 'developpement'; |
| 250 | 250 | } |
| 251 | 251 | |
| 252 | - return _T('plugin_etat_' . $etat); |
|
| 252 | + return _T('plugin_etat_'.$etat); |
|
| 253 | 253 | } |
| 254 | 254 | |
| 255 | 255 | function plugin_propre($texte, $module = '', $propre = 'propre') { |
@@ -258,7 +258,7 @@ discard block |
||
| 258 | 258 | $module = substr($module, strlen(_DIR_RACINE)); |
| 259 | 259 | } |
| 260 | 260 | if (preg_match('|^\w+_[\w_]+$|', $texte)) { |
| 261 | - $texte = _T(($module ? "$module:" : '') . $texte, [], ['force' => false]); |
|
| 261 | + $texte = _T(($module ? "$module:" : '').$texte, [], ['force' => false]); |
|
| 262 | 262 | } |
| 263 | 263 | |
| 264 | 264 | return $propre($texte); |
@@ -291,9 +291,9 @@ discard block |
||
| 291 | 291 | isset($info['documentation']) |
| 292 | 292 | and $lien = $info['documentation'] |
| 293 | 293 | ) { |
| 294 | - $description .= "<p><em class='site'><a href='$lien' class='spip_out'>" . _T('en_savoir_plus') . '</a></em></p>'; |
|
| 294 | + $description .= "<p><em class='site'><a href='$lien' class='spip_out'>"._T('en_savoir_plus').'</a></em></p>'; |
|
| 295 | 295 | } |
| 296 | - $s .= "<dd class='desc'>" . $description . "</dd>\n"; |
|
| 296 | + $s .= "<dd class='desc'>".$description."</dd>\n"; |
|
| 297 | 297 | |
| 298 | 298 | if (isset($info['auteur'])) { |
| 299 | 299 | if (is_array($info['auteur'])) { |
@@ -303,19 +303,19 @@ discard block |
||
| 303 | 303 | $a = trim($info['auteur']); |
| 304 | 304 | } |
| 305 | 305 | if ($a) { |
| 306 | - $s .= "<dt class='auteurs'>" . _T('public:par_auteur') . "</dt><dd class='auteurs'>" . PtoBR(propre( |
|
| 306 | + $s .= "<dt class='auteurs'>"._T('public:par_auteur')."</dt><dd class='auteurs'>".PtoBR(propre( |
|
| 307 | 307 | $a, |
| 308 | 308 | $dir |
| 309 | - )) . "</dd>\n"; |
|
| 309 | + ))."</dd>\n"; |
|
| 310 | 310 | } |
| 311 | 311 | } |
| 312 | 312 | |
| 313 | 313 | if (isset($info['credit'])) { |
| 314 | 314 | if ($a = formater_credits($info['credit'], ', ')) { |
| 315 | - $s .= "<dt class='credits'>" . _T('plugin_info_credit') . "</dt><dd class='credits'>" . PtoBR(propre( |
|
| 315 | + $s .= "<dt class='credits'>"._T('plugin_info_credit')."</dt><dd class='credits'>".PtoBR(propre( |
|
| 316 | 316 | $a, |
| 317 | 317 | $dir |
| 318 | - )) . "</dd>\n"; |
|
| 318 | + ))."</dd>\n"; |
|
| 319 | 319 | } |
| 320 | 320 | } |
| 321 | 321 | |
@@ -327,10 +327,10 @@ discard block |
||
| 327 | 327 | $a = trim($info['licence']); |
| 328 | 328 | } |
| 329 | 329 | if ($a) { |
| 330 | - $s .= "<dt class='licence'>" . _T('intitule_licence') . "</dt><dd class='licence'>" . PtoBR(propre( |
|
| 330 | + $s .= "<dt class='licence'>"._T('intitule_licence')."</dt><dd class='licence'>".PtoBR(propre( |
|
| 331 | 331 | $a, |
| 332 | 332 | $dir |
| 333 | - )) . "</dd>\n"; |
|
| 333 | + ))."</dd>\n"; |
|
| 334 | 334 | } |
| 335 | 335 | } |
| 336 | 336 | |
@@ -341,25 +341,24 @@ discard block |
||
| 341 | 341 | // |
| 342 | 342 | $infotech = []; |
| 343 | 343 | |
| 344 | - $version = '<dt>' . _T('version') . '</dt><dd>' . $info['version']; |
|
| 344 | + $version = '<dt>'._T('version').'</dt><dd>'.$info['version']; |
|
| 345 | 345 | // Version VCS |
| 346 | - if ($vcs = version_vcs_courante($dir_plugins . $plug_file)) { |
|
| 347 | - $version .= ' ' . $vcs; |
|
| 346 | + if ($vcs = version_vcs_courante($dir_plugins.$plug_file)) { |
|
| 347 | + $version .= ' '.$vcs; |
|
| 348 | 348 | } |
| 349 | 349 | $version .= '</dd>'; |
| 350 | 350 | $infotech[] = $version; |
| 351 | - $infotech[] = '<dt>' . _T('repertoire_plugins') . '</dt><dd>' . joli_repertoire("$dir_plugins$plug_file") . '</dd>'; |
|
| 351 | + $infotech[] = '<dt>'._T('repertoire_plugins').'</dt><dd>'.joli_repertoire("$dir_plugins$plug_file").'</dd>'; |
|
| 352 | 352 | // source zip le cas echeant |
| 353 | - $infotech[] = (lire_fichier($dir_plugins . $plug_file . '/install.log', $log) |
|
| 353 | + $infotech[] = (lire_fichier($dir_plugins.$plug_file.'/install.log', $log) |
|
| 354 | 354 | and preg_match(',^source:(.*)$,m', $log, $r)) |
| 355 | - ? '<dt>' . _T('plugin_source') . '</dt><dd>' . trim($r[1]) . '</dd>' |
|
| 355 | + ? '<dt>'._T('plugin_source').'</dt><dd>'.trim($r[1]).'</dd>' |
|
| 356 | 356 | : ''; |
| 357 | 357 | |
| 358 | - $infotech[] = !$info['necessite'] ? '' : |
|
| 359 | - ('<dt>' . _T('plugin_info_necessite') . '</dt><dd>' . join( |
|
| 358 | + $infotech[] = !$info['necessite'] ? '' : ('<dt>'._T('plugin_info_necessite').'</dt><dd>'.join( |
|
| 360 | 359 | ' ', |
| 361 | 360 | array_map('array_shift', $info['necessite']) |
| 362 | - ) . '</dd>'); |
|
| 361 | + ).'</dd>'); |
|
| 363 | 362 | |
| 364 | 363 | $s .= "<dl class='tech'>" |
| 365 | 364 | . join('', $infotech) |
@@ -380,8 +379,8 @@ discard block |
||
| 380 | 379 | $texte .= |
| 381 | 380 | (!is_array($_credit)) |
| 382 | 381 | ? PtoBR(propre($_credit)) |
| 383 | - : ($_credit['url'] ? '<a href="' . $_credit['url'] . '">' : '') . |
|
| 384 | - $_credit['nom'] . |
|
| 382 | + : ($_credit['url'] ? '<a href="'.$_credit['url'].'">' : ''). |
|
| 383 | + $_credit['nom']. |
|
| 385 | 384 | ($_credit['url'] ? '</a>' : ''); |
| 386 | 385 | } |
| 387 | 386 | |
@@ -44,9 +44,9 @@ discard block |
||
| 44 | 44 | ]; |
| 45 | 45 | $style_titre_mapping = ['couleur' => 'topper', 'trait-couleur' => 'section']; |
| 46 | 46 | $c = $style_mapping[$style] ?? 'simple'; |
| 47 | - $class = $c . ($class ? " $class" : ''); |
|
| 47 | + $class = $c.($class ? " $class" : ''); |
|
| 48 | 48 | if (!$padding) { |
| 49 | - $class .= ($class ? ' ' : '') . 'no-padding'; |
|
| 49 | + $class .= ($class ? ' ' : '').'no-padding'; |
|
| 50 | 50 | } |
| 51 | 51 | |
| 52 | 52 | //($id?"id='$id' ":"") |
@@ -61,12 +61,12 @@ discard block |
||
| 61 | 61 | if ($fonction) { |
| 62 | 62 | // 2 images pour composer l'icone : le fond (article) en background, |
| 63 | 63 | // la fonction (new) en image |
| 64 | - $icone = http_img_pack($fonction, '', "class='cadre-icone' width='$size' height='$size'\n" . |
|
| 64 | + $icone = http_img_pack($fonction, '', "class='cadre-icone' width='$size' height='$size'\n". |
|
| 65 | 65 | http_style_background($fond, 'no-repeat center center', $size)); |
| 66 | 66 | } else { |
| 67 | 67 | $icone = http_img_pack($fond, '', "class='cadre-icone' width='$size' height='$size'"); |
| 68 | 68 | } |
| 69 | - $titre = $icone . $titre; |
|
| 69 | + $titre = $icone.$titre; |
|
| 70 | 70 | } |
| 71 | 71 | |
| 72 | 72 | return boite_ouvrir($titre, $class, $style_titre_mapping[$style] ?? '', $id); |
@@ -179,14 +179,14 @@ discard block |
||
| 179 | 179 | $titre, |
| 180 | 180 | $ze_logo = '' |
| 181 | 181 | ) { |
| 182 | - return "<h1 class = 'grostitre'>" . $ze_logo . ' ' . typo($titre) . "</h1>\n"; |
|
| 182 | + return "<h1 class = 'grostitre'>".$ze_logo.' '.typo($titre)."</h1>\n"; |
|
| 183 | 183 | } |
| 184 | 184 | |
| 185 | 185 | // La boite des raccourcis |
| 186 | 186 | // Se place a droite si l'ecran est en mode panoramique. |
| 187 | 187 | function bloc_des_raccourcis($bloc) { |
| 188 | 188 | return creer_colonne_droite() |
| 189 | - . boite_ouvrir(_T('titre_cadre_raccourcis'), 'raccourcis') . $bloc . boite_fermer(); |
|
| 189 | + . boite_ouvrir(_T('titre_cadre_raccourcis'), 'raccourcis').$bloc.boite_fermer(); |
|
| 190 | 190 | } |
| 191 | 191 | |
| 192 | 192 | // |
@@ -53,7 +53,7 @@ discard block |
||
| 53 | 53 | $class = ' blocreplie'; |
| 54 | 54 | } |
| 55 | 55 | |
| 56 | - return '<div ' . ($id ? "id='$id' " : '') . "class='bloc_depliable$class'>"; |
|
| 56 | + return '<div '.($id ? "id='$id' " : '')."class='bloc_depliable$class'>"; |
|
| 57 | 57 | } |
| 58 | 58 | |
| 59 | 59 | function fin_block() { |
@@ -64,12 +64,12 @@ discard block |
||
| 64 | 64 | // $deplie : true (deplie) ou false (plie) ou -1 (inactif) ou 'incertain' pour que le bouton s'auto init au chargement de la page |
| 65 | 65 | // $ids : id des div lies au bouton (facultatif, par defaut c'est le div.bloc_depliable qui suit) |
| 66 | 66 | function bouton_block_depliable($texte, $deplie, $ids = '') { |
| 67 | - $bouton_id = 'b' . substr(md5($texte . microtime()), 0, 8); |
|
| 67 | + $bouton_id = 'b'.substr(md5($texte.microtime()), 0, 8); |
|
| 68 | 68 | |
| 69 | 69 | $class = ($deplie === true) ? ' deplie' : (($deplie == -1) ? ' impliable' : ' replie'); |
| 70 | 70 | if (strlen($ids)) { |
| 71 | 71 | $cible = explode(',', $ids); |
| 72 | - $cible = '#' . implode(',#', $cible); |
|
| 72 | + $cible = '#'.implode(',#', $cible); |
|
| 73 | 73 | } else { |
| 74 | 74 | $cible = "#$bouton_id + div.bloc_depliable"; |
| 75 | 75 | } |
@@ -43,10 +43,10 @@ discard block |
||
| 43 | 43 | * @return void |
| 44 | 44 | **/ |
| 45 | 45 | function install_fichier_connexion($nom, $texte) { |
| 46 | - $texte = '<' . "?php\n" |
|
| 46 | + $texte = '<'."?php\n" |
|
| 47 | 47 | . "if (!defined(\"_ECRIRE_INC_VERSION\")) return;\n" |
| 48 | 48 | . $texte |
| 49 | - . '?' . '>'; |
|
| 49 | + . '?'.'>'; |
|
| 50 | 50 | |
| 51 | 51 | ecrire_fichier($nom, $texte); |
| 52 | 52 | } |
@@ -113,10 +113,10 @@ discard block |
||
| 113 | 113 | return $regs; |
| 114 | 114 | } else { |
| 115 | 115 | $ar = '\s*\'([^\']*)\''; |
| 116 | - $r = '\s*,' . $ar; |
|
| 116 | + $r = '\s*,'.$ar; |
|
| 117 | 117 | $r = "#spip_connect_db[(]$ar$r$r$r$r(?:$r(?:$r(?:$r(?:$r)?)?)?)?#"; |
| 118 | 118 | if (preg_match($r, $s, $regs)) { |
| 119 | - $regs[2] = $regs[1] . (!$regs[2] ? '' : ':' . $regs[2] . ';'); |
|
| 119 | + $regs[2] = $regs[1].(!$regs[2] ? '' : ':'.$regs[2].';'); |
|
| 120 | 120 | array_shift($regs); |
| 121 | 121 | array_shift($regs); |
| 122 | 122 | |
@@ -173,7 +173,7 @@ discard block |
||
| 173 | 173 | // Si on n'a pas la bonne version de PHP, c'est la fin |
| 174 | 174 | if ($err) { |
| 175 | 175 | die("<div class='error'>" |
| 176 | - . '<h3>' . _T('avis_attention') . '</h3><p>' . _T('install_echec_annonce') . "</p><ul class='spip'>" |
|
| 176 | + . '<h3>'._T('avis_attention').'</h3><p>'._T('install_echec_annonce')."</p><ul class='spip'>" |
|
| 177 | 177 | . "<li><strong>{$err[0]}</strong></li>\n</ul></div>"); |
| 178 | 178 | } |
| 179 | 179 | |
@@ -200,7 +200,7 @@ discard block |
||
| 200 | 200 | |
| 201 | 201 | if ($err) { |
| 202 | 202 | echo "<div class='error'>" |
| 203 | - . '<h3>' . _T('avis_attention') . '</h3><p>' . _T('install_echec_annonce') . "</p><ul class='spip'>"; |
|
| 203 | + . '<h3>'._T('avis_attention').'</h3><p>'._T('install_echec_annonce')."</p><ul class='spip'>"; |
|
| 204 | 204 | foreach ($err as $e) { |
| 205 | 205 | echo "<li><strong>$e</strong></li>\n"; |
| 206 | 206 | } |
@@ -233,8 +233,8 @@ discard block |
||
| 233 | 233 | |
| 234 | 234 | |
| 235 | 235 | function info_etape($titre, $complement = '') { |
| 236 | - return '<h2>' . $titre . "</h2>\n" . |
|
| 237 | - ($complement ? '' . $complement . "\n" : ''); |
|
| 236 | + return '<h2>'.$titre."</h2>\n". |
|
| 237 | + ($complement ? ''.$complement."\n" : ''); |
|
| 238 | 238 | } |
| 239 | 239 | |
| 240 | 240 | /** |
@@ -248,18 +248,18 @@ discard block |
||
| 248 | 248 | $code = _T('bouton_suivant'); |
| 249 | 249 | } |
| 250 | 250 | static $suivant = 0; |
| 251 | - $id = 'suivant' . (($suivant > 0) ? strval($suivant) : ''); |
|
| 251 | + $id = 'suivant'.(($suivant > 0) ? strval($suivant) : ''); |
|
| 252 | 252 | $suivant += 1; |
| 253 | 253 | |
| 254 | - return "\n<p class='boutons suivant'><input id='" . $id . "' type='submit'\nvalue=\"" . |
|
| 255 | - $code . |
|
| 254 | + return "\n<p class='boutons suivant'><input id='".$id."' type='submit'\nvalue=\"". |
|
| 255 | + $code. |
|
| 256 | 256 | " >>\" /></p>\n"; |
| 257 | 257 | } |
| 258 | 258 | |
| 259 | 259 | function info_progression_etape($en_cours, $phase, $dir, $erreur = false) { |
| 260 | 260 | $intitule_etat = []; |
| 261 | 261 | //$en_cours = _request('etape')?_request('etape'):""; |
| 262 | - $liste = find_all_in_path($dir, $phase . '(([0-9])+|fin)[.]php$'); |
|
| 262 | + $liste = find_all_in_path($dir, $phase.'(([0-9])+|fin)[.]php$'); |
|
| 263 | 263 | $debut = 1; |
| 264 | 264 | $etat = 'ok'; |
| 265 | 265 | $last = count($liste); |
@@ -298,7 +298,7 @@ discard block |
||
| 298 | 298 | |
| 299 | 299 | $aff_etapes .= "<li class='$class'><div class='fond'>"; |
| 300 | 300 | $aff_etapes .= ($debut == $en_cours) ? '<strong>' : ''; |
| 301 | - $aff_etapes .= '<em>' . _T('etape') . " </em><span class='numero_etape'>$debut</span><em> : </em>"; |
|
| 301 | + $aff_etapes .= '<em>'._T('etape')." </em><span class='numero_etape'>$debut</span><em> : </em>"; |
|
| 302 | 302 | $aff_etapes .= $intitule_etat["$phase"][$debut]; |
| 303 | 303 | $aff_etapes .= ($debut == $en_cours) ? '</strong>' : ''; |
| 304 | 304 | $aff_etapes .= '</div></li>'; |
@@ -313,11 +313,11 @@ discard block |
||
| 313 | 313 | |
| 314 | 314 | |
| 315 | 315 | function fieldset($legend, $champs = [], $apres = '', $avant = '') { |
| 316 | - return "<fieldset>\n" . |
|
| 317 | - $avant . |
|
| 318 | - ($legend ? '<legend>' . $legend . "</legend>\n" : '') . |
|
| 319 | - fieldset_champs($champs) . |
|
| 320 | - $apres . |
|
| 316 | + return "<fieldset>\n". |
|
| 317 | + $avant. |
|
| 318 | + ($legend ? '<legend>'.$legend."</legend>\n" : ''). |
|
| 319 | + fieldset_champs($champs). |
|
| 320 | + $apres. |
|
| 321 | 321 | "</fieldset>\n"; |
| 322 | 322 | } |
| 323 | 323 | |
@@ -327,18 +327,18 @@ discard block |
||
| 327 | 327 | $type = isset($contenu['hidden']) ? 'hidden' : (preg_match(',^pass,', $nom) ? 'password' : 'text'); |
| 328 | 328 | $class = isset($contenu['hidden']) ? '' : "class='formo' size='40' "; |
| 329 | 329 | if (isset($contenu['alternatives'])) { |
| 330 | - $fieldset .= $contenu['label'] . "\n"; |
|
| 330 | + $fieldset .= $contenu['label']."\n"; |
|
| 331 | 331 | foreach ($contenu['alternatives'] as $valeur => $label) { |
| 332 | - $fieldset .= "<input type='radio' name='" . $nom . |
|
| 332 | + $fieldset .= "<input type='radio' name='".$nom. |
|
| 333 | 333 | "' id='$nom-$valeur' value='$valeur'" |
| 334 | 334 | . (($valeur == $contenu['valeur']) ? "\nchecked='checked'" : '') |
| 335 | 335 | . "/>\n"; |
| 336 | - $fieldset .= "<label for='$nom-$valeur'>" . $label . "</label>\n"; |
|
| 336 | + $fieldset .= "<label for='$nom-$valeur'>".$label."</label>\n"; |
|
| 337 | 337 | } |
| 338 | 338 | $fieldset .= "<br />\n"; |
| 339 | 339 | } else { |
| 340 | - $fieldset .= "<label for='" . $nom . "'>" . $contenu['label'] . "</label>\n"; |
|
| 341 | - $fieldset .= '<input ' . $class . "type='" . $type . "' id='" . $nom . "' name='" . $nom . "'\nvalue='" . $contenu['valeur'] . "'" |
|
| 340 | + $fieldset .= "<label for='".$nom."'>".$contenu['label']."</label>\n"; |
|
| 341 | + $fieldset .= '<input '.$class."type='".$type."' id='".$nom."' name='".$nom."'\nvalue='".$contenu['valeur']."'" |
|
| 342 | 342 | . (preg_match(',^(pass|login),', $nom) ? " autocomplete='off'" : '') |
| 343 | 343 | . ((isset($contenu['required']) and $contenu['required']) ? " required='required'" : '') |
| 344 | 344 | . " />\n"; |
@@ -350,7 +350,7 @@ discard block |
||
| 350 | 350 | |
| 351 | 351 | function install_select_serveur() { |
| 352 | 352 | $options = []; |
| 353 | - $dir = _DIR_RESTREINT . 'req/'; |
|
| 353 | + $dir = _DIR_RESTREINT.'req/'; |
|
| 354 | 354 | $d = opendir($dir); |
| 355 | 355 | if (!$d) { |
| 356 | 356 | return []; |
@@ -358,17 +358,17 @@ discard block |
||
| 358 | 358 | while (($f = readdir($d)) !== false) { |
| 359 | 359 | if ( |
| 360 | 360 | (preg_match('/^(.*)[.]php$/', $f, $s)) |
| 361 | - and is_readable($f = $dir . $f) |
|
| 361 | + and is_readable($f = $dir.$f) |
|
| 362 | 362 | ) { |
| 363 | 363 | require_once($f); |
| 364 | 364 | $s = $s[1]; |
| 365 | - $v = 'spip_versions_' . $s; |
|
| 365 | + $v = 'spip_versions_'.$s; |
|
| 366 | 366 | if (function_exists($v) and $v()) { |
| 367 | 367 | $titre = _T("install_select_type_$s"); |
| 368 | 368 | // proposer mysql par defaut si dispo |
| 369 | 369 | $checked = ($s == 'mysql' ? " checked='checked'" : ''); |
| 370 | 370 | $options[$s] = "<li><input type='radio' id='$s' value='$s' name='server_db'$checked>" |
| 371 | - . "<label for='$s'>" . ($titre ?: $s) . '</label></li>'; |
|
| 371 | + . "<label for='$s'>".($titre ?: $s).'</label></li>'; |
|
| 372 | 372 | } else { |
| 373 | 373 | spip_log("$s: portage indisponible"); |
| 374 | 374 | } |
@@ -386,8 +386,8 @@ discard block |
||
| 386 | 386 | "\n<input type='hidden' name='etape' value='$etape' />" |
| 387 | 387 | . $hidden |
| 388 | 388 | . (_request('echec') ? |
| 389 | - ('<p><b>' . _T('avis_connexion_echec_1') . |
|
| 390 | - '</b></p><p>' . _T('avis_connexion_echec_2') . "</p><p style='font-size: small;'>" . _T('avis_connexion_echec_3') . '</p>') |
|
| 389 | + ('<p><b>'._T('avis_connexion_echec_1'). |
|
| 390 | + '</b></p><p>'._T('avis_connexion_echec_2')."</p><p style='font-size: small;'>"._T('avis_connexion_echec_3').'</p>') |
|
| 391 | 391 | : '') |
| 392 | 392 | |
| 393 | 393 | . ($jquery ? http_script('', 'jquery.js') : '') |
@@ -425,9 +425,9 @@ discard block |
||
| 425 | 425 | });') |
| 426 | 426 | |
| 427 | 427 | . ($server_db |
| 428 | - ? '<input type="hidden" name="server_db" value="' . $server_db . '" />' |
|
| 428 | + ? '<input type="hidden" name="server_db" value="'.$server_db.'" />' |
|
| 429 | 429 | . (($predef[0]) |
| 430 | - ? ('<h3>' . _T('install_serveur_hebergeur') . '</h3>') |
|
| 430 | + ? ('<h3>'._T('install_serveur_hebergeur').'</h3>') |
|
| 431 | 431 | : '') |
| 432 | 432 | : ('<fieldset><legend>' |
| 433 | 433 | . _T('install_select_type_db') |
@@ -442,9 +442,9 @@ discard block |
||
| 442 | 442 | . "\n</ul>\n</div></fieldset>") |
| 443 | 443 | ) |
| 444 | 444 | . '<div id="install_adresse_base_hebergeur">' |
| 445 | - . '<p>' . _T('texte_connexion_mysql') . '</p>' |
|
| 445 | + . '<p>'._T('texte_connexion_mysql').'</p>' |
|
| 446 | 446 | . ($predef[1] |
| 447 | - ? '<h3>' . _T('install_adresse_base_hebergeur') . '</h3>' |
|
| 447 | + ? '<h3>'._T('install_adresse_base_hebergeur').'</h3>' |
|
| 448 | 448 | : fieldset( |
| 449 | 449 | _T('entree_base_donnee_1'), |
| 450 | 450 | [ |
@@ -459,7 +459,7 @@ discard block |
||
| 459 | 459 | |
| 460 | 460 | . '<div id="install_login_base_hebergeur">' |
| 461 | 461 | . ($predef[2] |
| 462 | - ? '<h3>' . _T('install_login_base_hebergeur') . '</h3>' |
|
| 462 | + ? '<h3>'._T('install_login_base_hebergeur').'</h3>' |
|
| 463 | 463 | : fieldset( |
| 464 | 464 | _T('entree_login_connexion_1'), |
| 465 | 465 | [ |
@@ -474,7 +474,7 @@ discard block |
||
| 474 | 474 | |
| 475 | 475 | . '<div id="install_pass_base_hebergeur">' |
| 476 | 476 | . ($predef[3] |
| 477 | - ? '<h3>' . _T('install_pass_base_hebergeur') . '</h3>' |
|
| 477 | + ? '<h3>'._T('install_pass_base_hebergeur').'</h3>' |
|
| 478 | 478 | : fieldset( |
| 479 | 479 | _T('entree_mot_passe_1'), |
| 480 | 480 | [ |
@@ -496,20 +496,20 @@ discard block |
||
| 496 | 496 | function predef_ou_cache($adresse_db, $login_db, $pass_db, $server_db) { |
| 497 | 497 | return ((defined('_INSTALL_HOST_DB')) |
| 498 | 498 | ? '' |
| 499 | - : "\n<input type='hidden' name='adresse_db' value=\"" . spip_htmlspecialchars($adresse_db) . '" />' |
|
| 499 | + : "\n<input type='hidden' name='adresse_db' value=\"".spip_htmlspecialchars($adresse_db).'" />' |
|
| 500 | 500 | ) |
| 501 | 501 | . ((defined('_INSTALL_USER_DB')) |
| 502 | 502 | ? '' |
| 503 | - : "\n<input type='hidden' name='login_db' value=\"" . spip_htmlspecialchars($login_db) . '" />' |
|
| 503 | + : "\n<input type='hidden' name='login_db' value=\"".spip_htmlspecialchars($login_db).'" />' |
|
| 504 | 504 | ) |
| 505 | 505 | . ((defined('_INSTALL_PASS_DB')) |
| 506 | 506 | ? '' |
| 507 | - : "\n<input type='hidden' name='pass_db' value=\"" . spip_htmlspecialchars($pass_db) . '" />' |
|
| 507 | + : "\n<input type='hidden' name='pass_db' value=\"".spip_htmlspecialchars($pass_db).'" />' |
|
| 508 | 508 | ) |
| 509 | 509 | |
| 510 | 510 | . ((defined('_INSTALL_SERVER_DB')) |
| 511 | 511 | ? '' |
| 512 | - : "\n<input type='hidden' name='server_db' value=\"" . spip_htmlspecialchars($server_db) . '" />' |
|
| 512 | + : "\n<input type='hidden' name='server_db' value=\"".spip_htmlspecialchars($server_db).'" />' |
|
| 513 | 513 | ); |
| 514 | 514 | } |
| 515 | 515 | |
@@ -98,7 +98,7 @@ discard block |
||
| 98 | 98 | return $r ?: traiter_lien_explicite($ref, $texte, $pour, $connect, $echappe_typo); |
| 99 | 99 | } |
| 100 | 100 | |
| 101 | -define('_EXTRAIRE_LIEN', ',^\s*(?:' . _PROTOCOLES_STD . '):?/?/?\s*$,iS'); |
|
| 101 | +define('_EXTRAIRE_LIEN', ',^\s*(?:'._PROTOCOLES_STD.'):?/?/?\s*$,iS'); |
|
| 102 | 102 | |
| 103 | 103 | function traiter_lien_explicite($ref, $texte = '', $pour = 'url', string $connect = '', $echappe_typo = true) { |
| 104 | 104 | if (preg_match(_EXTRAIRE_LIEN, $ref)) { |
@@ -114,19 +114,19 @@ discard block |
||
| 114 | 114 | $lien_court = charger_fonction('lien_court', 'inc'); |
| 115 | 115 | $texte = $lien_court($texte); |
| 116 | 116 | if ($echappe_typo) { |
| 117 | - $texte = '<html>' . quote_amp($texte) . '</html>'; |
|
| 117 | + $texte = '<html>'.quote_amp($texte).'</html>'; |
|
| 118 | 118 | } |
| 119 | 119 | } |
| 120 | 120 | |
| 121 | 121 | // petites corrections d'URL |
| 122 | 122 | if (preg_match('/^www\.[^@]+$/S', $lien)) { |
| 123 | - $lien = 'http://' . $lien; |
|
| 123 | + $lien = 'http://'.$lien; |
|
| 124 | 124 | } else { |
| 125 | 125 | if (strpos($lien, '@') && email_valide($lien)) { |
| 126 | 126 | if (!$texte) { |
| 127 | 127 | $texte = $lien; |
| 128 | 128 | } |
| 129 | - $lien = 'mailto:' . $lien; |
|
| 129 | + $lien = 'mailto:'.$lien; |
|
| 130 | 130 | } |
| 131 | 131 | } |
| 132 | 132 | |
@@ -142,7 +142,7 @@ discard block |
||
| 142 | 142 | } |
| 143 | 143 | |
| 144 | 144 | function liens_implicite_glose_dist($texte, $id, $type, $args, $ancre, string $connect = '') { |
| 145 | - if (function_exists($f = 'glossaire_' . $ancre)) { |
|
| 145 | + if (function_exists($f = 'glossaire_'.$ancre)) { |
|
| 146 | 146 | $url = $f($texte, $id); |
| 147 | 147 | } else { |
| 148 | 148 | $url = glossaire_std($texte); |
@@ -156,7 +156,7 @@ discard block |
||
| 156 | 156 | if (!($match = typer_raccourci($ref))) { |
| 157 | 157 | return false; |
| 158 | 158 | } |
| 159 | - [$type, , $id, , $args, , $ancre] = array_pad($match, 7, null); |
|
| 159 | + [$type,, $id,, $args,, $ancre] = array_pad($match, 7, null); |
|
| 160 | 160 | // attention dans le cas des sites le lien doit pointer non pas sur |
| 161 | 161 | // la page locale du site, mais directement sur le site lui-meme |
| 162 | 162 | if ($f = charger_fonction("implicite_$type", 'liens', true)) { |
@@ -183,7 +183,7 @@ discard block |
||
| 183 | 183 | $r['titre'] = $texte; |
| 184 | 184 | } |
| 185 | 185 | if (!@$r['titre']) { |
| 186 | - $r['titre'] = _T($type) . " $id"; |
|
| 186 | + $r['titre'] = _T($type)." $id"; |
|
| 187 | 187 | } |
| 188 | 188 | if ($pour == 'titre') { |
| 189 | 189 | return $r['titre']; |
@@ -196,7 +196,7 @@ discard block |
||
| 196 | 196 | and $mime = sql_getfetsel( |
| 197 | 197 | 'mime_type', |
| 198 | 198 | 'spip_types_documents', |
| 199 | - 'extension IN (' . sql_get_select('extension', 'spip_documents', 'id_document=' . sql_quote($id)) . ')', |
|
| 199 | + 'extension IN ('.sql_get_select('extension', 'spip_documents', 'id_document='.sql_quote($id)).')', |
|
| 200 | 200 | '', |
| 201 | 201 | '', |
| 202 | 202 | '', |
@@ -297,11 +297,11 @@ discard block |
||
| 297 | 297 | '(<([a-z_-]{3,})' # <modele |
| 298 | 298 | . '\s*([0-9]*)\s*' # id |
| 299 | 299 | . '([|](?:<[^<>]*>|[^>])*?)?' # |arguments (y compris des tags <...>) |
| 300 | - . '\s*/?' . '>)' # fin du modele > |
|
| 300 | + . '\s*/?'.'>)' # fin du modele > |
|
| 301 | 301 | . '\s*(<\/a>)?' # eventuel </a> |
| 302 | 302 | ); |
| 303 | 303 | |
| 304 | -define('_RACCOURCI_MODELE_DEBUT', '@^' . _RACCOURCI_MODELE . '@isS'); |
|
| 304 | +define('_RACCOURCI_MODELE_DEBUT', '@^'._RACCOURCI_MODELE.'@isS'); |
|
| 305 | 305 | |
| 306 | 306 | function traiter_modeles($texte, $doublons = false, $echap = '', string $connect = '', $liens = null, $env = []) { |
| 307 | 307 | // preserver la compatibilite : true = recherche des documents |
@@ -380,7 +380,7 @@ discard block |
||
| 380 | 380 | if (test_espace_prive()) { |
| 381 | 381 | $modele = entites_html(substr($texte, $a, $cherche)); |
| 382 | 382 | if (!is_null($liens)) { |
| 383 | - $modele = '<pre>' . str_replace($liens[0], $liens[1], $modele) . '</pre>'; |
|
| 383 | + $modele = '<pre>'.str_replace($liens[0], $liens[1], $modele).'</pre>'; |
|
| 384 | 384 | } |
| 385 | 385 | } |
| 386 | 386 | } |
@@ -44,13 +44,13 @@ discard block |
||
| 44 | 44 | // celle du texte) et public (spip_lang est la langue du texte) |
| 45 | 45 | $dir = _DIR_RESTREINT ? lang_dir() : lang_dir($GLOBALS['spip_lang']); |
| 46 | 46 | |
| 47 | - $p = 'puce' . (test_espace_prive() ? '_prive' : ''); |
|
| 47 | + $p = 'puce'.(test_espace_prive() ? '_prive' : ''); |
|
| 48 | 48 | if ($dir == 'rtl') { |
| 49 | 49 | $p .= '_rtl'; |
| 50 | 50 | } |
| 51 | 51 | |
| 52 | 52 | if (!isset($GLOBALS[$p])) { |
| 53 | - $GLOBALS[$p] = '<span class="spip-puce ' . $dir . '"><b>–</b></span>'; |
|
| 53 | + $GLOBALS[$p] = '<span class="spip-puce '.$dir.'"><b>–</b></span>'; |
|
| 54 | 54 | } |
| 55 | 55 | |
| 56 | 56 | return $GLOBALS[$p]; |
@@ -68,7 +68,7 @@ discard block |
||
| 68 | 68 | } |
| 69 | 69 | |
| 70 | 70 | if (!defined('_BALISES_BLOCS_REGEXP')) { |
| 71 | - define('_BALISES_BLOCS_REGEXP', ',</?(' . _BALISES_BLOCS . ')[>[:space:]],iS'); |
|
| 71 | + define('_BALISES_BLOCS_REGEXP', ',</?('._BALISES_BLOCS.')[>[:space:]],iS'); |
|
| 72 | 72 | } |
| 73 | 73 | |
| 74 | 74 | // |
@@ -85,7 +85,7 @@ discard block |
||
| 85 | 85 | |
| 86 | 86 | // Tester si on echappe en span ou en div |
| 87 | 87 | if (is_null($mode) or !in_array($mode, ['div', 'span'])) { |
| 88 | - $mode = preg_match(',</?(' . _BALISES_BLOCS . ')[>[:space:]],iS', $rempl) ? 'div' : 'span'; |
|
| 88 | + $mode = preg_match(',</?('._BALISES_BLOCS.')[>[:space:]],iS', $rempl) ? 'div' : 'span'; |
|
| 89 | 89 | } |
| 90 | 90 | |
| 91 | 91 | // Decouper en morceaux, base64 a des probleme selon la taille de la pile |
@@ -120,7 +120,7 @@ discard block |
||
| 120 | 120 | ) { |
| 121 | 121 | foreach ($matches as $m) { |
| 122 | 122 | if ($m[1] === 'code') { |
| 123 | - $code = '<code' . $m[2] . '>' . spip_htmlspecialchars($m[3]) . '</code>'; |
|
| 123 | + $code = '<code'.$m[2].'>'.spip_htmlspecialchars($m[3]).'</code>'; |
|
| 124 | 124 | $pre = str_replace($m[0], $code, $pre); |
| 125 | 125 | } |
| 126 | 126 | } |
@@ -130,7 +130,7 @@ discard block |
||
| 130 | 130 | |
| 131 | 131 | // Echapper les <code>...</ code> |
| 132 | 132 | function traiter_echap_code_dist($regs) { |
| 133 | - [, , $att, $corps] = $regs; |
|
| 133 | + [,, $att, $corps] = $regs; |
|
| 134 | 134 | $echap = spip_htmlspecialchars($corps); // il ne faut pas passer dans entites_html, ne pas transformer les &#xxx; du code ! |
| 135 | 135 | |
| 136 | 136 | // ne pas mettre le <div...> s'il n'y a qu'une ligne |
@@ -141,9 +141,9 @@ discard block |
||
| 141 | 141 | $echap = nl2br($echap); |
| 142 | 142 | $echap = "<div style='text-align: left;' " |
| 143 | 143 | . "class='spip_code' dir='ltr'><code$att>" |
| 144 | - . $echap . '</code></div>'; |
|
| 144 | + . $echap.'</code></div>'; |
|
| 145 | 145 | } else { |
| 146 | - $echap = "<code$att class='spip_code' dir='ltr'>" . $echap . '</code>'; |
|
| 146 | + $echap = "<code$att class='spip_code' dir='ltr'>".$echap.'</code>'; |
|
| 147 | 147 | } |
| 148 | 148 | |
| 149 | 149 | $echap = str_replace("\t", ' ', $echap); |
@@ -229,8 +229,8 @@ discard block |
||
| 229 | 229 | } // sinon les traiter selon le cas |
| 230 | 230 | else { |
| 231 | 231 | if ( |
| 232 | - function_exists($f = $callback_prefix . 'traiter_echap_' . strtolower($regs[1])) |
|
| 233 | - or function_exists($f = $f . '_dist') |
|
| 232 | + function_exists($f = $callback_prefix.'traiter_echap_'.strtolower($regs[1])) |
|
| 233 | + or function_exists($f = $f.'_dist') |
|
| 234 | 234 | ) { |
| 235 | 235 | $echap = $f($regs); |
| 236 | 236 | } |
@@ -251,7 +251,7 @@ discard block |
||
| 251 | 251 | // dans une callback autonommee |
| 252 | 252 | if (strpos($preg ?: _PROTEGE_BLOCS, 'script') !== false) { |
| 253 | 253 | if ( |
| 254 | - strpos($letexte, '<' . '?') !== false and preg_match_all( |
|
| 254 | + strpos($letexte, '<'.'?') !== false and preg_match_all( |
|
| 255 | 255 | ',<[?].*($|[?]>),UisS', |
| 256 | 256 | $letexte, |
| 257 | 257 | $matches, |
@@ -283,7 +283,7 @@ discard block |
||
| 283 | 283 | strpos($letexte, '<') !== false |
| 284 | 284 | and |
| 285 | 285 | preg_match_all( |
| 286 | - ',<(span|div)\sclass=[\'"]base64' . $source . '[\'"]\s(.*)>\s*</\1>,UmsS', |
|
| 286 | + ',<(span|div)\sclass=[\'"]base64'.$source.'[\'"]\s(.*)>\s*</\1>,UmsS', |
|
| 287 | 287 | $letexte, |
| 288 | 288 | $regs, |
| 289 | 289 | PREG_SET_ORDER |
@@ -300,7 +300,7 @@ discard block |
||
| 300 | 300 | } |
| 301 | 301 | } |
| 302 | 302 | if ($at) { |
| 303 | - $rempl = '<' . $reg[1] . '>' . $rempl . '</' . $reg[1] . '>'; |
|
| 303 | + $rempl = '<'.$reg[1].'>'.$rempl.'</'.$reg[1].'>'; |
|
| 304 | 304 | foreach ($at as $attr => $a) { |
| 305 | 305 | $rempl = inserer_attribut($rempl, $attr, $a); |
| 306 | 306 | } |
@@ -381,8 +381,8 @@ discard block |
||
| 381 | 381 | $texte = nettoyer_raccourcis_typo($texte); |
| 382 | 382 | |
| 383 | 383 | // balises de sauts de ligne et paragraphe |
| 384 | - $texte = preg_replace('/<p( [^>]*)?' . '>/', "\r", $texte); |
|
| 385 | - $texte = preg_replace('/<br( [^>]*)?' . '>/', "\n", $texte); |
|
| 384 | + $texte = preg_replace('/<p( [^>]*)?'.'>/', "\r", $texte); |
|
| 385 | + $texte = preg_replace('/<br( [^>]*)?'.'>/', "\n", $texte); |
|
| 386 | 386 | |
| 387 | 387 | // on repasse les doubles \n en \r que nettoyer_raccourcis_typo() a pu modifier |
| 388 | 388 | $texte = str_replace("\n\n", "\r", $texte); |
@@ -390,7 +390,7 @@ discard block |
||
| 390 | 390 | // supprimer les tags |
| 391 | 391 | $texte = supprimer_tags($texte); |
| 392 | 392 | $texte = trim(str_replace("\n", ' ', $texte)); |
| 393 | - $texte .= "\n"; // marquer la fin |
|
| 393 | + $texte .= "\n"; // marquer la fin |
|
| 394 | 394 | |
| 395 | 395 | // corriger la longueur de coupe |
| 396 | 396 | // en fonction de la presence de caracteres utf |
@@ -405,7 +405,7 @@ discard block |
||
| 405 | 405 | // couper au mot precedent |
| 406 | 406 | $long = spip_substr($texte, 0, max($taille - 4, 1)); |
| 407 | 407 | $u = $GLOBALS['meta']['pcre_u']; |
| 408 | - $court = preg_replace("/([^\s][\s]+)[^\s]*\n?$/" . $u, "\\1", $long); |
|
| 408 | + $court = preg_replace("/([^\s][\s]+)[^\s]*\n?$/".$u, "\\1", $long); |
|
| 409 | 409 | if (is_null($suite)) { |
| 410 | 410 | $suite = (defined('_COUPER_SUITE') ? _COUPER_SUITE : ' (...)'); |
| 411 | 411 | } |
@@ -415,7 +415,7 @@ discard block |
||
| 415 | 415 | if (spip_strlen($court) < max(0.75 * $taille, 2)) { |
| 416 | 416 | $points = ''; |
| 417 | 417 | $long = spip_substr($texte, 0, $taille); |
| 418 | - $texte = preg_replace("/([^\s][\s]+)[^\s]*\n?$/" . $u, "\\1", $long); |
|
| 418 | + $texte = preg_replace("/([^\s][\s]+)[^\s]*\n?$/".$u, "\\1", $long); |
|
| 419 | 419 | // encore trop court ? couper au caractere |
| 420 | 420 | if (spip_strlen($texte) < 0.75 * $taille) { |
| 421 | 421 | $texte = $long; |
@@ -434,7 +434,7 @@ discard block |
||
| 434 | 434 | // supprimer l'eventuelle entite finale mal coupee |
| 435 | 435 | $texte = preg_replace('/&#?[a-z0-9]*$/S', '', $texte); |
| 436 | 436 | |
| 437 | - return quote_amp(trim($texte)) . $points; |
|
| 437 | + return quote_amp(trim($texte)).$points; |
|
| 438 | 438 | } |
| 439 | 439 | |
| 440 | 440 | |
@@ -446,16 +446,16 @@ discard block |
||
| 446 | 446 | define('_PROTEGE_JS_MODELES', creer_uniqid()); |
| 447 | 447 | } |
| 448 | 448 | foreach ($r as $regs) { |
| 449 | - $t = str_replace($regs[0], code_echappement($regs[0], 'javascript' . _PROTEGE_JS_MODELES), $t); |
|
| 449 | + $t = str_replace($regs[0], code_echappement($regs[0], 'javascript'._PROTEGE_JS_MODELES), $t); |
|
| 450 | 450 | } |
| 451 | 451 | } |
| 452 | - if (preg_match_all(',<\?php.*?($|\?' . '>),isS', $t, $r, PREG_SET_ORDER)) { |
|
| 452 | + if (preg_match_all(',<\?php.*?($|\?'.'>),isS', $t, $r, PREG_SET_ORDER)) { |
|
| 453 | 453 | if (!defined('_PROTEGE_PHP_MODELES')) { |
| 454 | 454 | include_spip('inc/acces'); |
| 455 | 455 | define('_PROTEGE_PHP_MODELES', creer_uniqid()); |
| 456 | 456 | } |
| 457 | 457 | foreach ($r as $regs) { |
| 458 | - $t = str_replace($regs[0], code_echappement($regs[0], 'php' . _PROTEGE_PHP_MODELES), $t); |
|
| 458 | + $t = str_replace($regs[0], code_echappement($regs[0], 'php'._PROTEGE_PHP_MODELES), $t); |
|
| 459 | 459 | } |
| 460 | 460 | } |
| 461 | 461 | } |
@@ -528,7 +528,7 @@ discard block |
||
| 528 | 528 | if (!function_exists('attribut_html')) { |
| 529 | 529 | include_spip('inc/filtres'); |
| 530 | 530 | } |
| 531 | - $texte = "<mark class='danger-js' title='" . attribut_html(_T('erreur_contenu_suspect')) . "'>⚠️</mark> " . $texte; |
|
| 531 | + $texte = "<mark class='danger-js' title='".attribut_html(_T('erreur_contenu_suspect'))."'>⚠️</mark> ".$texte; |
|
| 532 | 532 | } |
| 533 | 533 | |
| 534 | 534 | return $texte; |
@@ -598,11 +598,11 @@ discard block |
||
| 598 | 598 | **/ |
| 599 | 599 | function supprime_img($letexte, $message = null) { |
| 600 | 600 | if ($message === null) { |
| 601 | - $message = '(' . _T('img_indisponible') . ')'; |
|
| 601 | + $message = '('._T('img_indisponible').')'; |
|
| 602 | 602 | } |
| 603 | 603 | |
| 604 | 604 | return preg_replace( |
| 605 | - ',<(img|doc|emb)([0-9]+)(\|([^>]*))?' . '\s*/?' . '>,i', |
|
| 605 | + ',<(img|doc|emb)([0-9]+)(\|([^>]*))?'.'\s*/?'.'>,i', |
|
| 606 | 606 | $message, |
| 607 | 607 | $letexte |
| 608 | 608 | ); |
@@ -40,14 +40,14 @@ discard block |
||
| 40 | 40 | function changer_langue($lang, $liste_langues = null) { |
| 41 | 41 | |
| 42 | 42 | if (is_null($liste_langues)) { |
| 43 | - $liste_langues = @$GLOBALS['meta']['langues_proposees'] . ',' . @$GLOBALS['meta']['langues_multilingue']; |
|
| 43 | + $liste_langues = @$GLOBALS['meta']['langues_proposees'].','.@$GLOBALS['meta']['langues_multilingue']; |
|
| 44 | 44 | } |
| 45 | 45 | else { |
| 46 | 46 | if (is_array($liste_langues)) { |
| 47 | 47 | $liste_langues = implode(',', $liste_langues); |
| 48 | 48 | } |
| 49 | 49 | } |
| 50 | - $liste_langues = ',' . $liste_langues . ','; |
|
| 50 | + $liste_langues = ','.$liste_langues.','; |
|
| 51 | 51 | |
| 52 | 52 | // Si la langue demandee n'existe pas, on essaie d'autres variantes |
| 53 | 53 | // Exemple : 'pt-br' => 'pt_br' => 'pt' |
@@ -193,7 +193,7 @@ discard block |
||
| 193 | 193 | } |
| 194 | 194 | foreach ($langues as $l) { |
| 195 | 195 | $selected = ($l == $default) ? ' selected=\'selected\'' : ''; |
| 196 | - $ret .= "<option value='$l'$selected>[" . $l . '] ' . traduire_nom_langue($l) . "</option>\n"; |
|
| 196 | + $ret .= "<option value='$l'$selected>[".$l.'] '.traduire_nom_langue($l)."</option>\n"; |
|
| 197 | 197 | } |
| 198 | 198 | |
| 199 | 199 | if (!test_espace_prive()) { |
@@ -211,23 +211,21 @@ discard block |
||
| 211 | 211 | $base, |
| 212 | 212 | $cible, |
| 213 | 213 | (select_langues($nom_select, $change, $ret) |
| 214 | - . "<noscript><div style='display:inline'><input type='submit' class='fondo' value='" . _T('bouton_changer') . "' /></div></noscript>"), |
|
| 214 | + . "<noscript><div style='display:inline'><input type='submit' class='fondo' value='"._T('bouton_changer')."' /></div></noscript>"), |
|
| 215 | 215 | " method='post'" |
| 216 | 216 | ); |
| 217 | 217 | } |
| 218 | 218 | |
| 219 | 219 | function select_langues($nom_select, $change, $options, $label = '') { |
| 220 | 220 | static $cpt = 0; |
| 221 | - $id = 'menu_langues' . $cpt++; |
|
| 221 | + $id = 'menu_langues'.$cpt++; |
|
| 222 | 222 | |
| 223 | 223 | return |
| 224 | - "<label for='$id'>" . ($label ?: _T('info_langues')) . '</label> ' . |
|
| 224 | + "<label for='$id'>".($label ?: _T('info_langues')).'</label> '. |
|
| 225 | 225 | "<select name='$nom_select' id='$id' " |
| 226 | 226 | . ((!test_espace_prive()) ? |
| 227 | - ("class='forml menu_langues'") : |
|
| 228 | - (($nom_select == 'var_lang_ecrire') ? |
|
| 229 | - ("class='lang_ecrire'") : |
|
| 230 | - "class='fondl'")) |
|
| 227 | + ("class='forml menu_langues'") : (($nom_select == 'var_lang_ecrire') ? |
|
| 228 | + ("class='lang_ecrire'") : "class='fondl'")) |
|
| 231 | 229 | . $change |
| 232 | 230 | . ">\n" |
| 233 | 231 | . $options |
@@ -353,7 +351,7 @@ discard block |
||
| 353 | 351 | and (!isset($GLOBALS['spip_lang']) |
| 354 | 352 | or $GLOBALS['spip_lang'] != $GLOBALS['meta']['langue_site']) |
| 355 | 353 | ) { |
| 356 | - return changer_langue($GLOBALS['meta']['langue_site'], $liste_langues);//@:install |
|
| 354 | + return changer_langue($GLOBALS['meta']['langue_site'], $liste_langues); //@:install |
|
| 357 | 355 | } |
| 358 | 356 | // en theorie là, la globale est définie, sinon c'est un problème. |
| 359 | 357 | if (!isset($GLOBALS['spip_lang'])) { |
@@ -456,7 +454,7 @@ discard block |
||
| 456 | 454 | if (!isset($GLOBALS['meta']['langue_site'])) { |
| 457 | 455 | // Initialisation : le francais si dispo, sinon la premiere langue trouvee |
| 458 | 456 | $GLOBALS['meta']['langue_site'] = $tout = |
| 459 | - (!$all_langs or (strpos(',' . _LANGUE_PAR_DEFAUT . ',', (string) ",$all_langs,") !== false)) |
|
| 457 | + (!$all_langs or (strpos(','._LANGUE_PAR_DEFAUT.',', (string) ",$all_langs,") !== false)) |
|
| 460 | 458 | ? _LANGUE_PAR_DEFAUT : substr($all_langs, 0, strpos($all_langs, ',')); |
| 461 | 459 | ecrire_meta('langue_site', $tout); |
| 462 | 460 | } |
@@ -61,7 +61,7 @@ discard block |
||
| 61 | 61 | . $pere |
| 62 | 62 | . '</b>' |
| 63 | 63 | . (!$bons_peres ? '' |
| 64 | - : ('<p style="font-size: 80%"> ' . _T('zxml_mais_de') . ' <b>' . $bons_peres . '</b></p>'))); |
|
| 64 | + : ('<p style="font-size: 80%"> '._T('zxml_mais_de').' <b>'.$bons_peres.'</b></p>'))); |
|
| 65 | 65 | } elseif ($this->dtc->regles[$pere][0] == '/') { |
| 66 | 66 | $frat = substr($depth, 2); |
| 67 | 67 | if (!isset($this->fratrie[$frat])) { |
@@ -98,15 +98,15 @@ discard block |
||
| 98 | 98 | if (!isset($a[$name])) { |
| 99 | 99 | $bons = join(', ', array_keys($a)); |
| 100 | 100 | if ($bons) { |
| 101 | - $bons = " title=' " . |
|
| 102 | - _T('zxml_connus_attributs') . |
|
| 103 | - ' : ' . |
|
| 104 | - $bons . |
|
| 101 | + $bons = " title=' ". |
|
| 102 | + _T('zxml_connus_attributs'). |
|
| 103 | + ' : '. |
|
| 104 | + $bons. |
|
| 105 | 105 | "'"; |
| 106 | 106 | } |
| 107 | 107 | $bons .= " style='font-weight: bold'"; |
| 108 | 108 | coordonnees_erreur($this, " <b>$name</b> " |
| 109 | - . _T('zxml_inconnu_attribut') . ' ' . _T('zxml_de') |
|
| 109 | + . _T('zxml_inconnu_attribut').' '._T('zxml_de') |
|
| 110 | 110 | . " <a$bons>$bal</a> (" |
| 111 | 111 | . _T('zxml_survoler') |
| 112 | 112 | . ')'); |
@@ -115,7 +115,7 @@ discard block |
||
| 115 | 115 | if (!preg_match('/^\w+$/', $type)) { |
| 116 | 116 | $this->valider_motif($phraseur, $name, $val, $bal, $type); |
| 117 | 117 | } else { |
| 118 | - if (method_exists($this, $f = 'validerAttribut_' . $type)) { |
|
| 118 | + if (method_exists($this, $f = 'validerAttribut_'.$type)) { |
|
| 119 | 119 | $this->$f($phraseur, $name, $val, $bal); |
| 120 | 120 | } |
| 121 | 121 | } |
@@ -164,13 +164,13 @@ discard block |
||
| 164 | 164 | . " <b>$bal</b> " |
| 165 | 165 | . _T('zxml_non_conforme') |
| 166 | 166 | . '</p><p>' |
| 167 | - . '<b>' . $motif . '</b>'); |
|
| 167 | + . '<b>'.$motif.'</b>'); |
|
| 168 | 168 | } |
| 169 | 169 | } |
| 170 | 170 | |
| 171 | 171 | public function valider_idref($nom, $ligne, $col) { |
| 172 | 172 | if (!isset($this->ids[$nom])) { |
| 173 | - $this->err[] = [" <p><b>$nom</b> " . _T('zxml_inconnu_id'), $ligne, $col]; |
|
| 173 | + $this->err[] = [" <p><b>$nom</b> "._T('zxml_inconnu_id'), $ligne, $col]; |
|
| 174 | 174 | } |
| 175 | 175 | } |
| 176 | 176 | |
@@ -217,7 +217,7 @@ discard block |
||
| 217 | 217 | // controler que les balises devant etre vides le sont |
| 218 | 218 | if ($vide) { |
| 219 | 219 | if ($n <> ($k + $c)) { |
| 220 | - coordonnees_erreur($this, " <p><b>$name</b> " . _T('zxml_nonvide_balise')); |
|
| 220 | + coordonnees_erreur($this, " <p><b>$name</b> "._T('zxml_nonvide_balise')); |
|
| 221 | 221 | } |
| 222 | 222 | // pour les regles PCDATA ou iteration de disjonction, tout est fait |
| 223 | 223 | } elseif ($regle and ($regle != '*')) { |
@@ -252,7 +252,7 @@ discard block |
||
| 252 | 252 | $d = $this->ouvrant[$d]; |
| 253 | 253 | preg_match('/^\s*(\S+)/', $d, $m); |
| 254 | 254 | if (isset($this->dtc->pcdata[$m[1]]) and ($this->dtc->pcdata[$m[1]])) { |
| 255 | - coordonnees_erreur($this, ' <p><b>' . $m[1] . '</b> ' |
|
| 255 | + coordonnees_erreur($this, ' <p><b>'.$m[1].'</b> ' |
|
| 256 | 256 | . _T('zxml_nonvide_balise')); // message a affiner |
| 257 | 257 | } |
| 258 | 258 | } |
@@ -296,7 +296,7 @@ discard block |
||
| 296 | 296 | public function phraserTout($phraseur, $data) { |
| 297 | 297 | xml_parsestring($this, $data); |
| 298 | 298 | |
| 299 | - if (!$this->dtc or preg_match(',^' . _MESSAGE_DOCTYPE . ',', $data)) { |
|
| 299 | + if (!$this->dtc or preg_match(',^'._MESSAGE_DOCTYPE.',', $data)) { |
|
| 300 | 300 | $this->err[] = ['DOCTYPE ?', 0, 0]; |
| 301 | 301 | } else { |
| 302 | 302 | $this->valider_passe2(); |
@@ -120,7 +120,7 @@ discard block |
||
| 120 | 120 | : calculer_liste($val, $p->descr, $boucles, $id_boucle); |
| 121 | 121 | if ($var !== 1) { |
| 122 | 122 | $val = ($echap ? "\'$var\' => ' . argumenter_squelette(" : "'$var' => ") |
| 123 | - . $val . ($echap ? ") . '" : ' '); |
|
| 123 | + . $val.($echap ? ") . '" : ' '); |
|
| 124 | 124 | } else { |
| 125 | 125 | $val = $echap ? "'.$val.'" : $val; |
| 126 | 126 | } |
@@ -141,7 +141,7 @@ discard block |
||
| 141 | 141 | if (!$lang) { |
| 142 | 142 | $lang = '$GLOBALS["spip_lang"]'; |
| 143 | 143 | } |
| 144 | - $l['lang'] = ($echap ? "\'lang\' => ' . argumenter_squelette(" : "'lang' => ") . $lang . ($echap ? ") . '" : ' '); |
|
| 144 | + $l['lang'] = ($echap ? "\'lang\' => ' . argumenter_squelette(" : "'lang' => ").$lang.($echap ? ") . '" : ' '); |
|
| 145 | 145 | |
| 146 | 146 | return $l; |
| 147 | 147 | } |
@@ -171,7 +171,7 @@ discard block |
||
| 171 | 171 | $_contexte = argumenter_inclure($p->param, false, $p, $boucles, $id_boucle, true, '', true); |
| 172 | 172 | if (is_string($p->texte)) { |
| 173 | 173 | $fichier = $p->texte; |
| 174 | - $code = '"' . str_replace('"', '\"', $fichier) . '"'; |
|
| 174 | + $code = '"'.str_replace('"', '\"', $fichier).'"'; |
|
| 175 | 175 | } else { |
| 176 | 176 | $code = calculer_liste($p->texte, $p->descr, $boucles, $id_boucle); |
| 177 | 177 | if ($code and preg_match("/^'([^']*)'/s", $code, $r)) { |
@@ -220,7 +220,7 @@ discard block |
||
| 220 | 220 | return false; |
| 221 | 221 | } // j'aurais voulu toucher le fond ... |
| 222 | 222 | |
| 223 | - $contexte = 'array(' . $_contexte . ')'; |
|
| 223 | + $contexte = 'array('.$_contexte.')'; |
|
| 224 | 224 | |
| 225 | 225 | if ($env) { |
| 226 | 226 | $contexte = "array_merge('.var_export(\$Pile[0],1).',$contexte)"; |
@@ -235,16 +235,16 @@ discard block |
||
| 235 | 235 | $_options[] = $ajax; |
| 236 | 236 | } |
| 237 | 237 | $code = " ' . argumenter_squelette($code) . '"; |
| 238 | - $code = 'echo ' . sprintf( |
|
| 238 | + $code = 'echo '.sprintf( |
|
| 239 | 239 | CODE_RECUPERER_FOND, |
| 240 | 240 | $code, |
| 241 | 241 | $contexte, |
| 242 | 242 | implode(',', $_options), |
| 243 | 243 | "_request(\\'connect\\') ?? \\'\\'" |
| 244 | - ) . ';'; |
|
| 244 | + ).';'; |
|
| 245 | 245 | } |
| 246 | 246 | |
| 247 | - return "\n'<'.'" . '?php ' . $code . "\n?'." . "'>'"; |
|
| 247 | + return "\n'<'.'".'?php '.$code."\n?'."."'>'"; |
|
| 248 | 248 | } |
| 249 | 249 | |
| 250 | 250 | |
@@ -324,7 +324,7 @@ discard block |
||
| 324 | 324 | $id = $id_table; |
| 325 | 325 | $statut = preg_replace(',\W,', '', $s['champ']); // securite |
| 326 | 326 | } |
| 327 | - $mstatut = $id . '.' . $statut; |
|
| 327 | + $mstatut = $id.'.'.$statut; |
|
| 328 | 328 | |
| 329 | 329 | $arg_ignore_previsu = ($ignore_previsu ? ',true' : ''); |
| 330 | 330 | include_spip('public/quete'); |
@@ -332,11 +332,11 @@ discard block |
||
| 332 | 332 | isset($s['post_date']) and $s['post_date'] |
| 333 | 333 | and $GLOBALS['meta']['post_dates'] == 'non' |
| 334 | 334 | ) { |
| 335 | - $date = $id . '.' . preg_replace(',\W,', '', $s['post_date']); // securite |
|
| 335 | + $date = $id.'.'.preg_replace(',\W,', '', $s['post_date']); // securite |
|
| 336 | 336 | array_unshift( |
| 337 | 337 | $boucle->where, |
| 338 | 338 | $echapper ? |
| 339 | - "\nquete_condition_postdates('$date'," . _q($boucle->sql_serveur) . "$arg_ignore_previsu)" |
|
| 339 | + "\nquete_condition_postdates('$date',"._q($boucle->sql_serveur)."$arg_ignore_previsu)" |
|
| 340 | 340 | : |
| 341 | 341 | quete_condition_postdates($date, $boucle->sql_serveur, $ignore_previsu) |
| 342 | 342 | ); |
@@ -345,9 +345,9 @@ discard block |
||
| 345 | 345 | $boucle->where, |
| 346 | 346 | $echapper ? |
| 347 | 347 | "\nquete_condition_statut('$mstatut'," |
| 348 | - . _q($s['previsu']) . ',' |
|
| 349 | - . _q($s['publie']) . ',' |
|
| 350 | - . _q($boucle->sql_serveur) . "$arg_ignore_previsu)" |
|
| 348 | + . _q($s['previsu']).',' |
|
| 349 | + . _q($s['publie']).',' |
|
| 350 | + . _q($boucle->sql_serveur)."$arg_ignore_previsu)" |
|
| 351 | 351 | : |
| 352 | 352 | quete_condition_statut($mstatut, $s['previsu'], $s['publie'], $boucle->sql_serveur, $ignore_previsu) |
| 353 | 353 | ); |
@@ -381,14 +381,14 @@ discard block |
||
| 381 | 381 | if (_request('var_mode_affiche') != 'resultat') { |
| 382 | 382 | $trace = ''; |
| 383 | 383 | } else { |
| 384 | - $_trace = $boucles[$id_boucle]->descr['nom'] . $id_boucle; |
|
| 384 | + $_trace = $boucles[$id_boucle]->descr['nom'].$id_boucle; |
|
| 385 | 385 | $_trace = "\$GLOBALS['debug_objets']['resultat']['$_trace']"; |
| 386 | 386 | $trace = " |
| 387 | 387 | if (empty($_trace)) { |
| 388 | 388 | $_trace = []; |
| 389 | 389 | } |
| 390 | 390 | if (count($_trace) < 3) { |
| 391 | - $_trace" . '[] = $t0; |
|
| 391 | + $_trace".'[] = $t0; |
|
| 392 | 392 | }'; |
| 393 | 393 | } |
| 394 | 394 | |
@@ -422,7 +422,7 @@ discard block |
||
| 422 | 422 | return |
| 423 | 423 | // Numrows[$nom] peut ne pas être encore defini |
| 424 | 424 | "\n\t\$save_numrows = (isset(\$Numrows['$nom']) ? \$Numrows['$nom'] : array());" |
| 425 | - . "\n\t\$t0 = " . $boucles[$id_boucle]->return . ';' |
|
| 425 | + . "\n\t\$t0 = ".$boucles[$id_boucle]->return.';' |
|
| 426 | 426 | . "\n\t\$Numrows['$nom'] = (\$save_numrows);" |
| 427 | 427 | . $trace |
| 428 | 428 | . "\n\treturn \$t0;"; |
@@ -490,7 +490,7 @@ discard block |
||
| 490 | 490 | // faudrait expanser le foreach a la compil, car y en a souvent qu'un |
| 491 | 491 | // et puis faire un [] plutot qu'un "','." |
| 492 | 492 | if ($boucle->doublons) { |
| 493 | - $corps .= "\n\t\t\tforeach(" . $boucle->doublons . ' as $k) $doublons[$k] .= "," . ' . |
|
| 493 | + $corps .= "\n\t\t\tforeach(".$boucle->doublons.' as $k) $doublons[$k] .= "," . '. |
|
| 494 | 494 | index_pile($id_boucle, $primary, $boucles) |
| 495 | 495 | . "; // doublons\n"; |
| 496 | 496 | } |
@@ -518,13 +518,13 @@ discard block |
||
| 518 | 518 | $corps .= |
| 519 | 519 | "\n\t\tlang_select_public(" |
| 520 | 520 | . index_pile($id_boucle, 'lang', $boucles) |
| 521 | - . ", '" . $boucle->lang_select . "'" |
|
| 521 | + . ", '".$boucle->lang_select."'" |
|
| 522 | 522 | . (in_array($type_boucle, [ |
| 523 | 523 | 'articles', |
| 524 | 524 | 'rubriques', |
| 525 | 525 | 'hierarchie', |
| 526 | 526 | 'breves' |
| 527 | - ]) ? ', ' . index_pile($id_boucle, 'titre', $boucles) : '') |
|
| 527 | + ]) ? ', '.index_pile($id_boucle, 'titre', $boucles) : '') |
|
| 528 | 528 | . ');'; |
| 529 | 529 | } else { |
| 530 | 530 | $init_lang = ''; |
@@ -546,20 +546,16 @@ discard block |
||
| 546 | 546 | |
| 547 | 547 | // gestion optimale des separateurs et des boucles constantes |
| 548 | 548 | if (is_countable($boucle->separateur) ? count($boucle->separateur) : 0) { |
| 549 | - $code_sep = ("'" . str_replace("'", "\'", join('', $boucle->separateur)) . "'"); |
|
| 549 | + $code_sep = ("'".str_replace("'", "\'", join('', $boucle->separateur))."'"); |
|
| 550 | 550 | } |
| 551 | 551 | |
| 552 | 552 | $corps .= |
| 553 | 553 | ((!$boucle->separateur) ? |
| 554 | - (($constant && !$corps && !$flag_cpt) ? $return : |
|
| 555 | - (($return === "''") ? '' : |
|
| 556 | - ("\n\t\t" . '$t0 .= ' . $return . ';'))) : |
|
| 557 | - ("\n\t\t\$t1 " . |
|
| 554 | + (($constant && !$corps && !$flag_cpt) ? $return : (($return === "''") ? '' : ("\n\t\t".'$t0 .= '.$return.';'))) : ("\n\t\t\$t1 ". |
|
| 558 | 555 | ((strpos($return, '$t1.') === 0) ? |
| 559 | - ('.=' . substr($return, 4)) : |
|
| 560 | - ('= ' . $return)) . |
|
| 561 | - ";\n\t\t" . |
|
| 562 | - '$t0 .= ((strlen($t1) && strlen($t0)) ? ' . $code_sep . " : '') . \$t1;")); |
|
| 556 | + ('.='.substr($return, 4)) : ('= '.$return)). |
|
| 557 | + ";\n\t\t". |
|
| 558 | + '$t0 .= ((strlen($t1) && strlen($t0)) ? '.$code_sep." : '') . \$t1;")); |
|
| 563 | 559 | |
| 564 | 560 | // Calculer les invalideurs si c'est une boucle non constante et si on |
| 565 | 561 | // souhaite invalider ces elements |
@@ -641,7 +637,7 @@ discard block |
||
| 641 | 637 | $corps, |
| 642 | 638 | $fin_lang, |
| 643 | 639 | $trace, |
| 644 | - 'BOUCLE' . $id_boucle . ' @ ' . ($boucle->descr['sourcefile']) |
|
| 640 | + 'BOUCLE'.$id_boucle.' @ '.($boucle->descr['sourcefile']) |
|
| 645 | 641 | ); |
| 646 | 642 | |
| 647 | 643 | # var_dump($a);exit; |
@@ -662,25 +658,24 @@ discard block |
||
| 662 | 658 | **/ |
| 663 | 659 | function calculer_requete_sql($boucle) { |
| 664 | 660 | $init = []; |
| 665 | - $init[] = calculer_dec('table', "'" . $boucle->id_table . "'"); |
|
| 666 | - $init[] = calculer_dec('id', "'" . $boucle->id_boucle . "'"); |
|
| 661 | + $init[] = calculer_dec('table', "'".$boucle->id_table."'"); |
|
| 662 | + $init[] = calculer_dec('id', "'".$boucle->id_boucle."'"); |
|
| 667 | 663 | # En absence de champ c'est un decompte : |
| 668 | 664 | $init[] = calculer_dec('from', calculer_from($boucle)); |
| 669 | 665 | $init[] = calculer_dec('type', calculer_from_type($boucle)); |
| 670 | 666 | $init[] = calculer_dec( |
| 671 | 667 | 'groupby', |
| 672 | - 'array(' . (($g = join("\",\n\t\t\"", $boucle->group)) ? '"' . $g . '"' : '') . ')' |
|
| 668 | + 'array('.(($g = join("\",\n\t\t\"", $boucle->group)) ? '"'.$g.'"' : '').')' |
|
| 673 | 669 | ); |
| 674 | - $init[] = calculer_dec('select', 'array("' . join("\",\n\t\t\"", $boucle->select) . '")'); |
|
| 675 | - $init[] = calculer_dec('orderby', 'array(' . calculer_order($boucle) . ')'); |
|
| 670 | + $init[] = calculer_dec('select', 'array("'.join("\",\n\t\t\"", $boucle->select).'")'); |
|
| 671 | + $init[] = calculer_dec('orderby', 'array('.calculer_order($boucle).')'); |
|
| 676 | 672 | $init[] = calculer_dec('where', calculer_dump_array($boucle->where)); |
| 677 | 673 | $init[] = calculer_dec('join', calculer_dump_join($boucle->join)); |
| 678 | 674 | $init[] = calculer_dec( |
| 679 | 675 | 'limit', |
| 680 | 676 | ( |
| 681 | 677 | strpos($boucle->limit, 'intval') === false ? |
| 682 | - "'" . ($boucle->limit) . "'" : |
|
| 683 | - $boucle->limit |
|
| 678 | + "'".($boucle->limit)."'" : $boucle->limit |
|
| 684 | 679 | ) |
| 685 | 680 | ); |
| 686 | 681 | $init[] = calculer_dec('having', calculer_dump_array($boucle->having)); |
@@ -689,17 +684,17 @@ discard block |
||
| 689 | 684 | // ou recalculée à chaque passage (vide) |
| 690 | 685 | foreach ($init as $i) { |
| 691 | 686 | if (reset($i)) { |
| 692 | - $s .= "\n\t\t" . end($i); |
|
| 687 | + $s .= "\n\t\t".end($i); |
|
| 693 | 688 | } # statique |
| 694 | 689 | else { |
| 695 | - $d .= "\n\t" . end($i); |
|
| 690 | + $d .= "\n\t".end($i); |
|
| 696 | 691 | } # dynamique |
| 697 | 692 | } |
| 698 | 693 | |
| 699 | 694 | return ($boucle->hierarchie ? "\n\t$boucle->hierarchie" : '') |
| 700 | 695 | . $boucle->in |
| 701 | 696 | . $boucle->hash |
| 702 | - . "\n\t" . 'if (!isset($command[\'table\'])) {' |
|
| 697 | + . "\n\t".'if (!isset($command[\'table\'])) {' |
|
| 703 | 698 | . $s |
| 704 | 699 | . "\n\t}" |
| 705 | 700 | . $d; |
@@ -782,7 +777,7 @@ discard block |
||
| 782 | 777 | * - index 1 : Code de l'affectation |
| 783 | 778 | **/ |
| 784 | 779 | function calculer_dec($nom, $val) { |
| 785 | - $static = 'if (!isset($command[\'' . $nom . '\'])) '; |
|
| 780 | + $static = 'if (!isset($command[\''.$nom.'\'])) '; |
|
| 786 | 781 | // si une variable apparait dans le calcul de la clause |
| 787 | 782 | // il faut la re-evaluer a chaque passage |
| 788 | 783 | if ( |
@@ -799,7 +794,7 @@ discard block |
||
| 799 | 794 | $static = ''; |
| 800 | 795 | } |
| 801 | 796 | |
| 802 | - return [$static, '$command[\'' . $nom . '\'] = ' . $val . ';']; |
|
| 797 | + return [$static, '$command[\''.$nom.'\'] = '.$val.';']; |
|
| 803 | 798 | } |
| 804 | 799 | |
| 805 | 800 | /** |
@@ -824,27 +819,27 @@ discard block |
||
| 824 | 819 | } |
| 825 | 820 | $res = ''; |
| 826 | 821 | if ($a and $a[0] == "'?'") { |
| 827 | - return ('(' . calculer_dump_array($a[1]) . |
|
| 828 | - ' ? ' . calculer_dump_array($a[2]) . |
|
| 829 | - ' : ' . calculer_dump_array($a[3]) . |
|
| 822 | + return ('('.calculer_dump_array($a[1]). |
|
| 823 | + ' ? '.calculer_dump_array($a[2]). |
|
| 824 | + ' : '.calculer_dump_array($a[3]). |
|
| 830 | 825 | ')'); |
| 831 | 826 | } else { |
| 832 | 827 | foreach ($a as $k => $v) { |
| 833 | - $showk = (is_numeric($k) ? '' : sql_quote($k) . ' => '); |
|
| 834 | - $res .= ', ' . $showk . calculer_dump_array($v); |
|
| 828 | + $showk = (is_numeric($k) ? '' : sql_quote($k).' => '); |
|
| 829 | + $res .= ', '.$showk.calculer_dump_array($v); |
|
| 835 | 830 | } |
| 836 | 831 | |
| 837 | - return "\n\t\t\tarray(" . substr($res, 2) . ')'; |
|
| 832 | + return "\n\t\t\tarray(".substr($res, 2).')'; |
|
| 838 | 833 | } |
| 839 | 834 | } |
| 840 | 835 | |
| 841 | 836 | function calculer_dump_join($a) { |
| 842 | 837 | $res = ''; |
| 843 | 838 | foreach ($a as $k => $v) { |
| 844 | - $res .= ", '$k' => array(" . implode(',', $v) . ')'; |
|
| 839 | + $res .= ", '$k' => array(".implode(',', $v).')'; |
|
| 845 | 840 | } |
| 846 | 841 | |
| 847 | - return 'array(' . substr($res, 2) . ')'; |
|
| 842 | + return 'array('.substr($res, 2).')'; |
|
| 848 | 843 | } |
| 849 | 844 | |
| 850 | 845 | /** |
@@ -861,7 +856,7 @@ discard block |
||
| 861 | 856 | $res .= ",'$k' => '$v'"; |
| 862 | 857 | } |
| 863 | 858 | |
| 864 | - return 'array(' . substr($res, 1) . ')'; |
|
| 859 | + return 'array('.substr($res, 1).')'; |
|
| 865 | 860 | } |
| 866 | 861 | |
| 867 | 862 | /** |
@@ -879,7 +874,7 @@ discard block |
||
| 879 | 874 | $res .= ",'$k' => '$v'"; |
| 880 | 875 | } |
| 881 | 876 | |
| 882 | - return 'array(' . substr($res, 1) . ')'; |
|
| 877 | + return 'array('.substr($res, 1).')'; |
|
| 883 | 878 | } |
| 884 | 879 | |
| 885 | 880 | function calculer_order(&$boucle) { |
@@ -948,19 +943,19 @@ discard block |
||
| 948 | 943 | ) { |
| 949 | 944 | $res .= " .\n$tab$code"; |
| 950 | 945 | } else { |
| 951 | - $res = substr($res, 0, -1) . substr($code, 1); |
|
| 946 | + $res = substr($res, 0, -1).substr($code, 1); |
|
| 952 | 947 | } |
| 953 | 948 | } |
| 954 | 949 | |
| 955 | - return '(' . substr($res, 2 + $descr['niv']) . ')'; |
|
| 950 | + return '('.substr($res, 2 + $descr['niv']).')'; |
|
| 956 | 951 | } |
| 957 | 952 | } else { |
| 958 | - $nom = $descr['nom'] . $id_boucle . ($descr['niv'] ?: ''); |
|
| 953 | + $nom = $descr['nom'].$id_boucle.($descr['niv'] ?: ''); |
|
| 959 | 954 | |
| 960 | - return "join('', array_map('array_shift', \$GLOBALS['debug_objets']['sequence']['$nom'] = array(" . join( |
|
| 955 | + return "join('', array_map('array_shift', \$GLOBALS['debug_objets']['sequence']['$nom'] = array(".join( |
|
| 961 | 956 | " ,\n$tab", |
| 962 | 957 | $codes |
| 963 | - ) . ')))'; |
|
| 958 | + ).')))'; |
|
| 964 | 959 | } |
| 965 | 960 | } |
| 966 | 961 | |
@@ -987,7 +982,7 @@ discard block |
||
| 987 | 982 | // texte seul |
| 988 | 983 | case 'texte': |
| 989 | 984 | $code = sandbox_composer_texte($p->texte, $p); |
| 990 | - $commentaire = strlen($p->texte) . ' signes'; |
|
| 985 | + $commentaire = strlen($p->texte).' signes'; |
|
| 991 | 986 | $avant = ''; |
| 992 | 987 | $apres = ''; |
| 993 | 988 | $altern = "''"; |
@@ -996,14 +991,14 @@ discard block |
||
| 996 | 991 | case 'polyglotte': |
| 997 | 992 | $code = ''; |
| 998 | 993 | foreach ($p->traductions as $k => $v) { |
| 999 | - $code .= ",'" . |
|
| 1000 | - str_replace(['\\', "'"], ['\\\\', "\\'"], $k) . |
|
| 1001 | - "' => '" . |
|
| 1002 | - str_replace(['\\', "'"], ['\\\\', "\\'"], $v) . |
|
| 994 | + $code .= ",'". |
|
| 995 | + str_replace(['\\', "'"], ['\\\\', "\\'"], $k). |
|
| 996 | + "' => '". |
|
| 997 | + str_replace(['\\', "'"], ['\\\\', "\\'"], $v). |
|
| 1003 | 998 | "'"; |
| 1004 | 999 | } |
| 1005 | - $code = 'choisir_traduction(array(' . |
|
| 1006 | - substr($code, 1) . |
|
| 1000 | + $code = 'choisir_traduction(array('. |
|
| 1001 | + substr($code, 1). |
|
| 1007 | 1002 | '))'; |
| 1008 | 1003 | $commentaire = '&'; |
| 1009 | 1004 | $avant = ''; |
@@ -1019,7 +1014,7 @@ discard block |
||
| 1019 | 1014 | $err_e_c = true; |
| 1020 | 1015 | $code = "''"; |
| 1021 | 1016 | } else { |
| 1022 | - $commentaire = '<INCLURE ' . addslashes(str_replace("\n", ' ', $code)) . '>'; |
|
| 1017 | + $commentaire = '<INCLURE '.addslashes(str_replace("\n", ' ', $code)).'>'; |
|
| 1023 | 1018 | $avant = ''; |
| 1024 | 1019 | $apres = ''; |
| 1025 | 1020 | $altern = "''"; |
@@ -1048,8 +1043,8 @@ discard block |
||
| 1048 | 1043 | $err_e_c = true; |
| 1049 | 1044 | $code = "''"; |
| 1050 | 1045 | } else { |
| 1051 | - $code = 'BOUCLE' . |
|
| 1052 | - str_replace('-', '_', $nom) . $descr['nom'] . |
|
| 1046 | + $code = 'BOUCLE'. |
|
| 1047 | + str_replace('-', '_', $nom).$descr['nom']. |
|
| 1053 | 1048 | '($Cache, $Pile, $doublons, $Numrows, $SP)'; |
| 1054 | 1049 | $commentaire = "?$nom"; |
| 1055 | 1050 | if ( |
@@ -1091,24 +1086,22 @@ discard block |
||
| 1091 | 1086 | foreach ($p->arg as $k => $v) { |
| 1092 | 1087 | $_v = calculer_liste($v, $descr, $boucles, $id_boucle); |
| 1093 | 1088 | if ($k) { |
| 1094 | - $l[] = _q($k) . ' => ' . $_v; |
|
| 1089 | + $l[] = _q($k).' => '.$_v; |
|
| 1095 | 1090 | } else { |
| 1096 | 1091 | $code = $_v; |
| 1097 | 1092 | } |
| 1098 | 1093 | } |
| 1099 | 1094 | // Si le module n'est pas fourni, l'expliciter sauf si calculé |
| 1100 | 1095 | if ($p->module) { |
| 1101 | - $m = $p->module . ':' . $p->nom_champ; |
|
| 1096 | + $m = $p->module.':'.$p->nom_champ; |
|
| 1102 | 1097 | } elseif ($p->nom_champ) { |
| 1103 | - $m = MODULES_IDIOMES . ':' . $p->nom_champ; |
|
| 1098 | + $m = MODULES_IDIOMES.':'.$p->nom_champ; |
|
| 1104 | 1099 | } else { |
| 1105 | 1100 | $m = ''; |
| 1106 | 1101 | } |
| 1107 | 1102 | |
| 1108 | - $code = (!$code ? "'$m'" : |
|
| 1109 | - ($m ? "'$m' . $code" : |
|
| 1110 | - ("(strpos(\$x=$code, ':') ? \$x : ('" . MODULES_IDIOMES . ":' . \$x))"))) |
|
| 1111 | - . (!$l ? '' : (', array(' . implode(",\n", $l) . ')')); |
|
| 1103 | + $code = (!$code ? "'$m'" : ($m ? "'$m' . $code" : ("(strpos(\$x=$code, ':') ? \$x : ('".MODULES_IDIOMES.":' . \$x))"))) |
|
| 1104 | + . (!$l ? '' : (', array('.implode(",\n", $l).')')); |
|
| 1112 | 1105 | $code = "_T($code)"; |
| 1113 | 1106 | if ($p->param) { |
| 1114 | 1107 | $p->id_boucle = $id_boucle; |
@@ -1130,7 +1123,7 @@ discard block |
||
| 1130 | 1123 | $p->type_requete = $type; |
| 1131 | 1124 | |
| 1132 | 1125 | $code = calculer_champ($p); |
| 1133 | - $commentaire = '#' . $p->nom_champ . $p->etoile; |
|
| 1126 | + $commentaire = '#'.$p->nom_champ.$p->etoile; |
|
| 1134 | 1127 | $avant = calculer_liste( |
| 1135 | 1128 | $p->avant, |
| 1136 | 1129 | $descr, |
@@ -1170,10 +1163,9 @@ discard block |
||
| 1170 | 1163 | if ($code != "''") { |
| 1171 | 1164 | $code = compile_retour($code, $avant, $apres, $altern, $tab, $descr['niv']); |
| 1172 | 1165 | $codes[] = (($mode == 'validation') ? |
| 1173 | - "array($code, '$commentaire', " . $p->ligne . ')' |
|
| 1166 | + "array($code, '$commentaire', ".$p->ligne.')' |
|
| 1174 | 1167 | : (($mode == 'code') ? |
| 1175 | - "\n// $commentaire\n$code" : |
|
| 1176 | - $code)); |
|
| 1168 | + "\n// $commentaire\n$code" : $code)); |
|
| 1177 | 1169 | } |
| 1178 | 1170 | } // foreach |
| 1179 | 1171 | |
@@ -1229,19 +1221,19 @@ discard block |
||
| 1229 | 1221 | $cond = ''; |
| 1230 | 1222 | } elseif (preg_match(_REGEXP_COND_VIDE_NONVIDE, $code, $r)) { |
| 1231 | 1223 | $t = $r[2]; |
| 1232 | - $cond = '!' . $r[1]; |
|
| 1224 | + $cond = '!'.$r[1]; |
|
| 1233 | 1225 | } else { |
| 1234 | 1226 | if (preg_match(_REGEXP_COND_NONVIDE_VIDE, $code, $r)) { |
| 1235 | 1227 | $t = $r[2]; |
| 1236 | 1228 | $cond = $r[1]; |
| 1237 | 1229 | } else { |
| 1238 | - $t = '$t' . $n; |
|
| 1230 | + $t = '$t'.$n; |
|
| 1239 | 1231 | $cond = "($t = $code)!==''"; |
| 1240 | 1232 | } |
| 1241 | 1233 | } |
| 1242 | 1234 | |
| 1243 | - $res = (!$avant ? '' : "$avant . ") . |
|
| 1244 | - $t . |
|
| 1235 | + $res = (!$avant ? '' : "$avant . "). |
|
| 1236 | + $t. |
|
| 1245 | 1237 | (!$apres ? '' : " . $apres"); |
| 1246 | 1238 | |
| 1247 | 1239 | if ($res !== $t) { |
@@ -1292,12 +1284,12 @@ discard block |
||
| 1292 | 1284 | |
| 1293 | 1285 | // rendre inertes les echappements de #[](){}<> |
| 1294 | 1286 | $i = 0; |
| 1295 | - while (false !== strpos($squelette, $inerte = '-INERTE' . $i)) { |
|
| 1287 | + while (false !== strpos($squelette, $inerte = '-INERTE'.$i)) { |
|
| 1296 | 1288 | $i++; |
| 1297 | 1289 | } |
| 1298 | 1290 | $squelette = preg_replace_callback( |
| 1299 | 1291 | ',\\\\([#[()\]{}<>]),', |
| 1300 | - fn($a) => "$inerte-" . ord($a[1]) . '-', |
|
| 1292 | + fn($a) => "$inerte-".ord($a[1]).'-', |
|
| 1301 | 1293 | $squelette, |
| 1302 | 1294 | -1, |
| 1303 | 1295 | $esc |
@@ -1313,7 +1305,7 @@ discard block |
||
| 1313 | 1305 | // Phraser le squelette, selon sa grammaire |
| 1314 | 1306 | |
| 1315 | 1307 | $boucles = []; |
| 1316 | - $f = charger_fonction('phraser_' . $gram, 'public'); |
|
| 1308 | + $f = charger_fonction('phraser_'.$gram, 'public'); |
|
| 1317 | 1309 | |
| 1318 | 1310 | $squelette = $f($squelette, '', $boucles, $descr); |
| 1319 | 1311 | |
@@ -1329,7 +1321,7 @@ discard block |
||
| 1329 | 1321 | ); |
| 1330 | 1322 | $boucles[$i]->descr['squelette'] = preg_replace_callback( |
| 1331 | 1323 | ",$inerte-(\d+)-,", |
| 1332 | - fn($a) => '\\\\' . chr($a[1]), |
|
| 1324 | + fn($a) => '\\\\'.chr($a[1]), |
|
| 1333 | 1325 | $boucle->descr['squelette'] |
| 1334 | 1326 | ); |
| 1335 | 1327 | } |
@@ -1340,19 +1332,19 @@ discard block |
||
| 1340 | 1332 | include_spip('public/decompiler'); |
| 1341 | 1333 | foreach ($boucles as $id => $boucle) { |
| 1342 | 1334 | if ($id) { |
| 1343 | - $decomp = "\n/* BOUCLE " . |
|
| 1344 | - $boucle->type_requete . |
|
| 1345 | - ' ' . |
|
| 1346 | - str_replace('*/', '* /', public_decompiler($boucle, $gram, 0, 'criteres')) . |
|
| 1347 | - ($boucle->debug ? "\n *\n * " . implode("\n * ", $boucle->debug) . "\n" : '') . |
|
| 1335 | + $decomp = "\n/* BOUCLE ". |
|
| 1336 | + $boucle->type_requete. |
|
| 1337 | + ' '. |
|
| 1338 | + str_replace('*/', '* /', public_decompiler($boucle, $gram, 0, 'criteres')). |
|
| 1339 | + ($boucle->debug ? "\n *\n * ".implode("\n * ", $boucle->debug)."\n" : ''). |
|
| 1348 | 1340 | " */\n"; |
| 1349 | 1341 | } else { |
| 1350 | - $decomp = ("\n/*\n" . |
|
| 1342 | + $decomp = ("\n/*\n". |
|
| 1351 | 1343 | str_replace('*/', '* /', public_decompiler($squelette, $gram)) |
| 1352 | 1344 | . "\n*/"); |
| 1353 | 1345 | } |
| 1354 | - $boucles[$id]->return = $decomp . $boucle->return; |
|
| 1355 | - $GLOBALS['debug_objets']['code'][$nom . $id] = $boucle->return; |
|
| 1346 | + $boucles[$id]->return = $decomp.$boucle->return; |
|
| 1347 | + $GLOBALS['debug_objets']['code'][$nom.$id] = $boucle->return; |
|
| 1356 | 1348 | } |
| 1357 | 1349 | } |
| 1358 | 1350 | |
@@ -1375,7 +1367,7 @@ discard block |
||
| 1375 | 1367 | } |
| 1376 | 1368 | } |
| 1377 | 1369 | foreach ($boucles as $id => $boucle) { |
| 1378 | - $GLOBALS['debug_objets']['boucle'][$nom . $id] = $boucle; |
|
| 1370 | + $GLOBALS['debug_objets']['boucle'][$nom.$id] = $boucle; |
|
| 1379 | 1371 | } |
| 1380 | 1372 | $descr['documents'] = compile_inclure_doublons($squelette); |
| 1381 | 1373 | |
@@ -1466,8 +1458,7 @@ discard block |
||
| 1466 | 1458 | } else { |
| 1467 | 1459 | $boucles[$id]->type_requete = false; |
| 1468 | 1460 | $boucle = $boucles[$id]; |
| 1469 | - $x = (!$boucle->sql_serveur ? '' : |
|
| 1470 | - ($boucle->sql_serveur . ':')) . |
|
| 1461 | + $x = (!$boucle->sql_serveur ? '' : ($boucle->sql_serveur.':')). |
|
| 1471 | 1462 | $type; |
| 1472 | 1463 | $msg = [ |
| 1473 | 1464 | 'zbug_table_inconnue', |
@@ -1557,13 +1548,13 @@ discard block |
||
| 1557 | 1548 | if ( |
| 1558 | 1549 | // fonction de boucle avec serveur & table |
| 1559 | 1550 | (!$serveur or |
| 1560 | - ((!function_exists($f = 'boucle_' . $serveur . '_' . $table)) |
|
| 1561 | - and (!function_exists($f = $f . '_dist')) |
|
| 1551 | + ((!function_exists($f = 'boucle_'.$serveur.'_'.$table)) |
|
| 1552 | + and (!function_exists($f = $f.'_dist')) |
|
| 1562 | 1553 | ) |
| 1563 | 1554 | ) |
| 1564 | 1555 | // fonction de boucle avec table |
| 1565 | - and (!function_exists($f = 'boucle_' . $table)) |
|
| 1566 | - and (!function_exists($f = $f . '_dist')) |
|
| 1556 | + and (!function_exists($f = 'boucle_'.$table)) |
|
| 1557 | + and (!function_exists($f = $f.'_dist')) |
|
| 1567 | 1558 | ) { |
| 1568 | 1559 | // fonction de boucle standard |
| 1569 | 1560 | if (!function_exists($f = 'boucle_DEFAUT')) { |
@@ -1571,20 +1562,20 @@ discard block |
||
| 1571 | 1562 | } |
| 1572 | 1563 | } |
| 1573 | 1564 | |
| 1574 | - $req = "\n\n\tstatic \$command = array();\n\t" . |
|
| 1575 | - "static \$connect;\n\t" . |
|
| 1576 | - "\$command['connect'] = \$connect = " . |
|
| 1577 | - _q($boucle->sql_serveur) . |
|
| 1578 | - ';' . |
|
| 1565 | + $req = "\n\n\tstatic \$command = array();\n\t". |
|
| 1566 | + "static \$connect;\n\t". |
|
| 1567 | + "\$command['connect'] = \$connect = ". |
|
| 1568 | + _q($boucle->sql_serveur). |
|
| 1569 | + ';'. |
|
| 1579 | 1570 | $f($id, $boucles); |
| 1580 | 1571 | } else { |
| 1581 | 1572 | $req = ("\n\treturn '';"); |
| 1582 | 1573 | } |
| 1583 | 1574 | |
| 1584 | 1575 | $boucles[$id]->return = |
| 1585 | - "\n\nfunction BOUCLE" . strtr($id, '-', '_') . $nom . |
|
| 1586 | - '(&$Cache, &$Pile, &$doublons, &$Numrows, $SP) {' . |
|
| 1587 | - $req . |
|
| 1576 | + "\n\nfunction BOUCLE".strtr($id, '-', '_').$nom. |
|
| 1577 | + '(&$Cache, &$Pile, &$doublons, &$Numrows, $SP) {'. |
|
| 1578 | + $req. |
|
| 1588 | 1579 | "\n}\n"; |
| 1589 | 1580 | } |
| 1590 | 1581 | |
@@ -1594,7 +1585,7 @@ discard block |
||
| 1594 | 1585 | return false; |
| 1595 | 1586 | } |
| 1596 | 1587 | |
| 1597 | - $principal = "\nfunction " . $nom . '($Cache, $Pile, $doublons = array(), $Numrows = array(), $SP = 0) { |
|
| 1588 | + $principal = "\nfunction ".$nom.'($Cache, $Pile, $doublons = array(), $Numrows = array(), $SP = 0) { |
|
| 1598 | 1589 | ' |
| 1599 | 1590 | // reporter de maniere securisee les doublons inclus |
| 1600 | 1591 | . ' |
@@ -1602,15 +1593,15 @@ discard block |
||
| 1602 | 1593 | $doublons = nettoyer_env_doublons($Pile[0]["doublons"]); |
| 1603 | 1594 | |
| 1604 | 1595 | $connect = ' . |
| 1605 | - _q($connect) . '; |
|
| 1596 | + _q($connect).'; |
|
| 1606 | 1597 | $page = ' . |
| 1607 | 1598 | // ATTENTION, le calcul de l'expression $corps affectera $Cache |
| 1608 | 1599 | // c'est pourquoi on l'affecte a la variable auxiliaire $page. |
| 1609 | 1600 | // avant de referencer $Cache |
| 1610 | - $corps . '; |
|
| 1601 | + $corps.'; |
|
| 1611 | 1602 | |
| 1612 | 1603 | return analyse_resultat_skel(' . var_export($nom, true) |
| 1613 | - . ', $Cache, $page, ' . var_export($sourcefile, true) . '); |
|
| 1604 | + . ', $Cache, $page, '.var_export($sourcefile, true).'); |
|
| 1614 | 1605 | }'; |
| 1615 | 1606 | |
| 1616 | 1607 | $secondes = spip_timer('calcul_skel'); |
@@ -1624,10 +1615,10 @@ discard block |
||
| 1624 | 1615 | $code->return = ' |
| 1625 | 1616 | // |
| 1626 | 1617 | // Fonction principale du squelette ' . |
| 1627 | - $sourcefile . |
|
| 1628 | - ($connect ? " pour $connect" : '') . |
|
| 1629 | - (!CODE_COMMENTE ? '' : "\n// Temps de compilation total: $secondes") . |
|
| 1630 | - "\n//\n" . |
|
| 1618 | + $sourcefile. |
|
| 1619 | + ($connect ? " pour $connect" : ''). |
|
| 1620 | + (!CODE_COMMENTE ? '' : "\n// Temps de compilation total: $secondes"). |
|
| 1621 | + "\n//\n". |
|
| 1631 | 1622 | $principal; |
| 1632 | 1623 | |
| 1633 | 1624 | $boucles[''] = $code; |
@@ -1679,7 +1670,7 @@ discard block |
||
| 1679 | 1670 | **/ |
| 1680 | 1671 | function requeteur_data_dist(&$boucles, &$boucle, &$id) { |
| 1681 | 1672 | include_spip('iterateur/data'); |
| 1682 | - if ($h = charger_fonction($boucle->type_requete . '_to_array', 'inc', true)) { |
|
| 1673 | + if ($h = charger_fonction($boucle->type_requete.'_to_array', 'inc', true)) { |
|
| 1683 | 1674 | $g = charger_fonction('data', 'iterateur'); |
| 1684 | 1675 | $boucles[$id] = $g($boucle); |
| 1685 | 1676 | // from[0] stocke le type de data (rss, yql, ...) |