@@ -54,12 +54,12 @@ |
||
| 54 | 54 | $_params = '['; |
| 55 | 55 | $nb_params = is_countable($p->param[0]) ? count($p->param[0]) : 0; // 1ère valeur vide donc 1 en plus |
| 56 | 56 | for ($i = 3; $i < $nb_params; $i++) { |
| 57 | - $_params .= interprete_argument_balise($i, $p) . ','; |
|
| 57 | + $_params .= interprete_argument_balise($i, $p).','; |
|
| 58 | 58 | } |
| 59 | 59 | $_params .= ']'; |
| 60 | 60 | |
| 61 | 61 | $info_sql = strtolower(substr($info, 5)); |
| 62 | - $code = "generer_info_entite($id_objet, $type_objet, '$info_sql', " . ($p->etoile ? _q($p->etoile) : "''") . ", $_params)"; |
|
| 62 | + $code = "generer_info_entite($id_objet, $type_objet, '$info_sql', ".($p->etoile ? _q($p->etoile) : "''").", $_params)"; |
|
| 63 | 63 | $p->code = champ_sql($info, $p, $code); |
| 64 | 64 | $p->interdire_scripts = true; |
| 65 | 65 | |
@@ -73,5 +73,5 @@ |
||
| 73 | 73 | return ''; |
| 74 | 74 | } |
| 75 | 75 | |
| 76 | - return generer_url_action('logout', 'logout=public&url=' . rawurlencode($cible ?: self('&'))); |
|
| 76 | + return generer_url_action('logout', 'logout=public&url='.rawurlencode($cible ?: self('&'))); |
|
| 77 | 77 | } |
@@ -121,7 +121,7 @@ discard block |
||
| 121 | 121 | : calculer_liste($val, $p->descr, $boucles, $id_boucle); |
| 122 | 122 | if ($var !== 1) { |
| 123 | 123 | $val = ($echap ? "\'$var\' => ' . argumenter_squelette(" : "'$var' => ") |
| 124 | - . $val . ($echap ? ") . '" : ' '); |
|
| 124 | + . $val.($echap ? ") . '" : ' '); |
|
| 125 | 125 | } else { |
| 126 | 126 | $val = $echap ? "'.$val.'" : $val; |
| 127 | 127 | } |
@@ -142,7 +142,7 @@ discard block |
||
| 142 | 142 | if (!$lang) { |
| 143 | 143 | $lang = '$GLOBALS["spip_lang"]'; |
| 144 | 144 | } |
| 145 | - $l['lang'] = ($echap ? "\'lang\' => ' . argumenter_squelette(" : "'lang' => ") . $lang . ($echap ? ") . '" : ' '); |
|
| 145 | + $l['lang'] = ($echap ? "\'lang\' => ' . argumenter_squelette(" : "'lang' => ").$lang.($echap ? ") . '" : ' '); |
|
| 146 | 146 | |
| 147 | 147 | return $l; |
| 148 | 148 | } |
@@ -172,7 +172,7 @@ discard block |
||
| 172 | 172 | $_contexte = argumenter_inclure($p->param, false, $p, $boucles, $id_boucle, true, '', true); |
| 173 | 173 | if (is_string($p->texte)) { |
| 174 | 174 | $fichier = $p->texte; |
| 175 | - $code = '"' . str_replace('"', '\"', $fichier) . '"'; |
|
| 175 | + $code = '"'.str_replace('"', '\"', $fichier).'"'; |
|
| 176 | 176 | } else { |
| 177 | 177 | $code = calculer_liste($p->texte, $p->descr, $boucles, $id_boucle); |
| 178 | 178 | if ($code and preg_match("/^'([^']*)'/s", $code, $r)) { |
@@ -221,7 +221,7 @@ discard block |
||
| 221 | 221 | return false; |
| 222 | 222 | } // j'aurais voulu toucher le fond ... |
| 223 | 223 | |
| 224 | - $contexte = 'array(' . $_contexte . ')'; |
|
| 224 | + $contexte = 'array('.$_contexte.')'; |
|
| 225 | 225 | |
| 226 | 226 | if ($env) { |
| 227 | 227 | $contexte = "array_merge('.var_export(\$Pile[0],1).',$contexte)"; |
@@ -236,16 +236,16 @@ discard block |
||
| 236 | 236 | $_options[] = $ajax; |
| 237 | 237 | } |
| 238 | 238 | $code = " ' . argumenter_squelette($code) . '"; |
| 239 | - $code = 'echo ' . sprintf( |
|
| 239 | + $code = 'echo '.sprintf( |
|
| 240 | 240 | CODE_RECUPERER_FOND, |
| 241 | 241 | $code, |
| 242 | 242 | $contexte, |
| 243 | 243 | implode(',', $_options), |
| 244 | 244 | "_request(\\'connect\\') ?? \\'\\'" |
| 245 | - ) . ';'; |
|
| 245 | + ).';'; |
|
| 246 | 246 | } |
| 247 | 247 | |
| 248 | - return "\n'<'.'" . '?php ' . $code . "\n?'." . "'>'"; |
|
| 248 | + return "\n'<'.'".'?php '.$code."\n?'."."'>'"; |
|
| 249 | 249 | } |
| 250 | 250 | |
| 251 | 251 | |
@@ -325,7 +325,7 @@ discard block |
||
| 325 | 325 | $id = $id_table; |
| 326 | 326 | $statut = preg_replace(',\W,', '', $s['champ']); // securite |
| 327 | 327 | } |
| 328 | - $mstatut = $id . '.' . $statut; |
|
| 328 | + $mstatut = $id.'.'.$statut; |
|
| 329 | 329 | |
| 330 | 330 | $arg_ignore_previsu = ($ignore_previsu ? ',true' : ''); |
| 331 | 331 | include_spip('public/quete'); |
@@ -333,11 +333,11 @@ discard block |
||
| 333 | 333 | isset($s['post_date']) and $s['post_date'] |
| 334 | 334 | and $GLOBALS['meta']['post_dates'] == 'non' |
| 335 | 335 | ) { |
| 336 | - $date = $id . '.' . preg_replace(',\W,', '', $s['post_date']); // securite |
|
| 336 | + $date = $id.'.'.preg_replace(',\W,', '', $s['post_date']); // securite |
|
| 337 | 337 | array_unshift( |
| 338 | 338 | $boucle->where, |
| 339 | 339 | $echapper ? |
| 340 | - "\nquete_condition_postdates('$date'," . _q($boucle->sql_serveur) . "$arg_ignore_previsu)" |
|
| 340 | + "\nquete_condition_postdates('$date',"._q($boucle->sql_serveur)."$arg_ignore_previsu)" |
|
| 341 | 341 | : |
| 342 | 342 | quete_condition_postdates($date, $boucle->sql_serveur, $ignore_previsu) |
| 343 | 343 | ); |
@@ -346,9 +346,9 @@ discard block |
||
| 346 | 346 | $boucle->where, |
| 347 | 347 | $echapper ? |
| 348 | 348 | "\nquete_condition_statut('$mstatut'," |
| 349 | - . _q($s['previsu']) . ',' |
|
| 350 | - . _q($s['publie']) . ',' |
|
| 351 | - . _q($boucle->sql_serveur) . "$arg_ignore_previsu)" |
|
| 349 | + . _q($s['previsu']).',' |
|
| 350 | + . _q($s['publie']).',' |
|
| 351 | + . _q($boucle->sql_serveur)."$arg_ignore_previsu)" |
|
| 352 | 352 | : |
| 353 | 353 | quete_condition_statut($mstatut, $s['previsu'], $s['publie'], $boucle->sql_serveur, $ignore_previsu) |
| 354 | 354 | ); |
@@ -382,14 +382,14 @@ discard block |
||
| 382 | 382 | if (_request('var_mode_affiche') != 'resultat') { |
| 383 | 383 | $trace = ''; |
| 384 | 384 | } else { |
| 385 | - $_trace = $boucles[$id_boucle]->descr['nom'] . $id_boucle; |
|
| 385 | + $_trace = $boucles[$id_boucle]->descr['nom'].$id_boucle; |
|
| 386 | 386 | $_trace = "\$GLOBALS['debug_objets']['resultat']['$_trace']"; |
| 387 | 387 | $trace = " |
| 388 | 388 | if (empty($_trace)) { |
| 389 | 389 | $_trace = []; |
| 390 | 390 | } |
| 391 | 391 | if (count($_trace) < 3) { |
| 392 | - $_trace" . '[] = $t0; |
|
| 392 | + $_trace".'[] = $t0; |
|
| 393 | 393 | }'; |
| 394 | 394 | } |
| 395 | 395 | |
@@ -423,7 +423,7 @@ discard block |
||
| 423 | 423 | return |
| 424 | 424 | // Numrows[$nom] peut ne pas être encore defini |
| 425 | 425 | "\n\t\$save_numrows = (isset(\$Numrows['$nom']) ? \$Numrows['$nom'] : array());" |
| 426 | - . "\n\t\$t0 = " . $boucles[$id_boucle]->return . ';' |
|
| 426 | + . "\n\t\$t0 = ".$boucles[$id_boucle]->return.';' |
|
| 427 | 427 | . "\n\t\$Numrows['$nom'] = (\$save_numrows);" |
| 428 | 428 | . $trace |
| 429 | 429 | . "\n\treturn \$t0;"; |
@@ -491,7 +491,7 @@ discard block |
||
| 491 | 491 | // faudrait expanser le foreach a la compil, car y en a souvent qu'un |
| 492 | 492 | // et puis faire un [] plutot qu'un "','." |
| 493 | 493 | if ($boucle->doublons) { |
| 494 | - $corps .= "\n\t\t\tforeach(" . $boucle->doublons . ' as $k) $doublons[$k] .= "," . ' . |
|
| 494 | + $corps .= "\n\t\t\tforeach(".$boucle->doublons.' as $k) $doublons[$k] .= "," . '. |
|
| 495 | 495 | index_pile($id_boucle, $primary, $boucles) |
| 496 | 496 | . "; // doublons\n"; |
| 497 | 497 | } |
@@ -519,13 +519,13 @@ discard block |
||
| 519 | 519 | $corps .= |
| 520 | 520 | "\n\t\tlang_select_public(" |
| 521 | 521 | . index_pile($id_boucle, 'lang', $boucles) |
| 522 | - . ", '" . $boucle->lang_select . "'" |
|
| 522 | + . ", '".$boucle->lang_select."'" |
|
| 523 | 523 | . (in_array($type_boucle, [ |
| 524 | 524 | 'articles', |
| 525 | 525 | 'rubriques', |
| 526 | 526 | 'hierarchie', |
| 527 | 527 | 'breves' |
| 528 | - ]) ? ', ' . index_pile($id_boucle, 'titre', $boucles) : '') |
|
| 528 | + ]) ? ', '.index_pile($id_boucle, 'titre', $boucles) : '') |
|
| 529 | 529 | . ');'; |
| 530 | 530 | } else { |
| 531 | 531 | $init_lang = ''; |
@@ -547,20 +547,16 @@ discard block |
||
| 547 | 547 | |
| 548 | 548 | // gestion optimale des separateurs et des boucles constantes |
| 549 | 549 | if (is_countable($boucle->separateur) ? count($boucle->separateur) : 0) { |
| 550 | - $code_sep = ("'" . str_replace("'", "\'", join('', $boucle->separateur)) . "'"); |
|
| 550 | + $code_sep = ("'".str_replace("'", "\'", join('', $boucle->separateur))."'"); |
|
| 551 | 551 | } |
| 552 | 552 | |
| 553 | 553 | $corps .= |
| 554 | 554 | ((!$boucle->separateur) ? |
| 555 | - (($constant && !$corps && !$flag_cpt) ? $return : |
|
| 556 | - (($return === "''") ? '' : |
|
| 557 | - ("\n\t\t" . '$t0 .= ' . $return . ';'))) : |
|
| 558 | - ("\n\t\t\$t1 " . |
|
| 555 | + (($constant && !$corps && !$flag_cpt) ? $return : (($return === "''") ? '' : ("\n\t\t".'$t0 .= '.$return.';'))) : ("\n\t\t\$t1 ". |
|
| 559 | 556 | ((strpos($return, '$t1.') === 0) ? |
| 560 | - ('.=' . substr($return, 4)) : |
|
| 561 | - ('= ' . $return)) . |
|
| 562 | - ";\n\t\t" . |
|
| 563 | - '$t0 .= ((strlen($t1) && strlen($t0)) ? ' . $code_sep . " : '') . \$t1;")); |
|
| 557 | + ('.='.substr($return, 4)) : ('= '.$return)). |
|
| 558 | + ";\n\t\t". |
|
| 559 | + '$t0 .= ((strlen($t1) && strlen($t0)) ? '.$code_sep." : '') . \$t1;")); |
|
| 564 | 560 | |
| 565 | 561 | // Calculer les invalideurs si c'est une boucle non constante et si on |
| 566 | 562 | // souhaite invalider ces elements |
@@ -642,7 +638,7 @@ discard block |
||
| 642 | 638 | $corps, |
| 643 | 639 | $fin_lang, |
| 644 | 640 | $trace, |
| 645 | - 'BOUCLE' . $id_boucle . ' @ ' . ($boucle->descr['sourcefile']) |
|
| 641 | + 'BOUCLE'.$id_boucle.' @ '.($boucle->descr['sourcefile']) |
|
| 646 | 642 | ); |
| 647 | 643 | |
| 648 | 644 | # var_dump($a);exit; |
@@ -663,25 +659,24 @@ discard block |
||
| 663 | 659 | **/ |
| 664 | 660 | function calculer_requete_sql($boucle) { |
| 665 | 661 | $init = []; |
| 666 | - $init[] = calculer_dec('table', "'" . $boucle->id_table . "'"); |
|
| 667 | - $init[] = calculer_dec('id', "'" . $boucle->id_boucle . "'"); |
|
| 662 | + $init[] = calculer_dec('table', "'".$boucle->id_table."'"); |
|
| 663 | + $init[] = calculer_dec('id', "'".$boucle->id_boucle."'"); |
|
| 668 | 664 | # En absence de champ c'est un decompte : |
| 669 | 665 | $init[] = calculer_dec('from', calculer_from($boucle)); |
| 670 | 666 | $init[] = calculer_dec('type', calculer_from_type($boucle)); |
| 671 | 667 | $init[] = calculer_dec( |
| 672 | 668 | 'groupby', |
| 673 | - 'array(' . (($g = join("\",\n\t\t\"", $boucle->group)) ? '"' . $g . '"' : '') . ')' |
|
| 669 | + 'array('.(($g = join("\",\n\t\t\"", $boucle->group)) ? '"'.$g.'"' : '').')' |
|
| 674 | 670 | ); |
| 675 | - $init[] = calculer_dec('select', 'array("' . join("\",\n\t\t\"", $boucle->select) . '")'); |
|
| 676 | - $init[] = calculer_dec('orderby', 'array(' . calculer_order($boucle) . ')'); |
|
| 671 | + $init[] = calculer_dec('select', 'array("'.join("\",\n\t\t\"", $boucle->select).'")'); |
|
| 672 | + $init[] = calculer_dec('orderby', 'array('.calculer_order($boucle).')'); |
|
| 677 | 673 | $init[] = calculer_dec('where', calculer_dump_array($boucle->where)); |
| 678 | 674 | $init[] = calculer_dec('join', calculer_dump_join($boucle->join)); |
| 679 | 675 | $init[] = calculer_dec( |
| 680 | 676 | 'limit', |
| 681 | 677 | ( |
| 682 | 678 | strpos($boucle->limit, 'intval') === false ? |
| 683 | - "'" . ($boucle->limit) . "'" : |
|
| 684 | - $boucle->limit |
|
| 679 | + "'".($boucle->limit)."'" : $boucle->limit |
|
| 685 | 680 | ) |
| 686 | 681 | ); |
| 687 | 682 | $init[] = calculer_dec('having', calculer_dump_array($boucle->having)); |
@@ -690,17 +685,17 @@ discard block |
||
| 690 | 685 | // ou recalculée à chaque passage (vide) |
| 691 | 686 | foreach ($init as $i) { |
| 692 | 687 | if (reset($i)) { |
| 693 | - $s .= "\n\t\t" . end($i); |
|
| 688 | + $s .= "\n\t\t".end($i); |
|
| 694 | 689 | } # statique |
| 695 | 690 | else { |
| 696 | - $d .= "\n\t" . end($i); |
|
| 691 | + $d .= "\n\t".end($i); |
|
| 697 | 692 | } # dynamique |
| 698 | 693 | } |
| 699 | 694 | |
| 700 | 695 | return ($boucle->hierarchie ? "\n\t$boucle->hierarchie" : '') |
| 701 | 696 | . $boucle->in |
| 702 | 697 | . $boucle->hash |
| 703 | - . "\n\t" . 'if (!isset($command[\'table\'])) {' |
|
| 698 | + . "\n\t".'if (!isset($command[\'table\'])) {' |
|
| 704 | 699 | . $s |
| 705 | 700 | . "\n\t}" |
| 706 | 701 | . $d; |
@@ -783,7 +778,7 @@ discard block |
||
| 783 | 778 | * - index 1 : Code de l'affectation |
| 784 | 779 | **/ |
| 785 | 780 | function calculer_dec($nom, $val) { |
| 786 | - $static = 'if (!isset($command[\'' . $nom . '\'])) '; |
|
| 781 | + $static = 'if (!isset($command[\''.$nom.'\'])) '; |
|
| 787 | 782 | // si une variable apparait dans le calcul de la clause |
| 788 | 783 | // il faut la re-evaluer a chaque passage |
| 789 | 784 | if ( |
@@ -800,7 +795,7 @@ discard block |
||
| 800 | 795 | $static = ''; |
| 801 | 796 | } |
| 802 | 797 | |
| 803 | - return [$static, '$command[\'' . $nom . '\'] = ' . $val . ';']; |
|
| 798 | + return [$static, '$command[\''.$nom.'\'] = '.$val.';']; |
|
| 804 | 799 | } |
| 805 | 800 | |
| 806 | 801 | /** |
@@ -825,17 +820,17 @@ discard block |
||
| 825 | 820 | } |
| 826 | 821 | $res = ''; |
| 827 | 822 | if ($a and $a[0] == "'?'") { |
| 828 | - return ('(' . calculer_dump_array($a[1]) . |
|
| 829 | - ' ? ' . calculer_dump_array($a[2]) . |
|
| 830 | - ' : ' . calculer_dump_array($a[3]) . |
|
| 823 | + return ('('.calculer_dump_array($a[1]). |
|
| 824 | + ' ? '.calculer_dump_array($a[2]). |
|
| 825 | + ' : '.calculer_dump_array($a[3]). |
|
| 831 | 826 | ')'); |
| 832 | 827 | } else { |
| 833 | 828 | foreach ($a as $k => $v) { |
| 834 | - $showk = (is_numeric($k) ? '' : sql_quote($k) . ' => '); |
|
| 835 | - $res .= ', ' . $showk . calculer_dump_array($v); |
|
| 829 | + $showk = (is_numeric($k) ? '' : sql_quote($k).' => '); |
|
| 830 | + $res .= ', '.$showk.calculer_dump_array($v); |
|
| 836 | 831 | } |
| 837 | 832 | |
| 838 | - return "\n\t\t\tarray(" . substr($res, 2) . ')'; |
|
| 833 | + return "\n\t\t\tarray(".substr($res, 2).')'; |
|
| 839 | 834 | } |
| 840 | 835 | } |
| 841 | 836 | |
@@ -843,10 +838,10 @@ discard block |
||
| 843 | 838 | function calculer_dump_join($a) { |
| 844 | 839 | $res = ''; |
| 845 | 840 | foreach ($a as $k => $v) { |
| 846 | - $res .= ", '$k' => array(" . implode(',', $v) . ')'; |
|
| 841 | + $res .= ", '$k' => array(".implode(',', $v).')'; |
|
| 847 | 842 | } |
| 848 | 843 | |
| 849 | - return 'array(' . substr($res, 2) . ')'; |
|
| 844 | + return 'array('.substr($res, 2).')'; |
|
| 850 | 845 | } |
| 851 | 846 | |
| 852 | 847 | /** |
@@ -863,7 +858,7 @@ discard block |
||
| 863 | 858 | $res .= ",'$k' => '$v'"; |
| 864 | 859 | } |
| 865 | 860 | |
| 866 | - return 'array(' . substr($res, 1) . ')'; |
|
| 861 | + return 'array('.substr($res, 1).')'; |
|
| 867 | 862 | } |
| 868 | 863 | |
| 869 | 864 | /** |
@@ -881,7 +876,7 @@ discard block |
||
| 881 | 876 | $res .= ",'$k' => '$v'"; |
| 882 | 877 | } |
| 883 | 878 | |
| 884 | - return 'array(' . substr($res, 1) . ')'; |
|
| 879 | + return 'array('.substr($res, 1).')'; |
|
| 885 | 880 | } |
| 886 | 881 | |
| 887 | 882 | // https://code.spip.net/@calculer_order |
@@ -952,19 +947,19 @@ discard block |
||
| 952 | 947 | ) { |
| 953 | 948 | $res .= " .\n$tab$code"; |
| 954 | 949 | } else { |
| 955 | - $res = substr($res, 0, -1) . substr($code, 1); |
|
| 950 | + $res = substr($res, 0, -1).substr($code, 1); |
|
| 956 | 951 | } |
| 957 | 952 | } |
| 958 | 953 | |
| 959 | - return '(' . substr($res, 2 + $descr['niv']) . ')'; |
|
| 954 | + return '('.substr($res, 2 + $descr['niv']).')'; |
|
| 960 | 955 | } |
| 961 | 956 | } else { |
| 962 | - $nom = $descr['nom'] . $id_boucle . ($descr['niv'] ?: ''); |
|
| 957 | + $nom = $descr['nom'].$id_boucle.($descr['niv'] ?: ''); |
|
| 963 | 958 | |
| 964 | - return "join('', array_map('array_shift', \$GLOBALS['debug_objets']['sequence']['$nom'] = array(" . join( |
|
| 959 | + return "join('', array_map('array_shift', \$GLOBALS['debug_objets']['sequence']['$nom'] = array(".join( |
|
| 965 | 960 | " ,\n$tab", |
| 966 | 961 | $codes |
| 967 | - ) . ')))'; |
|
| 962 | + ).')))'; |
|
| 968 | 963 | } |
| 969 | 964 | } |
| 970 | 965 | |
@@ -992,7 +987,7 @@ discard block |
||
| 992 | 987 | // texte seul |
| 993 | 988 | case 'texte': |
| 994 | 989 | $code = sandbox_composer_texte($p->texte, $p); |
| 995 | - $commentaire = strlen($p->texte) . ' signes'; |
|
| 990 | + $commentaire = strlen($p->texte).' signes'; |
|
| 996 | 991 | $avant = ''; |
| 997 | 992 | $apres = ''; |
| 998 | 993 | $altern = "''"; |
@@ -1001,14 +996,14 @@ discard block |
||
| 1001 | 996 | case 'polyglotte': |
| 1002 | 997 | $code = ''; |
| 1003 | 998 | foreach ($p->traductions as $k => $v) { |
| 1004 | - $code .= ",'" . |
|
| 1005 | - str_replace(['\\', "'"], ['\\\\', "\\'"], $k) . |
|
| 1006 | - "' => '" . |
|
| 1007 | - str_replace(['\\', "'"], ['\\\\', "\\'"], $v) . |
|
| 999 | + $code .= ",'". |
|
| 1000 | + str_replace(['\\', "'"], ['\\\\', "\\'"], $k). |
|
| 1001 | + "' => '". |
|
| 1002 | + str_replace(['\\', "'"], ['\\\\', "\\'"], $v). |
|
| 1008 | 1003 | "'"; |
| 1009 | 1004 | } |
| 1010 | - $code = 'choisir_traduction(array(' . |
|
| 1011 | - substr($code, 1) . |
|
| 1005 | + $code = 'choisir_traduction(array('. |
|
| 1006 | + substr($code, 1). |
|
| 1012 | 1007 | '))'; |
| 1013 | 1008 | $commentaire = '&'; |
| 1014 | 1009 | $avant = ''; |
@@ -1024,7 +1019,7 @@ discard block |
||
| 1024 | 1019 | $err_e_c = true; |
| 1025 | 1020 | $code = "''"; |
| 1026 | 1021 | } else { |
| 1027 | - $commentaire = '<INCLURE ' . addslashes(str_replace("\n", ' ', $code)) . '>'; |
|
| 1022 | + $commentaire = '<INCLURE '.addslashes(str_replace("\n", ' ', $code)).'>'; |
|
| 1028 | 1023 | $avant = ''; |
| 1029 | 1024 | $apres = ''; |
| 1030 | 1025 | $altern = "''"; |
@@ -1053,8 +1048,8 @@ discard block |
||
| 1053 | 1048 | $err_e_c = true; |
| 1054 | 1049 | $code = "''"; |
| 1055 | 1050 | } else { |
| 1056 | - $code = 'BOUCLE' . |
|
| 1057 | - str_replace('-', '_', $nom) . $descr['nom'] . |
|
| 1051 | + $code = 'BOUCLE'. |
|
| 1052 | + str_replace('-', '_', $nom).$descr['nom']. |
|
| 1058 | 1053 | '($Cache, $Pile, $doublons, $Numrows, $SP)'; |
| 1059 | 1054 | $commentaire = "?$nom"; |
| 1060 | 1055 | if ( |
@@ -1096,24 +1091,22 @@ discard block |
||
| 1096 | 1091 | foreach ($p->arg as $k => $v) { |
| 1097 | 1092 | $_v = calculer_liste($v, $descr, $boucles, $id_boucle); |
| 1098 | 1093 | if ($k) { |
| 1099 | - $l[] = _q($k) . ' => ' . $_v; |
|
| 1094 | + $l[] = _q($k).' => '.$_v; |
|
| 1100 | 1095 | } else { |
| 1101 | 1096 | $code = $_v; |
| 1102 | 1097 | } |
| 1103 | 1098 | } |
| 1104 | 1099 | // Si le module n'est pas fourni, l'expliciter sauf si calculé |
| 1105 | 1100 | if ($p->module) { |
| 1106 | - $m = $p->module . ':' . $p->nom_champ; |
|
| 1101 | + $m = $p->module.':'.$p->nom_champ; |
|
| 1107 | 1102 | } elseif ($p->nom_champ) { |
| 1108 | - $m = MODULES_IDIOMES . ':' . $p->nom_champ; |
|
| 1103 | + $m = MODULES_IDIOMES.':'.$p->nom_champ; |
|
| 1109 | 1104 | } else { |
| 1110 | 1105 | $m = ''; |
| 1111 | 1106 | } |
| 1112 | 1107 | |
| 1113 | - $code = (!$code ? "'$m'" : |
|
| 1114 | - ($m ? "'$m' . $code" : |
|
| 1115 | - ("(strpos(\$x=$code, ':') ? \$x : ('" . MODULES_IDIOMES . ":' . \$x))"))) |
|
| 1116 | - . (!$l ? '' : (', array(' . implode(",\n", $l) . ')')); |
|
| 1108 | + $code = (!$code ? "'$m'" : ($m ? "'$m' . $code" : ("(strpos(\$x=$code, ':') ? \$x : ('".MODULES_IDIOMES.":' . \$x))"))) |
|
| 1109 | + . (!$l ? '' : (', array('.implode(",\n", $l).')')); |
|
| 1117 | 1110 | $code = "_T($code)"; |
| 1118 | 1111 | if ($p->param) { |
| 1119 | 1112 | $p->id_boucle = $id_boucle; |
@@ -1135,7 +1128,7 @@ discard block |
||
| 1135 | 1128 | $p->type_requete = $type; |
| 1136 | 1129 | |
| 1137 | 1130 | $code = calculer_champ($p); |
| 1138 | - $commentaire = '#' . $p->nom_champ . $p->etoile; |
|
| 1131 | + $commentaire = '#'.$p->nom_champ.$p->etoile; |
|
| 1139 | 1132 | $avant = calculer_liste( |
| 1140 | 1133 | $p->avant, |
| 1141 | 1134 | $descr, |
@@ -1175,10 +1168,9 @@ discard block |
||
| 1175 | 1168 | if ($code != "''") { |
| 1176 | 1169 | $code = compile_retour($code, $avant, $apres, $altern, $tab, $descr['niv']); |
| 1177 | 1170 | $codes[] = (($mode == 'validation') ? |
| 1178 | - "array($code, '$commentaire', " . $p->ligne . ')' |
|
| 1171 | + "array($code, '$commentaire', ".$p->ligne.')' |
|
| 1179 | 1172 | : (($mode == 'code') ? |
| 1180 | - "\n// $commentaire\n$code" : |
|
| 1181 | - $code)); |
|
| 1173 | + "\n// $commentaire\n$code" : $code)); |
|
| 1182 | 1174 | } |
| 1183 | 1175 | } // foreach |
| 1184 | 1176 | |
@@ -1235,19 +1227,19 @@ discard block |
||
| 1235 | 1227 | $cond = ''; |
| 1236 | 1228 | } elseif (preg_match(_REGEXP_COND_VIDE_NONVIDE, $code, $r)) { |
| 1237 | 1229 | $t = $r[2]; |
| 1238 | - $cond = '!' . $r[1]; |
|
| 1230 | + $cond = '!'.$r[1]; |
|
| 1239 | 1231 | } else { |
| 1240 | 1232 | if (preg_match(_REGEXP_COND_NONVIDE_VIDE, $code, $r)) { |
| 1241 | 1233 | $t = $r[2]; |
| 1242 | 1234 | $cond = $r[1]; |
| 1243 | 1235 | } else { |
| 1244 | - $t = '$t' . $n; |
|
| 1236 | + $t = '$t'.$n; |
|
| 1245 | 1237 | $cond = "($t = $code)!==''"; |
| 1246 | 1238 | } |
| 1247 | 1239 | } |
| 1248 | 1240 | |
| 1249 | - $res = (!$avant ? '' : "$avant . ") . |
|
| 1250 | - $t . |
|
| 1241 | + $res = (!$avant ? '' : "$avant . "). |
|
| 1242 | + $t. |
|
| 1251 | 1243 | (!$apres ? '' : " . $apres"); |
| 1252 | 1244 | |
| 1253 | 1245 | if ($res !== $t) { |
@@ -1299,12 +1291,12 @@ discard block |
||
| 1299 | 1291 | |
| 1300 | 1292 | // rendre inertes les echappements de #[](){}<> |
| 1301 | 1293 | $i = 0; |
| 1302 | - while (false !== strpos($squelette, $inerte = '-INERTE' . $i)) { |
|
| 1294 | + while (false !== strpos($squelette, $inerte = '-INERTE'.$i)) { |
|
| 1303 | 1295 | $i++; |
| 1304 | 1296 | } |
| 1305 | 1297 | $squelette = preg_replace_callback( |
| 1306 | 1298 | ',\\\\([#[()\]{}<>]),', |
| 1307 | - fn($a) => "$inerte-" . ord($a[1]) . '-', |
|
| 1299 | + fn($a) => "$inerte-".ord($a[1]).'-', |
|
| 1308 | 1300 | $squelette, |
| 1309 | 1301 | -1, |
| 1310 | 1302 | $esc |
@@ -1320,7 +1312,7 @@ discard block |
||
| 1320 | 1312 | // Phraser le squelette, selon sa grammaire |
| 1321 | 1313 | |
| 1322 | 1314 | $boucles = []; |
| 1323 | - $f = charger_fonction('phraser_' . $gram, 'public'); |
|
| 1315 | + $f = charger_fonction('phraser_'.$gram, 'public'); |
|
| 1324 | 1316 | |
| 1325 | 1317 | $squelette = $f($squelette, '', $boucles, $descr); |
| 1326 | 1318 | |
@@ -1336,7 +1328,7 @@ discard block |
||
| 1336 | 1328 | ); |
| 1337 | 1329 | $boucles[$i]->descr['squelette'] = preg_replace_callback( |
| 1338 | 1330 | ",$inerte-(\d+)-,", |
| 1339 | - fn($a) => '\\\\' . chr($a[1]), |
|
| 1331 | + fn($a) => '\\\\'.chr($a[1]), |
|
| 1340 | 1332 | $boucle->descr['squelette'] |
| 1341 | 1333 | ); |
| 1342 | 1334 | } |
@@ -1347,19 +1339,19 @@ discard block |
||
| 1347 | 1339 | include_spip('public/decompiler'); |
| 1348 | 1340 | foreach ($boucles as $id => $boucle) { |
| 1349 | 1341 | if ($id) { |
| 1350 | - $decomp = "\n/* BOUCLE " . |
|
| 1351 | - $boucle->type_requete . |
|
| 1352 | - ' ' . |
|
| 1353 | - str_replace('*/', '* /', public_decompiler($boucle, $gram, 0, 'criteres')) . |
|
| 1354 | - ($boucle->debug ? "\n *\n * " . implode("\n * ", $boucle->debug) . "\n" : '') . |
|
| 1342 | + $decomp = "\n/* BOUCLE ". |
|
| 1343 | + $boucle->type_requete. |
|
| 1344 | + ' '. |
|
| 1345 | + str_replace('*/', '* /', public_decompiler($boucle, $gram, 0, 'criteres')). |
|
| 1346 | + ($boucle->debug ? "\n *\n * ".implode("\n * ", $boucle->debug)."\n" : ''). |
|
| 1355 | 1347 | " */\n"; |
| 1356 | 1348 | } else { |
| 1357 | - $decomp = ("\n/*\n" . |
|
| 1349 | + $decomp = ("\n/*\n". |
|
| 1358 | 1350 | str_replace('*/', '* /', public_decompiler($squelette, $gram)) |
| 1359 | 1351 | . "\n*/"); |
| 1360 | 1352 | } |
| 1361 | - $boucles[$id]->return = $decomp . $boucle->return; |
|
| 1362 | - $GLOBALS['debug_objets']['code'][$nom . $id] = $boucle->return; |
|
| 1353 | + $boucles[$id]->return = $decomp.$boucle->return; |
|
| 1354 | + $GLOBALS['debug_objets']['code'][$nom.$id] = $boucle->return; |
|
| 1363 | 1355 | } |
| 1364 | 1356 | } |
| 1365 | 1357 | |
@@ -1382,7 +1374,7 @@ discard block |
||
| 1382 | 1374 | } |
| 1383 | 1375 | } |
| 1384 | 1376 | foreach ($boucles as $id => $boucle) { |
| 1385 | - $GLOBALS['debug_objets']['boucle'][$nom . $id] = $boucle; |
|
| 1377 | + $GLOBALS['debug_objets']['boucle'][$nom.$id] = $boucle; |
|
| 1386 | 1378 | } |
| 1387 | 1379 | $descr['documents'] = compile_inclure_doublons($squelette); |
| 1388 | 1380 | |
@@ -1473,8 +1465,7 @@ discard block |
||
| 1473 | 1465 | } else { |
| 1474 | 1466 | $boucles[$id]->type_requete = false; |
| 1475 | 1467 | $boucle = $boucles[$id]; |
| 1476 | - $x = (!$boucle->sql_serveur ? '' : |
|
| 1477 | - ($boucle->sql_serveur . ':')) . |
|
| 1468 | + $x = (!$boucle->sql_serveur ? '' : ($boucle->sql_serveur.':')). |
|
| 1478 | 1469 | $type; |
| 1479 | 1470 | $msg = [ |
| 1480 | 1471 | 'zbug_table_inconnue', |
@@ -1564,13 +1555,13 @@ discard block |
||
| 1564 | 1555 | if ( |
| 1565 | 1556 | // fonction de boucle avec serveur & table |
| 1566 | 1557 | (!$serveur or |
| 1567 | - ((!function_exists($f = 'boucle_' . $serveur . '_' . $table)) |
|
| 1568 | - and (!function_exists($f = $f . '_dist')) |
|
| 1558 | + ((!function_exists($f = 'boucle_'.$serveur.'_'.$table)) |
|
| 1559 | + and (!function_exists($f = $f.'_dist')) |
|
| 1569 | 1560 | ) |
| 1570 | 1561 | ) |
| 1571 | 1562 | // fonction de boucle avec table |
| 1572 | - and (!function_exists($f = 'boucle_' . $table)) |
|
| 1573 | - and (!function_exists($f = $f . '_dist')) |
|
| 1563 | + and (!function_exists($f = 'boucle_'.$table)) |
|
| 1564 | + and (!function_exists($f = $f.'_dist')) |
|
| 1574 | 1565 | ) { |
| 1575 | 1566 | // fonction de boucle standard |
| 1576 | 1567 | if (!function_exists($f = 'boucle_DEFAUT')) { |
@@ -1578,20 +1569,20 @@ discard block |
||
| 1578 | 1569 | } |
| 1579 | 1570 | } |
| 1580 | 1571 | |
| 1581 | - $req = "\n\n\tstatic \$command = array();\n\t" . |
|
| 1582 | - "static \$connect;\n\t" . |
|
| 1583 | - "\$command['connect'] = \$connect = " . |
|
| 1584 | - _q($boucle->sql_serveur) . |
|
| 1585 | - ';' . |
|
| 1572 | + $req = "\n\n\tstatic \$command = array();\n\t". |
|
| 1573 | + "static \$connect;\n\t". |
|
| 1574 | + "\$command['connect'] = \$connect = ". |
|
| 1575 | + _q($boucle->sql_serveur). |
|
| 1576 | + ';'. |
|
| 1586 | 1577 | $f($id, $boucles); |
| 1587 | 1578 | } else { |
| 1588 | 1579 | $req = ("\n\treturn '';"); |
| 1589 | 1580 | } |
| 1590 | 1581 | |
| 1591 | 1582 | $boucles[$id]->return = |
| 1592 | - "\n\nfunction BOUCLE" . strtr($id, '-', '_') . $nom . |
|
| 1593 | - '(&$Cache, &$Pile, &$doublons, &$Numrows, $SP) {' . |
|
| 1594 | - $req . |
|
| 1583 | + "\n\nfunction BOUCLE".strtr($id, '-', '_').$nom. |
|
| 1584 | + '(&$Cache, &$Pile, &$doublons, &$Numrows, $SP) {'. |
|
| 1585 | + $req. |
|
| 1595 | 1586 | "\n}\n"; |
| 1596 | 1587 | } |
| 1597 | 1588 | |
@@ -1601,7 +1592,7 @@ discard block |
||
| 1601 | 1592 | return false; |
| 1602 | 1593 | } |
| 1603 | 1594 | |
| 1604 | - $principal = "\nfunction " . $nom . '($Cache, $Pile, $doublons = array(), $Numrows = array(), $SP = 0) { |
|
| 1595 | + $principal = "\nfunction ".$nom.'($Cache, $Pile, $doublons = array(), $Numrows = array(), $SP = 0) { |
|
| 1605 | 1596 | ' |
| 1606 | 1597 | // reporter de maniere securisee les doublons inclus |
| 1607 | 1598 | . ' |
@@ -1609,15 +1600,15 @@ discard block |
||
| 1609 | 1600 | $doublons = nettoyer_env_doublons($Pile[0]["doublons"]); |
| 1610 | 1601 | |
| 1611 | 1602 | $connect = ' . |
| 1612 | - _q($connect) . '; |
|
| 1603 | + _q($connect).'; |
|
| 1613 | 1604 | $page = ' . |
| 1614 | 1605 | // ATTENTION, le calcul de l'expression $corps affectera $Cache |
| 1615 | 1606 | // c'est pourquoi on l'affecte a la variable auxiliaire $page. |
| 1616 | 1607 | // avant de referencer $Cache |
| 1617 | - $corps . '; |
|
| 1608 | + $corps.'; |
|
| 1618 | 1609 | |
| 1619 | 1610 | return analyse_resultat_skel(' . var_export($nom, true) |
| 1620 | - . ', $Cache, $page, ' . var_export($sourcefile, true) . '); |
|
| 1611 | + . ', $Cache, $page, '.var_export($sourcefile, true).'); |
|
| 1621 | 1612 | }'; |
| 1622 | 1613 | |
| 1623 | 1614 | $secondes = spip_timer('calcul_skel'); |
@@ -1631,10 +1622,10 @@ discard block |
||
| 1631 | 1622 | $code->return = ' |
| 1632 | 1623 | // |
| 1633 | 1624 | // Fonction principale du squelette ' . |
| 1634 | - $sourcefile . |
|
| 1635 | - ($connect ? " pour $connect" : '') . |
|
| 1636 | - (!CODE_COMMENTE ? '' : "\n// Temps de compilation total: $secondes") . |
|
| 1637 | - "\n//\n" . |
|
| 1625 | + $sourcefile. |
|
| 1626 | + ($connect ? " pour $connect" : ''). |
|
| 1627 | + (!CODE_COMMENTE ? '' : "\n// Temps de compilation total: $secondes"). |
|
| 1628 | + "\n//\n". |
|
| 1638 | 1629 | $principal; |
| 1639 | 1630 | |
| 1640 | 1631 | $boucles[''] = $code; |
@@ -1686,7 +1677,7 @@ discard block |
||
| 1686 | 1677 | **/ |
| 1687 | 1678 | function requeteur_data_dist(&$boucles, &$boucle, &$id) { |
| 1688 | 1679 | include_spip('iterateur/data'); |
| 1689 | - if ($h = charger_fonction($boucle->type_requete . '_to_array', 'inc', true)) { |
|
| 1680 | + if ($h = charger_fonction($boucle->type_requete.'_to_array', 'inc', true)) { |
|
| 1690 | 1681 | $g = charger_fonction('data', 'iterateur'); |
| 1691 | 1682 | $boucles[$id] = $g($boucle); |
| 1692 | 1683 | // from[0] stocke le type de data (rss, yql, ...) |
@@ -29,7 +29,7 @@ discard block |
||
| 29 | 29 | $type .= ($struct->type_requete ?: $struct->table_optionnelle); |
| 30 | 30 | |
| 31 | 31 | if ($struct->jointures_explicites) { |
| 32 | - $type .= ' ' . $struct->jointures_explicites; |
|
| 32 | + $type .= ' '.$struct->jointures_explicites; |
|
| 33 | 33 | } |
| 34 | 34 | if ($struct->table_optionnelle) { |
| 35 | 35 | $type .= '?'; |
@@ -38,11 +38,11 @@ discard block |
||
| 38 | 38 | |
| 39 | 39 | $crit = $struct->param; |
| 40 | 40 | if ($crit and !is_array($crit[0])) { |
| 41 | - $type = strtolower($type) . array_shift($crit); |
|
| 41 | + $type = strtolower($type).array_shift($crit); |
|
| 42 | 42 | } |
| 43 | 43 | $crit = decompiler_criteres($struct, $fmt, $prof); |
| 44 | 44 | |
| 45 | - $f = 'format_boucle_' . $fmt; |
|
| 45 | + $f = 'format_boucle_'.$fmt; |
|
| 46 | 46 | |
| 47 | 47 | return $f($preaff, $avant, $nom, $type, $crit, $milieu, $apres, $altern, $postaff, $prof); |
| 48 | 48 | } |
@@ -55,21 +55,20 @@ discard block |
||
| 55 | 55 | $res[] = decompiler_($v, $fmt, $prof); |
| 56 | 56 | } |
| 57 | 57 | } |
| 58 | - $file = is_string($struct->texte) ? $struct->texte : |
|
| 59 | - decompiler_($struct->texte, $fmt, $prof); |
|
| 60 | - $f = 'format_inclure_' . $fmt; |
|
| 58 | + $file = is_string($struct->texte) ? $struct->texte : decompiler_($struct->texte, $fmt, $prof); |
|
| 59 | + $f = 'format_inclure_'.$fmt; |
|
| 61 | 60 | |
| 62 | 61 | return $f($file, $res, $prof); |
| 63 | 62 | } |
| 64 | 63 | |
| 65 | 64 | function decompiler_texte($struct, $fmt = '', $prof = 0) { |
| 66 | - $f = 'format_texte_' . $fmt; |
|
| 65 | + $f = 'format_texte_'.$fmt; |
|
| 67 | 66 | |
| 68 | 67 | return strlen($struct->texte) ? $f($struct->texte, $prof) : ''; |
| 69 | 68 | } |
| 70 | 69 | |
| 71 | 70 | function decompiler_polyglotte($struct, $fmt = '', $prof = 0) { |
| 72 | - $f = 'format_polyglotte_' . $fmt; |
|
| 71 | + $f = 'format_polyglotte_'.$fmt; |
|
| 73 | 72 | |
| 74 | 73 | return $f($struct->traductions, $prof); |
| 75 | 74 | } |
@@ -82,7 +81,7 @@ discard block |
||
| 82 | 81 | |
| 83 | 82 | $filtres = decompiler_liste($struct->param, $fmt, $prof); |
| 84 | 83 | |
| 85 | - $f = 'format_idiome_' . $fmt; |
|
| 84 | + $f = 'format_idiome_'.$fmt; |
|
| 86 | 85 | |
| 87 | 86 | return $f($struct->nom_champ, $struct->module, $args, $filtres, $prof); |
| 88 | 87 | } |
@@ -97,7 +96,7 @@ discard block |
||
| 97 | 96 | } |
| 98 | 97 | $filtres = decompiler_liste($p, $fmt, $prof); |
| 99 | 98 | } |
| 100 | - $f = 'format_champ_' . $fmt; |
|
| 99 | + $f = 'format_champ_'.$fmt; |
|
| 101 | 100 | |
| 102 | 101 | return $f($struct->nom_champ, $struct->nom_boucle, $struct->etoile, $avant, $apres, $args, $filtres, $prof); |
| 103 | 102 | } |
@@ -106,7 +105,7 @@ discard block |
||
| 106 | 105 | if (!is_array($sources)) { |
| 107 | 106 | return ''; |
| 108 | 107 | } |
| 109 | - $f = 'format_liste_' . $fmt; |
|
| 108 | + $f = 'format_liste_'.$fmt; |
|
| 110 | 109 | $res = ''; |
| 111 | 110 | foreach ($sources as $arg) { |
| 112 | 111 | if (!is_array($arg)) { |
@@ -123,7 +122,7 @@ discard block |
||
| 123 | 122 | and (strlen($v[0]->apres) == 1) |
| 124 | 123 | and $v[0]->apres == $v[0]->avant |
| 125 | 124 | ) { |
| 126 | - $args[] = $v[0]->avant . $v[0]->texte . $v[0]->apres; |
|
| 125 | + $args[] = $v[0]->avant.$v[0]->texte.$v[0]->apres; |
|
| 127 | 126 | } else { |
| 128 | 127 | $args[] = decompiler_($v, $fmt, 0 - $prof); |
| 129 | 128 | } |
@@ -146,7 +145,7 @@ discard block |
||
| 146 | 145 | return ''; |
| 147 | 146 | } |
| 148 | 147 | $res = ''; |
| 149 | - $f = 'format_critere_' . $fmt; |
|
| 148 | + $f = 'format_critere_'.$fmt; |
|
| 150 | 149 | foreach ($sources as $crit) { |
| 151 | 150 | if (!is_array($crit)) { |
| 152 | 151 | continue; |
@@ -159,13 +158,13 @@ discard block |
||
| 159 | 158 | and $v[0]->type == 'texte' |
| 160 | 159 | and $v[0]->apres |
| 161 | 160 | ) { |
| 162 | - $args[] = [['texte', ($v[0]->apres . $v[0]->texte . $v[0]->apres)]]; |
|
| 161 | + $args[] = [['texte', ($v[0]->apres.$v[0]->texte.$v[0]->apres)]]; |
|
| 163 | 162 | } else { |
| 164 | 163 | $res2 = []; |
| 165 | 164 | foreach ($v as $k => $p) { |
| 166 | 165 | if ( |
| 167 | 166 | isset($p->type) |
| 168 | - and function_exists($d = 'decompiler_' . $p->type) |
|
| 167 | + and function_exists($d = 'decompiler_'.$p->type) |
|
| 169 | 168 | ) { |
| 170 | 169 | $r = $d($p, $fmt, (0 - $prof), @$v[$k + 1]); |
| 171 | 170 | $res2[] = [$p->type, $r]; |
@@ -193,7 +192,7 @@ discard block |
||
| 193 | 192 | if (!isset($p->type)) { |
| 194 | 193 | continue; |
| 195 | 194 | } #?????? |
| 196 | - $d = 'decompiler_' . $p->type; |
|
| 195 | + $d = 'decompiler_'.$p->type; |
|
| 197 | 196 | $next = $liste[$k + 1] ?? false; |
| 198 | 197 | // Forcer le champ etendu si son source (pas les reecritures) |
| 199 | 198 | // contenait des args et s'il est suivi d'espaces, |
@@ -218,16 +217,16 @@ discard block |
||
| 218 | 217 | } |
| 219 | 218 | $contenu[] = [$d($p, $fmt, $prof2), $p->type]; |
| 220 | 219 | } |
| 221 | - $f = 'format_suite_' . $fmt; |
|
| 220 | + $f = 'format_suite_'.$fmt; |
|
| 222 | 221 | |
| 223 | 222 | return $f($contenu); |
| 224 | 223 | } |
| 225 | 224 | |
| 226 | 225 | function public_decompiler($liste, $fmt = '', $prof = 0, $quoi = '') { |
| 227 | - if (!include_spip('public/format_' . $fmt)) { |
|
| 226 | + if (!include_spip('public/format_'.$fmt)) { |
|
| 228 | 227 | return "'$fmt'?"; |
| 229 | 228 | } |
| 230 | - $f = 'decompiler_' . $quoi; |
|
| 229 | + $f = 'decompiler_'.$quoi; |
|
| 231 | 230 | |
| 232 | 231 | return $f($liste, $fmt, $prof); |
| 233 | 232 | } |
@@ -56,7 +56,7 @@ discard block |
||
| 56 | 56 | $GLOBALS['debug_objets']['courant'] = $nom; |
| 57 | 57 | } |
| 58 | 58 | |
| 59 | - $phpfile = sous_repertoire(_DIR_SKELS, '', false, true) . $nom . '.php'; |
|
| 59 | + $phpfile = sous_repertoire(_DIR_SKELS, '', false, true).$nom.'.php'; |
|
| 60 | 60 | |
| 61 | 61 | // si squelette est deja compile et perenne, le charger |
| 62 | 62 | if (!squelette_obsolete($phpfile, $source)) { |
@@ -69,7 +69,7 @@ discard block |
||
| 69 | 69 | #} |
| 70 | 70 | } |
| 71 | 71 | |
| 72 | - if (file_exists($lib = $squelette . '_fonctions' . '.php')) { |
|
| 72 | + if (file_exists($lib = $squelette.'_fonctions'.'.php')) { |
|
| 73 | 73 | include_once $lib; |
| 74 | 74 | } |
| 75 | 75 | |
@@ -97,7 +97,7 @@ discard block |
||
| 97 | 97 | eval("return true; $f ;"); |
| 98 | 98 | } catch (\ParseError $e) { |
| 99 | 99 | // Code syntaxiquement faux (critere etc mal programme') |
| 100 | - $msg = _T('zbug_erreur_compilation') . ' | Line ' . $e->getLine() . ' : ' . $e->getMessage(); |
|
| 100 | + $msg = _T('zbug_erreur_compilation').' | Line '.$e->getLine().' : '.$e->getMessage(); |
|
| 101 | 101 | erreur_squelette($msg, $boucle); |
| 102 | 102 | // continuer pour trouver d'autres fautes eventuelles |
| 103 | 103 | // mais prevenir que c'est mort |
@@ -125,7 +125,7 @@ discard block |
||
| 125 | 125 | |
| 126 | 126 | if (defined('_VAR_MODE') and _VAR_MODE == 'debug') { |
| 127 | 127 | // Tracer ce qui vient d'etre compile |
| 128 | - $GLOBALS['debug_objets']['code'][$nom . 'tout'] = $code; |
|
| 128 | + $GLOBALS['debug_objets']['code'][$nom.'tout'] = $code; |
|
| 129 | 129 | |
| 130 | 130 | // si c'est ce que demande le debusqueur, lui passer la main |
| 131 | 131 | if ( |
@@ -149,13 +149,13 @@ discard block |
||
| 149 | 149 | $code = " |
| 150 | 150 | /* |
| 151 | 151 | * Squelette : $sourcefile |
| 152 | - * Date : " . gmdate('D, d M Y H:i:s', @filemtime($sourcefile)) . ' GMT |
|
| 153 | - * Compile : ' . gmdate('D, d M Y H:i:s', time()) . ' GMT |
|
| 154 | - * ' . (!$boucles ? 'Pas de boucle' : ('Boucles : ' . $noms)) . ' |
|
| 152 | + * Date : ".gmdate('D, d M Y H:i:s', @filemtime($sourcefile)).' GMT |
|
| 153 | + * Compile : ' . gmdate('D, d M Y H:i:s', time()).' GMT |
|
| 154 | + * ' . (!$boucles ? 'Pas de boucle' : ('Boucles : '.$noms)).' |
|
| 155 | 155 | */ '; |
| 156 | 156 | } |
| 157 | 157 | |
| 158 | - $code = '<' . "?php\n" . $code . join('', $boucles) . "\n?" . '>'; |
|
| 158 | + $code = '<'."?php\n".$code.join('', $boucles)."\n?".'>'; |
|
| 159 | 159 | if (!defined('_VAR_NOCACHE') or !_VAR_NOCACHE) { |
| 160 | 160 | ecrire_fichier($phpfile, $code); |
| 161 | 161 | } |
@@ -219,7 +219,7 @@ discard block |
||
| 219 | 219 | $j = join('-', array_map('ucwords', explode('-', strtolower($r[2])))); |
| 220 | 220 | |
| 221 | 221 | if ($j == 'X-Spip-Filtre' and isset($headers[$j])) { |
| 222 | - $headers[$j] .= '|' . $r[3]; |
|
| 222 | + $headers[$j] .= '|'.$r[3]; |
|
| 223 | 223 | } else { |
| 224 | 224 | $headers[$j] = $r[3]; |
| 225 | 225 | } |
@@ -227,10 +227,10 @@ discard block |
||
| 227 | 227 | } |
| 228 | 228 | // S'agit-il d'un resultat constant ou contenant du code php |
| 229 | 229 | $process_ins = ( |
| 230 | - strpos($corps, '<' . '?') === false |
|
| 230 | + strpos($corps, '<'.'?') === false |
|
| 231 | 231 | or |
| 232 | - (strpos($corps, '<' . '?xml') !== false and |
|
| 233 | - strpos(str_replace('<' . '?xml', '', $corps), '<' . '?') === false) |
|
| 232 | + (strpos($corps, '<'.'?xml') !== false and |
|
| 233 | + strpos(str_replace('<'.'?xml', '', $corps), '<'.'?') === false) |
|
| 234 | 234 | ) |
| 235 | 235 | ? 'html' |
| 236 | 236 | : 'php'; |
@@ -259,10 +259,10 @@ discard block |
||
| 259 | 259 | |
| 260 | 260 | if ($process_ins == 'html') { |
| 261 | 261 | $skel['process_ins'] = ( |
| 262 | - strpos($corps, '<' . '?') === false |
|
| 262 | + strpos($corps, '<'.'?') === false |
|
| 263 | 263 | or |
| 264 | - (strpos($corps, '<' . '?xml') !== false and |
|
| 265 | - strpos(str_replace('<' . '?xml', '', $corps), '<' . '?') === false) |
|
| 264 | + (strpos($corps, '<'.'?xml') !== false and |
|
| 265 | + strpos(str_replace('<'.'?xml', '', $corps), '<'.'?') === false) |
|
| 266 | 266 | ) |
| 267 | 267 | ? 'html' |
| 268 | 268 | : 'php'; |
@@ -280,7 +280,7 @@ discard block |
||
| 280 | 280 | // |
| 281 | 281 | |
| 282 | 282 | /** Code PHP pour inclure une balise dynamique à l'exécution d'une page */ |
| 283 | -define('CODE_INCLURE_BALISE', '<' . '?php |
|
| 283 | +define('CODE_INCLURE_BALISE', '<'.'?php |
|
| 284 | 284 | include_once("%s"); |
| 285 | 285 | if ($lang_select = "%s") $lang_select = lang_select($lang_select); |
| 286 | 286 | inserer_balise_dynamique(balise_%s_dyn(%s), array(%s)); |
@@ -311,7 +311,7 @@ discard block |
||
| 311 | 311 | // pas de lien symbolique sous Windows |
| 312 | 312 | and !(stristr(PHP_OS, 'WIN') and strpos($file, ':') !== false) |
| 313 | 313 | ) { |
| 314 | - $file = './" . _DIR_RACINE . "' . $file; |
|
| 314 | + $file = './" . _DIR_RACINE . "'.$file; |
|
| 315 | 315 | } |
| 316 | 316 | |
| 317 | 317 | $lang = $context_compil[4]; |
@@ -321,7 +321,7 @@ discard block |
||
| 321 | 321 | |
| 322 | 322 | $args = array_map('argumenter_squelette', $args); |
| 323 | 323 | if (!empty($context_compil['appel_php_depuis_modele'])) { |
| 324 | - $args[0] = 'arguments_balise_dyn_depuis_modele(' . $args[0] . ')'; |
|
| 324 | + $args[0] = 'arguments_balise_dyn_depuis_modele('.$args[0].')'; |
|
| 325 | 325 | } |
| 326 | 326 | $args = join(', ', $args); |
| 327 | 327 | |
@@ -355,14 +355,14 @@ discard block |
||
| 355 | 355 | if (is_object($v)) { |
| 356 | 356 | return var_export($v, true); |
| 357 | 357 | } elseif (!is_array($v)) { |
| 358 | - return "'" . texte_script((string) $v) . "'"; |
|
| 358 | + return "'".texte_script((string) $v)."'"; |
|
| 359 | 359 | } else { |
| 360 | 360 | $out = []; |
| 361 | 361 | foreach ($v as $k => $val) { |
| 362 | - $out [] = argumenter_squelette($k) . '=>' . argumenter_squelette($val); |
|
| 362 | + $out [] = argumenter_squelette($k).'=>'.argumenter_squelette($val); |
|
| 363 | 363 | } |
| 364 | 364 | |
| 365 | - return 'array(' . join(', ', $out) . ')'; |
|
| 365 | + return 'array('.join(', ', $out).')'; |
|
| 366 | 366 | } |
| 367 | 367 | } |
| 368 | 368 | |
@@ -440,7 +440,7 @@ discard block |
||
| 440 | 440 | } |
| 441 | 441 | |
| 442 | 442 | // Y a-t-il une fonction de traitement des arguments ? |
| 443 | - $f = 'balise_' . $nom_balise . '_stat'; |
|
| 443 | + $f = 'balise_'.$nom_balise.'_stat'; |
|
| 444 | 444 | |
| 445 | 445 | $r = !function_exists($f) ? $args : $f($args, $context_compil); |
| 446 | 446 | |
@@ -450,18 +450,18 @@ discard block |
||
| 450 | 450 | |
| 451 | 451 | // verifier que la fonction dyn est la, |
| 452 | 452 | // sinon se replier sur la generique si elle existe |
| 453 | - if (!function_exists('balise_' . $nom_balise . '_dyn')) { |
|
| 453 | + if (!function_exists('balise_'.$nom_balise.'_dyn')) { |
|
| 454 | 454 | if ( |
| 455 | 455 | $balise_generique = chercher_balise_generique($nom) |
| 456 | 456 | and $nom_balise_generique = $balise_generique['nom_generique'] |
| 457 | - and $file = include_spip('balise/' . strtolower($nom_balise_generique)) |
|
| 458 | - and function_exists('balise_' . $nom_balise_generique . '_dyn') |
|
| 457 | + and $file = include_spip('balise/'.strtolower($nom_balise_generique)) |
|
| 458 | + and function_exists('balise_'.$nom_balise_generique.'_dyn') |
|
| 459 | 459 | ) { |
| 460 | 460 | // et lui injecter en premier arg le nom de la balise |
| 461 | 461 | array_unshift($r, $nom); |
| 462 | 462 | $nom_balise = $nom_balise_generique; |
| 463 | 463 | if (!_DIR_RESTREINT) { |
| 464 | - $file = _DIR_RESTREINT_ABS . $file; |
|
| 464 | + $file = _DIR_RESTREINT_ABS.$file; |
|
| 465 | 465 | } |
| 466 | 466 | } else { |
| 467 | 467 | $msg = ['zbug_balise_inexistante', ['from' => 'CVT', 'balise' => $nom]]; |
@@ -563,7 +563,7 @@ discard block |
||
| 563 | 563 | $n = ''; |
| 564 | 564 | foreach (explode(',', $liste) as $val) { |
| 565 | 565 | if ($a = intval($val) and $val === strval($a)) { |
| 566 | - $n .= ',' . $val; |
|
| 566 | + $n .= ','.$val; |
|
| 567 | 567 | } |
| 568 | 568 | } |
| 569 | 569 | if (strlen($n)) { |
@@ -742,8 +742,8 @@ discard block |
||
| 742 | 742 | // on construit le where une fois, puis on ajoute les where complentaires si besoin, et on reconstruit le where en fonction |
| 743 | 743 | $i = 0; |
| 744 | 744 | do { |
| 745 | - $where[$k] = remplace_sous_requete($w, '(' . calculer_select( |
|
| 746 | - [$sous[1] . ' AS id'], |
|
| 745 | + $where[$k] = remplace_sous_requete($w, '('.calculer_select( |
|
| 746 | + [$sous[1].' AS id'], |
|
| 747 | 747 | $from, |
| 748 | 748 | $from_type, |
| 749 | 749 | $wheresub, |
@@ -756,7 +756,7 @@ discard block |
||
| 756 | 756 | $id, |
| 757 | 757 | $serveur, |
| 758 | 758 | false |
| 759 | - ) . ')'); |
|
| 759 | + ).')'); |
|
| 760 | 760 | if (!$i) { |
| 761 | 761 | $i = 1; |
| 762 | 762 | $wherestring = calculer_where_to_string($where[$k]); |
@@ -776,7 +776,7 @@ discard block |
||
| 776 | 776 | if ($sous[0] == 'SUBSELECT') { |
| 777 | 777 | // c'est une sous requete explicite sous la forme identique a sql_select : (SUBSELECT,$select,$from,$where,$groupby,$orderby,$limit,$having) |
| 778 | 778 | array_push($where_simples, $sous[3]); // est-ce utile dans ce cas ? |
| 779 | - $where[$k] = remplace_sous_requete($w, '(' . calculer_select( |
|
| 779 | + $where[$k] = remplace_sous_requete($w, '('.calculer_select( |
|
| 780 | 780 | $sous[1], # select |
| 781 | 781 | $sous[2], #from |
| 782 | 782 | [], #from_type |
@@ -791,7 +791,7 @@ discard block |
||
| 791 | 791 | $id, |
| 792 | 792 | $serveur, |
| 793 | 793 | false |
| 794 | - ) . ')'); |
|
| 794 | + ).')'); |
|
| 795 | 795 | } |
| 796 | 796 | array_pop($where_simples); |
| 797 | 797 | } |
@@ -854,15 +854,15 @@ discard block |
||
| 854 | 854 | // sans recours a preg_match |
| 855 | 855 | // un implode(' ',..) est fait dans reinjecte_joint un peu plus bas |
| 856 | 856 | $afrom[$t][$cle] = [ |
| 857 | - "\n" . |
|
| 858 | - ($from_type[$cle] ?? 'INNER') . ' JOIN', |
|
| 857 | + "\n". |
|
| 858 | + ($from_type[$cle] ?? 'INNER').' JOIN', |
|
| 859 | 859 | $from[$cle], |
| 860 | 860 | "AS $cle", |
| 861 | 861 | 'ON (', |
| 862 | 862 | "$cle.$c", |
| 863 | 863 | '=', |
| 864 | 864 | "$t.$carr", |
| 865 | - ($and ? 'AND ' . $and : '') . |
|
| 865 | + ($and ? 'AND '.$and : ''). |
|
| 866 | 866 | ')' |
| 867 | 867 | ]; |
| 868 | 868 | if (isset($afrom[$cle])) { |
@@ -900,7 +900,7 @@ discard block |
||
| 900 | 900 | $t = key($from); |
| 901 | 901 | $c = current($from); |
| 902 | 902 | reset($from); |
| 903 | - $e = '/\b(' . "$t\\." . join('|' . $t . '\.', $equiv) . ')\b/'; |
|
| 903 | + $e = '/\b('."$t\\.".join('|'.$t.'\.', $equiv).')\b/'; |
|
| 904 | 904 | if ( |
| 905 | 905 | !(strpos($t, ' ') or // jointure des le depart cf boucle_doc |
| 906 | 906 | calculer_jointnul($t, $select, $e) or |
@@ -918,7 +918,7 @@ discard block |
||
| 918 | 918 | unset($afrom[$t][$nt]); |
| 919 | 919 | $afrom[$nt] = $afrom[$t]; |
| 920 | 920 | unset($afrom[$t]); |
| 921 | - $e = '/\b' . preg_quote($nfrom[6]) . '\b/'; |
|
| 921 | + $e = '/\b'.preg_quote($nfrom[6]).'\b/'; |
|
| 922 | 922 | $t = $nfrom[4]; |
| 923 | 923 | $alias = ''; |
| 924 | 924 | // verifier que les deux cles sont homonymes, sinon installer un alias dans le select |
@@ -929,14 +929,14 @@ discard block |
||
| 929 | 929 | if ($newcle != $oldcle) { |
| 930 | 930 | // si l'ancienne cle etait deja dans le select avec un AS |
| 931 | 931 | // reprendre simplement ce AS |
| 932 | - $as = '/\b' . preg_quote($nfrom[6]) . '\s+(AS\s+\w+)\b/'; |
|
| 932 | + $as = '/\b'.preg_quote($nfrom[6]).'\s+(AS\s+\w+)\b/'; |
|
| 933 | 933 | if (preg_match($as, implode(',', $select), $m)) { |
| 934 | 934 | $alias = ''; |
| 935 | 935 | } else { |
| 936 | - $alias = ', ' . $nfrom[4] . " AS $oldcle"; |
|
| 936 | + $alias = ', '.$nfrom[4]." AS $oldcle"; |
|
| 937 | 937 | } |
| 938 | 938 | } |
| 939 | - $select = remplacer_jointnul($t . $alias, $select, $e); |
|
| 939 | + $select = remplacer_jointnul($t.$alias, $select, $e); |
|
| 940 | 940 | $join = remplacer_jointnul($t, $join, $e); |
| 941 | 941 | $where = remplacer_jointnul($t, $where, $e); |
| 942 | 942 | $having = remplacer_jointnul($t, $having, $e); |
@@ -986,9 +986,9 @@ discard block |
||
| 986 | 986 | } else { |
| 987 | 987 | $exp = ''; |
| 988 | 988 | if (strtoupper($join) === 'AND') { |
| 989 | - return $exp . join(" $join ", array_map('calculer_where_to_string', $v)); |
|
| 989 | + return $exp.join(" $join ", array_map('calculer_where_to_string', $v)); |
|
| 990 | 990 | } else { |
| 991 | - return $exp . join($join, $v); |
|
| 991 | + return $exp.join($join, $v); |
|
| 992 | 992 | } |
| 993 | 993 | } |
| 994 | 994 | } |
@@ -1054,6 +1054,6 @@ discard block |
||
| 1054 | 1054 | } |
| 1055 | 1055 | |
| 1056 | 1056 | return $mime_type |
| 1057 | - . (!$connect ? '' : preg_replace('/\W/', '_', $connect)) . '_' |
|
| 1058 | - . md5($GLOBALS['spip_version_code'] . ' * ' . $skel . (isset($GLOBALS['marqueur_skel']) ? '*' . $GLOBALS['marqueur_skel'] : '')); |
|
| 1057 | + . (!$connect ? '' : preg_replace('/\W/', '_', $connect)).'_' |
|
| 1058 | + . md5($GLOBALS['spip_version_code'].' * '.$skel.(isset($GLOBALS['marqueur_skel']) ? '*'.$GLOBALS['marqueur_skel'] : '')); |
|
| 1059 | 1059 | } |
@@ -53,8 +53,7 @@ discard block |
||
| 53 | 53 | // (pas glop) |
| 54 | 54 | try { |
| 55 | 55 | switch (is_countable($a) ? count($a) : 0) { |
| 56 | - case 0: |
|
| 57 | - $iter = new $iterateur(); |
|
| 56 | + case 0 : $iter = new $iterateur(); |
|
| 58 | 57 | break; |
| 59 | 58 | case 1: |
| 60 | 59 | $iter = new $iterateur($a[0]); |
@@ -79,10 +78,10 @@ discard block |
||
| 79 | 78 | // chercher la classe d'iterateur |
| 80 | 79 | // IterateurXXX |
| 81 | 80 | // definie dans le fichier iterateurs/xxx.php |
| 82 | - $class = 'Iterateur' . $iterateur; |
|
| 81 | + $class = 'Iterateur'.$iterateur; |
|
| 83 | 82 | if (!class_exists($class)) { |
| 84 | 83 | if ( |
| 85 | - !include_spip('iterateur/' . strtolower($iterateur)) |
|
| 84 | + !include_spip('iterateur/'.strtolower($iterateur)) |
|
| 86 | 85 | or !class_exists($class) |
| 87 | 86 | ) { |
| 88 | 87 | die("Iterateur $iterateur non trouvé"); |
@@ -210,7 +209,7 @@ discard block |
||
| 210 | 209 | return $this->iter->$nom(); |
| 211 | 210 | } catch (Exception $e) { |
| 212 | 211 | // #GETCHILDREN sur un fichier de DirectoryIterator ... |
| 213 | - spip_log("Methode $nom en echec sur " . get_class($this->iter)); |
|
| 212 | + spip_log("Methode $nom en echec sur ".get_class($this->iter)); |
|
| 214 | 213 | spip_log("Cela peut être normal : retour d'une ligne de resultat ne pouvant pas calculer cette methode"); |
| 215 | 214 | |
| 216 | 215 | return ''; |
@@ -259,7 +258,7 @@ discard block |
||
| 259 | 258 | // Creer la fonction de filtrage sur $this |
| 260 | 259 | if ($this->filtre) { |
| 261 | 260 | if ($filtres = $this->assembler_filtres($this->filtre)) { |
| 262 | - $filtres = 'return ' . $filtres . ';'; |
|
| 261 | + $filtres = 'return '.$filtres.';'; |
|
| 263 | 262 | $this->func_filtre = fn() => eval($filtres); |
| 264 | 263 | } |
| 265 | 264 | else { |
@@ -294,7 +293,7 @@ discard block |
||
| 294 | 293 | return null; |
| 295 | 294 | } |
| 296 | 295 | |
| 297 | - return '(' . implode(") $operateur (", $filtres_string) . ')'; |
|
| 296 | + return '('.implode(") $operateur (", $filtres_string).')'; |
|
| 298 | 297 | } |
| 299 | 298 | |
| 300 | 299 | /** |
@@ -375,7 +374,7 @@ discard block |
||
| 375 | 374 | return $this->composer_filtre($v[1], $v[0], $v[2]); |
| 376 | 375 | } |
| 377 | 376 | |
| 378 | - return null; // sera ignore |
|
| 377 | + return null; // sera ignore |
|
| 379 | 378 | } |
| 380 | 379 | |
| 381 | 380 | /** |
@@ -401,28 +400,28 @@ discard block |
||
| 401 | 400 | # if (!in_array($cle, array('cle', 'valeur'))) |
| 402 | 401 | # return; |
| 403 | 402 | |
| 404 | - $a = '$this->get_select(\'' . $cle . '\')'; |
|
| 403 | + $a = '$this->get_select(\''.$cle.'\')'; |
|
| 405 | 404 | |
| 406 | 405 | $filtre = ''; |
| 407 | 406 | |
| 408 | 407 | if ($op == 'REGEXP') { |
| 409 | - $filtre = 'filtrer("match", ' . $a . ', ' . str_replace('\"', '"', $valeur) . ')'; |
|
| 408 | + $filtre = 'filtrer("match", '.$a.', '.str_replace('\"', '"', $valeur).')'; |
|
| 410 | 409 | $op = ''; |
| 411 | 410 | } else { |
| 412 | 411 | if ($op == 'LIKE') { |
| 413 | 412 | $valeur = str_replace(['\"', '_', '%'], ['"', '.', '.*'], preg_quote($valeur)); |
| 414 | - $filtre = 'filtrer("match", ' . $a . ', ' . $valeur . ')'; |
|
| 413 | + $filtre = 'filtrer("match", '.$a.', '.$valeur.')'; |
|
| 415 | 414 | $op = ''; |
| 416 | 415 | } else { |
| 417 | 416 | if ($op == '=') { |
| 418 | 417 | $op = '=='; |
| 419 | 418 | } else { |
| 420 | 419 | if ($op == 'IN') { |
| 421 | - $filtre = 'in_array(' . $a . ', array' . $valeur . ')'; |
|
| 420 | + $filtre = 'in_array('.$a.', array'.$valeur.')'; |
|
| 422 | 421 | $op = ''; |
| 423 | 422 | } else { |
| 424 | 423 | if (!in_array($op, ['<', '<=', '>', '>='])) { |
| 425 | - spip_log('operateur non reconnu ' . $op); // [todo] mettre une erreur de squelette |
|
| 424 | + spip_log('operateur non reconnu '.$op); // [todo] mettre une erreur de squelette |
|
| 426 | 425 | $op = ''; |
| 427 | 426 | } |
| 428 | 427 | } |
@@ -431,7 +430,7 @@ discard block |
||
| 431 | 430 | } |
| 432 | 431 | |
| 433 | 432 | if ($op) { |
| 434 | - $filtre = $a . $op . str_replace('\"', '"', $valeur); |
|
| 433 | + $filtre = $a.$op.str_replace('\"', '"', $valeur); |
|
| 435 | 434 | } |
| 436 | 435 | |
| 437 | 436 | if ($not) { |
@@ -36,7 +36,7 @@ discard block |
||
| 36 | 36 | return sql_getfetsel( |
| 37 | 37 | 'virtuel', |
| 38 | 38 | 'spip_articles', |
| 39 | - ['id_article=' . intval($id_article), "statut='publie'"], |
|
| 39 | + ['id_article='.intval($id_article), "statut='publie'"], |
|
| 40 | 40 | '', |
| 41 | 41 | '', |
| 42 | 42 | '', |
@@ -81,7 +81,7 @@ discard block |
||
| 81 | 81 | $cache_quete[$connect][$table][$id] = sql_fetsel( |
| 82 | 82 | $cache_quete[$connect][$table]['_select'], |
| 83 | 83 | $table, |
| 84 | - $cache_quete[$connect][$table]['_id'] . '=' . intval($id), |
|
| 84 | + $cache_quete[$connect][$table]['_id'].'='.intval($id), |
|
| 85 | 85 | '', |
| 86 | 86 | '', |
| 87 | 87 | '', |
@@ -173,7 +173,7 @@ discard block |
||
| 173 | 173 | return |
| 174 | 174 | (isset($GLOBALS['meta']['date_prochain_postdate']) |
| 175 | 175 | and $GLOBALS['meta']['date_prochain_postdate'] > time()) |
| 176 | - ? "$champ_date<" . sql_quote(date('Y-m-d H:i:s', $GLOBALS['meta']['date_prochain_postdate']), $serveur) |
|
| 176 | + ? "$champ_date<".sql_quote(date('Y-m-d H:i:s', $GLOBALS['meta']['date_prochain_postdate']), $serveur) |
|
| 177 | 177 | : '1=1'; |
| 178 | 178 | } |
| 179 | 179 | |
@@ -232,7 +232,7 @@ discard block |
||
| 232 | 232 | and $id_table = reset($objet) |
| 233 | 233 | and $objet = objet_type($id_table) |
| 234 | 234 | ) { |
| 235 | - $w = "$mstatut<>" . sql_quote($v); |
|
| 235 | + $w = "$mstatut<>".sql_quote($v); |
|
| 236 | 236 | |
| 237 | 237 | // retrouver l’id_auteur qui a filé un lien de prévisu éventuellement, |
| 238 | 238 | // sinon l’auteur en session |
@@ -246,22 +246,22 @@ discard block |
||
| 246 | 246 | } |
| 247 | 247 | |
| 248 | 248 | // dans ce cas (admin en general), pas de filtrage sur ce statut |
| 249 | - if (!autoriser('previsualiser' . $v, $objet, '', $id_auteur)) { |
|
| 249 | + if (!autoriser('previsualiser'.$v, $objet, '', $id_auteur)) { |
|
| 250 | 250 | // si pas d'auteur identifie pas de sous-requete car pas d'article qui matche |
| 251 | 251 | if (!$id_auteur) { |
| 252 | 252 | $where[] = $w; |
| 253 | 253 | } else { |
| 254 | 254 | $primary = id_table_objet($objet); |
| 255 | - $where[] = "($w OR $id_table.$primary IN (" . sql_get_select( |
|
| 255 | + $where[] = "($w OR $id_table.$primary IN (".sql_get_select( |
|
| 256 | 256 | 'ssss.id_objet', |
| 257 | 257 | 'spip_auteurs_liens AS ssss', |
| 258 | - 'ssss.objet=' . sql_quote($objet) . ' AND ssss.id_auteur=' . intval($id_auteur), |
|
| 258 | + 'ssss.objet='.sql_quote($objet).' AND ssss.id_auteur='.intval($id_auteur), |
|
| 259 | 259 | '', |
| 260 | 260 | '', |
| 261 | 261 | '', |
| 262 | 262 | '', |
| 263 | 263 | $serveur |
| 264 | - ) . '))'; |
|
| 264 | + ).'))'; |
|
| 265 | 265 | } |
| 266 | 266 | } |
| 267 | 267 | } // ignorer ce statut si on ne sait pas comment le filtrer |
@@ -299,7 +299,7 @@ discard block |
||
| 299 | 299 | * @return array|bool|null |
| 300 | 300 | */ |
| 301 | 301 | function quete_fichier($id_document, $serveur = '') { |
| 302 | - return sql_getfetsel('fichier', 'spip_documents', ('id_document=' . intval($id_document)), '', [], '', '', $serveur); |
|
| 302 | + return sql_getfetsel('fichier', 'spip_documents', ('id_document='.intval($id_document)), '', [], '', '', $serveur); |
|
| 303 | 303 | } |
| 304 | 304 | |
| 305 | 305 | /** |
@@ -310,7 +310,7 @@ discard block |
||
| 310 | 310 | * @return array|bool |
| 311 | 311 | */ |
| 312 | 312 | function quete_document($id_document, $serveur = '') { |
| 313 | - return sql_fetsel('*', 'spip_documents', ('id_document=' . intval($id_document)), '', [], '', '', $serveur); |
|
| 313 | + return sql_fetsel('*', 'spip_documents', ('id_document='.intval($id_document)), '', [], '', '', $serveur); |
|
| 314 | 314 | } |
| 315 | 315 | |
| 316 | 316 | /** |
@@ -321,7 +321,7 @@ discard block |
||
| 321 | 321 | * @return array|bool|null |
| 322 | 322 | */ |
| 323 | 323 | function quete_meta($nom, $serveur) { |
| 324 | - return sql_getfetsel('valeur', 'spip_meta', 'nom=' . sql_quote($nom), '', '', '', '', $serveur); |
|
| 324 | + return sql_getfetsel('valeur', 'spip_meta', 'nom='.sql_quote($nom), '', '', '', '', $serveur); |
|
| 325 | 325 | } |
| 326 | 326 | |
| 327 | 327 | /** |
@@ -377,9 +377,9 @@ discard block |
||
| 377 | 377 | // qui permet de distinguer le changement de logo |
| 378 | 378 | // et placer un expire sur le dossier IMG/ |
| 379 | 379 | $res = [ |
| 380 | - $on['chemin'] . ($on['timestamp'] ? "?{$on['timestamp']}" : ''), |
|
| 381 | - ($off ? $off['chemin'] . ($off['timestamp'] ? "?{$off['timestamp']}" : '') : ''), |
|
| 382 | - (!$taille ? '' : (' ' . $taille[3])) |
|
| 380 | + $on['chemin'].($on['timestamp'] ? "?{$on['timestamp']}" : ''), |
|
| 381 | + ($off ? $off['chemin'].($off['timestamp'] ? "?{$off['timestamp']}" : '') : ''), |
|
| 382 | + (!$taille ? '' : (' '.$taille[3])) |
|
| 383 | 383 | ]; |
| 384 | 384 | $res['src'] = $res[0]; |
| 385 | 385 | $res['logo_on'] = $res[0]; |
@@ -476,7 +476,7 @@ discard block |
||
| 476 | 476 | if ( |
| 477 | 477 | strcmp($logo, _DIR_PLUGINS) == 0 |
| 478 | 478 | or strcmp($logo, _DIR_PLUGINS_DIST) == 0 |
| 479 | - or strcmp($logo, _DIR_RACINE . 'prive/') == 0 |
|
| 479 | + or strcmp($logo, _DIR_RACINE.'prive/') == 0 |
|
| 480 | 480 | ) { |
| 481 | 481 | return $logo; |
| 482 | 482 | } |
@@ -646,7 +646,7 @@ discard block |
||
| 646 | 646 | $exposer[$m][$type][$principal] = true; |
| 647 | 647 | if ($type == 'id_mot') { |
| 648 | 648 | if (!$parent) { |
| 649 | - $parent = sql_getfetsel('id_groupe', 'spip_mots', 'id_mot=' . intval($principal), '', '', '', '', $connect); |
|
| 649 | + $parent = sql_getfetsel('id_groupe', 'spip_mots', 'id_mot='.intval($principal), '', '', '', '', $connect); |
|
| 650 | 650 | } |
| 651 | 651 | if ($parent) { |
| 652 | 652 | $exposer[$m]['id_groupe'][$parent] = true; |
@@ -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 | } |