@@ -47,7 +47,7 @@ discard block |
||
| 47 | 47 | $boucle = &$boucles[$idb]; |
| 48 | 48 | $id_parent = $GLOBALS['exceptions_des_tables'][$boucle->id_table]['id_parent'] ?? 'id_parent'; |
| 49 | 49 | |
| 50 | - $c = ["'='", "'$boucle->id_table." . "$id_parent'", 0]; |
|
| 50 | + $c = ["'='", "'$boucle->id_table."."$id_parent'", 0]; |
|
| 51 | 51 | $boucle->where[] = ($crit->not ? ["'NOT'", $c] : $c); |
| 52 | 52 | } |
| 53 | 53 | |
@@ -70,10 +70,10 @@ discard block |
||
| 70 | 70 | $id = $boucle->primary; |
| 71 | 71 | |
| 72 | 72 | if ($not or !$id) { |
| 73 | - return (['zbug_critere_inconnu', ['critere' => $not . $crit->op]]); |
|
| 73 | + return (['zbug_critere_inconnu', ['critere' => $not.$crit->op]]); |
|
| 74 | 74 | } |
| 75 | 75 | $arg = kwote(calculer_argument_precedent($idb, $id, $boucles)); |
| 76 | - $boucle->where[] = ["'!='", "'$boucle->id_table." . "$id'", $arg]; |
|
| 76 | + $boucle->where[] = ["'!='", "'$boucle->id_table."."$id'", $arg]; |
|
| 77 | 77 | } |
| 78 | 78 | |
| 79 | 79 | |
@@ -104,12 +104,12 @@ discard block |
||
| 104 | 104 | $not = ($crit->not ? '' : 'NOT'); |
| 105 | 105 | |
| 106 | 106 | // le doublon s'applique sur un type de boucle (article) |
| 107 | - $nom = "'" . $boucle->type_requete . "'"; |
|
| 107 | + $nom = "'".$boucle->type_requete."'"; |
|
| 108 | 108 | |
| 109 | 109 | // compléter le nom avec un nom précisé {doublons nom} |
| 110 | 110 | // on obtient $nom = "'article' . 'nom'" |
| 111 | 111 | if (isset($crit->param[0])) { |
| 112 | - $nom .= '.' . calculer_liste($crit->param[0], $idb, $boucles, $boucles[$idb]->id_parent); |
|
| 112 | + $nom .= '.'.calculer_liste($crit->param[0], $idb, $boucles, $boucles[$idb]->id_parent); |
|
| 113 | 113 | } |
| 114 | 114 | |
| 115 | 115 | // code qui déclarera l'index du stockage de nos doublons (pour éviter une notice PHP) |
@@ -121,13 +121,13 @@ discard block |
||
| 121 | 121 | // $doublons et son index, ici $nom |
| 122 | 122 | |
| 123 | 123 | // debut du code "sql_in('articles.id_article', " |
| 124 | - $debut_in = "sql_in('" . $boucle->id_table . '.' . $primary . "', "; |
|
| 124 | + $debut_in = "sql_in('".$boucle->id_table.'.'.$primary."', "; |
|
| 125 | 125 | // lecture des données du doublon "$doublons[$doublon_index[] = " |
| 126 | 126 | // Attention : boucle->doublons désigne une variable qu'on affecte |
| 127 | - $debut_doub = '$doublons[' . (!$not ? '' : ($boucle->doublons . '[]= ')); |
|
| 127 | + $debut_doub = '$doublons['.(!$not ? '' : ($boucle->doublons.'[]= ')); |
|
| 128 | 128 | |
| 129 | 129 | // le debut complet du code des doublons |
| 130 | - $debut_doub = $debut_in . $debut_doub; |
|
| 130 | + $debut_doub = $debut_in.$debut_doub; |
|
| 131 | 131 | |
| 132 | 132 | // nom du doublon "('article' . 'nom')]" |
| 133 | 133 | $fin_doub = "($nom)]"; |
@@ -137,22 +137,22 @@ discard block |
||
| 137 | 137 | foreach ($boucle->where as $k => $w) { |
| 138 | 138 | if (strpos($w[0], $debut_doub) === 0) { |
| 139 | 139 | // fusionner le sql_in (du where) |
| 140 | - $boucle->where[$k][0] = $debut_doub . $fin_doub . ' . ' . substr($w[0], strlen($debut_in)); |
|
| 140 | + $boucle->where[$k][0] = $debut_doub.$fin_doub.' . '.substr($w[0], strlen($debut_in)); |
|
| 141 | 141 | // fusionner l'initialisation (du hash) pour faire plus joli |
| 142 | 142 | $x = strpos($boucle->hash, $init_comment); |
| 143 | 143 | $len = strlen($init_comment); |
| 144 | 144 | $boucle->hash = |
| 145 | - substr($boucle->hash, 0, $x + $len) . $init_code . substr($boucle->hash, $x + $len); |
|
| 145 | + substr($boucle->hash, 0, $x + $len).$init_code.substr($boucle->hash, $x + $len); |
|
| 146 | 146 | |
| 147 | 147 | return; |
| 148 | 148 | } |
| 149 | 149 | } |
| 150 | 150 | |
| 151 | 151 | // mettre l'ensemble dans un tableau pour que ce ne soit pas vu comme une constante |
| 152 | - $boucle->where[] = [$debut_doub . $fin_doub . ", '" . $not . "')"]; |
|
| 152 | + $boucle->where[] = [$debut_doub.$fin_doub.", '".$not."')"]; |
|
| 153 | 153 | |
| 154 | 154 | // déclarer le doublon s'il n'existe pas encore |
| 155 | - $boucle->hash .= $init_comment . $init_code; |
|
| 155 | + $boucle->hash .= $init_comment.$init_code; |
|
| 156 | 156 | |
| 157 | 157 | |
| 158 | 158 | # la ligne suivante avait l'intention d'eviter une collecte deja faite |
@@ -214,7 +214,7 @@ discard block |
||
| 214 | 214 | $deux = $deux[0]->texte; |
| 215 | 215 | if ($deux) { |
| 216 | 216 | $boucles[$idb]->limit = |
| 217 | - 'intval($Pile[0]["debut' . $un . '"]) . ",' . $deux . '"'; |
|
| 217 | + 'intval($Pile[0]["debut'.$un.'"]) . ",'.$deux.'"'; |
|
| 218 | 218 | } else { |
| 219 | 219 | calculer_critere_DEFAUT_dist($idb, $boucles, $crit); |
| 220 | 220 | } |
@@ -276,26 +276,26 @@ discard block |
||
| 276 | 276 | $type = calculer_liste([$crit->param[1][0]], $idb, $boucles, $boucle->id_parent); |
| 277 | 277 | } |
| 278 | 278 | |
| 279 | - $debut = ($type[0] !== "'") ? "'debut'.$type" : ("'debut" . substr($type, 1)); |
|
| 279 | + $debut = ($type[0] !== "'") ? "'debut'.$type" : ("'debut".substr($type, 1)); |
|
| 280 | 280 | $boucle->modificateur['debut_nom'] = $type; |
| 281 | 281 | $partie = |
| 282 | 282 | // tester si le numero de page demande est de la forme '@yyy' |
| 283 | - 'isset($Pile[0][' . $debut . ']) ? $Pile[0][' . $debut . '] : _request(' . $debut . ");\n" |
|
| 283 | + 'isset($Pile[0]['.$debut.']) ? $Pile[0]['.$debut.'] : _request('.$debut.");\n" |
|
| 284 | 284 | . "\tif (\$debut_boucle && \$debut_boucle[0] === '@') {\n" |
| 285 | - . "\t\t" . '$debut_boucle = $Pile[0][' . $debut . '] = quete_debut_pagination(\'' . $boucle->primary . '\',$Pile[0][\'@' . $boucle->primary . '\'] = substr($debut_boucle,1),' . $pas . ',$iter);' . "\n" |
|
| 286 | - . "\t\t" . '$iter->seek(0);' . "\n" |
|
| 285 | + . "\t\t".'$debut_boucle = $Pile[0]['.$debut.'] = quete_debut_pagination(\''.$boucle->primary.'\',$Pile[0][\'@'.$boucle->primary.'\'] = substr($debut_boucle,1),'.$pas.',$iter);'."\n" |
|
| 286 | + . "\t\t".'$iter->seek(0);'."\n" |
|
| 287 | 287 | . "\t}\n" |
| 288 | - . "\t" . '$debut_boucle = intval($debut_boucle)'; |
|
| 288 | + . "\t".'$debut_boucle = intval($debut_boucle)'; |
|
| 289 | 289 | |
| 290 | 290 | $boucle->hash .= ' |
| 291 | - $command[\'pagination\'] = array((isset($Pile[0][' . $debut . ']) ? $Pile[0][' . $debut . '] : null), ' . $pas . ');'; |
|
| 291 | + $command[\'pagination\'] = array((isset($Pile[0][' . $debut.']) ? $Pile[0]['.$debut.'] : null), '.$pas.');'; |
|
| 292 | 292 | |
| 293 | 293 | $boucle->total_parties = $pas; |
| 294 | 294 | calculer_parties($boucles, $idb, $partie, 'p+'); |
| 295 | 295 | // ajouter la cle primaire dans le select pour pouvoir gerer la pagination referencee par @id |
| 296 | 296 | // sauf si pas de primaire, ou si primaire composee |
| 297 | 297 | // dans ce cas, on ne sait pas gerer une pagination indirecte |
| 298 | - $t = $boucle->id_table . '.' . $boucle->primary; |
|
| 298 | + $t = $boucle->id_table.'.'.$boucle->primary; |
|
| 299 | 299 | if ( |
| 300 | 300 | $boucle->primary |
| 301 | 301 | and !preg_match('/[,\s]/', $boucle->primary) |
@@ -342,24 +342,24 @@ discard block |
||
| 342 | 342 | $boucle->hash .= ' |
| 343 | 343 | // RECHERCHE' |
| 344 | 344 | . ($crit->cond ? ' |
| 345 | - if (!strlen(' . $quoi . ')){ |
|
| 345 | + if (!strlen(' . $quoi.')){ |
|
| 346 | 346 | list($rech_select, $rech_where) = array("0 as points",""); |
| 347 | - } else' : '') . ' |
|
| 347 | + } else' : '').' |
|
| 348 | 348 | { |
| 349 | 349 | $prepare_recherche = charger_fonction(\'prepare_recherche\', \'inc\'); |
| 350 | - list($rech_select, $rech_where) = $prepare_recherche(' . $quoi . ', "' . $boucle->id_table . '", "' . $crit->cond . '","' . $boucle->sql_serveur . '",' . $_modificateur . ',"' . $boucle->primary . '"); |
|
| 350 | + list($rech_select, $rech_where) = $prepare_recherche(' . $quoi.', "'.$boucle->id_table.'", "'.$crit->cond.'","'.$boucle->sql_serveur.'",'.$_modificateur.',"'.$boucle->primary.'"); |
|
| 351 | 351 | } |
| 352 | 352 | '; |
| 353 | 353 | |
| 354 | 354 | |
| 355 | - $t = $boucle->id_table . '.' . $boucle->primary; |
|
| 355 | + $t = $boucle->id_table.'.'.$boucle->primary; |
|
| 356 | 356 | if (!in_array($t, $boucles[$idb]->select)) { |
| 357 | 357 | $boucle->select[] = $t; |
| 358 | 358 | } # pour postgres, neuneu ici |
| 359 | 359 | // jointure uniquement sur le serveur principal |
| 360 | 360 | // (on ne peut joindre une table d'un serveur distant avec la table des resultats du serveur principal) |
| 361 | 361 | if (!$boucle->sql_serveur) { |
| 362 | - $boucle->join['resultats'] = ["'" . $boucle->id_table . "'", "'id'", "'" . $boucle->primary . "'"]; |
|
| 362 | + $boucle->join['resultats'] = ["'".$boucle->id_table."'", "'id'", "'".$boucle->primary."'"]; |
|
| 363 | 363 | $boucle->from['resultats'] = 'spip_resultats'; |
| 364 | 364 | } |
| 365 | 365 | $boucle->select[] = '$rech_select'; |
@@ -426,7 +426,7 @@ discard block |
||
| 426 | 426 | $c = |
| 427 | 427 | [ |
| 428 | 428 | "'OR'", |
| 429 | - ["'='", "'$table." . "id_trad'", "'$table.$prim'"], |
|
| 429 | + ["'='", "'$table."."id_trad'", "'$table.$prim'"], |
|
| 430 | 430 | ["'='", "'$table.id_trad'", "'0'"] |
| 431 | 431 | ]; |
| 432 | 432 | $boucle->where[] = ($crit->not ? ["'NOT'", $c] : $c); |
@@ -449,13 +449,13 @@ discard block |
||
| 449 | 449 | $boucle = &$boucles[$idb]; |
| 450 | 450 | $arg = kwote(calculer_argument_precedent($idb, 'id_parent', $boucles)); |
| 451 | 451 | $id_parent = $GLOBALS['exceptions_des_tables'][$boucle->id_table]['id_parent'] ?? 'id_parent'; |
| 452 | - $mparent = $boucle->id_table . '.' . $id_parent; |
|
| 452 | + $mparent = $boucle->id_table.'.'.$id_parent; |
|
| 453 | 453 | |
| 454 | 454 | if ($boucle->type_requete == 'rubriques' or isset($GLOBALS['exceptions_des_tables'][$boucle->id_table]['id_parent'])) { |
| 455 | 455 | $boucle->where[] = ["'='", "'$mparent'", $arg]; |
| 456 | 456 | } // le cas FORUMS est gere dans le plugin forum, dans la fonction critere_FORUMS_meme_parent_dist() |
| 457 | 457 | else { |
| 458 | - return (['zbug_critere_inconnu', ['critere' => $crit->op . ' ' . $boucle->type_requete]]); |
|
| 458 | + return (['zbug_critere_inconnu', ['critere' => $crit->op.' '.$boucle->type_requete]]); |
|
| 459 | 459 | } |
| 460 | 460 | } |
| 461 | 461 | |
@@ -508,16 +508,15 @@ discard block |
||
| 508 | 508 | if (count(trouver_champs_decomposes($champ, $desc)) > 1) { |
| 509 | 509 | $decompose = decompose_champ_id_objet($champ); |
| 510 | 510 | $champ = array_shift($decompose); |
| 511 | - $boucle->where[] = ["'='", _q($cle . '.' . reset($decompose)), '"' . sql_quote(end($decompose)) . '"']; |
|
| 511 | + $boucle->where[] = ["'='", _q($cle.'.'.reset($decompose)), '"'.sql_quote(end($decompose)).'"']; |
|
| 512 | 512 | } |
| 513 | 513 | } else { |
| 514 | 514 | $cle = $boucle->id_table; |
| 515 | 515 | } |
| 516 | 516 | |
| 517 | - $c = "sql_in('$cle" . ".$champ', calcul_branche_in($arg)" |
|
| 518 | - . ($not ? ", 'NOT'" : '') . ')'; |
|
| 519 | - $boucle->where[] = !$crit->cond ? $c : |
|
| 520 | - ("($arg ? $c : " . ($not ? "'0=1'" : "'1=1'") . ')'); |
|
| 517 | + $c = "sql_in('$cle".".$champ', calcul_branche_in($arg)" |
|
| 518 | + . ($not ? ", 'NOT'" : '').')'; |
|
| 519 | + $boucle->where[] = !$crit->cond ? $c : ("($arg ? $c : ".($not ? "'0=1'" : "'1=1'").')'); |
|
| 521 | 520 | } |
| 522 | 521 | |
| 523 | 522 | /** |
@@ -537,9 +536,9 @@ discard block |
||
| 537 | 536 | $not = ($crit->not ? 'NOT' : ''); |
| 538 | 537 | $serveur = $boucle->sql_serveur; |
| 539 | 538 | |
| 540 | - $c = "sql_in('" . |
|
| 541 | - $boucle->id_table . '.' . $boucle->primary |
|
| 542 | - . "', lister_objets_avec_logos('" . $boucle->primary . "'), '$not', '$serveur')"; |
|
| 539 | + $c = "sql_in('". |
|
| 540 | + $boucle->id_table.'.'.$boucle->primary |
|
| 541 | + . "', lister_objets_avec_logos('".$boucle->primary."'), '$not', '$serveur')"; |
|
| 543 | 542 | |
| 544 | 543 | $boucle->where[] = $c; |
| 545 | 544 | } |
@@ -571,7 +570,7 @@ discard block |
||
| 571 | 570 | $t = table_objet_sql($r[1]); |
| 572 | 571 | $t = array_search($t, $boucles[$idb]->from); |
| 573 | 572 | if ($t) { |
| 574 | - $t .= '.' . $r[2]; |
|
| 573 | + $t .= '.'.$r[2]; |
|
| 575 | 574 | } |
| 576 | 575 | } |
| 577 | 576 | } else { |
@@ -586,7 +585,7 @@ discard block |
||
| 586 | 585 | $boucles[$idb]->select[] = $t; |
| 587 | 586 | } |
| 588 | 587 | } else { |
| 589 | - return (['zbug_critere_inconnu', ['critere' => $crit->op . ' ?']]); |
|
| 588 | + return (['zbug_critere_inconnu', ['critere' => $crit->op.' ?']]); |
|
| 590 | 589 | } |
| 591 | 590 | } |
| 592 | 591 | |
@@ -656,26 +655,26 @@ discard block |
||
| 656 | 655 | (false !== $i = strpos($boucle->order[$n - 1], 'ASC')) |
| 657 | 656 | or (false !== $i = strpos($boucle->order[$n - 1], 'DESC')) |
| 658 | 657 | ) { |
| 659 | - $boucle->order[$n - 1] = substr_replace($boucle->order[$n - 1], "' . " . $boucle->modificateur['collate'] . " . ' ", $i, 0); |
|
| 658 | + $boucle->order[$n - 1] = substr_replace($boucle->order[$n - 1], "' . ".$boucle->modificateur['collate']." . ' ", $i, 0); |
|
| 660 | 659 | } else { |
| 661 | - $boucle->order[$n - 1] .= ' . ' . $boucle->modificateur['collate']; |
|
| 660 | + $boucle->order[$n - 1] .= ' . '.$boucle->modificateur['collate']; |
|
| 662 | 661 | } |
| 663 | 662 | } |
| 664 | 663 | } else { |
| 665 | - return (['zbug_critere_inconnu', ['critere' => $crit->op . ' ' . (is_countable($boucles[$idb]->order) ? count($boucles[$idb]->order) : 0)]]); |
|
| 664 | + return (['zbug_critere_inconnu', ['critere' => $crit->op.' '.(is_countable($boucles[$idb]->order) ? count($boucles[$idb]->order) : 0)]]); |
|
| 666 | 665 | } |
| 667 | 666 | } |
| 668 | 667 | |
| 669 | 668 | // https://code.spip.net/@calculer_critere_arg_dynamique |
| 670 | 669 | function calculer_critere_arg_dynamique($idb, &$boucles, $crit, $suffix = '') { |
| 671 | 670 | $boucle = $boucles[$idb]; |
| 672 | - $alt = "('" . $boucle->id_table . '.\' . $x' . $suffix . ')'; |
|
| 673 | - $var = '$champs_' . $idb; |
|
| 671 | + $alt = "('".$boucle->id_table.'.\' . $x'.$suffix.')'; |
|
| 672 | + $var = '$champs_'.$idb; |
|
| 674 | 673 | $desc = (strpos($boucle->in, (string) "static $var =") !== false); |
| 675 | 674 | if (!$desc) { |
| 676 | 675 | $desc = $boucle->show['field']; |
| 677 | 676 | $desc = implode(',', array_map('_q', array_keys($desc))); |
| 678 | - $boucles[$idb]->in .= "\n\tstatic $var = array(" . $desc . ');'; |
|
| 677 | + $boucles[$idb]->in .= "\n\tstatic $var = array(".$desc.');'; |
|
| 679 | 678 | } |
| 680 | 679 | if ($desc) { |
| 681 | 680 | $alt = "(in_array(\$x, $var) ? $alt :(\$x$suffix))"; |
@@ -750,7 +749,7 @@ discard block |
||
| 750 | 749 | $sens = " . ' DESC'"; |
| 751 | 750 | } |
| 752 | 751 | if (isset($boucle->modificateur['collate'])) { |
| 753 | - $collecte = ' . ' . $boucle->modificateur['collate']; |
|
| 752 | + $collecte = ' . '.$boucle->modificateur['collate']; |
|
| 754 | 753 | } |
| 755 | 754 | |
| 756 | 755 | // Pour chaque paramètre du critère |
@@ -772,14 +771,14 @@ discard block |
||
| 772 | 771 | if (preg_match(',^(\w+)[\s]+(.*)$,', $par, $m)) { |
| 773 | 772 | $expression = trim($m[1]); |
| 774 | 773 | $champ = trim($m[2]); |
| 775 | - if (function_exists($f = 'calculer_critere_par_expression_' . $expression)) { |
|
| 774 | + if (function_exists($f = 'calculer_critere_par_expression_'.$expression)) { |
|
| 776 | 775 | $order = $f($idb, $boucles, $crit, $tri, $champ); |
| 777 | 776 | } else { |
| 778 | - return ['zbug_critere_inconnu', ['critere' => $crit->op . " $par"]]; |
|
| 777 | + return ['zbug_critere_inconnu', ['critere' => $crit->op." $par"]]; |
|
| 779 | 778 | } |
| 780 | 779 | |
| 781 | 780 | // tris de la forme {par champ} ou {par FONCTION(champ)} |
| 782 | - } elseif (preg_match(',^' . CHAMP_SQL_PLUS_FONC . '$,is', $par, $match)) { |
|
| 781 | + } elseif (preg_match(',^'.CHAMP_SQL_PLUS_FONC.'$,is', $par, $match)) { |
|
| 783 | 782 | // {par FONCTION(champ)} |
| 784 | 783 | if (count($match) > 2) { |
| 785 | 784 | $par = substr($match[2], 1, -1); |
@@ -789,7 +788,7 @@ discard block |
||
| 789 | 788 | if ($par == 'hasard') { |
| 790 | 789 | $order = calculer_critere_par_hasard($idb, $boucles, $crit); |
| 791 | 790 | } elseif ($par == 'date' and !empty($boucle->show['date'])) { |
| 792 | - $order = "'" . $boucle->id_table . '.' . $boucle->show['date'] . "'"; |
|
| 791 | + $order = "'".$boucle->id_table.'.'.$boucle->show['date']."'"; |
|
| 793 | 792 | } else { |
| 794 | 793 | // cas général {par champ}, {par table.champ}, ... |
| 795 | 794 | $order = calculer_critere_par_champ($idb, $boucles, $crit, $par); |
@@ -798,7 +797,7 @@ discard block |
||
| 798 | 797 | |
| 799 | 798 | // on ne sait pas traiter… |
| 800 | 799 | else { |
| 801 | - return ['zbug_critere_inconnu', ['critere' => $crit->op . " $par"]]; |
|
| 800 | + return ['zbug_critere_inconnu', ['critere' => $crit->op." $par"]]; |
|
| 802 | 801 | } |
| 803 | 802 | |
| 804 | 803 | // En cas d'erreur de squelette retournée par une fonction |
@@ -818,14 +817,14 @@ discard block |
||
| 818 | 817 | |
| 819 | 818 | if ($fct) { |
| 820 | 819 | if (preg_match("/^\s*'(.*)'\s*$/", $order, $r)) { |
| 821 | - $order = "'$fct(" . $r[1] . ")'"; |
|
| 820 | + $order = "'$fct(".$r[1].")'"; |
|
| 822 | 821 | } else { |
| 823 | 822 | $order = "'$fct(' . $order . ')'"; |
| 824 | 823 | } |
| 825 | 824 | } |
| 826 | - $t = $order . $collecte . $sens; |
|
| 825 | + $t = $order.$collecte.$sens; |
|
| 827 | 826 | if (preg_match("/^(.*)'\s*\.\s*'([^']*')$/", $t, $r)) { |
| 828 | - $t = $r[1] . $r[2]; |
|
| 827 | + $t = $r[1].$r[2]; |
|
| 829 | 828 | } |
| 830 | 829 | |
| 831 | 830 | $boucle->order[] = $t; |
@@ -875,16 +874,16 @@ discard block |
||
| 875 | 874 | function calculer_critere_par_expression_num($idb, &$boucles, $crit, $tri, $champ) { |
| 876 | 875 | $_champ = calculer_critere_par_champ($idb, $boucles, $crit, $champ, true); |
| 877 | 876 | if (is_array($_champ)) { |
| 878 | - return ['zbug_critere_inconnu', ['critere' => $crit->op . " num $champ"]]; |
|
| 877 | + return ['zbug_critere_inconnu', ['critere' => $crit->op." num $champ"]]; |
|
| 879 | 878 | } |
| 880 | 879 | $boucle = &$boucles[$idb]; |
| 881 | - $texte = '0+' . $_champ; |
|
| 880 | + $texte = '0+'.$_champ; |
|
| 882 | 881 | $suite = calculer_liste($tri, $idb, $boucles, $boucle->id_parent); |
| 883 | 882 | if ($suite !== "''") { |
| 884 | - $texte = "\" . ((\$x = $suite) ? ('$texte' . \$x) : '0')" . ' . "'; |
|
| 883 | + $texte = "\" . ((\$x = $suite) ? ('$texte' . \$x) : '0')".' . "'; |
|
| 885 | 884 | } |
| 886 | - $asnum = 'num' . ($boucle->order ? count($boucle->order) : ''); |
|
| 887 | - $boucle->select[] = $texte . " AS $asnum"; |
|
| 885 | + $asnum = 'num'.($boucle->order ? count($boucle->order) : ''); |
|
| 886 | + $boucle->select[] = $texte." AS $asnum"; |
|
| 888 | 887 | |
| 889 | 888 | $orderassinum = calculer_critere_par_expression_sinum($idb, $boucles, $crit, $tri, $champ); |
| 890 | 889 | $orderassinum = trim($orderassinum, "'"); |
@@ -913,13 +912,13 @@ discard block |
||
| 913 | 912 | function calculer_critere_par_expression_sinum($idb, &$boucles, $crit, $tri, $champ) { |
| 914 | 913 | $_champ = calculer_critere_par_champ($idb, $boucles, $crit, $champ, true); |
| 915 | 914 | if (is_array($_champ)) { |
| 916 | - return ['zbug_critere_inconnu', ['critere' => $crit->op . " sinum $champ"]]; |
|
| 915 | + return ['zbug_critere_inconnu', ['critere' => $crit->op." sinum $champ"]]; |
|
| 917 | 916 | } |
| 918 | 917 | $boucle = &$boucles[$idb]; |
| 919 | - $texte = '0+' . $_champ; |
|
| 918 | + $texte = '0+'.$_champ; |
|
| 920 | 919 | $suite = calculer_liste($tri, $idb, $boucles, $boucle->id_parent); |
| 921 | 920 | if ($suite !== "''") { |
| 922 | - $texte = "\" . ((\$x = $suite) ? ('$texte' . \$x) : '0')" . ' . "'; |
|
| 921 | + $texte = "\" . ((\$x = $suite) ? ('$texte' . \$x) : '0')".' . "'; |
|
| 923 | 922 | } |
| 924 | 923 | |
| 925 | 924 | $as = false; |
@@ -935,8 +934,8 @@ discard block |
||
| 935 | 934 | } |
| 936 | 935 | |
| 937 | 936 | if (!$as) { |
| 938 | - $as = 'sinum' . ($boucle->order ? count($boucle->order) : ''); |
|
| 939 | - $boucle->select[] = $select . $as; |
|
| 937 | + $as = 'sinum'.($boucle->order ? count($boucle->order) : ''); |
|
| 938 | + $boucle->select[] = $select.$as; |
|
| 940 | 939 | } |
| 941 | 940 | $order = "'$as'"; |
| 942 | 941 | return $order; |
@@ -961,10 +960,10 @@ discard block |
||
| 961 | 960 | function calculer_critere_par_expression_multi($idb, &$boucles, $crit, $tri, $champ) { |
| 962 | 961 | $_champ = calculer_critere_par_champ($idb, $boucles, $crit, $champ, true); |
| 963 | 962 | if (is_array($_champ)) { |
| 964 | - return ['zbug_critere_inconnu', ['critere' => $crit->op . " multi $champ"]]; |
|
| 963 | + return ['zbug_critere_inconnu', ['critere' => $crit->op." multi $champ"]]; |
|
| 965 | 964 | } |
| 966 | 965 | $boucle = &$boucles[$idb]; |
| 967 | - $boucle->select[] = "\".sql_multi('" . $_champ . "', \$GLOBALS['spip_lang']).\""; |
|
| 966 | + $boucle->select[] = "\".sql_multi('".$_champ."', \$GLOBALS['spip_lang']).\""; |
|
| 968 | 967 | $order = "'multi'"; |
| 969 | 968 | return $order; |
| 970 | 969 | } |
@@ -990,7 +989,7 @@ discard block |
||
| 990 | 989 | |
| 991 | 990 | // le champ existe dans la table, pas de souci (le plus commun) |
| 992 | 991 | if (isset($desc['field'][$par])) { |
| 993 | - $par = $boucle->id_table . '.' . $par; |
|
| 992 | + $par = $boucle->id_table.'.'.$par; |
|
| 994 | 993 | } |
| 995 | 994 | // le champ est peut être une jointure |
| 996 | 995 | else { |
@@ -1011,24 +1010,24 @@ discard block |
||
| 1011 | 1010 | // Sinon on cherche le champ dans les tables possibles de jointures |
| 1012 | 1011 | // Si la table est déjà dans le from, on la réutilise. |
| 1013 | 1012 | if ($infos = chercher_champ_dans_tables($champ, $boucle->from, $boucle->sql_serveur, $table)) { |
| 1014 | - $par = $infos['alias'] . '.' . $champ; |
|
| 1013 | + $par = $infos['alias'].'.'.$champ; |
|
| 1015 | 1014 | } elseif ( |
| 1016 | 1015 | $boucle->jointures_explicites |
| 1017 | 1016 | and $alias = trouver_jointure_champ($champ, $boucle, explode(' ', $boucle->jointures_explicites), false, $table) |
| 1018 | 1017 | ) { |
| 1019 | - $par = $alias . '.' . $champ; |
|
| 1018 | + $par = $alias.'.'.$champ; |
|
| 1020 | 1019 | } elseif ($alias = trouver_jointure_champ($champ, $boucle, $boucle->jointures, false, $table)) { |
| 1021 | - $par = $alias . '.' . $champ; |
|
| 1020 | + $par = $alias.'.'.$champ; |
|
| 1022 | 1021 | // en spécifiant directement l'alias {par L2.titre} (situation hasardeuse tout de même) |
| 1023 | 1022 | } elseif ( |
| 1024 | 1023 | $table_alias |
| 1025 | 1024 | and isset($boucle->from[$table_alias]) |
| 1026 | 1025 | and $infos = chercher_champ_dans_tables($champ, $boucle->from, $boucle->sql_serveur, $boucle->from[$table_alias]) |
| 1027 | 1026 | ) { |
| 1028 | - $par = $infos['alias'] . '.' . $champ; |
|
| 1027 | + $par = $infos['alias'].'.'.$champ; |
|
| 1029 | 1028 | } elseif ($table) { |
| 1030 | 1029 | // On avait table + champ, mais on ne les a pas trouvés |
| 1031 | - return ['zbug_critere_inconnu', ['critere' => $crit->op . " $par"]]; |
|
| 1030 | + return ['zbug_critere_inconnu', ['critere' => $crit->op." $par"]]; |
|
| 1032 | 1031 | } else { |
| 1033 | 1032 | // Sinon tant pis, ca doit etre un champ synthetise (cf points) |
| 1034 | 1033 | } |
@@ -1052,7 +1051,7 @@ discard block |
||
| 1052 | 1051 | if (!$t) { |
| 1053 | 1052 | $t = trouver_jointure_champ($champ, $boucle); |
| 1054 | 1053 | } |
| 1055 | - return !$t ? '' : ("'" . $t . '.' . $champ . "'"); |
|
| 1054 | + return !$t ? '' : ("'".$t.'.'.$champ."'"); |
|
| 1056 | 1055 | } |
| 1057 | 1056 | |
| 1058 | 1057 | /** |
@@ -1097,9 +1096,9 @@ discard block |
||
| 1097 | 1096 | $boucle->default_order[] = ' DESC'; |
| 1098 | 1097 | } |
| 1099 | 1098 | } else { |
| 1100 | - $t = $boucle->order[$n - 1] . " . $order"; |
|
| 1099 | + $t = $boucle->order[$n - 1]." . $order"; |
|
| 1101 | 1100 | if (preg_match("/^(.*)'\s*\.\s*'([^']*')$/", $t, $r)) { |
| 1102 | - $t = $r[1] . $r[2]; |
|
| 1101 | + $t = $r[1].$r[2]; |
|
| 1103 | 1102 | } |
| 1104 | 1103 | $boucle->order[$n - 1] = $t; |
| 1105 | 1104 | } |
@@ -1134,7 +1133,7 @@ discard block |
||
| 1134 | 1133 | $_order = array_pop($boucle->order); |
| 1135 | 1134 | |
| 1136 | 1135 | $_liste = calculer_liste($crit->param[1], [], $boucles, $boucles[$idb]->id_parent); |
| 1137 | - $boucle->order[] = "'FIELD(' . $_order . ',' . ((\$zl=formate_liste_critere_par_ordre_liste($_liste,'" . $boucle->sql_serveur . "')) ? \$zl : '0').')'$sens"; |
|
| 1136 | + $boucle->order[] = "'FIELD(' . $_order . ',' . ((\$zl=formate_liste_critere_par_ordre_liste($_liste,'".$boucle->sql_serveur."')) ? \$zl : '0').')'$sens"; |
|
| 1138 | 1137 | } |
| 1139 | 1138 | |
| 1140 | 1139 | |
@@ -1143,7 +1142,7 @@ discard block |
||
| 1143 | 1142 | $params = $crit->param; |
| 1144 | 1143 | |
| 1145 | 1144 | if ((is_countable($params) ? count($params) : 0) < 1) { |
| 1146 | - return ['zbug_critere_inconnu', ['critere' => $crit->op . ' ?']]; |
|
| 1145 | + return ['zbug_critere_inconnu', ['critere' => $crit->op.' ?']]; |
|
| 1147 | 1146 | } |
| 1148 | 1147 | |
| 1149 | 1148 | $boucle = &$boucles[$idb]; |
@@ -1164,7 +1163,7 @@ discard block |
||
| 1164 | 1163 | if (((is_countable($date) ? count($date) : 0) == 1) and ($date[0]->type == 'texte')) { |
| 1165 | 1164 | $date = $date[0]->texte; |
| 1166 | 1165 | if (!isset($fields[$date])) { |
| 1167 | - return ['zbug_critere_inconnu', ['critere' => $crit->op . ' ' . $date]]; |
|
| 1166 | + return ['zbug_critere_inconnu', ['critere' => $crit->op.' '.$date]]; |
|
| 1168 | 1167 | } |
| 1169 | 1168 | } else { |
| 1170 | 1169 | $a = calculer_liste($date, $idb, $boucles, $parent); |
@@ -1176,38 +1175,38 @@ discard block |
||
| 1176 | 1175 | $date = "'.(($cond)\n?\$a:\"$defaut\").'"; |
| 1177 | 1176 | } |
| 1178 | 1177 | $annee = $params ? array_shift($params) : ''; |
| 1179 | - $annee = "\n" . 'sprintf("%04d", ($x = ' . |
|
| 1180 | - calculer_liste($annee, $idb, $boucles, $parent) . |
|
| 1178 | + $annee = "\n".'sprintf("%04d", ($x = '. |
|
| 1179 | + calculer_liste($annee, $idb, $boucles, $parent). |
|
| 1181 | 1180 | ') ? $x : date("Y"))'; |
| 1182 | 1181 | |
| 1183 | 1182 | $mois = $params ? array_shift($params) : ''; |
| 1184 | - $mois = "\n" . 'sprintf("%02d", ($x = ' . |
|
| 1185 | - calculer_liste($mois, $idb, $boucles, $parent) . |
|
| 1183 | + $mois = "\n".'sprintf("%02d", ($x = '. |
|
| 1184 | + calculer_liste($mois, $idb, $boucles, $parent). |
|
| 1186 | 1185 | ') ? $x : date("m"))'; |
| 1187 | 1186 | |
| 1188 | 1187 | $jour = $params ? array_shift($params) : ''; |
| 1189 | - $jour = "\n" . 'sprintf("%02d", ($x = ' . |
|
| 1190 | - calculer_liste($jour, $idb, $boucles, $parent) . |
|
| 1188 | + $jour = "\n".'sprintf("%02d", ($x = '. |
|
| 1189 | + calculer_liste($jour, $idb, $boucles, $parent). |
|
| 1191 | 1190 | ') ? $x : date("d"))'; |
| 1192 | 1191 | |
| 1193 | 1192 | $annee2 = $params ? array_shift($params) : ''; |
| 1194 | - $annee2 = "\n" . 'sprintf("%04d", ($x = ' . |
|
| 1195 | - calculer_liste($annee2, $idb, $boucles, $parent) . |
|
| 1193 | + $annee2 = "\n".'sprintf("%04d", ($x = '. |
|
| 1194 | + calculer_liste($annee2, $idb, $boucles, $parent). |
|
| 1196 | 1195 | ') ? $x : date("Y"))'; |
| 1197 | 1196 | |
| 1198 | 1197 | $mois2 = $params ? array_shift($params) : ''; |
| 1199 | - $mois2 = "\n" . 'sprintf("%02d", ($x = ' . |
|
| 1200 | - calculer_liste($mois2, $idb, $boucles, $parent) . |
|
| 1198 | + $mois2 = "\n".'sprintf("%02d", ($x = '. |
|
| 1199 | + calculer_liste($mois2, $idb, $boucles, $parent). |
|
| 1201 | 1200 | ') ? $x : date("m"))'; |
| 1202 | 1201 | |
| 1203 | 1202 | $jour2 = $params ? array_shift($params) : ''; |
| 1204 | - $jour2 = "\n" . 'sprintf("%02d", ($x = ' . |
|
| 1205 | - calculer_liste($jour2, $idb, $boucles, $parent) . |
|
| 1203 | + $jour2 = "\n".'sprintf("%02d", ($x = '. |
|
| 1204 | + calculer_liste($jour2, $idb, $boucles, $parent). |
|
| 1206 | 1205 | ') ? $x : date("d"))'; |
| 1207 | 1206 | |
| 1208 | - $date = $boucle->id_table . ".$date"; |
|
| 1207 | + $date = $boucle->id_table.".$date"; |
|
| 1209 | 1208 | |
| 1210 | - $quote_end = ",'" . $boucle->sql_serveur . "','text'"; |
|
| 1209 | + $quote_end = ",'".$boucle->sql_serveur."','text'"; |
|
| 1211 | 1210 | if ($type == 'jour') { |
| 1212 | 1211 | $boucle->where[] = [ |
| 1213 | 1212 | "'='", |
@@ -1279,14 +1278,13 @@ discard block |
||
| 1279 | 1278 | [$a21, $a22] = calculer_critere_parties_aux($idb, $boucles, $a2); |
| 1280 | 1279 | |
| 1281 | 1280 | if (($op == ',') && (is_numeric($a11) && (is_numeric($a21)))) { |
| 1282 | - $boucle->limit = $a11 . ',' . $a21; |
|
| 1281 | + $boucle->limit = $a11.','.$a21; |
|
| 1283 | 1282 | } else { |
| 1284 | 1283 | // 3 dans {1/3}, {2,3} ou {1,n-3} |
| 1285 | 1284 | $boucle->total_parties = ($a21 != 'n') ? $a21 : $a22; |
| 1286 | 1285 | // 2 dans {2/3}, {2,5}, {n-2,1} |
| 1287 | 1286 | $partie = ($a11 != 'n') ? $a11 : $a12; |
| 1288 | - $mode = (($op == '/') ? '/' : |
|
| 1289 | - (($a11 == 'n') ? '-' : '+') . (($a21 == 'n') ? '-' : '+')); |
|
| 1287 | + $mode = (($op == '/') ? '/' : (($a11 == 'n') ? '-' : '+').(($a21 == 'n') ? '-' : '+')); |
|
| 1290 | 1288 | // cas simple {0,#ENV{truc}} compilons le en LIMIT : |
| 1291 | 1289 | if ($a11 !== 'n' and $a21 !== 'n' and $mode == '++' and $op == ',') { |
| 1292 | 1290 | $boucle->limit = |
@@ -1332,8 +1330,7 @@ discard block |
||
| 1332 | 1330 | // {1/3} |
| 1333 | 1331 | if ($op1 == '/') { |
| 1334 | 1332 | $pmoins1 = is_numeric($debut) ? ($debut - 1) : "($debut-1)"; |
| 1335 | - $totpos = is_numeric($total_parties) ? ($total_parties) : |
|
| 1336 | - "($total_parties ? $total_parties : 1)"; |
|
| 1333 | + $totpos = is_numeric($total_parties) ? ($total_parties) : "($total_parties ? $total_parties : 1)"; |
|
| 1337 | 1334 | $fin = "ceil(($nombre_boucle * $debut )/$totpos) - 1"; |
| 1338 | 1335 | $debut = !$pmoins1 ? 0 : "ceil(($nombre_boucle * $pmoins1)/$totpos);"; |
| 1339 | 1336 | } else { |
@@ -1344,15 +1341,13 @@ discard block |
||
| 1344 | 1341 | |
| 1345 | 1342 | // cas {x,n-1} |
| 1346 | 1343 | if ($op2 == '-') { |
| 1347 | - $fin = '$debut_boucle + ' . $nombre_boucle . ' - ' |
|
| 1348 | - . (is_numeric($total_parties) ? ($total_parties + 1) : |
|
| 1349 | - ($total_parties . ' - 1')); |
|
| 1344 | + $fin = '$debut_boucle + '.$nombre_boucle.' - ' |
|
| 1345 | + . (is_numeric($total_parties) ? ($total_parties + 1) : ($total_parties.' - 1')); |
|
| 1350 | 1346 | } else { |
| 1351 | 1347 | // {x,1} ou {pagination} |
| 1352 | 1348 | $fin = '$debut_boucle' |
| 1353 | 1349 | . (is_numeric($total_parties) ? |
| 1354 | - (($total_parties == 1) ? '' : (' + ' . ($total_parties - 1))) : |
|
| 1355 | - ('+' . $total_parties . ' - 1')); |
|
| 1350 | + (($total_parties == 1) ? '' : (' + '.($total_parties - 1))) : ('+'.$total_parties.' - 1')); |
|
| 1356 | 1351 | } |
| 1357 | 1352 | |
| 1358 | 1353 | // {pagination}, gerer le debut_xx=-1 pour tout voir |
@@ -1370,11 +1365,11 @@ discard block |
||
| 1370 | 1365 | // Utiliser min pour rabattre $fin_boucle sur total_boucle. |
| 1371 | 1366 | |
| 1372 | 1367 | $boucles[$id_boucle]->mode_partie = "\n\t" |
| 1373 | - . '$debut_boucle = ' . $debut . ";\n " |
|
| 1368 | + . '$debut_boucle = '.$debut.";\n " |
|
| 1374 | 1369 | . "\$debut_boucle = intval(\$debut_boucle);\n " |
| 1375 | - . '$fin_boucle = min(' . $fin . ", \$Numrows['$id_boucle']['total'] - 1);\n " |
|
| 1376 | - . '$Numrows[\'' . $id_boucle . "']['grand_total'] = \$Numrows['$id_boucle']['total'];\n " |
|
| 1377 | - . '$Numrows[\'' . $id_boucle . '\']["total"] = max(0,$fin_boucle - $debut_boucle + 1);' |
|
| 1370 | + . '$fin_boucle = min('.$fin.", \$Numrows['$id_boucle']['total'] - 1);\n " |
|
| 1371 | + . '$Numrows[\''.$id_boucle."']['grand_total'] = \$Numrows['$id_boucle']['total'];\n " |
|
| 1372 | + . '$Numrows[\''.$id_boucle.'\']["total"] = max(0,$fin_boucle - $debut_boucle + 1);' |
|
| 1378 | 1373 | . "\n\tif (\$debut_boucle>0" |
| 1379 | 1374 | . " AND \$debut_boucle < \$Numrows['$id_boucle']['grand_total']" |
| 1380 | 1375 | . " AND \$iter->seek(\$debut_boucle,'continue'))" |
@@ -1459,16 +1454,16 @@ discard block |
||
| 1459 | 1454 | // critere personnalise ? |
| 1460 | 1455 | if ( |
| 1461 | 1456 | (!$serveur or |
| 1462 | - ((!function_exists($f = 'critere_' . $serveur . '_' . $table . '_' . $critere)) |
|
| 1463 | - and (!function_exists($f = $f . '_dist')) |
|
| 1464 | - and (!function_exists($f = 'critere_' . $serveur . '_' . $critere)) |
|
| 1465 | - and (!function_exists($f = $f . '_dist')) |
|
| 1457 | + ((!function_exists($f = 'critere_'.$serveur.'_'.$table.'_'.$critere)) |
|
| 1458 | + and (!function_exists($f = $f.'_dist')) |
|
| 1459 | + and (!function_exists($f = 'critere_'.$serveur.'_'.$critere)) |
|
| 1460 | + and (!function_exists($f = $f.'_dist')) |
|
| 1466 | 1461 | ) |
| 1467 | 1462 | ) |
| 1468 | - and (!function_exists($f = 'critere_' . $table . '_' . $critere)) |
|
| 1469 | - and (!function_exists($f = $f . '_dist')) |
|
| 1470 | - and (!function_exists($f = 'critere_' . $critere)) |
|
| 1471 | - and (!function_exists($f = $f . '_dist')) |
|
| 1463 | + and (!function_exists($f = 'critere_'.$table.'_'.$critere)) |
|
| 1464 | + and (!function_exists($f = $f.'_dist')) |
|
| 1465 | + and (!function_exists($f = 'critere_'.$critere)) |
|
| 1466 | + and (!function_exists($f = $f.'_dist')) |
|
| 1472 | 1467 | ) { |
| 1473 | 1468 | // fonction critere standard |
| 1474 | 1469 | $f = $defaut; |
@@ -1501,9 +1496,9 @@ discard block |
||
| 1501 | 1496 | */ |
| 1502 | 1497 | function kwote($lisp, $serveur = '', $type = '') { |
| 1503 | 1498 | if (preg_match(_CODE_QUOTE, $lisp, $r)) { |
| 1504 | - return $r[1] . '"' . sql_quote(str_replace(["\\'", '\\\\'], ["'", '\\'], $r[2]), $serveur, $type) . '"'; |
|
| 1499 | + return $r[1].'"'.sql_quote(str_replace(["\\'", '\\\\'], ["'", '\\'], $r[2]), $serveur, $type).'"'; |
|
| 1505 | 1500 | } else { |
| 1506 | - return "sql_quote($lisp, '$serveur', '" . str_replace("'", "\\'", $type) . "')"; |
|
| 1501 | + return "sql_quote($lisp, '$serveur', '".str_replace("'", "\\'", $type)."')"; |
|
| 1507 | 1502 | } |
| 1508 | 1503 | } |
| 1509 | 1504 | |
@@ -1525,7 +1520,7 @@ discard block |
||
| 1525 | 1520 | function critere_IN_dist($idb, &$boucles, $crit) { |
| 1526 | 1521 | $r = calculer_critere_infixe($idb, $boucles, $crit); |
| 1527 | 1522 | if (!$r) { |
| 1528 | - return (['zbug_critere_inconnu', ['critere' => $crit->op . ' ?']]); |
|
| 1523 | + return (['zbug_critere_inconnu', ['critere' => $crit->op.' ?']]); |
|
| 1529 | 1524 | } |
| 1530 | 1525 | [$arg, $op, $val, $col, $where_complement] = $r; |
| 1531 | 1526 | |
@@ -1550,8 +1545,8 @@ discard block |
||
| 1550 | 1545 | "'NOT'", |
| 1551 | 1546 | [ |
| 1552 | 1547 | "'IN'", |
| 1553 | - "'" . $boucles[$idb]->id_table . '.' . $boucles[$idb]->primary . "'", |
|
| 1554 | - ["'SELF'", "'" . $boucles[$idb]->id_table . '.' . $boucles[$idb]->primary . "'", $where] |
|
| 1548 | + "'".$boucles[$idb]->id_table.'.'.$boucles[$idb]->primary."'", |
|
| 1549 | + ["'SELF'", "'".$boucles[$idb]->id_table.'.'.$boucles[$idb]->primary."'", $where] |
|
| 1555 | 1550 | ] |
| 1556 | 1551 | ]; |
| 1557 | 1552 | } |
@@ -1569,22 +1564,22 @@ discard block |
||
| 1569 | 1564 | $descr = $boucles[$idb]->descr; |
| 1570 | 1565 | $cpt = &$num[$descr['nom']][$descr['gram']][$idb]; |
| 1571 | 1566 | |
| 1572 | - $var = '$in' . $cpt++; |
|
| 1567 | + $var = '$in'.$cpt++; |
|
| 1573 | 1568 | $x = "\n\t$var = array();"; |
| 1574 | 1569 | foreach ($val as $k => $v) { |
| 1575 | 1570 | if (preg_match(",^(\n//.*\n)?'(.*)'$,", $v, $r)) { |
| 1576 | 1571 | // optimiser le traitement des constantes |
| 1577 | 1572 | if (is_numeric($r[2])) { |
| 1578 | - $x .= "\n\t$var" . "[]= $r[2];"; |
|
| 1573 | + $x .= "\n\t$var"."[]= $r[2];"; |
|
| 1579 | 1574 | } else { |
| 1580 | - $x .= "\n\t$var" . '[]= ' . sql_quote($r[2]) . ';'; |
|
| 1575 | + $x .= "\n\t$var".'[]= '.sql_quote($r[2]).';'; |
|
| 1581 | 1576 | } |
| 1582 | 1577 | } else { |
| 1583 | 1578 | // Pour permettre de passer des tableaux de valeurs |
| 1584 | 1579 | // on repere l'utilisation brute de #ENV**{X}, |
| 1585 | 1580 | // c'est-a-dire sa traduction en ($PILE[0][X]). |
| 1586 | 1581 | // et on deballe mais en rajoutant l'anti XSS |
| 1587 | - $x .= "\n\tif (!(is_array(\$a = ($v))))\n\t\t$var" . "[]= \$a;\n\telse $var = array_merge($var, \$a);"; |
|
| 1582 | + $x .= "\n\tif (!(is_array(\$a = ($v))))\n\t\t$var"."[]= \$a;\n\telse $var = array_merge($var, \$a);"; |
|
| 1588 | 1583 | } |
| 1589 | 1584 | } |
| 1590 | 1585 | |
@@ -1598,7 +1593,7 @@ discard block |
||
| 1598 | 1593 | $boucles[$idb]->default_order[] = "((!\$zqv=sql_quote($var) OR \$zqv===\"''\") ? 0 : ('FIELD($arg,' . \$zqv . ')'))"; |
| 1599 | 1594 | } |
| 1600 | 1595 | |
| 1601 | - return "sql_in('$arg', $var" . ($crit2 == 'NOT' ? ",'NOT'" : '') . ')'; |
|
| 1596 | + return "sql_in('$arg', $var".($crit2 == 'NOT' ? ",'NOT'" : '').')'; |
|
| 1602 | 1597 | } |
| 1603 | 1598 | |
| 1604 | 1599 | /** |
@@ -1671,7 +1666,7 @@ discard block |
||
| 1671 | 1666 | $champs = array_diff($champs, array_keys($boucle->modificateur['criteres'])); |
| 1672 | 1667 | } |
| 1673 | 1668 | // nous aider en mode debug. |
| 1674 | - $boucle->debug[] = 'id_ : ' . implode(', ', $champs); |
|
| 1669 | + $boucle->debug[] = 'id_ : '.implode(', ', $champs); |
|
| 1675 | 1670 | $boucle->modificateur['id_'] = $champs; |
| 1676 | 1671 | |
| 1677 | 1672 | // créer un critère {id_xxx?} de chaque champ retenu |
@@ -1922,8 +1917,8 @@ discard block |
||
| 1922 | 1917 | "'NOT'", |
| 1923 | 1918 | [ |
| 1924 | 1919 | "'IN'", |
| 1925 | - "'" . $boucles[$idb]->id_table . '.' . $boucles[$idb]->primary . "'", |
|
| 1926 | - ["'SELF'", "'" . $boucles[$idb]->id_table . '.' . $boucles[$idb]->primary . "'", $where] |
|
| 1920 | + "'".$boucles[$idb]->id_table.'.'.$boucles[$idb]->primary."'", |
|
| 1921 | + ["'SELF'", "'".$boucles[$idb]->id_table.'.'.$boucles[$idb]->primary."'", $where] |
|
| 1927 | 1922 | ] |
| 1928 | 1923 | ]; |
| 1929 | 1924 | } |
@@ -1934,7 +1929,7 @@ discard block |
||
| 1934 | 1929 | if ($crit->cond) { |
| 1935 | 1930 | $pred = calculer_argument_precedent($idb, $col, $boucles); |
| 1936 | 1931 | if ($col === 'date' or $col === 'date_redac') { |
| 1937 | - if ($pred === "\$Pile[0]['" . $col . "']") { |
|
| 1932 | + if ($pred === "\$Pile[0]['".$col."']") { |
|
| 1938 | 1933 | $pred = "(\$Pile[0]['{$col}_default']?'':$pred)"; |
| 1939 | 1934 | } |
| 1940 | 1935 | } |
@@ -2097,7 +2092,7 @@ discard block |
||
| 2097 | 2092 | // defaire le quote des int et les passer dans sql_quote avec le bon type de champ si on le connait, int sinon |
| 2098 | 2093 | // prendre en compte le debug ou la valeur arrive avec un commentaire PHP en debut |
| 2099 | 2094 | if (preg_match(",^\\A(\s*//.*?$\s*)?\"'(-?\d+)'\"\\z,ms", $val[0], $r)) { |
| 2100 | - $val[0] = $r[1] . '"' . sql_quote($r[2], $boucle->sql_serveur, $type_cast_quote) . '"'; |
|
| 2095 | + $val[0] = $r[1].'"'.sql_quote($r[2], $boucle->sql_serveur, $type_cast_quote).'"'; |
|
| 2101 | 2096 | } |
| 2102 | 2097 | // sinon expliciter les |
| 2103 | 2098 | // sql_quote(truc) en sql_quote(truc,'',type) |
@@ -2113,14 +2108,14 @@ discard block |
||
| 2113 | 2108 | ) { |
| 2114 | 2109 | $r = $r[1] |
| 2115 | 2110 | . ((isset($r[2]) and $r[2]) ? $r[2] : ",''") |
| 2116 | - . ",'" . addslashes($type_cast_quote) . "'"; |
|
| 2111 | + . ",'".addslashes($type_cast_quote)."'"; |
|
| 2117 | 2112 | $val[0] = "sql_quote($r)"; |
| 2118 | 2113 | } |
| 2119 | 2114 | elseif ( |
| 2120 | 2115 | strpos($val[0], '@@defaultcast@@') !== false |
| 2121 | 2116 | and preg_match("/'@@defaultcast@@'\s*\)\s*\z/ms", $val[0], $r) |
| 2122 | 2117 | ) { |
| 2123 | - $val[0] = substr($val[0], 0, -strlen($r[0])) . "'" . addslashes($type_cast_quote) . "')"; |
|
| 2118 | + $val[0] = substr($val[0], 0, -strlen($r[0]))."'".addslashes($type_cast_quote)."')"; |
|
| 2124 | 2119 | } |
| 2125 | 2120 | } |
| 2126 | 2121 | |
@@ -2128,7 +2123,7 @@ discard block |
||
| 2128 | 2123 | strpos($val[0], '@@defaultcast@@') !== false |
| 2129 | 2124 | and preg_match("/'@@defaultcast@@'\s*\)\s*\z/ms", $val[0], $r) |
| 2130 | 2125 | ) { |
| 2131 | - $val[0] = substr($val[0], 0, -strlen($r[0])) . "'char')"; |
|
| 2126 | + $val[0] = substr($val[0], 0, -strlen($r[0]))."'char')"; |
|
| 2132 | 2127 | } |
| 2133 | 2128 | |
| 2134 | 2129 | // Indicateur pour permettre aux fonctionx boucle_X de modifier |
@@ -2144,7 +2139,7 @@ discard block |
||
| 2144 | 2139 | // inserer le nom de la table SQL devant le nom du champ |
| 2145 | 2140 | if ($table) { |
| 2146 | 2141 | if ($col[0] == '`') { |
| 2147 | - $arg = "$table." . substr($col, 1, -1); |
|
| 2142 | + $arg = "$table.".substr($col, 1, -1); |
|
| 2148 | 2143 | } else { |
| 2149 | 2144 | $arg = "$table.$col"; |
| 2150 | 2145 | } |
@@ -2278,9 +2273,9 @@ discard block |
||
| 2278 | 2273 | **/ |
| 2279 | 2274 | function primary_doublee($decompose, $table) { |
| 2280 | 2275 | $e1 = reset($decompose); |
| 2281 | - $e2 = "sql_quote('" . end($decompose) . "')"; |
|
| 2276 | + $e2 = "sql_quote('".end($decompose)."')"; |
|
| 2282 | 2277 | |
| 2283 | - return ["'='", "'$table." . $e1 . "'", $e2]; |
|
| 2278 | + return ["'='", "'$table.".$e1."'", $e2]; |
|
| 2284 | 2279 | } |
| 2285 | 2280 | |
| 2286 | 2281 | /** |
@@ -2319,7 +2314,7 @@ discard block |
||
| 2319 | 2314 | $checkarrivee |
| 2320 | 2315 | and is_string($checkarrivee) |
| 2321 | 2316 | and $a = table_objet($checkarrivee) |
| 2322 | - and in_array($a . '_liens', $joints) |
|
| 2317 | + and in_array($a.'_liens', $joints) |
|
| 2323 | 2318 | ) { |
| 2324 | 2319 | if ($res = calculer_lien_externe_init($boucle, $joints, $col, $desc, $cond, $checkarrivee)) { |
| 2325 | 2320 | return $res; |
@@ -2339,12 +2334,12 @@ discard block |
||
| 2339 | 2334 | // la table est déjà dans le FROM, on vérifie si le champ est utilisé. |
| 2340 | 2335 | $joindre = false; |
| 2341 | 2336 | foreach ($cols as $col) { |
| 2342 | - $c = '/\b' . $t . ".$col" . '\b/'; |
|
| 2337 | + $c = '/\b'.$t.".$col".'\b/'; |
|
| 2343 | 2338 | if (trouver_champ($c, $boucle->where)) { |
| 2344 | 2339 | $joindre = true; |
| 2345 | 2340 | } else { |
| 2346 | 2341 | // mais ca peut etre dans le FIELD pour le Having |
| 2347 | - $c = "/FIELD.$t" . ".$col,/"; |
|
| 2342 | + $c = "/FIELD.$t".".$col,/"; |
|
| 2348 | 2343 | if (trouver_champ($c, $boucle->select)) { |
| 2349 | 2344 | $joindre = true; |
| 2350 | 2345 | } |
@@ -2390,7 +2385,7 @@ discard block |
||
| 2390 | 2385 | $primary_arrivee = id_table_objet($checkarrivee); |
| 2391 | 2386 | |
| 2392 | 2387 | // [FIXME] $checkarrivee peut-il arriver avec false ???? |
| 2393 | - $intermediaire = trouver_champ_exterieur($primary_arrivee, $joints, $boucle, $checkarrivee . '_liens'); |
|
| 2388 | + $intermediaire = trouver_champ_exterieur($primary_arrivee, $joints, $boucle, $checkarrivee.'_liens'); |
|
| 2394 | 2389 | $arrivee = trouver_champ_exterieur($col, $joints, $boucle, $checkarrivee); |
| 2395 | 2390 | |
| 2396 | 2391 | if (!$intermediaire or !$arrivee) { |
@@ -2494,7 +2489,7 @@ discard block |
||
| 2494 | 2489 | } elseif ($crit->cond and ($col == 'date' or $col == 'date_redac')) { |
| 2495 | 2490 | // un critere conditionnel sur date est traite a part |
| 2496 | 2491 | // car la date est mise d'office par SPIP, |
| 2497 | - $defaut = "(\$Pile[0]['{$col}_default']?'':\$Pile[0]['" . $col . "'])"; |
|
| 2492 | + $defaut = "(\$Pile[0]['{$col}_default']?'':\$Pile[0]['".$col."'])"; |
|
| 2498 | 2493 | } |
| 2499 | 2494 | |
| 2500 | 2495 | $val = calculer_argument_precedent($idb, $val, $boucles, $defaut); |
@@ -2526,7 +2521,7 @@ discard block |
||
| 2526 | 2521 | and (($p == "'") or ($p == '"')) |
| 2527 | 2522 | and $params[0][1]->type == 'champ' |
| 2528 | 2523 | ) { |
| 2529 | - $val[] = "$p\\$p#" . $params[0][1]->nom_champ . "\\$p$p"; |
|
| 2524 | + $val[] = "$p\\$p#".$params[0][1]->nom_champ."\\$p$p"; |
|
| 2530 | 2525 | } else { |
| 2531 | 2526 | foreach ((($op != 'IN') ? $params : calculer_vieux_in($params)) as $p) { |
| 2532 | 2527 | $a = calculer_liste($p, $idb, $boucles, $parent); |
@@ -2542,7 +2537,7 @@ discard block |
||
| 2542 | 2537 | $fct = $args_sql = ''; |
| 2543 | 2538 | // fonction SQL ? |
| 2544 | 2539 | // chercher FONCTION(champ) tel que CONCAT(titre,descriptif) |
| 2545 | - if (preg_match('/^(.*)' . SQL_ARGS . '$/', $col, $m)) { |
|
| 2540 | + if (preg_match('/^(.*)'.SQL_ARGS.'$/', $col, $m)) { |
|
| 2546 | 2541 | $fct = $m[1]; |
| 2547 | 2542 | preg_match('/^\(([^,]*)(.*)\)$/', $m[2], $a); |
| 2548 | 2543 | $col = $a[1]; |
@@ -2633,7 +2628,7 @@ discard block |
||
| 2633 | 2628 | # si oui choisir ce champ, sinon choisir xxxx |
| 2634 | 2629 | |
| 2635 | 2630 | if (isset($table['field']["date$suite"])) { |
| 2636 | - $date_orig = 'date' . $suite; |
|
| 2631 | + $date_orig = 'date'.$suite; |
|
| 2637 | 2632 | } else { |
| 2638 | 2633 | $date_orig = substr($suite, 1); |
| 2639 | 2634 | } |
@@ -2644,12 +2639,12 @@ discard block |
||
| 2644 | 2639 | } |
| 2645 | 2640 | } |
| 2646 | 2641 | |
| 2647 | - $date_compare = "\"' . normaliser_date(" . |
|
| 2648 | - calculer_argument_precedent($idb, $pred, $boucles) . |
|
| 2642 | + $date_compare = "\"' . normaliser_date(". |
|
| 2643 | + calculer_argument_precedent($idb, $pred, $boucles). |
|
| 2649 | 2644 | ") . '\""; |
| 2650 | 2645 | |
| 2651 | 2646 | $col_vraie = $date_orig; |
| 2652 | - $date_orig = $boucle->id_table . '.' . $date_orig; |
|
| 2647 | + $date_orig = $boucle->id_table.'.'.$date_orig; |
|
| 2653 | 2648 | |
| 2654 | 2649 | switch ($col) { |
| 2655 | 2650 | case 'date': |
@@ -2669,26 +2664,26 @@ discard block |
||
| 2669 | 2664 | break; |
| 2670 | 2665 | case 'age': |
| 2671 | 2666 | $col = calculer_param_date("\'' . date('Y-m-d H:i:00') . '\'", $date_orig); |
| 2672 | - $col_vraie = '';// comparer a un int (par defaut) |
|
| 2667 | + $col_vraie = ''; // comparer a un int (par defaut) |
|
| 2673 | 2668 | break; |
| 2674 | 2669 | case 'age_relatif': |
| 2675 | 2670 | $col = calculer_param_date($date_compare, $date_orig); |
| 2676 | - $col_vraie = '';// comparer a un int (par defaut) |
|
| 2671 | + $col_vraie = ''; // comparer a un int (par defaut) |
|
| 2677 | 2672 | break; |
| 2678 | 2673 | case 'jour_relatif': |
| 2679 | - $col = '(TO_DAYS(' . $date_compare . ')-TO_DAYS(' . $date_orig . '))'; |
|
| 2680 | - $col_vraie = '';// comparer a un int (par defaut) |
|
| 2674 | + $col = '(TO_DAYS('.$date_compare.')-TO_DAYS('.$date_orig.'))'; |
|
| 2675 | + $col_vraie = ''; // comparer a un int (par defaut) |
|
| 2681 | 2676 | break; |
| 2682 | 2677 | case 'mois_relatif': |
| 2683 | - $col = 'MONTH(' . $date_compare . ')-MONTH(' . |
|
| 2684 | - $date_orig . ')+12*(YEAR(' . $date_compare . |
|
| 2685 | - ')-YEAR(' . $date_orig . '))'; |
|
| 2686 | - $col_vraie = '';// comparer a un int (par defaut) |
|
| 2678 | + $col = 'MONTH('.$date_compare.')-MONTH('. |
|
| 2679 | + $date_orig.')+12*(YEAR('.$date_compare. |
|
| 2680 | + ')-YEAR('.$date_orig.'))'; |
|
| 2681 | + $col_vraie = ''; // comparer a un int (par defaut) |
|
| 2687 | 2682 | break; |
| 2688 | 2683 | case 'annee_relatif': |
| 2689 | - $col = 'YEAR(' . $date_compare . ')-YEAR(' . |
|
| 2690 | - $date_orig . ')'; |
|
| 2691 | - $col_vraie = '';// comparer a un int (par defaut) |
|
| 2684 | + $col = 'YEAR('.$date_compare.')-YEAR('. |
|
| 2685 | + $date_orig.')'; |
|
| 2686 | + $col_vraie = ''; // comparer a un int (par defaut) |
|
| 2692 | 2687 | break; |
| 2693 | 2688 | } |
| 2694 | 2689 | |
@@ -2749,10 +2744,10 @@ discard block |
||
| 2749 | 2744 | } |
| 2750 | 2745 | |
| 2751 | 2746 | $boucle->hash .= ' |
| 2752 | - $command[\'sourcemode\'] = ' . array_shift($args) . ";\n"; |
|
| 2747 | + $command[\'sourcemode\'] = ' . array_shift($args).";\n"; |
|
| 2753 | 2748 | |
| 2754 | 2749 | $boucle->hash .= ' |
| 2755 | - $command[\'source\'] = array(' . join(', ', $args) . ");\n"; |
|
| 2750 | + $command[\'source\'] = array(' . join(', ', $args).");\n"; |
|
| 2756 | 2751 | } |
| 2757 | 2752 | |
| 2758 | 2753 | /** |
@@ -2771,7 +2766,7 @@ discard block |
||
| 2771 | 2766 | function critere_DATA_datacache_dist($idb, &$boucles, $crit) { |
| 2772 | 2767 | $boucle = &$boucles[$idb]; |
| 2773 | 2768 | $boucle->hash .= ' |
| 2774 | - $command[\'datacache\'] = ' . calculer_liste($crit->param[0], $idb, $boucles, $boucles[$idb]->id_parent) . ';'; |
|
| 2769 | + $command[\'datacache\'] = ' . calculer_liste($crit->param[0], $idb, $boucles, $boucles[$idb]->id_parent).';'; |
|
| 2775 | 2770 | } |
| 2776 | 2771 | |
| 2777 | 2772 | |
@@ -2790,7 +2785,7 @@ discard block |
||
| 2790 | 2785 | $boucle->hash .= '$command[\'args\']=array();'; |
| 2791 | 2786 | foreach ($crit->param as $param) { |
| 2792 | 2787 | $boucle->hash .= ' |
| 2793 | - $command[\'args\'][] = ' . calculer_liste($param, $idb, $boucles, $boucles[$idb]->id_parent) . ';'; |
|
| 2788 | + $command[\'args\'][] = ' . calculer_liste($param, $idb, $boucles, $boucles[$idb]->id_parent).';'; |
|
| 2794 | 2789 | } |
| 2795 | 2790 | } |
| 2796 | 2791 | |
@@ -2809,14 +2804,14 @@ discard block |
||
| 2809 | 2804 | */ |
| 2810 | 2805 | function critere_DATA_liste_dist($idb, &$boucles, $crit) { |
| 2811 | 2806 | $boucle = &$boucles[$idb]; |
| 2812 | - $boucle->hash .= "\n\t" . '$command[\'liste\'] = array();' . "\n"; |
|
| 2807 | + $boucle->hash .= "\n\t".'$command[\'liste\'] = array();'."\n"; |
|
| 2813 | 2808 | foreach ($crit->param as $param) { |
| 2814 | - $boucle->hash .= "\t" . '$command[\'liste\'][] = ' . calculer_liste( |
|
| 2809 | + $boucle->hash .= "\t".'$command[\'liste\'][] = '.calculer_liste( |
|
| 2815 | 2810 | $param, |
| 2816 | 2811 | $idb, |
| 2817 | 2812 | $boucles, |
| 2818 | 2813 | $boucles[$idb]->id_parent |
| 2819 | - ) . ";\n"; |
|
| 2814 | + ).";\n"; |
|
| 2820 | 2815 | } |
| 2821 | 2816 | } |
| 2822 | 2817 | |
@@ -2843,14 +2838,14 @@ discard block |
||
| 2843 | 2838 | */ |
| 2844 | 2839 | function critere_DATA_enum_dist($idb, &$boucles, $crit) { |
| 2845 | 2840 | $boucle = &$boucles[$idb]; |
| 2846 | - $boucle->hash .= "\n\t" . '$command[\'enum\'] = array();' . "\n"; |
|
| 2841 | + $boucle->hash .= "\n\t".'$command[\'enum\'] = array();'."\n"; |
|
| 2847 | 2842 | foreach ($crit->param as $param) { |
| 2848 | - $boucle->hash .= "\t" . '$command[\'enum\'][] = ' . calculer_liste( |
|
| 2843 | + $boucle->hash .= "\t".'$command[\'enum\'][] = '.calculer_liste( |
|
| 2849 | 2844 | $param, |
| 2850 | 2845 | $idb, |
| 2851 | 2846 | $boucles, |
| 2852 | 2847 | $boucles[$idb]->id_parent |
| 2853 | - ) . ";\n"; |
|
| 2848 | + ).";\n"; |
|
| 2854 | 2849 | } |
| 2855 | 2850 | } |
| 2856 | 2851 | |
@@ -2869,7 +2864,7 @@ discard block |
||
| 2869 | 2864 | $boucle = &$boucles[$idb]; |
| 2870 | 2865 | foreach ($crit->param as $param) { |
| 2871 | 2866 | $boucle->hash .= ' |
| 2872 | - $command[\'datapath\'][] = ' . calculer_liste($param, $idb, $boucles, $boucles[$idb]->id_parent) . ';'; |
|
| 2867 | + $command[\'datapath\'][] = ' . calculer_liste($param, $idb, $boucles, $boucles[$idb]->id_parent).';'; |
|
| 2873 | 2868 | } |
| 2874 | 2869 | } |
| 2875 | 2870 | |
@@ -2910,7 +2905,7 @@ discard block |
||
| 2910 | 2905 | if ($crit->param) { |
| 2911 | 2906 | foreach ($crit->param as $param) { |
| 2912 | 2907 | $boucle->hash .= "\t\$command['si'][] = " |
| 2913 | - . calculer_liste($param, $idb, $boucles, $boucles[$idb]->id_parent) . ";\n"; |
|
| 2908 | + . calculer_liste($param, $idb, $boucles, $boucles[$idb]->id_parent).";\n"; |
|
| 2914 | 2909 | } |
| 2915 | 2910 | // interdire {si 0} aussi ! |
| 2916 | 2911 | } else { |
@@ -2934,7 +2929,7 @@ discard block |
||
| 2934 | 2929 | function critere_POUR_tableau_dist($idb, &$boucles, $crit) { |
| 2935 | 2930 | $boucle = &$boucles[$idb]; |
| 2936 | 2931 | $boucle->hash .= ' |
| 2937 | - $command[\'source\'] = array(' . calculer_liste($crit->param[0], $idb, $boucles, $boucles[$idb]->id_parent) . '); |
|
| 2932 | + $command[\'source\'] = array(' . calculer_liste($crit->param[0], $idb, $boucles, $boucles[$idb]->id_parent).'); |
|
| 2938 | 2933 | $command[\'sourcemode\'] = \'table\';'; |
| 2939 | 2934 | } |
| 2940 | 2935 | |
@@ -2969,7 +2964,7 @@ discard block |
||
| 2969 | 2964 | $id_parent = $GLOBALS['exceptions_des_tables'][$boucle->id_table]['id_parent'] ?? 'id_parent'; |
| 2970 | 2965 | |
| 2971 | 2966 | $in = 'IN'; |
| 2972 | - $where = ["'IN'", "'$boucle->id_table." . "$primary'", "'('.sql_get_select('$id_parent', '$table_sql').')'"]; |
|
| 2967 | + $where = ["'IN'", "'$boucle->id_table."."$primary'", "'('.sql_get_select('$id_parent', '$table_sql').')'"]; |
|
| 2973 | 2968 | if ($not) { |
| 2974 | 2969 | $where = ["'NOT'", $where]; |
| 2975 | 2970 | } |
@@ -31,36 +31,36 @@ discard block |
||
| 31 | 31 | |
| 32 | 32 | function format_inclure_html($file, $args, $prof) { |
| 33 | 33 | if (strpos($file, '#') === false) { |
| 34 | - $t = $file ? ('(' . $file . ')') : ''; |
|
| 34 | + $t = $file ? ('('.$file.')') : ''; |
|
| 35 | 35 | } else { |
| 36 | - $t = '{fond=' . $file . '}'; |
|
| 36 | + $t = '{fond='.$file.'}'; |
|
| 37 | 37 | } |
| 38 | - $args = !$args ? '' : ('{' . join(', ', $args) . '}'); |
|
| 38 | + $args = !$args ? '' : ('{'.join(', ', $args).'}'); |
|
| 39 | 39 | |
| 40 | - return ('<INCLURE' . $t . $args . '>'); |
|
| 40 | + return ('<INCLURE'.$t.$args.'>'); |
|
| 41 | 41 | } |
| 42 | 42 | |
| 43 | 43 | function format_polyglotte_html($args, $prof) { |
| 44 | 44 | $contenu = []; |
| 45 | 45 | foreach ($args as $l => $t) { |
| 46 | - $contenu[] = ($l ? "[$l]" : '') . $t; |
|
| 46 | + $contenu[] = ($l ? "[$l]" : '').$t; |
|
| 47 | 47 | } |
| 48 | 48 | |
| 49 | - return ('<multi>' . join(' ', $contenu) . '</multi>'); |
|
| 49 | + return ('<multi>'.join(' ', $contenu).'</multi>'); |
|
| 50 | 50 | } |
| 51 | 51 | |
| 52 | 52 | function format_idiome_html($nom, $module, $args, $filtres, $prof) { |
| 53 | 53 | foreach ($args as $k => $v) { |
| 54 | 54 | $args[$k] = "$k=$v"; |
| 55 | 55 | } |
| 56 | - $args = (!$args ? '' : ('{' . join(',', $args) . '}')); |
|
| 56 | + $args = (!$args ? '' : ('{'.join(',', $args).'}')); |
|
| 57 | 57 | |
| 58 | - return ('<:' . ($module ? "$module:" : '') . $nom . $args . $filtres . ':>'); |
|
| 58 | + return ('<:'.($module ? "$module:" : '').$nom.$args.$filtres.':>'); |
|
| 59 | 59 | } |
| 60 | 60 | |
| 61 | 61 | function format_champ_html($nom, $boucle, $etoile, $avant, $apres, $args, $filtres, $prof) { |
| 62 | 62 | $nom = '#' |
| 63 | - . ($boucle ? ($boucle . ':') : '') |
|
| 63 | + . ($boucle ? ($boucle.':') : '') |
|
| 64 | 64 | . $nom |
| 65 | 65 | . $etoile |
| 66 | 66 | . $args |
@@ -90,12 +90,12 @@ discard block |
||
| 90 | 90 | $critere[$k] = $crit_s; |
| 91 | 91 | } |
| 92 | 92 | |
| 93 | - return (!$critere ? '' : ('{' . join(',', $critere) . '}')); |
|
| 93 | + return (!$critere ? '' : ('{'.join(',', $critere).'}')); |
|
| 94 | 94 | } |
| 95 | 95 | |
| 96 | 96 | function format_liste_html($fonc, $args, $prof) { |
| 97 | 97 | return ((($fonc !== '') ? "|$fonc" : $fonc) |
| 98 | - . (!$args ? '' : ('{' . join(',', $args) . '}'))); |
|
| 98 | + . (!$args ? '' : ('{'.join(',', $args).'}'))); |
|
| 99 | 99 | } |
| 100 | 100 | |
| 101 | 101 | // Concatenation sans separateur: verifier qu'on ne cree pas de faux lexemes |
@@ -111,7 +111,7 @@ discard block |
||
| 111 | 111 | // si un texte se termine par ( et est suivi d'un champ |
| 112 | 112 | // ou assimiles, forcer la notation pleine |
| 113 | 113 | if ($c1 == '(' and substr($texte2, 0, 1) == '#') { |
| 114 | - $args[$i + 1][0] = '[(' . $texte2 . ')]'; |
|
| 114 | + $args[$i + 1][0] = '[('.$texte2.')]'; |
|
| 115 | 115 | } |
| 116 | 116 | } else { |
| 117 | 117 | if ($type == 'texte') { |
@@ -124,7 +124,7 @@ discard block |
||
| 124 | 124 | ($c1 == '}' and substr(ltrim($texte2), 0, 1) == '|') |
| 125 | 125 | or (preg_match('/[\w\d_*]/', $c1) and preg_match('/^[\w\d_*{|]/', $texte2)) |
| 126 | 126 | ) { |
| 127 | - $args[$i][0] = '[(' . $texte . ')]'; |
|
| 127 | + $args[$i][0] = '[('.$texte.')]'; |
|
| 128 | 128 | } |
| 129 | 129 | } |
| 130 | 130 | } |
@@ -148,7 +148,7 @@ discard block |
||
| 148 | 148 | if (!$fonc) { |
| 149 | 149 | $fonc = $GLOBALS['debug_objets']['principal']; |
| 150 | 150 | } |
| 151 | - $titre = !$mode ? $fonc : ($mode . (isset($GLOBALS['debug_objets']['sourcefile'][$fonc]) ? ' ' . $GLOBALS['debug_objets']['sourcefile'][$fonc] : '')); |
|
| 151 | + $titre = !$mode ? $fonc : ($mode.(isset($GLOBALS['debug_objets']['sourcefile'][$fonc]) ? ' '.$GLOBALS['debug_objets']['sourcefile'][$fonc] : '')); |
|
| 152 | 152 | } |
| 153 | 153 | if ($message === false) { |
| 154 | 154 | lang_select(); |
@@ -177,7 +177,7 @@ discard block |
||
| 177 | 177 | $fond = $GLOBALS['fond'] ?? ''; |
| 178 | 178 | // une erreur critique sort $message en array |
| 179 | 179 | $debug = is_array($msg) ? $msg[1] : $msg; |
| 180 | - spip_log('Debug: ' . $debug . ' (' . $fond . ')'); |
|
| 180 | + spip_log('Debug: '.$debug.' ('.$fond.')'); |
|
| 181 | 181 | |
| 182 | 182 | return $msg; |
| 183 | 183 | } |
@@ -185,7 +185,7 @@ discard block |
||
| 185 | 185 | function debusquer_bandeau($erreurs) { |
| 186 | 186 | |
| 187 | 187 | if (!empty($erreurs)) { |
| 188 | - $n = [(is_countable($erreurs) ? count($erreurs) : 0) . ' ' . _T('zbug_erreur_squelette')]; |
|
| 188 | + $n = [(is_countable($erreurs) ? count($erreurs) : 0).' '._T('zbug_erreur_squelette')]; |
|
| 189 | 189 | |
| 190 | 190 | return debusquer_navigation($erreurs, $n); |
| 191 | 191 | } elseif (!empty($GLOBALS['tableau_des_temps'])) { |
@@ -218,25 +218,25 @@ discard block |
||
| 218 | 218 | $valeur_simple = []; |
| 219 | 219 | foreach ($valeur as $v) { |
| 220 | 220 | if (is_array($v)) { |
| 221 | - $valeur_simple[] = 'array:' . count($v); |
|
| 221 | + $valeur_simple[] = 'array:'.count($v); |
|
| 222 | 222 | } elseif (is_object($v)) { |
| 223 | 223 | $valeur_simple[] = get_class($v); |
| 224 | 224 | } elseif (is_string($v)) { |
| 225 | - $valeur_simple[] = "'" . $v . "'"; |
|
| 225 | + $valeur_simple[] = "'".$v."'"; |
|
| 226 | 226 | } else { |
| 227 | 227 | $valeur_simple[] = $v; |
| 228 | 228 | } |
| 229 | 229 | } |
| 230 | 230 | $n = count($valeur); |
| 231 | - $valeur = (($n > 3) ? 'array:' . $n . ' ' : ''); |
|
| 232 | - $valeur .= '[' . join(', ', $valeur_simple) . ']'; |
|
| 231 | + $valeur = (($n > 3) ? 'array:'.$n.' ' : ''); |
|
| 232 | + $valeur .= '['.join(', ', $valeur_simple).']'; |
|
| 233 | 233 | } elseif (is_object($valeur)) { |
| 234 | 234 | $valeur = get_class($valeur); |
| 235 | 235 | } elseif (is_string($valeur)) { |
| 236 | - $valeur = "'" . $valeur . "'"; |
|
| 236 | + $valeur = "'".$valeur."'"; |
|
| 237 | 237 | } |
| 238 | - $res .= "\n<tr><td><strong>" . nl2br(entites_html($nom)) |
|
| 239 | - . '</strong></td><td>: ' . nl2br(entites_html($valeur)) |
|
| 238 | + $res .= "\n<tr><td><strong>".nl2br(entites_html($nom)) |
|
| 239 | + . '</strong></td><td>: '.nl2br(entites_html($valeur)) |
|
| 240 | 240 | . "</td></tr>\n"; |
| 241 | 241 | } |
| 242 | 242 | |
@@ -264,10 +264,10 @@ discard block |
||
| 264 | 264 | $nom_code = $lieu->descr['nom']; |
| 265 | 265 | $skel = $lieu->descr['sourcefile']; |
| 266 | 266 | $h2 = parametre_url($href, 'var_mode_objet', $nom_code); |
| 267 | - $h3 = parametre_url($h2, 'var_mode_affiche', 'squelette') . '#L' . $ligne; |
|
| 267 | + $h3 = parametre_url($h2, 'var_mode_affiche', 'squelette').'#L'.$ligne; |
|
| 268 | 268 | $skel = "<a href='$h3'><b>$skel</b></a>"; |
| 269 | 269 | if ($boucle) { |
| 270 | - $h3 = parametre_url($h2 . $boucle, 'var_mode_affiche', 'boucle'); |
|
| 270 | + $h3 = parametre_url($h2.$boucle, 'var_mode_affiche', 'boucle'); |
|
| 271 | 271 | $boucle = "<a href='$h3'><b>$boucle</b></a>"; |
| 272 | 272 | } |
| 273 | 273 | } |
@@ -356,7 +356,7 @@ discard block |
||
| 356 | 356 | } |
| 357 | 357 | |
| 358 | 358 | // Requete erronee |
| 359 | - $err = '<b>' . _T('avis_erreur_mysql') . " $errno</b><br /><tt>\n" |
|
| 359 | + $err = '<b>'._T('avis_erreur_mysql')." $errno</b><br /><tt>\n" |
|
| 360 | 360 | . spip_htmlspecialchars($msg) |
| 361 | 361 | . "\n<br /><span style='color: red'><b>" |
| 362 | 362 | . spip_htmlspecialchars($query) |
@@ -371,7 +371,7 @@ discard block |
||
| 371 | 371 | // https://code.spip.net/@trouve_boucle_debug |
| 372 | 372 | function trouve_boucle_debug($n, $nom, $debut = 0, $boucle = '') { |
| 373 | 373 | |
| 374 | - $id = $nom . $boucle; |
|
| 374 | + $id = $nom.$boucle; |
|
| 375 | 375 | if (is_array($GLOBALS['debug_objets']['sequence'][$id])) { |
| 376 | 376 | foreach ($GLOBALS['debug_objets']['sequence'][$id] as $v) { |
| 377 | 377 | if (!preg_match('/^(.*)(<\?.*\?>)(.*)$/s', $v[0], $r)) { |
@@ -418,7 +418,7 @@ discard block |
||
| 418 | 418 | } |
| 419 | 419 | } |
| 420 | 420 | } |
| 421 | - $incl = ',' . $reg[1] . '[.]\w$,'; |
|
| 421 | + $incl = ','.$reg[1].'[.]\w$,'; |
|
| 422 | 422 | |
| 423 | 423 | foreach ($GLOBALS['debug_objets']['sourcefile'] as $k => $v) { |
| 424 | 424 | if (preg_match($incl, $v)) { |
@@ -434,16 +434,13 @@ discard block |
||
| 434 | 434 | [$skel, $boucle, $ligne] = trouve_boucle_debug($n, $nom); |
| 435 | 435 | |
| 436 | 436 | if (!$boucle) { |
| 437 | - return !$ligne ? '' : |
|
| 438 | - (' (' . |
|
| 439 | - (($nom != $skel) ? _T('squelette_inclus_ligne') : |
|
| 440 | - _T('squelette_ligne')) . |
|
| 437 | + return !$ligne ? '' : (' ('. |
|
| 438 | + (($nom != $skel) ? _T('squelette_inclus_ligne') : _T('squelette_ligne')). |
|
| 441 | 439 | " <a href='$self&var_mode_objet=$skel&var_mode_affiche=squelette&var_mode_ligne=$ligne#L$ligne'>$ligne</a>)"); |
| 442 | 440 | } else { |
| 443 | 441 | $self .= "&var_mode_objet=$skel$boucle&var_mode_affiche=boucle"; |
| 444 | 442 | |
| 445 | - return !$ligne ? " (boucle\n<a href='$self#$skel$boucle'>$boucle</a>)" : |
|
| 446 | - " (boucle $boucle ligne\n<a href='$self&var_mode_ligne=$ligne#L$ligne'>$ligne</a>)"; |
|
| 443 | + return !$ligne ? " (boucle\n<a href='$self#$skel$boucle'>$boucle</a>)" : " (boucle $boucle ligne\n<a href='$self&var_mode_ligne=$ligne#L$ligne'>$ligne</a>)"; |
|
| 447 | 444 | } |
| 448 | 445 | } |
| 449 | 446 | |
@@ -466,14 +463,14 @@ discard block |
||
| 466 | 463 | |
| 467 | 464 | $s = preg_replace( |
| 468 | 465 | ',<(\w[^<>]*)>([^<]*)<br />([^<]*)</\1>,', |
| 469 | - '<\1>\2</\1><br />' . "\n" . '<\1>\3</\1>', |
|
| 466 | + '<\1>\2</\1><br />'."\n".'<\1>\3</\1>', |
|
| 470 | 467 | $s |
| 471 | 468 | ); |
| 472 | 469 | |
| 473 | 470 | |
| 474 | 471 | $tableau = explode('<br />', $s); |
| 475 | 472 | |
| 476 | - $format = "<span style='float:left;display:block;width:50px;height:1px'><a id='L%d' style='background-color: white; visibility: " . ($nocpt ? 'hidden' : 'visible') . ";%s' href='#T%s' title=\"%s\">%0" . strval(@strlen(count($tableau))) . "d</a></span> %s<br />\n"; |
|
| 473 | + $format = "<span style='float:left;display:block;width:50px;height:1px'><a id='L%d' style='background-color: white; visibility: ".($nocpt ? 'hidden' : 'visible').";%s' href='#T%s' title=\"%s\">%0".strval(@strlen(count($tableau)))."d</a></span> %s<br />\n"; |
|
| 477 | 474 | |
| 478 | 475 | $format10 = str_replace('white', 'lightgrey', $format); |
| 479 | 476 | $formaterr = 'color: red;'; |
@@ -517,7 +514,7 @@ discard block |
||
| 517 | 514 | . '" style="cursor: pointer;">' |
| 518 | 515 | . ($nocpt ? '' : _T('info_numero_abbreviation')) |
| 519 | 516 | . '</div> |
| 520 | - ' . $res . "</div>\n"; |
|
| 517 | + ' . $res."</div>\n"; |
|
| 521 | 518 | } |
| 522 | 519 | |
| 523 | 520 | // l'environnement graphique du debuggueur |
@@ -539,14 +536,14 @@ discard block |
||
| 539 | 536 | if (!empty($GLOBALS['debug_objets'][$mode][$fonc])) { |
| 540 | 537 | [$legend, $texte, $res2] = debusquer_source($fonc, $mode); |
| 541 | 538 | $texte .= $res2; |
| 542 | - } elseif (!empty($GLOBALS['debug_objets'][$mode][$fonc . 'tout'])) { |
|
| 543 | - $legend = _T('zbug_' . $mode); |
|
| 544 | - $texte = $GLOBALS['debug_objets'][$mode][$fonc . 'tout']; |
|
| 539 | + } elseif (!empty($GLOBALS['debug_objets'][$mode][$fonc.'tout'])) { |
|
| 540 | + $legend = _T('zbug_'.$mode); |
|
| 541 | + $texte = $GLOBALS['debug_objets'][$mode][$fonc.'tout']; |
|
| 545 | 542 | $texte = ancre_texte($texte, ['', '']); |
| 546 | 543 | } |
| 547 | 544 | } else { |
| 548 | 545 | if (strlen(trim($res))) { |
| 549 | - 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>"; |
|
| 546 | + 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>"; |
|
| 550 | 547 | } else { |
| 551 | 548 | // cas de l'appel sur erreur: montre la page |
| 552 | 549 | return $GLOBALS['debug_objets']['resultat']['tout'] ?? ''; |
@@ -554,7 +551,7 @@ discard block |
||
| 554 | 551 | } |
| 555 | 552 | } else { |
| 556 | 553 | $valider = charger_fonction('valider', 'xml'); |
| 557 | - $val = $valider($GLOBALS['debug_objets']['validation'][$fonc . 'tout']); |
|
| 554 | + $val = $valider($GLOBALS['debug_objets']['validation'][$fonc.'tout']); |
|
| 558 | 555 | // Si erreur, signaler leur nombre dans le formulaire admin |
| 559 | 556 | $GLOBALS['debug_objets']['validation'] = $val->err ? count($val->err) : ''; |
| 560 | 557 | [$texte, $err] = emboite_texte($val, $fonc, $self); |
@@ -565,14 +562,14 @@ discard block |
||
| 565 | 562 | } else { |
| 566 | 563 | $err = ": $err"; |
| 567 | 564 | } |
| 568 | - $legend = _T('validation') . ' ' . $err; |
|
| 565 | + $legend = _T('validation').' '.$err; |
|
| 569 | 566 | $res = $id = ''; |
| 570 | 567 | } |
| 571 | 568 | |
| 572 | 569 | return !trim($texte) ? '' : ( |
| 573 | - "<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" |
|
| 570 | + "<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" |
|
| 574 | 571 | . "<div id='debug_boucle'><fieldset$id><legend>" |
| 575 | - . "<a href='" . $self . '#f_' . substr($fonc, 0, 37) . "'> ↑ " |
|
| 572 | + . "<a href='".$self.'#f_'.substr($fonc, 0, 37)."'> ↑ " |
|
| 576 | 573 | . ($legend ?: $mode) |
| 577 | 574 | . '</a></legend>' |
| 578 | 575 | . $texte |
@@ -584,7 +581,7 @@ discard block |
||
| 584 | 581 | // https://code.spip.net/@emboite_texte |
| 585 | 582 | function emboite_texte($res, $fonc = '', $self = '') { |
| 586 | 583 | $errs = $res->err; |
| 587 | - $texte = $res->entete . ($errs ? '' : $res->page); |
|
| 584 | + $texte = $res->entete.($errs ? '' : $res->page); |
|
| 588 | 585 | |
| 589 | 586 | if (!$texte and !$errs) { |
| 590 | 587 | return [ancre_texte('', ['', '']), false]; |
@@ -640,7 +637,7 @@ discard block |
||
| 640 | 637 | $err = "<h2 style='text-align: center'>" |
| 641 | 638 | . $i |
| 642 | 639 | . "<a href='#fin_err'>" |
| 643 | - . ' ' . _T('erreur_texte') |
|
| 640 | + . ' '._T('erreur_texte') |
|
| 644 | 641 | . "</a></h2><table id='debut_err' style='width: 100%'>" |
| 645 | 642 | . $err |
| 646 | 643 | . " </table><a id='fin_err'></a>"; |
@@ -650,9 +647,9 @@ discard block |
||
| 650 | 647 | [$msg, $fermant, $ouvrant] = $errs[0]; |
| 651 | 648 | $rf = reference_boucle_debug($fermant, $fonc, $self); |
| 652 | 649 | $ro = reference_boucle_debug($ouvrant, $fonc, $self); |
| 653 | - $err = $msg . |
|
| 654 | - "<a href='#L" . $fermant . "'>$fermant</a>$rf<br />" . |
|
| 655 | - "<a href='#L" . $ouvrant . "'>$ouvrant</a>$ro"; |
|
| 650 | + $err = $msg. |
|
| 651 | + "<a href='#L".$fermant."'>$fermant</a>$rf<br />". |
|
| 652 | + "<a href='#L".$ouvrant."'>$ouvrant</a>$ro"; |
|
| 656 | 653 | |
| 657 | 654 | return [ancre_texte($texte, [[$ouvrant], [$fermant]]), $err]; |
| 658 | 655 | } |
@@ -686,7 +683,7 @@ discard block |
||
| 686 | 683 | ['time' => $GLOBALS['debug_objets']['profile'][$sourcefile]] |
| 687 | 684 | ); |
| 688 | 685 | |
| 689 | - $res .= "<fieldset id='f_" . $nom . "'><legend>" |
|
| 686 | + $res .= "<fieldset id='f_".$nom."'><legend>" |
|
| 690 | 687 | . $t_skel |
| 691 | 688 | . ' ' |
| 692 | 689 | . $sourcefile |
@@ -701,7 +698,7 @@ discard block |
||
| 701 | 698 | . "'>" |
| 702 | 699 | . _T('zbug_calcul') |
| 703 | 700 | . '</a></legend>' |
| 704 | - . (!$temps ? '' : ("\n<span style='display:block;float:" . $GLOBALS['spip_lang_right'] . "'>$temps</span><br />")) |
|
| 701 | + . (!$temps ? '' : ("\n<span style='display:block;float:".$GLOBALS['spip_lang_right']."'>$temps</span><br />")) |
|
| 705 | 702 | . debusquer_contexte($contexte[$sourcefile]) |
| 706 | 703 | . (!$nav ? '' : ("<table width='100%'>\n$nav</table>\n")) |
| 707 | 704 | . "</fieldset>\n"; |
@@ -722,33 +719,33 @@ discard block |
||
| 722 | 719 | $nom = $boucle->id_boucle; |
| 723 | 720 | $req = $boucle->type_requete; |
| 724 | 721 | $crit = public_decompiler($boucle, $gram, 0, 'criteres'); |
| 725 | - $self2 = $self . '&var_mode_objet=' . $objet; |
|
| 726 | - |
|
| 727 | - $res .= "\n<tr style='background-color: " . |
|
| 728 | - ($i % 2 ? '#e0e0f0' : '#f8f8ff') . |
|
| 729 | - "'><td align='right'>$i</td><td>\n" . |
|
| 730 | - "<a class='debug_link_boucle' href='" . |
|
| 731 | - $self2 . |
|
| 732 | - "&var_mode_affiche=boucle#f_$nom_skel'>" . |
|
| 733 | - _T('zbug_boucle') . |
|
| 734 | - "</a></td><td>\n<a class='debug_link_boucle' href='" . |
|
| 735 | - $self2 . |
|
| 736 | - "&var_mode_affiche=resultat#f_$nom_skel'>" . |
|
| 737 | - _T('zbug_resultat') . |
|
| 738 | - "</a></td><td>\n<a class='debug_link_resultat' href='" . |
|
| 739 | - $self2 . |
|
| 740 | - "&var_mode_affiche=code#f_$nom_skel'>" . |
|
| 741 | - _T('zbug_code') . |
|
| 742 | - "</a></td><td>\n<a class='debug_link_resultat' href='" . |
|
| 743 | - str_replace('var_mode=', 'var_profile=', $self2) . |
|
| 744 | - "'>" . |
|
| 745 | - _T('zbug_calcul') . |
|
| 746 | - "</a></td><td>\n" . |
|
| 747 | - (($var_mode_objet == $objet) ? "<b>$nom</b>" : $nom) . |
|
| 748 | - "</td><td>\n" . |
|
| 749 | - $req . |
|
| 750 | - "</td><td>\n" . |
|
| 751 | - spip_htmlspecialchars($crit) . |
|
| 722 | + $self2 = $self.'&var_mode_objet='.$objet; |
|
| 723 | + |
|
| 724 | + $res .= "\n<tr style='background-color: ". |
|
| 725 | + ($i % 2 ? '#e0e0f0' : '#f8f8ff'). |
|
| 726 | + "'><td align='right'>$i</td><td>\n". |
|
| 727 | + "<a class='debug_link_boucle' href='". |
|
| 728 | + $self2. |
|
| 729 | + "&var_mode_affiche=boucle#f_$nom_skel'>". |
|
| 730 | + _T('zbug_boucle'). |
|
| 731 | + "</a></td><td>\n<a class='debug_link_boucle' href='". |
|
| 732 | + $self2. |
|
| 733 | + "&var_mode_affiche=resultat#f_$nom_skel'>". |
|
| 734 | + _T('zbug_resultat'). |
|
| 735 | + "</a></td><td>\n<a class='debug_link_resultat' href='". |
|
| 736 | + $self2. |
|
| 737 | + "&var_mode_affiche=code#f_$nom_skel'>". |
|
| 738 | + _T('zbug_code'). |
|
| 739 | + "</a></td><td>\n<a class='debug_link_resultat' href='". |
|
| 740 | + str_replace('var_mode=', 'var_profile=', $self2). |
|
| 741 | + "'>". |
|
| 742 | + _T('zbug_calcul'). |
|
| 743 | + "</a></td><td>\n". |
|
| 744 | + (($var_mode_objet == $objet) ? "<b>$nom</b>" : $nom). |
|
| 745 | + "</td><td>\n". |
|
| 746 | + $req. |
|
| 747 | + "</td><td>\n". |
|
| 748 | + spip_htmlspecialchars($crit). |
|
| 752 | 749 | '</td></tr>'; |
| 753 | 750 | } |
| 754 | 751 | } |
@@ -775,7 +772,7 @@ discard block |
||
| 775 | 772 | } |
| 776 | 773 | // permettre le copier/coller facile |
| 777 | 774 | // $res = ancre_texte($req, array(), true); |
| 778 | - $res = "<div id='T" . md5($req) . "'>\n<pre>\n" . $req . "</pre>\n</div>\n"; |
|
| 775 | + $res = "<div id='T".md5($req)."'>\n<pre>\n".$req."</pre>\n</div>\n"; |
|
| 779 | 776 | // formatage et affichage des resultats bruts de la requete |
| 780 | 777 | $ress_req = spip_query($req); |
| 781 | 778 | $brut_sql = ''; |
@@ -785,10 +782,10 @@ discard block |
||
| 785 | 782 | $max_aff = defined('_MAX_DEBUG_AFF') ? _MAX_DEBUG_AFF : 50; |
| 786 | 783 | while ($retours_sql = sql_fetch($ress_req)) { |
| 787 | 784 | if ($num <= $max_aff) { |
| 788 | - $brut_sql .= '<h3>' . ($num == 1 ? $num . ' sur ' . sql_count($ress_req) : $num) . '</h3>'; |
|
| 785 | + $brut_sql .= '<h3>'.($num == 1 ? $num.' sur '.sql_count($ress_req) : $num).'</h3>'; |
|
| 789 | 786 | $brut_sql .= '<p>'; |
| 790 | 787 | foreach ($retours_sql as $key => $val) { |
| 791 | - $brut_sql .= '<strong>' . $key . '</strong> => ' . spip_htmlspecialchars(couper($val, 150)) . "<br />\n"; |
|
| 788 | + $brut_sql .= '<strong>'.$key.'</strong> => '.spip_htmlspecialchars(couper($val, 150))."<br />\n"; |
|
| 792 | 789 | } |
| 793 | 790 | $brut_sql .= '</p>'; |
| 794 | 791 | } |
@@ -799,14 +796,14 @@ discard block |
||
| 799 | 796 | // ne pas afficher les $contexte_inclus |
| 800 | 797 | $view = preg_replace(',<\?php.+\?[>],Uims', '', $view); |
| 801 | 798 | if ($view) { |
| 802 | - $res2 .= "\n<br /><fieldset>" . interdire_scripts($view) . '</fieldset>'; |
|
| 799 | + $res2 .= "\n<br /><fieldset>".interdire_scripts($view).'</fieldset>'; |
|
| 803 | 800 | } |
| 804 | 801 | } |
| 805 | 802 | } elseif ($affiche == 'code') { |
| 806 | 803 | $legend = $nom; |
| 807 | - $res = ancre_texte('<' . "?php\n" . $quoi . "\n?" . '>'); |
|
| 804 | + $res = ancre_texte('<'."?php\n".$quoi."\n?".'>'); |
|
| 808 | 805 | } elseif ($affiche == 'boucle') { |
| 809 | - $legend = _T('zbug_boucle') . ' ' . $nom; |
|
| 806 | + $legend = _T('zbug_boucle').' '.$nom; |
|
| 810 | 807 | // Le compilateur prefixe le nom des boucles par l'extension du fichier source. |
| 811 | 808 | $gram = preg_match('/^([^_]+)_/', $objet, $r) ? $r[1] : ''; |
| 812 | 809 | $res = ancre_texte(public_decompiler($quoi, $gram, 0, 'boucle')); |
@@ -825,23 +822,23 @@ discard block |
||
| 825 | 822 | include_spip('public/assembler'); // pour inclure_balise_dynamique |
| 826 | 823 | include_spip('inc/texte'); // pour corriger_typo |
| 827 | 824 | |
| 828 | - return _DOCTYPE_ECRIRE . |
|
| 829 | - html_lang_attributes() . |
|
| 830 | - "<head>\n<title>" . |
|
| 831 | - ('SPIP ' . $GLOBALS['spip_version_affichee'] . ' ' . |
|
| 832 | - _T('admin_debug') . ' ' . $titre . ' (' . |
|
| 833 | - supprimer_tags(corriger_typo($GLOBALS['meta']['nom_site']))) . |
|
| 834 | - ")</title>\n" . |
|
| 835 | - "<meta http-equiv='Content-Type' content='text/html" . |
|
| 836 | - (($c = $GLOBALS['meta']['charset']) ? "; charset=$c" : '') . |
|
| 837 | - "' />\n" . |
|
| 825 | + return _DOCTYPE_ECRIRE. |
|
| 826 | + html_lang_attributes(). |
|
| 827 | + "<head>\n<title>". |
|
| 828 | + ('SPIP '.$GLOBALS['spip_version_affichee'].' '. |
|
| 829 | + _T('admin_debug').' '.$titre.' ('. |
|
| 830 | + supprimer_tags(corriger_typo($GLOBALS['meta']['nom_site']))). |
|
| 831 | + ")</title>\n". |
|
| 832 | + "<meta http-equiv='Content-Type' content='text/html". |
|
| 833 | + (($c = $GLOBALS['meta']['charset']) ? "; charset=$c" : ''). |
|
| 834 | + "' />\n". |
|
| 838 | 835 | http_script('', 'jquery.js') |
| 839 | - . "<link rel='stylesheet' href='" . url_absolue(find_in_path('spip_admin.css')) |
|
| 840 | - . "' type='text/css' />" . |
|
| 841 | - "</head>\n" . |
|
| 842 | - "<body style='margin:0 10px;'>\n" . |
|
| 843 | - "<div id='spip-debug-header'>" . |
|
| 844 | - $corps . |
|
| 845 | - inclure_balise_dynamique(balise_FORMULAIRE_ADMIN_dyn('spip-admin-float', $GLOBALS['debug_objets']), false) . |
|
| 836 | + . "<link rel='stylesheet' href='".url_absolue(find_in_path('spip_admin.css')) |
|
| 837 | + . "' type='text/css' />". |
|
| 838 | + "</head>\n". |
|
| 839 | + "<body style='margin:0 10px;'>\n". |
|
| 840 | + "<div id='spip-debug-header'>". |
|
| 841 | + $corps. |
|
| 842 | + inclure_balise_dynamique(balise_FORMULAIRE_ADMIN_dyn('spip-admin-float', $GLOBALS['debug_objets']), false). |
|
| 846 | 843 | '</div></body></html>'; |
| 847 | 844 | } |
@@ -48,19 +48,19 @@ discard block |
||
| 48 | 48 | * Nom d'une balise #TOTO |
| 49 | 49 | * |
| 50 | 50 | * Écriture alambiquée pour rester compatible avec les hexadecimaux des vieux squelettes */ |
| 51 | -define('NOM_DE_CHAMP', '#((' . NOM_DE_BOUCLE . "):)?(([A-F]*[G-Z_][A-Z_0-9]*)|[A-Z_]+)\b(\*{0,2})"); |
|
| 51 | +define('NOM_DE_CHAMP', '#(('.NOM_DE_BOUCLE."):)?(([A-F]*[G-Z_][A-Z_0-9]*)|[A-Z_]+)\b(\*{0,2})"); |
|
| 52 | 52 | /** Balise complète [...(#TOTO) ... ] */ |
| 53 | -define('CHAMP_ETENDU', '/\[([^]\[]*)\(' . NOM_DE_CHAMP . '([^[)]*\)[^]\[]*)\]/S'); |
|
| 53 | +define('CHAMP_ETENDU', '/\[([^]\[]*)\('.NOM_DE_CHAMP.'([^[)]*\)[^]\[]*)\]/S'); |
|
| 54 | 54 | |
| 55 | 55 | define('BALISE_INCLURE', '/<INCLU[DR]E[[:space:]]*(\(([^)]*)\))?/S'); |
| 56 | 56 | define('BALISE_POLYGLOTTE', ',<multi>(.*)</multi>,Uims'); |
| 57 | 57 | define('BALISE_IDIOMES', ',<:(([a-z0-9_]+):)?([a-z0-9_]*)({([^\|=>]*=[^\|>]*)})?((\|[^>]*)?:/?>),iS'); |
| 58 | -define('BALISE_IDIOMES_ARGS', '@^\s*([^= ]*)\s*=\s*((' . NOM_DE_CHAMP . '[{][^}]*})?[^,]*)\s*,?\s*@s'); |
|
| 58 | +define('BALISE_IDIOMES_ARGS', '@^\s*([^= ]*)\s*=\s*(('.NOM_DE_CHAMP.'[{][^}]*})?[^,]*)\s*,?\s*@s'); |
|
| 59 | 59 | |
| 60 | 60 | /** Champ sql dans parenthèse ex: (id_article) */ |
| 61 | 61 | define('SQL_ARGS', '(\([^)]*\))'); |
| 62 | 62 | /** Fonction SQL sur un champ ex: SUM(visites) */ |
| 63 | -define('CHAMP_SQL_PLUS_FONC', '`?([A-Z_\/][A-Z_\/0-9.]*)' . SQL_ARGS . '?`?'); |
|
| 63 | +define('CHAMP_SQL_PLUS_FONC', '`?([A-Z_\/][A-Z_\/0-9.]*)'.SQL_ARGS.'?`?'); |
|
| 64 | 64 | |
| 65 | 65 | // https://code.spip.net/@phraser_inclure |
| 66 | 66 | function phraser_inclure($texte, $ligne, $result) { |
@@ -217,7 +217,7 @@ discard block |
||
| 217 | 217 | * @return array |
| 218 | 218 | **/ |
| 219 | 219 | function phraser_champs($texte, $ligne, $result) { |
| 220 | - while (preg_match('/' . NOM_DE_CHAMP . '/S', $texte, $match)) { |
|
| 220 | + while (preg_match('/'.NOM_DE_CHAMP.'/S', $texte, $match)) { |
|
| 221 | 221 | $p = strpos($texte, (string) $match[0]); |
| 222 | 222 | // texte après la balise |
| 223 | 223 | $suite = substr($texte, $p + strlen($match[0])); |
@@ -369,7 +369,7 @@ discard block |
||
| 369 | 369 | $collecte[] = $champ; |
| 370 | 370 | $args = ltrim($regs[count($regs) - 1]); |
| 371 | 371 | } else { |
| 372 | - if (!preg_match('/' . NOM_DE_CHAMP . '([{|])/', $arg, $r)) { |
|
| 372 | + if (!preg_match('/'.NOM_DE_CHAMP.'([{|])/', $arg, $r)) { |
|
| 373 | 373 | // 0 est un aveu d'impuissance. A completer |
| 374 | 374 | $arg = phraser_champs_exterieurs($arg, 0, $sep, $result); |
| 375 | 375 | |
@@ -454,7 +454,7 @@ discard block |
||
| 454 | 454 | function phraser_champs_exterieurs($texte, $ligne, $sep, $nested) { |
| 455 | 455 | $res = []; |
| 456 | 456 | while (($p = strpos($texte, (string) "%$sep")) !== false) { |
| 457 | - if (!preg_match(',^%' . preg_quote($sep) . '([0-9]+)@,', substr($texte, $p), $m)) { |
|
| 457 | + if (!preg_match(',^%'.preg_quote($sep).'([0-9]+)@,', substr($texte, $p), $m)) { |
|
| 458 | 458 | break; |
| 459 | 459 | } |
| 460 | 460 | $debut = substr($texte, 0, $p); |
@@ -495,7 +495,7 @@ discard block |
||
| 495 | 495 | $pos_apres = 0; |
| 496 | 496 | $result = phraser_args($match[7], ')', $sep, $result, $champ, $pos_apres); |
| 497 | 497 | phraser_vieux($champ); |
| 498 | - $champ->avant = phraser_champs_exterieurs($match[1], $n, $sep, $result); |
|
| 498 | + $champ->avant = phraser_champs_exterieurs($match[1], $n, $sep, $result); |
|
| 499 | 499 | $debut = substr($match[7], $pos_apres + 1); |
| 500 | 500 | if (!empty($debut)) { |
| 501 | 501 | $n += substr_count(substr($texte, 0, strpos($texte, $debut)), "\n"); |
@@ -626,7 +626,7 @@ discard block |
||
| 626 | 626 | // une maniere tres sale de supprimer les "' autour de {critere "xxx","yyy"} |
| 627 | 627 | if (preg_match(',^(["\'])(.*)\1$,', $m[4])) { |
| 628 | 628 | $c = null; |
| 629 | - eval('$c = ' . $m[4] . ';'); |
|
| 629 | + eval('$c = '.$m[4].';'); |
|
| 630 | 630 | if (isset($c)) { |
| 631 | 631 | $m[4] = $c; |
| 632 | 632 | } |
@@ -706,7 +706,7 @@ discard block |
||
| 706 | 706 | if (preg_match(',^ *([0-9-]+) *(/) *(.+) *$,', $param, $m)) { |
| 707 | 707 | $crit = phraser_critere_infixe($m[1], $m[3], $v, '/', '', ''); |
| 708 | 708 | } elseif ( |
| 709 | - preg_match(',^([!]?)(' . CHAMP_SQL_PLUS_FONC . |
|
| 709 | + preg_match(',^([!]?)('.CHAMP_SQL_PLUS_FONC. |
|
| 710 | 710 | ')[[:space:]]*(\??)(!?)(<=?|>=?|==?|\b(?:IN|LIKE)\b)(.*)$,is', $param, $m) |
| 711 | 711 | ) { |
| 712 | 712 | $a2 = trim($m[8]); |
@@ -723,8 +723,8 @@ discard block |
||
| 723 | 723 | ); |
| 724 | 724 | $crit->exclus = $m[1]; |
| 725 | 725 | } elseif ( |
| 726 | - preg_match('/^([!]?)\s*(' . |
|
| 727 | - CHAMP_SQL_PLUS_FONC . |
|
| 726 | + preg_match('/^([!]?)\s*('. |
|
| 727 | + CHAMP_SQL_PLUS_FONC. |
|
| 728 | 728 | ')\s*(\??)(.*)$/is', $param, $m) |
| 729 | 729 | ) { |
| 730 | 730 | // contient aussi les comparaisons implicites ! |
@@ -870,7 +870,7 @@ discard block |
||
| 870 | 870 | } |
| 871 | 871 | |
| 872 | 872 | // trouver sa position de depart reelle : au <Bxx> ou au <BBxx> |
| 873 | - $precond_boucle = BALISE_PRECOND_BOUCLE . $id_boucle . '>'; |
|
| 873 | + $precond_boucle = BALISE_PRECOND_BOUCLE.$id_boucle.'>'; |
|
| 874 | 874 | $pos_precond = strpos($texte, $precond_boucle, $id_boucle ? $pos_debut_texte : $pos_derniere_boucle_anonyme); |
| 875 | 875 | if ( |
| 876 | 876 | $pos_precond !== false |
@@ -881,7 +881,7 @@ discard block |
||
| 881 | 881 | $boucle['pos_precond_inside'] = $pos_precond + strlen($precond_boucle); |
| 882 | 882 | } |
| 883 | 883 | |
| 884 | - $preaff_boucle = BALISE_PREAFF_BOUCLE . $id_boucle . '>'; |
|
| 884 | + $preaff_boucle = BALISE_PREAFF_BOUCLE.$id_boucle.'>'; |
|
| 885 | 885 | $pos_preaff = strpos($texte, $preaff_boucle, $id_boucle ? $pos_debut_texte : $pos_derniere_boucle_anonyme); |
| 886 | 886 | if ( |
| 887 | 887 | $pos_preaff !== false |
@@ -929,13 +929,13 @@ discard block |
||
| 929 | 929 | $pos_anonyme_next = null; |
| 930 | 930 | // si c'est une boucle anonyme, chercher la position de la prochaine boucle anonyme |
| 931 | 931 | if (!strlen($id_boucle)) { |
| 932 | - $pos_anonyme_next = strpos($texte, BALISE_BOUCLE . '(', $pos_courante); |
|
| 932 | + $pos_anonyme_next = strpos($texte, BALISE_BOUCLE.'(', $pos_courante); |
|
| 933 | 933 | } |
| 934 | 934 | |
| 935 | 935 | // |
| 936 | 936 | // 1. Recuperer la partie conditionnelle apres |
| 937 | 937 | // |
| 938 | - $apres_boucle = BALISE_POSTCOND_BOUCLE . $id_boucle . '>'; |
|
| 938 | + $apres_boucle = BALISE_POSTCOND_BOUCLE.$id_boucle.'>'; |
|
| 939 | 939 | $pos_apres = strpos($texte, $apres_boucle, $pos_courante); |
| 940 | 940 | if ( |
| 941 | 941 | $pos_apres !== false |
@@ -944,13 +944,13 @@ discard block |
||
| 944 | 944 | $boucle['pos_postcond'] = $pos_apres; |
| 945 | 945 | $pos_apres += strlen($apres_boucle); |
| 946 | 946 | $boucle['pos_postcond_inside'] = $pos_apres; |
| 947 | - $pos_courante = $pos_apres ; |
|
| 947 | + $pos_courante = $pos_apres; |
|
| 948 | 948 | } |
| 949 | 949 | |
| 950 | 950 | // |
| 951 | 951 | // 2. Récuperer la partie alternative apres |
| 952 | 952 | // |
| 953 | - $altern_boucle = BALISE_ALT_BOUCLE . $id_boucle . '>'; |
|
| 953 | + $altern_boucle = BALISE_ALT_BOUCLE.$id_boucle.'>'; |
|
| 954 | 954 | $pos_altern = strpos($texte, $altern_boucle, $pos_courante); |
| 955 | 955 | if ( |
| 956 | 956 | $pos_altern !== false |
@@ -965,7 +965,7 @@ discard block |
||
| 965 | 965 | // |
| 966 | 966 | // 3. Recuperer la partie footer non alternative |
| 967 | 967 | // |
| 968 | - $postaff_boucle = BALISE_POSTAFF_BOUCLE . $id_boucle . '>'; |
|
| 968 | + $postaff_boucle = BALISE_POSTAFF_BOUCLE.$id_boucle.'>'; |
|
| 969 | 969 | $pos_postaff = strpos($texte, $postaff_boucle, $pos_courante); |
| 970 | 970 | if ( |
| 971 | 971 | $pos_postaff !== false |
@@ -974,7 +974,7 @@ discard block |
||
| 974 | 974 | $boucle['pos_postaff'] = $pos_postaff; |
| 975 | 975 | $pos_postaff += strlen($postaff_boucle); |
| 976 | 976 | $boucle['pos_postaff_inside'] = $pos_postaff; |
| 977 | - $pos_courante = $pos_postaff ; |
|
| 977 | + $pos_courante = $pos_postaff; |
|
| 978 | 978 | } |
| 979 | 979 | |
| 980 | 980 | return $boucle; |
@@ -1014,7 +1014,7 @@ discard block |
||
| 1014 | 1014 | * @return string |
| 1015 | 1015 | */ |
| 1016 | 1016 | function public_generer_boucle_placeholder($id_boucle, &$boucle, $boucle_placeholder, $nb_lignes) { |
| 1017 | - $placeholder = "[(#{$boucle_placeholder}{" . $id_boucle . '})' . str_pad('', $nb_lignes, "\n") . ']'; |
|
| 1017 | + $placeholder = "[(#{$boucle_placeholder}{".$id_boucle.'})'.str_pad('', $nb_lignes, "\n").']'; |
|
| 1018 | 1018 | //memoriser la boucle a reinjecter |
| 1019 | 1019 | $id_boucle = "$id_boucle"; |
| 1020 | 1020 | phraser_boucle_placeholder($id_boucle, $boucle_placeholder, $boucle); |
@@ -1027,7 +1027,7 @@ discard block |
||
| 1027 | 1027 | // definir un placholder pour les boucles dont on est sur d'avoir aucune occurence dans le squelette |
| 1028 | 1028 | if (is_null($boucle_placeholder)) { |
| 1029 | 1029 | do { |
| 1030 | - $boucle_placeholder = 'BOUCLE_PLACEHOLDER_' . strtoupper(md5(uniqid())); |
|
| 1030 | + $boucle_placeholder = 'BOUCLE_PLACEHOLDER_'.strtoupper(md5(uniqid())); |
|
| 1031 | 1031 | } while (strpos($texte, $boucle_placeholder) !== false); |
| 1032 | 1032 | } |
| 1033 | 1033 | |
@@ -1047,7 +1047,7 @@ discard block |
||
| 1047 | 1047 | |
| 1048 | 1048 | // boucle anonyme ? |
| 1049 | 1049 | if (!strlen($id_boucle)) { |
| 1050 | - $id_boucle = '_anon_L' . $ligne_milieu . '_' . substr(md5('anonyme:' . $id_parent . ':' . json_encode($boucle, JSON_THROW_ON_ERROR)), 0, 8); |
|
| 1050 | + $id_boucle = '_anon_L'.$ligne_milieu.'_'.substr(md5('anonyme:'.$id_parent.':'.json_encode($boucle, JSON_THROW_ON_ERROR)), 0, 8); |
|
| 1051 | 1051 | } |
| 1052 | 1052 | |
| 1053 | 1053 | $pos_debut_boucle = $pos_courante; |
@@ -1060,7 +1060,7 @@ discard block |
||
| 1060 | 1060 | |
| 1061 | 1061 | $pos_avant = $boucle['pos_precond_inside']; |
| 1062 | 1062 | $result->avant = substr($texte, $pos_avant, $pos_courante - $pos_avant); |
| 1063 | - $ligne_avant = $ligne_debut_texte + public_compte_ligne($texte, $pos_debut_texte, $pos_avant); |
|
| 1063 | + $ligne_avant = $ligne_debut_texte + public_compte_ligne($texte, $pos_debut_texte, $pos_avant); |
|
| 1064 | 1064 | } |
| 1065 | 1065 | |
| 1066 | 1066 | // Regarder si on a une partie inconditionnelle avant <BB_xxx> |
@@ -1069,7 +1069,7 @@ discard block |
||
| 1069 | 1069 | |
| 1070 | 1070 | $pos_preaff = $boucle['pos_preaff_inside']; |
| 1071 | 1071 | $result->preaff = substr($texte, $pos_preaff, $end_preaff - $pos_preaff); |
| 1072 | - $ligne_preaff = $ligne_debut_texte + public_compte_ligne($texte, $pos_debut_texte, $pos_preaff); |
|
| 1072 | + $ligne_preaff = $ligne_debut_texte + public_compte_ligne($texte, $pos_debut_texte, $pos_preaff); |
|
| 1073 | 1073 | } |
| 1074 | 1074 | |
| 1075 | 1075 | $result->id_boucle = $id_boucle; |
@@ -1126,7 +1126,7 @@ discard block |
||
| 1126 | 1126 | } else { |
| 1127 | 1127 | $pos_milieu += 1; |
| 1128 | 1128 | |
| 1129 | - $fin_boucle = BALISE_FIN_BOUCLE . $id_boucle_search . '>'; |
|
| 1129 | + $fin_boucle = BALISE_FIN_BOUCLE.$id_boucle_search.'>'; |
|
| 1130 | 1130 | $pos_fin = strpos($texte, $fin_boucle, $pos_milieu); |
| 1131 | 1131 | if ($pos_fin === false) { |
| 1132 | 1132 | $err_b = [ |
@@ -1139,7 +1139,7 @@ discard block |
||
| 1139 | 1139 | else { |
| 1140 | 1140 | // verifier une eventuelle imbrication d'une boucle homonyme |
| 1141 | 1141 | // (interdite, generera une erreur plus loin, mais permet de signaler la bonne erreur) |
| 1142 | - $search_debut_boucle = BALISE_BOUCLE . $id_boucle_search . '('; |
|
| 1142 | + $search_debut_boucle = BALISE_BOUCLE.$id_boucle_search.'('; |
|
| 1143 | 1143 | $search_from = $pos_milieu; |
| 1144 | 1144 | $nb_open = 1; |
| 1145 | 1145 | $nb_close = 1; |
@@ -1179,7 +1179,7 @@ discard block |
||
| 1179 | 1179 | if ($boucle['pos_postcond']) { |
| 1180 | 1180 | $result->apres = substr($texte, $pos_courante, $boucle['pos_postcond'] - $pos_courante); |
| 1181 | 1181 | $ligne_suite += public_compte_ligne($texte, $pos_courante, $boucle['pos_postcond_inside']); |
| 1182 | - $pos_courante = $boucle['pos_postcond_inside'] ; |
|
| 1182 | + $pos_courante = $boucle['pos_postcond_inside']; |
|
| 1183 | 1183 | } |
| 1184 | 1184 | |
| 1185 | 1185 | |
@@ -80,7 +80,7 @@ discard block |
||
| 80 | 80 | } else { |
| 81 | 81 | // Preparer l'appel de la fonction principale du squelette |
| 82 | 82 | |
| 83 | - spip_timer($a = 'calcul page ' . random_int(0, 1000)); |
|
| 83 | + spip_timer($a = 'calcul page '.random_int(0, 1000)); |
|
| 84 | 84 | |
| 85 | 85 | // On cree un marqueur de notes unique lie a cette composition |
| 86 | 86 | // et on enregistre l'etat courant des globales de notes... |
@@ -112,8 +112,8 @@ discard block |
||
| 112 | 112 | try { |
| 113 | 113 | $page = $fonc(['cache' => $cache], [$contexte]); |
| 114 | 114 | } catch (Throwable $e) { |
| 115 | - $msg = _T('zbug_erreur_execution_page') . " $sourcefile"; |
|
| 116 | - $full_msg = $msg . ' | File ' . $e->getFile() . ' Line ' . $e->getLine() . ' : ' . $e->getMessage(); |
|
| 115 | + $msg = _T('zbug_erreur_execution_page')." $sourcefile"; |
|
| 116 | + $full_msg = $msg.' | File '.$e->getFile().' Line '.$e->getLine().' : '.$e->getMessage(); |
|
| 117 | 117 | $full_msg = str_replace(_ROOT_RACINE, '[…]/', $full_msg); |
| 118 | 118 | $corps = "<pre>$msg</pre>"; |
| 119 | 119 | $page = analyse_resultat_skel($fond, ['cache' => $cache], $corps, $sourcefile); |
@@ -144,17 +144,17 @@ discard block |
||
| 144 | 144 | |
| 145 | 145 | $profile = spip_timer($a); |
| 146 | 146 | spip_log("calcul ($profile) [$skel] $infos" |
| 147 | - . ' (' . strlen($page['texte']) . ' octets)'); |
|
| 147 | + . ' ('.strlen($page['texte']).' octets)'); |
|
| 148 | 148 | |
| 149 | 149 | if (defined('_CALCUL_PROFILER') and intval($profile) > _CALCUL_PROFILER) { |
| 150 | 150 | spip_log("calcul ($profile) [$skel] $infos" |
| 151 | - . ' (' . strlen($page['texte']) . ' octets) | ' . $_SERVER['REQUEST_URI'], 'profiler' . _LOG_AVERTISSEMENT); |
|
| 151 | + . ' ('.strlen($page['texte']).' octets) | '.$_SERVER['REQUEST_URI'], 'profiler'._LOG_AVERTISSEMENT); |
|
| 152 | 152 | } |
| 153 | 153 | |
| 154 | 154 | if ($debug) { |
| 155 | 155 | // si c'est ce que demande le debusqueur, lui passer la main |
| 156 | 156 | $t = strlen($page['texte']) ? $page['texte'] : ' '; |
| 157 | - $GLOBALS['debug_objets']['resultat'][$fonc . 'tout'] = $t; |
|
| 157 | + $GLOBALS['debug_objets']['resultat'][$fonc.'tout'] = $t; |
|
| 158 | 158 | $GLOBALS['debug_objets']['courant'] = $courant; |
| 159 | 159 | $GLOBALS['debug_objets']['profile'][$sourcefile] = $profile; |
| 160 | 160 | if ( |
@@ -185,7 +185,7 @@ discard block |
||
| 185 | 185 | if (defined('_VAR_INCLURE') and _VAR_INCLURE) { |
| 186 | 186 | $page['sourcefile'] = $sourcefile; |
| 187 | 187 | $page['texte'] = |
| 188 | - "<div class='inclure_blocs'><h6>" . $page['sourcefile'] . '</h6>' . $page['texte'] . '</div>' |
|
| 188 | + "<div class='inclure_blocs'><h6>".$page['sourcefile'].'</h6>'.$page['texte'].'</div>' |
|
| 189 | 189 | . ($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>"); |
| 190 | 190 | $js_inclus = true; |
| 191 | 191 | } |
@@ -222,14 +222,14 @@ discard block |
||
| 222 | 222 | $val = ''; |
| 223 | 223 | } elseif (is_array($val)) { |
| 224 | 224 | if ($profondeur_max > 0) { |
| 225 | - $val = 'array:' . count($val) . '(' . presenter_contexte($val, $profondeur_max - 1, 3) . ')'; |
|
| 225 | + $val = 'array:'.count($val).'('.presenter_contexte($val, $profondeur_max - 1, 3).')'; |
|
| 226 | 226 | } else { |
| 227 | - $val = 'array:' . count($val); |
|
| 227 | + $val = 'array:'.count($val); |
|
| 228 | 228 | } |
| 229 | 229 | } elseif (is_object($val)) { |
| 230 | 230 | $val = get_class($val); |
| 231 | 231 | } elseif (strlen("$val") > 30) { |
| 232 | - $val = substr("$val", 0, 29) . '…'; |
|
| 232 | + $val = substr("$val", 0, 29).'…'; |
|
| 233 | 233 | if (strstr($val, ' ')) { |
| 234 | 234 | $val = "'$val'"; |
| 235 | 235 | } |
@@ -238,7 +238,7 @@ discard block |
||
| 238 | 238 | } elseif (!strlen($val)) { |
| 239 | 239 | $val = "''"; |
| 240 | 240 | } |
| 241 | - $infos[] = $var . '=' . $val; |
|
| 241 | + $infos[] = $var.'='.$val; |
|
| 242 | 242 | } |
| 243 | 243 | return join(', ', $infos); |
| 244 | 244 | } |
@@ -306,7 +306,7 @@ discard block |
||
| 306 | 306 | . "?php include_spip('inc/headers');redirige_par_entete('" |
| 307 | 307 | . texte_script($url) |
| 308 | 308 | . "','',$status);" |
| 309 | - . '?' . '>', |
|
| 309 | + . '?'.'>', |
|
| 310 | 310 | 'process_ins' => 'php', |
| 311 | 311 | 'status' => $status |
| 312 | 312 | ]; |
@@ -124,7 +124,7 @@ discard block |
||
| 124 | 124 | $select = true |
| 125 | 125 | ) { |
| 126 | 126 | if (!is_string($defaut)) { |
| 127 | - $defaut = '($Pile[0][\'' . strtolower($nom_champ) . '\'] ?? null)'; |
|
| 127 | + $defaut = '($Pile[0][\''.strtolower($nom_champ).'\'] ?? null)'; |
|
| 128 | 128 | } |
| 129 | 129 | |
| 130 | 130 | $idb_origine = $idb; |
@@ -157,7 +157,7 @@ discard block |
||
| 157 | 157 | } |
| 158 | 158 | // renseigner la boucle source de ce champ pour les traitements |
| 159 | 159 | $boucles[$idb_origine]->index_champ[$nom_champ_origine] = $idb; |
| 160 | - $champ = '$Pile[$SP' . ($i ? "-$i" : '') . '][\'' . $c . '\']'; |
|
| 160 | + $champ = '$Pile[$SP'.($i ? "-$i" : '').'][\''.$c.'\']'; |
|
| 161 | 161 | if (!$joker) { |
| 162 | 162 | return index_compose($conditionnel, $champ); |
| 163 | 163 | } |
@@ -198,7 +198,7 @@ discard block |
||
| 198 | 198 | function index_compose($conditionnel, $defaut) { |
| 199 | 199 | while ($c = array_pop($conditionnel)) { |
| 200 | 200 | // si on passe defaut = '', ne pas générer d'erreur de compilation. |
| 201 | - $defaut = "($c:(" . ($defaut ?: "''") . '))'; |
|
| 201 | + $defaut = "($c:(".($defaut ?: "''").'))'; |
|
| 202 | 202 | } |
| 203 | 203 | |
| 204 | 204 | return $defaut; |
@@ -245,7 +245,7 @@ discard block |
||
| 245 | 245 | if (!$r) { |
| 246 | 246 | $joker = false; // indiquer a l'appelant |
| 247 | 247 | # continuer pour chercher l'erreur suivante |
| 248 | - return ["'#" . $r . ':' . $nom_champ . "'", '']; |
|
| 248 | + return ["'#".$r.':'.$nom_champ."'", '']; |
|
| 249 | 249 | } |
| 250 | 250 | |
| 251 | 251 | $desc = $boucles[$idb]->show; |
@@ -348,8 +348,8 @@ discard block |
||
| 348 | 348 | $t = $index_exception_derogatoire($boucle, $desc, $nom_champ, $excep); |
| 349 | 349 | } |
| 350 | 350 | if ($t == null) { |
| 351 | - [$e, $x] = $excep; #PHP4 affecte de gauche a droite |
|
| 352 | - $excep = $x; #PHP5 de droite a gauche ! |
|
| 351 | + [$e, $x] = $excep; #PHP4 affecte de gauche a droite |
|
| 352 | + $excep = $x; #PHP5 de droite a gauche ! |
|
| 353 | 353 | $j = $trouver_table($e, $boucle->sql_serveur); |
| 354 | 354 | if (!$j) { |
| 355 | 355 | return ['', '']; |
@@ -361,7 +361,7 @@ discard block |
||
| 361 | 361 | $l = (preg_split('/\s*,\s*/', $k)); |
| 362 | 362 | $k = $desc['key']['PRIMARY KEY']; |
| 363 | 363 | if (!in_array($k, $l)) { |
| 364 | - spip_log("jointure impossible $e " . join(',', $l)); |
|
| 364 | + spip_log("jointure impossible $e ".join(',', $l)); |
|
| 365 | 365 | |
| 366 | 366 | return ['', '']; |
| 367 | 367 | } |
@@ -377,7 +377,7 @@ discard block |
||
| 377 | 377 | // demander a SQL de gerer le synonyme |
| 378 | 378 | // ca permet que excep soit dynamique (Cedric, 2/3/06) |
| 379 | 379 | if ($excep != $nom_champ) { |
| 380 | - $excep .= ' AS ' . $nom_champ; |
|
| 380 | + $excep .= ' AS '.$nom_champ; |
|
| 381 | 381 | } |
| 382 | 382 | |
| 383 | 383 | return ["$t.$excep", $nom_champ]; |
@@ -611,7 +611,7 @@ discard block |
||
| 611 | 611 | join(',', $collecte), |
| 612 | 612 | ($collecte ? $param : substr($param, 1)), # virer la virgule |
| 613 | 613 | memoriser_contexte_compil($p), |
| 614 | - (!$supp ? '' : (', ' . join(',', $supp))) |
|
| 614 | + (!$supp ? '' : (', '.join(',', $supp))) |
|
| 615 | 615 | ); |
| 616 | 616 | |
| 617 | 617 | $p->interdire_scripts = false; |
@@ -709,7 +709,7 @@ discard block |
||
| 709 | 709 | $nom = $p->id_boucle; |
| 710 | 710 | |
| 711 | 711 | if ($nom and trouver_nom_serveur_distant($p)) { |
| 712 | - spip_log($nom . ':' . $p->nom_champ . ' ' . _T('zbug_distant_interdit')); |
|
| 712 | + spip_log($nom.':'.$p->nom_champ.' '._T('zbug_distant_interdit')); |
|
| 713 | 713 | |
| 714 | 714 | return false; |
| 715 | 715 | } |
@@ -795,7 +795,7 @@ discard block |
||
| 795 | 795 | (strpos($ps, 'typo') !== false) |
| 796 | 796 | ) |
| 797 | 797 | ) { |
| 798 | - $ps = 'traiter_doublons_documents($doublons, ' . $ps . ')'; |
|
| 798 | + $ps = 'traiter_doublons_documents($doublons, '.$ps.')'; |
|
| 799 | 799 | } |
| 800 | 800 | |
| 801 | 801 | // La protection des champs par |safehtml est assuree par les extensions |
@@ -916,7 +916,7 @@ discard block |
||
| 916 | 916 | function compose_filtres_args($p, $args, $sep) { |
| 917 | 917 | $arglist = ''; |
| 918 | 918 | foreach ($args as $arg) { |
| 919 | - $arglist .= $sep . |
|
| 919 | + $arglist .= $sep. |
|
| 920 | 920 | calculer_liste($arg, $p->descr, $p->boucles, $p->id_boucle); |
| 921 | 921 | } |
| 922 | 922 | |
@@ -967,7 +967,7 @@ discard block |
||
| 967 | 967 | while ($b != '') { |
| 968 | 968 | foreach ($p->boucles[$b]->criteres as $critere) { |
| 969 | 969 | if ($critere->op == $motif) { |
| 970 | - $p->code = '$Pile[$SP' . (($n == 0) ? '' : "-$n") . |
|
| 970 | + $p->code = '$Pile[$SP'.(($n == 0) ? '' : "-$n"). |
|
| 971 | 971 | "]['$champ']"; |
| 972 | 972 | $b = ''; |
| 973 | 973 | break 2; |
@@ -995,6 +995,6 @@ discard block |
||
| 995 | 995 | */ |
| 996 | 996 | function zbug_presenter_champ($p, $champ = '') { |
| 997 | 997 | $balise = $champ ?: $p->nom_champ; |
| 998 | - $explicite = $p->nom_boucle ? $p->nom_boucle . ':' : ''; |
|
| 998 | + $explicite = $p->nom_boucle ? $p->nom_boucle.':' : ''; |
|
| 999 | 999 | return "#{$explicite}{$balise}"; |
| 1000 | 1000 | } |
@@ -111,13 +111,13 @@ discard block |
||
| 111 | 111 | |
| 112 | 112 | function chrono_requete($temps) { |
| 113 | 113 | $total = 0; |
| 114 | - $hors = '<i>' . _T('zbug_hors_compilation') . '</i>'; |
|
| 114 | + $hors = '<i>'._T('zbug_hors_compilation').'</i>'; |
|
| 115 | 115 | $t = $q = $n = $d = []; |
| 116 | 116 | // Totaliser les temps et completer le Explain |
| 117 | 117 | foreach ($temps as $key => $v) { |
| 118 | 118 | [$dt, $nb, $boucle, $query, $explain, $res, $contexte] = $v; |
| 119 | 119 | if (is_array($contexte)) { |
| 120 | - $k = ($contexte[0] . " $boucle"); |
|
| 120 | + $k = ($contexte[0]." $boucle"); |
|
| 121 | 121 | include_spip('public/compiler'); |
| 122 | 122 | $env = reconstruire_contexte_compil($contexte); |
| 123 | 123 | } else { |
@@ -162,7 +162,7 @@ discard block |
||
| 162 | 162 | // Fabriquer les liens de navigations dans le tableau des temps |
| 163 | 163 | foreach ($temps as $k => $v) { |
| 164 | 164 | $titre = strip_tags($v[2]); |
| 165 | - $href = quote_amp($GLOBALS['REQUEST_URI']) . "#req$i"; |
|
| 165 | + $href = quote_amp($GLOBALS['REQUEST_URI'])."#req$i"; |
|
| 166 | 166 | $href = str_replace("\\'", ''', $href); |
| 167 | 167 | |
| 168 | 168 | if (!isset($t[$v[2]])) { |
@@ -183,7 +183,7 @@ discard block |
||
| 183 | 183 | unset($d['']); |
| 184 | 184 | // Fabriquer le tableau des liens de navigation dans le grand tableau |
| 185 | 185 | foreach ($d as $k => $v) { |
| 186 | - $d[$k] = $n[$k] . "</td><td>$k</td><td class='time'>$v</td><td class='liste-reqs'>" |
|
| 186 | + $d[$k] = $n[$k]."</td><td>$k</td><td class='time'>$v</td><td class='liste-reqs'>" |
|
| 187 | 187 | . join('', $t[$k]); |
| 188 | 188 | } |
| 189 | 189 | |
@@ -193,7 +193,7 @@ discard block |
||
| 193 | 193 | . join("</td></tr>\n<tr><td>", $d) |
| 194 | 194 | . "</td></tr>\n" |
| 195 | 195 | . (# _request('var_mode_objet') ? '' : |
| 196 | - ('<tr><td>' . (is_countable($temps) ? count($temps) : 0) . '</td><td>' . _T('info_total') . '</td><td class="time">' . $total . '</td><td></td></tr>')) |
|
| 196 | + ('<tr><td>'.(is_countable($temps) ? count($temps) : 0).'</td><td>'._T('info_total').'</td><td class="time">'.$total.'</td><td></td></tr>')) |
|
| 197 | 197 | ]; |
| 198 | 198 | |
| 199 | 199 | return [$temps, $navigation]; |
@@ -51,11 +51,11 @@ discard block |
||
| 51 | 51 | define('_DIR_RACINE', _DIR_RESTREINT ? '' : '../'); |
| 52 | 52 | |
| 53 | 53 | /** chemin absolu vers la racine */ |
| 54 | -define('_ROOT_RACINE', dirname(__DIR__) . '/'); |
|
| 54 | +define('_ROOT_RACINE', dirname(__DIR__).'/'); |
|
| 55 | 55 | /** chemin absolu vers le repertoire de travail */ |
| 56 | -define('_ROOT_CWD', getcwd() . '/'); |
|
| 56 | +define('_ROOT_CWD', getcwd().'/'); |
|
| 57 | 57 | /** chemin absolu vers ecrire */ |
| 58 | -define('_ROOT_RESTREINT', _ROOT_CWD . _DIR_RESTREINT); |
|
| 58 | +define('_ROOT_RESTREINT', _ROOT_CWD._DIR_RESTREINT); |
|
| 59 | 59 | |
| 60 | 60 | // Icones |
| 61 | 61 | if (!defined('_NOM_IMG_PACK')) { |
@@ -63,17 +63,17 @@ discard block |
||
| 63 | 63 | define('_NOM_IMG_PACK', 'images/'); |
| 64 | 64 | } |
| 65 | 65 | /** le chemin http (relatif) vers les images standard */ |
| 66 | -define('_DIR_IMG_PACK', (_DIR_RACINE . 'prive/' . _NOM_IMG_PACK)); |
|
| 66 | +define('_DIR_IMG_PACK', (_DIR_RACINE.'prive/'._NOM_IMG_PACK)); |
|
| 67 | 67 | |
| 68 | 68 | /** le chemin php (absolu) vers les images standard (pour hebergement centralise) */ |
| 69 | -define('_ROOT_IMG_PACK', dirname(__DIR__) . '/prive/' . _NOM_IMG_PACK); |
|
| 69 | +define('_ROOT_IMG_PACK', dirname(__DIR__).'/prive/'._NOM_IMG_PACK); |
|
| 70 | 70 | |
| 71 | 71 | if (!defined('_JAVASCRIPT')) { |
| 72 | 72 | /** Nom du repertoire des bibliotheques JavaScript */ |
| 73 | 73 | define('_JAVASCRIPT', 'javascript/'); |
| 74 | 74 | } // utilisable avec #CHEMIN et find_in_path |
| 75 | 75 | /** le nom du repertoire des bibliotheques JavaScript du prive */ |
| 76 | -define('_DIR_JAVASCRIPT', (_DIR_RACINE . 'prive/' . _JAVASCRIPT)); |
|
| 76 | +define('_DIR_JAVASCRIPT', (_DIR_RACINE.'prive/'._JAVASCRIPT)); |
|
| 77 | 77 | |
| 78 | 78 | # Le nom des 4 repertoires modifiables par les scripts lances par httpd |
| 79 | 79 | # Par defaut ces 4 noms seront suffixes par _DIR_RACINE (cf plus bas) |
@@ -104,8 +104,8 @@ discard block |
||
| 104 | 104 | |
| 105 | 105 | // Son emplacement absolu si on le trouve |
| 106 | 106 | if ( |
| 107 | - @file_exists($f = _ROOT_RACINE . _NOM_PERMANENTS_INACCESSIBLES . _NOM_CONFIG . '.php') |
|
| 108 | - or (@file_exists($f = _ROOT_RESTREINT . _NOM_CONFIG . '.php')) |
|
| 107 | + @file_exists($f = _ROOT_RACINE._NOM_PERMANENTS_INACCESSIBLES._NOM_CONFIG.'.php') |
|
| 108 | + or (@file_exists($f = _ROOT_RESTREINT._NOM_CONFIG.'.php')) |
|
| 109 | 109 | ) { |
| 110 | 110 | /** Emplacement absolu du fichier d'option */ |
| 111 | 111 | define('_FILE_OPTIONS', $f); |
@@ -129,7 +129,7 @@ discard block |
||
| 129 | 129 | // Inclure l'ecran de securite |
| 130 | 130 | if ( |
| 131 | 131 | !defined('_ECRAN_SECURITE') |
| 132 | - and @file_exists($f = _ROOT_RACINE . _NOM_PERMANENTS_INACCESSIBLES . 'ecran_securite.php') |
|
| 132 | + and @file_exists($f = _ROOT_RACINE._NOM_PERMANENTS_INACCESSIBLES.'ecran_securite.php') |
|
| 133 | 133 | ) { |
| 134 | 134 | include $f; |
| 135 | 135 | } |
@@ -150,7 +150,7 @@ discard block |
||
| 150 | 150 | // UA plus cibles |
| 151 | 151 | . '80legs|accoona|AltaVista|ASPSeek|Baidu|Charlotte|EC2LinkFinder|eStyle|facebook|flipboard|hootsuite|FunWebProducts|Google|Genieo|INA dlweb|InfegyAtlas|Java VM|LiteFinder|Lycos|MetaURI|Moreover|Rambler|Scooter|ScrubbyBloglines|Yahoo|Yeti' |
| 152 | 152 | . ',i', |
| 153 | - (string)$_SERVER['HTTP_USER_AGENT'] |
|
| 153 | + (string) $_SERVER['HTTP_USER_AGENT'] |
|
| 154 | 154 | ) |
| 155 | 155 | ); |
| 156 | 156 | } |
@@ -392,7 +392,7 @@ discard block |
||
| 392 | 392 | # la matrice standard (fichiers definissant les fonctions a inclure) |
| 393 | 393 | $spip_matrice = []; |
| 394 | 394 | # les plugins a activer |
| 395 | -$plugins = []; // voir le contenu du repertoire /plugins/ |
|
| 395 | +$plugins = []; // voir le contenu du repertoire /plugins/ |
|
| 396 | 396 | # les surcharges de include_spip() |
| 397 | 397 | $surcharges = []; // format 'inc_truc' => '/plugins/chose/inc_truc2.php' |
| 398 | 398 | |
@@ -470,8 +470,8 @@ discard block |
||
| 470 | 470 | // |
| 471 | 471 | // Charger les fonctions liees aux serveurs Http et Sql. |
| 472 | 472 | // |
| 473 | -require_once _ROOT_RESTREINT . 'inc/utils.php'; |
|
| 474 | -require_once _ROOT_RESTREINT . 'base/connect_sql.php'; |
|
| 473 | +require_once _ROOT_RESTREINT.'inc/utils.php'; |
|
| 474 | +require_once _ROOT_RESTREINT.'base/connect_sql.php'; |
|
| 475 | 475 | |
| 476 | 476 | // Definition personnelles eventuelles |
| 477 | 477 | |
@@ -494,10 +494,10 @@ discard block |
||
| 494 | 494 | // ===> on execute en neutralisant les messages d'erreur |
| 495 | 495 | |
| 496 | 496 | spip_initialisation_core( |
| 497 | - (_DIR_RACINE . _NOM_PERMANENTS_INACCESSIBLES), |
|
| 498 | - (_DIR_RACINE . _NOM_PERMANENTS_ACCESSIBLES), |
|
| 499 | - (_DIR_RACINE . _NOM_TEMPORAIRES_INACCESSIBLES), |
|
| 500 | - (_DIR_RACINE . _NOM_TEMPORAIRES_ACCESSIBLES) |
|
| 497 | + (_DIR_RACINE._NOM_PERMANENTS_INACCESSIBLES), |
|
| 498 | + (_DIR_RACINE._NOM_PERMANENTS_ACCESSIBLES), |
|
| 499 | + (_DIR_RACINE._NOM_TEMPORAIRES_INACCESSIBLES), |
|
| 500 | + (_DIR_RACINE._NOM_TEMPORAIRES_ACCESSIBLES) |
|
| 501 | 501 | ); |
| 502 | 502 | |
| 503 | 503 | |
@@ -552,7 +552,7 @@ discard block |
||
| 552 | 552 | // Si on est dans le site public, dire que qq s'en occupe |
| 553 | 553 | include_spip('inc/minipres'); |
| 554 | 554 | utiliser_langue_visiteur(); |
| 555 | - echo minipres(_T('info_travaux_titre'), "<p style='text-align: center;'>" . _T('info_travaux_texte') . '</p>', ['status' => 503]); |
|
| 555 | + echo minipres(_T('info_travaux_titre'), "<p style='text-align: center;'>"._T('info_travaux_texte').'</p>', ['status' => 503]); |
|
| 556 | 556 | exit; |
| 557 | 557 | } |
| 558 | 558 | // autrement c'est une install ad hoc (spikini...), on sait pas faire |
@@ -591,12 +591,12 @@ discard block |
||
| 591 | 591 | } |
| 592 | 592 | if (!isset($GLOBALS['spip_header_silencieux']) or !$GLOBALS['spip_header_silencieux']) { |
| 593 | 593 | include_spip('inc/filtres_mini'); |
| 594 | - header(_HEADER_COMPOSED_BY . " $spip_version_affichee @ www.spip.net + " . url_absolue(_DIR_VAR . 'config.txt')); |
|
| 594 | + header(_HEADER_COMPOSED_BY." $spip_version_affichee @ www.spip.net + ".url_absolue(_DIR_VAR.'config.txt')); |
|
| 595 | 595 | } else { |
| 596 | 596 | // header minimal |
| 597 | - header(_HEADER_COMPOSED_BY . ' @ www.spip.net'); |
|
| 597 | + header(_HEADER_COMPOSED_BY.' @ www.spip.net'); |
|
| 598 | 598 | } |
| 599 | 599 | } |
| 600 | 600 | |
| 601 | 601 | $methode = ($_SERVER['REQUEST_METHOD'] ?? ((php_sapi_name() == 'cli') ? 'cli' : '')); |
| 602 | -spip_log($methode . ' ' . self() . ' - ' . _FILE_CONNECT, _LOG_DEBUG); |
|
| 602 | +spip_log($methode.' '.self().' - '._FILE_CONNECT, _LOG_DEBUG); |
|
@@ -147,11 +147,11 @@ discard block |
||
| 147 | 147 | if ($quoi !== 'actifs') { |
| 148 | 148 | $lpf = liste_plugin_files(); |
| 149 | 149 | if ($lpf) { |
| 150 | - echo '<p>' . _T('texte_presente_plugin') . '</p>'; |
|
| 150 | + echo '<p>'._T('texte_presente_plugin').'</p>'; |
|
| 151 | 151 | } else { |
| 152 | 152 | if (!@is_dir(_DIR_PLUGINS)) { |
| 153 | - echo '<p>' . _T('plugin_info_automatique_ftp', ['rep' => joli_repertoire(_DIR_PLUGINS)]) |
|
| 154 | - . ' — ' . _T('plugin_info_automatique_creer') . '</p>'; |
|
| 153 | + echo '<p>'._T('plugin_info_automatique_ftp', ['rep' => joli_repertoire(_DIR_PLUGINS)]) |
|
| 154 | + . ' — '._T('plugin_info_automatique_creer').'</p>'; |
|
| 155 | 155 | } |
| 156 | 156 | } |
| 157 | 157 | $lcpaffiche = $lpf; |
@@ -172,10 +172,10 @@ discard block |
||
| 172 | 172 | if (defined('_DIR_PLUGINS_SUPPL')) { |
| 173 | 173 | $nb += is_countable($lcpas) ? count($lcpas) : 0; |
| 174 | 174 | } |
| 175 | - echo '<h3>' . sinon( |
|
| 175 | + echo '<h3>'.sinon( |
|
| 176 | 176 | singulier_ou_pluriel($nb, 'plugins_actif_un', 'plugins_actifs', 'count'), |
| 177 | 177 | _T('plugins_actif_aucun') |
| 178 | - ) . '</h3>'; |
|
| 178 | + ).'</h3>'; |
|
| 179 | 179 | } |
| 180 | 180 | |
| 181 | 181 | if (empty($format)) { |
@@ -192,7 +192,7 @@ discard block |
||
| 192 | 192 | |
| 193 | 193 | if ($corps) { |
| 194 | 194 | $corps .= "\n<div class='boutons' style='display:none;'>" |
| 195 | - . "<input type='submit' class='submit save' value='" . _T('bouton_enregistrer') |
|
| 195 | + . "<input type='submit' class='submit save' value='"._T('bouton_enregistrer') |
|
| 196 | 196 | . "' />" |
| 197 | 197 | . '</div>'; |
| 198 | 198 | } |
@@ -266,7 +266,7 @@ discard block |
||
| 266 | 266 | . debut_cadre_trait_couleur('', true, '', _T('plugins_liste_dist'), 'liste_plugins_dist') |
| 267 | 267 | . '<p>' |
| 268 | 268 | . _T('plugin_info_plugins_dist_1', ['plugins_dist' => joli_repertoire(_DIR_PLUGINS_DIST)]) |
| 269 | - . '<br />' . _T('plugin_info_plugins_dist_2') |
|
| 269 | + . '<br />'._T('plugin_info_plugins_dist_2') |
|
| 270 | 270 | . '</p>' |
| 271 | 271 | . $liste |
| 272 | 272 | . fin_cadre_trait_couleur() |
@@ -289,7 +289,7 @@ discard block |
||
| 289 | 289 | $res = debut_cadre_enfonce('', true, '', _T('plugin_librairies_installees')); |
| 290 | 290 | $res .= '<dl>'; |
| 291 | 291 | foreach ($libs as $lib => $rep) { |
| 292 | - $res .= "<dt>$lib</dt><dd>" . joli_repertoire($rep) . "</dd>\n"; |
|
| 292 | + $res .= "<dt>$lib</dt><dd>".joli_repertoire($rep)."</dd>\n"; |
|
| 293 | 293 | } |
| 294 | 294 | $res .= '</dl>'; |
| 295 | 295 | $res .= fin_cadre_enfonce(); |
@@ -308,7 +308,7 @@ discard block |
||
| 308 | 308 | $libs = []; |
| 309 | 309 | foreach (array_reverse(creer_chemin()) as $d) { |
| 310 | 310 | if ( |
| 311 | - is_dir($dir = $d . 'lib/') |
|
| 311 | + is_dir($dir = $d.'lib/') |
|
| 312 | 312 | and $t = opendir($dir) |
| 313 | 313 | ) { |
| 314 | 314 | while (($f = readdir($t)) !== false) { |