@@ -22,7 +22,7 @@ discard block |
||
| 22 | 22 | |
| 23 | 23 | /** l'adresse du repertoire de telechargement et de decompactage des plugins */ |
| 24 | 24 | if (!defined('_DIR_PLUGINS_AUTO')) { |
| 25 | - define('_DIR_PLUGINS_AUTO', _DIR_PLUGINS . 'auto/'); |
|
| 25 | + define('_DIR_PLUGINS_AUTO', _DIR_PLUGINS.'auto/'); |
|
| 26 | 26 | } |
| 27 | 27 | |
| 28 | 28 | #include_spip('inc/texte'); // ????? Appelle public/parametrer trop tot avant la reconstruction du chemin des plugins. |
@@ -373,7 +373,7 @@ discard block |
||
| 373 | 373 | if ($dir) { |
| 374 | 374 | $dir .= '/'; |
| 375 | 375 | } |
| 376 | - $dir .= 'procure:' . $procure['nom']; |
|
| 376 | + $dir .= 'procure:'.$procure['nom']; |
|
| 377 | 377 | |
| 378 | 378 | $procure['etat'] = '?'; |
| 379 | 379 | $procure['dir_type'] = $resume['dir_type']; |
@@ -557,7 +557,7 @@ discard block |
||
| 557 | 557 | $plug = $resume['dir']; |
| 558 | 558 | $k = $infos[$dir_type][$plug]; |
| 559 | 559 | |
| 560 | - $plug = constant($dir_type) . $plug; |
|
| 560 | + $plug = constant($dir_type).$plug; |
|
| 561 | 561 | if (!isset($msg[$p])) { |
| 562 | 562 | if (isset($resume['erreur']) and $resume['erreur']) { |
| 563 | 563 | $msg[$p] = [$resume['erreur']]; |
@@ -600,10 +600,10 @@ discard block |
||
| 600 | 600 | $list = $raw ? [] : $GLOBALS['meta']['plugin_erreur_activation']; |
| 601 | 601 | } elseif (!$raw) { |
| 602 | 602 | foreach ($list as $plug => $msg) { |
| 603 | - $list[$plug] = '<li>' . _T('plugin_impossible_activer', ['plugin' => $plug]) |
|
| 604 | - . '<ul><li>' . implode('</li><li>', $msg) . '</li></ul></li>'; |
|
| 603 | + $list[$plug] = '<li>'._T('plugin_impossible_activer', ['plugin' => $plug]) |
|
| 604 | + . '<ul><li>'.implode('</li><li>', $msg).'</li></ul></li>'; |
|
| 605 | 605 | } |
| 606 | - $list = '<ul>' . join("\n", $list) . '</ul>'; |
|
| 606 | + $list = '<ul>'.join("\n", $list).'</ul>'; |
|
| 607 | 607 | } |
| 608 | 608 | if ($raz) { |
| 609 | 609 | effacer_meta('plugin_erreur_activation'); |
@@ -717,13 +717,13 @@ discard block |
||
| 717 | 717 | if ($minimum_inclus and spip_version_compare($version, $minimum, '<')) { |
| 718 | 718 | return _T("plugin_${balise}_${type}", [ |
| 719 | 719 | 'plugin' => $nom, |
| 720 | - 'version' => ' ≥ ' . $minimum |
|
| 720 | + 'version' => ' ≥ '.$minimum |
|
| 721 | 721 | ]); |
| 722 | 722 | } |
| 723 | 723 | if (!$minimum_inclus and spip_version_compare($version, $minimum, '<=')) { |
| 724 | 724 | return _T("plugin_${balise}_${type}", [ |
| 725 | 725 | 'plugin' => $nom, |
| 726 | - 'version' => ' > ' . $minimum |
|
| 726 | + 'version' => ' > '.$minimum |
|
| 727 | 727 | ]); |
| 728 | 728 | } |
| 729 | 729 | } |
@@ -732,13 +732,13 @@ discard block |
||
| 732 | 732 | if ($maximum_inclus and spip_version_compare($version, $maximum, '>')) { |
| 733 | 733 | return _T("plugin_${balise}_${type}", [ |
| 734 | 734 | 'plugin' => $nom, |
| 735 | - 'version' => ' ≤ ' . $maximum |
|
| 735 | + 'version' => ' ≤ '.$maximum |
|
| 736 | 736 | ]); |
| 737 | 737 | } |
| 738 | 738 | if (!$maximum_inclus and spip_version_compare($version, $maximum, '>=')) { |
| 739 | 739 | return _T("plugin_${balise}_plugin", [ |
| 740 | 740 | 'plugin' => $nom, |
| 741 | - 'version' => ' < ' . $maximum |
|
| 741 | + 'version' => ' < '.$maximum |
|
| 742 | 742 | ]); |
| 743 | 743 | } |
| 744 | 744 | } |
@@ -757,7 +757,7 @@ discard block |
||
| 757 | 757 | include_spip('inc/charger_plugin'); |
| 758 | 758 | $url = '<br />' . bouton_telechargement_plugin($url, 'lib'); |
| 759 | 759 | }*/ |
| 760 | - return _T('plugin_necessite_lib', ['lib' => $lib]) . " <a href='$url'>$url</a>"; |
|
| 760 | + return _T('plugin_necessite_lib', ['lib' => $lib])." <a href='$url'>$url</a>"; |
|
| 761 | 761 | } |
| 762 | 762 | |
| 763 | 763 | |
@@ -857,7 +857,7 @@ discard block |
||
| 857 | 857 | foreach ($plugin_valides as $p => $resume) { |
| 858 | 858 | // Les headers ne doivent pas indiquer les versions des extensions PHP, ni la version PHP |
| 859 | 859 | if (0 !== strpos($p, 'PHP:') and $p !== 'PHP') { |
| 860 | - $header[] = $p . ($resume['version'] ? '(' . $resume['version'] . ')' : ''); |
|
| 860 | + $header[] = $p.($resume['version'] ? '('.$resume['version'].')' : ''); |
|
| 861 | 861 | } |
| 862 | 862 | if ($resume['dir']) { |
| 863 | 863 | foreach ($infos[$resume['dir_type']][$resume['dir']]['lib'] as $l) { |
@@ -882,11 +882,11 @@ discard block |
||
| 882 | 882 | $header = strtolower(implode(',', $header)); |
| 883 | 883 | if (!isset($GLOBALS['spip_header_silencieux']) or !$GLOBALS['spip_header_silencieux']) { |
| 884 | 884 | ecrire_fichier( |
| 885 | - _DIR_VAR . 'config.txt', |
|
| 886 | - (defined('_HEADER_COMPOSED_BY') ? _HEADER_COMPOSED_BY : 'Composed-By: SPIP') . ' ' . $GLOBALS['spip_version_affichee'] . ' @ www.spip.net + ' . $header |
|
| 885 | + _DIR_VAR.'config.txt', |
|
| 886 | + (defined('_HEADER_COMPOSED_BY') ? _HEADER_COMPOSED_BY : 'Composed-By: SPIP').' '.$GLOBALS['spip_version_affichee'].' @ www.spip.net + '.$header |
|
| 887 | 887 | ); |
| 888 | 888 | } else { |
| 889 | - @unlink(_DIR_VAR . 'config.txt'); |
|
| 889 | + @unlink(_DIR_VAR.'config.txt'); |
|
| 890 | 890 | } |
| 891 | 891 | // generer charger_plugins_chemin.php |
| 892 | 892 | plugins_precompile_chemin($plugin_valides, $ordre); |
@@ -940,7 +940,7 @@ discard block |
||
| 940 | 940 | // definir le plugin, donc le path avant l'include du fichier options |
| 941 | 941 | // permet de faire des include_spip pour attraper un inc_ du plugin |
| 942 | 942 | |
| 943 | - $dir = $dir_type . ".'" . $plug . "/'"; |
|
| 943 | + $dir = $dir_type.".'".$plug."/'"; |
|
| 944 | 944 | |
| 945 | 945 | $prefix = strtoupper(preg_replace(',\W,', '_', $info['prefix'])); |
| 946 | 946 | if ( |
@@ -951,7 +951,7 @@ discard block |
||
| 951 | 951 | if (!$info['chemin']) { |
| 952 | 952 | $chemins['public'][] = "_DIR_PLUGIN_$prefix"; |
| 953 | 953 | $chemins['prive'][] = "_DIR_PLUGIN_$prefix"; |
| 954 | - if (is_dir(constant($dir_type) . $plug . '/squelettes/')) { |
|
| 954 | + if (is_dir(constant($dir_type).$plug.'/squelettes/')) { |
|
| 955 | 955 | $chemins['public'][] = "_DIR_PLUGIN_{$prefix}.'squelettes/'"; |
| 956 | 956 | } |
| 957 | 957 | } |
@@ -972,13 +972,13 @@ discard block |
||
| 972 | 972 | $dir = ''; |
| 973 | 973 | } |
| 974 | 974 | if (strlen($dir)) { |
| 975 | - $dir = rtrim($dir, '/') . '/'; |
|
| 975 | + $dir = rtrim($dir, '/').'/'; |
|
| 976 | 976 | } |
| 977 | 977 | if (!isset($chemin['type']) or $chemin['type'] == 'public') { |
| 978 | - $chemins['public'][] = "_DIR_PLUGIN_$prefix" . (strlen($dir) ? ".'$dir'" : ''); |
|
| 978 | + $chemins['public'][] = "_DIR_PLUGIN_$prefix".(strlen($dir) ? ".'$dir'" : ''); |
|
| 979 | 979 | } |
| 980 | 980 | if (!isset($chemin['type']) or $chemin['type'] == 'prive') { |
| 981 | - $chemins['prive'][] = "_DIR_PLUGIN_$prefix" . (strlen($dir) ? ".'$dir'" : ''); |
|
| 981 | + $chemins['prive'][] = "_DIR_PLUGIN_$prefix".(strlen($dir) ? ".'$dir'" : ''); |
|
| 982 | 982 | } |
| 983 | 983 | } |
| 984 | 984 | } |
@@ -987,11 +987,11 @@ discard block |
||
| 987 | 987 | } |
| 988 | 988 | } |
| 989 | 989 | if (count($chemins['public']) or count($chemins['prive'])) { |
| 990 | - $contenu .= 'if (_DIR_RESTREINT) _chemin([' . implode( |
|
| 990 | + $contenu .= 'if (_DIR_RESTREINT) _chemin(['.implode( |
|
| 991 | 991 | ',', |
| 992 | 992 | array_reverse($chemins['public']) |
| 993 | - ) . "]);\n" |
|
| 994 | - . 'else _chemin([' . implode(',', array_reverse($chemins['prive'])) . "]);\n"; |
|
| 993 | + )."]);\n" |
|
| 994 | + . 'else _chemin(['.implode(',', array_reverse($chemins['prive']))."]);\n"; |
|
| 995 | 995 | } |
| 996 | 996 | |
| 997 | 997 | ecrire_fichier_php(_CACHE_PLUGINS_PATH, $contenu); |
@@ -1040,7 +1040,7 @@ discard block |
||
| 1040 | 1040 | and strpos($dir, ':') === false // exclure le cas des procure: |
| 1041 | 1041 | and file_exists("$dir$plug/paquet.xml") // uniquement pour les paquet.xml |
| 1042 | 1042 | ) { |
| 1043 | - if (is_readable("$dir$plug/" . ($file = $info['prefix'] . '_' . $charge . '.php'))) { |
|
| 1043 | + if (is_readable("$dir$plug/".($file = $info['prefix'].'_'.$charge.'.php'))) { |
|
| 1044 | 1044 | $info[$charge] = [$file]; |
| 1045 | 1045 | } |
| 1046 | 1046 | } |
@@ -1057,7 +1057,7 @@ discard block |
||
| 1057 | 1057 | ) { |
| 1058 | 1058 | unset($info[$charge][$k]); |
| 1059 | 1059 | } else { |
| 1060 | - $_file = $root_dir_type . ".'$plug/$file'"; |
|
| 1060 | + $_file = $root_dir_type.".'$plug/$file'"; |
|
| 1061 | 1061 | $contenu[$charge] .= "include_once_check($_file);\n"; |
| 1062 | 1062 | } |
| 1063 | 1063 | } |
@@ -1067,7 +1067,7 @@ discard block |
||
| 1067 | 1067 | } |
| 1068 | 1068 | } |
| 1069 | 1069 | |
| 1070 | - $contenu['options'] = "define('_PLUGINS_HASH','" . md5($sign) . "');\n" . $contenu['options']; |
|
| 1070 | + $contenu['options'] = "define('_PLUGINS_HASH','".md5($sign)."');\n".$contenu['options']; |
|
| 1071 | 1071 | $contenu['fonctions'] .= plugin_ongletbouton('boutons_plugins', $boutons) |
| 1072 | 1072 | . plugin_ongletbouton('onglets_plugins', $onglets); |
| 1073 | 1073 | |
@@ -1102,12 +1102,12 @@ discard block |
||
| 1102 | 1102 | define("_UPDATED_$nom", $val); |
| 1103 | 1103 | define("_UPDATED_md5_$nom", $md5); |
| 1104 | 1104 | } |
| 1105 | - $val = "unserialize('" . str_replace("'", "\'", $val) . "')"; |
|
| 1105 | + $val = "unserialize('".str_replace("'", "\'", $val)."')"; |
|
| 1106 | 1106 | |
| 1107 | 1107 | return |
| 1108 | 1108 | "if (!function_exists('$nom')) {\n" |
| 1109 | 1109 | . "function $nom(){return defined('_UPDATED_$nom')?unserialize(_UPDATED_$nom):$val;}\n" |
| 1110 | - . "function md5_$nom(){return defined('_UPDATED_md5_$nom')?_UPDATED_md5_$nom:'" . $md5 . "';}\n" |
|
| 1110 | + . "function md5_$nom(){return defined('_UPDATED_md5_$nom')?_UPDATED_md5_$nom:'".$md5."';}\n" |
|
| 1111 | 1111 | . "}\n"; |
| 1112 | 1112 | } |
| 1113 | 1113 | |
@@ -1130,7 +1130,7 @@ discard block |
||
| 1130 | 1130 | if (@is_readable(_CACHE_PLUGINS_OPT)) { |
| 1131 | 1131 | include_once(_CACHE_PLUGINS_OPT); |
| 1132 | 1132 | } else { |
| 1133 | - spip_log('pipelines desactives: impossible de produire ' . _CACHE_PLUGINS_OPT); |
|
| 1133 | + spip_log('pipelines desactives: impossible de produire '._CACHE_PLUGINS_OPT); |
|
| 1134 | 1134 | } |
| 1135 | 1135 | } |
| 1136 | 1136 | |
@@ -1167,7 +1167,7 @@ discard block |
||
| 1167 | 1167 | $dir_type = $plugin_valides[$p]['dir_type']; |
| 1168 | 1168 | $root_dir_type = str_replace('_DIR_', '_ROOT_', $dir_type); |
| 1169 | 1169 | $plug = $plugin_valides[$p]['dir']; |
| 1170 | - $prefix = (($info['prefix'] == 'spip') ? '' : $info['prefix'] . '_'); |
|
| 1170 | + $prefix = (($info['prefix'] == 'spip') ? '' : $info['prefix'].'_'); |
|
| 1171 | 1171 | if (isset($info['pipeline']) and is_array($info['pipeline'])) { |
| 1172 | 1172 | foreach ($info['pipeline'] as $pipe) { |
| 1173 | 1173 | $nom = $pipe['nom']; |
@@ -1201,7 +1201,7 @@ discard block |
||
| 1201 | 1201 | } |
| 1202 | 1202 | if (isset($pipe['inclure'])) { |
| 1203 | 1203 | $GLOBALS['spip_matrice']["$prefix$action"] = |
| 1204 | - "$root_dir_type:$plug/" . $pipe['inclure']; |
|
| 1204 | + "$root_dir_type:$plug/".$pipe['inclure']; |
|
| 1205 | 1205 | } |
| 1206 | 1206 | } |
| 1207 | 1207 | } |
@@ -1211,7 +1211,7 @@ discard block |
||
| 1211 | 1211 | $prepend_code['taches_generales_cron'] = ''; |
| 1212 | 1212 | } |
| 1213 | 1213 | foreach ($info['genie'] as $genie) { |
| 1214 | - $nom = $prefix . $genie['nom']; |
|
| 1214 | + $nom = $prefix.$genie['nom']; |
|
| 1215 | 1215 | $periode = max(60, intval($genie['periode'])); |
| 1216 | 1216 | if (charger_fonction($nom, 'genie', true)) { |
| 1217 | 1217 | $prepend_code['taches_generales_cron'] .= "\$val['$nom'] = $periode;\n"; |
@@ -1229,13 +1229,13 @@ discard block |
||
| 1229 | 1229 | } |
| 1230 | 1230 | foreach ($info['style'] as $style) { |
| 1231 | 1231 | if (isset($style['path']) and $style['path']) { |
| 1232 | - $code = "if (\$f=timestamp(direction_css(find_in_path('" . addslashes($style['path']) . "')))) "; |
|
| 1232 | + $code = "if (\$f=timestamp(direction_css(find_in_path('".addslashes($style['path'])."')))) "; |
|
| 1233 | 1233 | } else { |
| 1234 | - $code = "if (\$f='" . addslashes($style['url']) . "') "; |
|
| 1234 | + $code = "if (\$f='".addslashes($style['url'])."') "; |
|
| 1235 | 1235 | } |
| 1236 | 1236 | $code .= "\$val .= '<link rel=\"stylesheet\" href=\"'.\$f.'\" type=\"text/css\""; |
| 1237 | 1237 | if (isset($style['media']) and strlen($style['media'])) { |
| 1238 | - $code .= ' media="' . addslashes($style['media']) . '"'; |
|
| 1238 | + $code .= ' media="'.addslashes($style['media']).'"'; |
|
| 1239 | 1239 | } |
| 1240 | 1240 | $code .= "/>';\n"; |
| 1241 | 1241 | if ($style['type'] != 'prive') { |
@@ -1255,9 +1255,9 @@ discard block |
||
| 1255 | 1255 | if (isset($info['script']) and is_countable($info['script']) ? count($info['script']) : 0) { |
| 1256 | 1256 | foreach ($info['script'] as $script) { |
| 1257 | 1257 | if (isset($script['path']) and $script['path']) { |
| 1258 | - $code = "if (\$f=timestamp(find_in_path('" . addslashes($script['path']) . "'))) "; |
|
| 1258 | + $code = "if (\$f=timestamp(find_in_path('".addslashes($script['path'])."'))) "; |
|
| 1259 | 1259 | } else { |
| 1260 | - $code = "if (\$f='" . addslashes($script['url']) . "') "; |
|
| 1260 | + $code = "if (\$f='".addslashes($script['url'])."') "; |
|
| 1261 | 1261 | } |
| 1262 | 1262 | $code .= "\$val .= '<script src=\"'.\$f.'\" type=\"text/javascript\"></script>';\n"; |
| 1263 | 1263 | if ($script['type'] != 'prive') { |
@@ -1320,10 +1320,10 @@ discard block |
||
| 1320 | 1320 | unset($GLOBALS['spip_pipeline']['all']); |
| 1321 | 1321 | $all_pipes = trim(array_shift($a)); |
| 1322 | 1322 | if ($all_pipes) { |
| 1323 | - $all_pipes = '|' . ltrim($all_pipes, '|'); |
|
| 1323 | + $all_pipes = '|'.ltrim($all_pipes, '|'); |
|
| 1324 | 1324 | } |
| 1325 | 1325 | if (count($a)) { |
| 1326 | - $all_pipes_end = '||' . array_shift($a); |
|
| 1326 | + $all_pipes_end = '||'.array_shift($a); |
|
| 1327 | 1327 | } |
| 1328 | 1328 | } |
| 1329 | 1329 | $content = ''; |
@@ -1340,7 +1340,7 @@ discard block |
||
| 1340 | 1340 | // Eclater le pipeline en filtres et appliquer chaque filtre |
| 1341 | 1341 | foreach ($pipe as $fonc) { |
| 1342 | 1342 | $fonc = trim($fonc); |
| 1343 | - $s_call .= '$val = minipipe(\'' . $fonc . '\', $val);' . "\n"; |
|
| 1343 | + $s_call .= '$val = minipipe(\''.$fonc.'\', $val);'."\n"; |
|
| 1344 | 1344 | if (isset($GLOBALS['spip_matrice'][$fonc])) { |
| 1345 | 1345 | $file = $GLOBALS['spip_matrice'][$fonc]; |
| 1346 | 1346 | $file = "'$file'"; |
@@ -1351,7 +1351,7 @@ discard block |
||
| 1351 | 1351 | if (defined($root_dir)) { |
| 1352 | 1352 | $dir = $root_dir; |
| 1353 | 1353 | } |
| 1354 | - $file = str_replace($regs[0], "'." . $dir . ".'", $file); |
|
| 1354 | + $file = str_replace($regs[0], "'.".$dir.".'", $file); |
|
| 1355 | 1355 | $file = str_replace("''.", '', $file); |
| 1356 | 1356 | $file = str_replace(constant($dir), '', $file); |
| 1357 | 1357 | } |
@@ -1364,7 +1364,7 @@ discard block |
||
| 1364 | 1364 | $content .= "// Pipeline $action \n" |
| 1365 | 1365 | . "function execute_pipeline_$action(&\$val){\n" |
| 1366 | 1366 | . $s_inc |
| 1367 | - . ((isset($prepend_code[$action]) and strlen($prepend_code[$action])) ? trim($prepend_code[$action]) . "\n" : '') |
|
| 1367 | + . ((isset($prepend_code[$action]) and strlen($prepend_code[$action])) ? trim($prepend_code[$action])."\n" : '') |
|
| 1368 | 1368 | . $s_call |
| 1369 | 1369 | . "return \$val;\n}\n"; |
| 1370 | 1370 | } |
@@ -1420,9 +1420,9 @@ discard block |
||
| 1420 | 1420 | $result = ($ok ? ((isset($infos['upgrade']) && $infos['upgrade']) ? _T('plugin_info_upgrade_ok') : _T('plugin_info_install_ok')) : _T('avis_operation_echec')); |
| 1421 | 1421 | if (_IS_CLI) { |
| 1422 | 1422 | include_spip('inc/filtres'); |
| 1423 | - $trace = ltrim(textebrut($trace) . "\n" . $result); |
|
| 1424 | - $trace = ' ' . str_replace("\n", "\n ", $trace); |
|
| 1425 | - echo "\n" . ($ok ? 'OK ' : '/!\ ') . textebrut($titre) . "\n", |
|
| 1423 | + $trace = ltrim(textebrut($trace)."\n".$result); |
|
| 1424 | + $trace = ' '.str_replace("\n", "\n ", $trace); |
|
| 1425 | + echo "\n".($ok ? 'OK ' : '/!\ ').textebrut($titre)."\n", |
|
| 1426 | 1426 | $trace, |
| 1427 | 1427 | "\n"; |
| 1428 | 1428 | } |
@@ -1457,15 +1457,15 @@ discard block |
||
| 1457 | 1457 | $GLOBALS['fichier_php_compile_recent'] = 0; |
| 1458 | 1458 | } |
| 1459 | 1459 | |
| 1460 | - $contenu = '<' . '?php' . "\n" . $comment . "\nif (defined('_ECRIRE_INC_VERSION')) {\n" . $contenu . "}\n?" . '>'; |
|
| 1460 | + $contenu = '<'.'?php'."\n".$comment."\nif (defined('_ECRIRE_INC_VERSION')) {\n".$contenu."}\n?".'>'; |
|
| 1461 | 1461 | // si un fichier existe deja on verifie que son contenu change avant de l'ecraser |
| 1462 | 1462 | // si pas de modif on ne touche pas au fichier initial |
| 1463 | 1463 | if (file_exists($nom)) { |
| 1464 | 1464 | if (substr($nom, -4) == '.php') { |
| 1465 | - $fichier_tmp = substr($nom, 0, -4) . '.tmp.php'; |
|
| 1465 | + $fichier_tmp = substr($nom, 0, -4).'.tmp.php'; |
|
| 1466 | 1466 | } |
| 1467 | 1467 | else { |
| 1468 | - $fichier_tmp = $nom . '.tmp'; |
|
| 1468 | + $fichier_tmp = $nom.'.tmp'; |
|
| 1469 | 1469 | } |
| 1470 | 1470 | file_put_contents($fichier_tmp, $contenu); |
| 1471 | 1471 | if (md5_file($nom) == md5_file($fichier_tmp)) { |
@@ -135,9 +135,9 @@ discard block |
||
| 135 | 135 | sql_updateq( |
| 136 | 136 | 'spip_rubriques', |
| 137 | 137 | ['statut' => 'publie', 'date' => date('Y-m-d H:i:s')], |
| 138 | - 'id_rubrique=' . intval($id_rubrique) |
|
| 138 | + 'id_rubrique='.intval($id_rubrique) |
|
| 139 | 139 | ); |
| 140 | - $id_parent = sql_getfetsel('id_parent', 'spip_rubriques AS R', 'R.id_rubrique=' . intval($id_rubrique)); |
|
| 140 | + $id_parent = sql_getfetsel('id_parent', 'spip_rubriques AS R', 'R.id_rubrique='.intval($id_rubrique)); |
|
| 141 | 141 | if (!$id_parent) { |
| 142 | 142 | break; |
| 143 | 143 | } |
@@ -172,7 +172,7 @@ discard block |
||
| 172 | 172 | return $id_pred != $id_rubrique; |
| 173 | 173 | } |
| 174 | 174 | // passer au parent si on a depublie |
| 175 | - $r = sql_fetsel('id_parent', 'spip_rubriques', 'id_rubrique=' . intval($id_pred)); |
|
| 175 | + $r = sql_fetsel('id_parent', 'spip_rubriques', 'id_rubrique='.intval($id_pred)); |
|
| 176 | 176 | $id_pred = $r['id_parent']; |
| 177 | 177 | } |
| 178 | 178 | |
@@ -197,14 +197,14 @@ discard block |
||
| 197 | 197 | $date = date('Y-m-d H:i:s'); |
| 198 | 198 | } |
| 199 | 199 | $postdates = ($GLOBALS['meta']['post_dates'] == 'non') ? |
| 200 | - ' AND date <= ' . sql_quote($date) : ''; |
|
| 200 | + ' AND date <= '.sql_quote($date) : ''; |
|
| 201 | 201 | |
| 202 | 202 | if (!$id_rubrique = intval($id_rubrique)) { |
| 203 | 203 | return false; |
| 204 | 204 | } |
| 205 | 205 | |
| 206 | 206 | // verifier qu'elle existe et est bien publiee |
| 207 | - $r = sql_fetsel('id_rubrique,statut', 'spip_rubriques', 'id_rubrique=' . intval($id_rubrique)); |
|
| 207 | + $r = sql_fetsel('id_rubrique,statut', 'spip_rubriques', 'id_rubrique='.intval($id_rubrique)); |
|
| 208 | 208 | if (!$r or $r['statut'] !== 'publie') { |
| 209 | 209 | return false; |
| 210 | 210 | } |
@@ -214,12 +214,12 @@ discard block |
||
| 214 | 214 | $compte = [ |
| 215 | 215 | 'articles' => sql_countsel( |
| 216 | 216 | 'spip_articles', |
| 217 | - 'id_rubrique=' . intval($id_rubrique) . " AND statut='publie'$postdates" |
|
| 217 | + 'id_rubrique='.intval($id_rubrique)." AND statut='publie'$postdates" |
|
| 218 | 218 | ), |
| 219 | - 'rubriques' => sql_countsel('spip_rubriques', 'id_parent=' . intval($id_rubrique) . " AND statut='publie'"), |
|
| 219 | + 'rubriques' => sql_countsel('spip_rubriques', 'id_parent='.intval($id_rubrique)." AND statut='publie'"), |
|
| 220 | 220 | 'documents' => sql_countsel( |
| 221 | 221 | 'spip_documents AS D JOIN spip_documents_liens AS L ON D.id_document=L.id_document', |
| 222 | - 'L.id_objet=' . intval($id_rubrique) . " AND L.objet='rubrique' and D.mode NOT IN('logoon', 'logooff') " |
|
| 222 | + 'L.id_objet='.intval($id_rubrique)." AND L.objet='rubrique' and D.mode NOT IN('logoon', 'logooff') " |
|
| 223 | 223 | ) |
| 224 | 224 | ]; |
| 225 | 225 | |
@@ -244,7 +244,7 @@ discard block |
||
| 244 | 244 | } |
| 245 | 245 | } |
| 246 | 246 | |
| 247 | - sql_updateq('spip_rubriques', ['statut' => 'prepa'], 'id_rubrique=' . intval($id_rubrique)); |
|
| 247 | + sql_updateq('spip_rubriques', ['statut' => 'prepa'], 'id_rubrique='.intval($id_rubrique)); |
|
| 248 | 248 | |
| 249 | 249 | # spip_log("depublier_rubrique $id_pred"); |
| 250 | 250 | return true; |
@@ -307,7 +307,7 @@ discard block |
||
| 307 | 307 | |
| 308 | 308 | // Afficher les articles post-dates ? |
| 309 | 309 | $postdates = ($GLOBALS['meta']['post_dates'] == 'non') ? |
| 310 | - 'AND A.date <= ' . sql_quote(date('Y-m-d H:i:s')) : ''; |
|
| 310 | + 'AND A.date <= '.sql_quote(date('Y-m-d H:i:s')) : ''; |
|
| 311 | 311 | |
| 312 | 312 | $r = sql_select( |
| 313 | 313 | 'R.id_rubrique AS id, max(A.date) AS date_h', |
@@ -319,7 +319,7 @@ discard block |
||
| 319 | 319 | sql_updateq( |
| 320 | 320 | 'spip_rubriques', |
| 321 | 321 | ['statut_tmp' => 'publie', 'date_tmp' => $row['date_h']], |
| 322 | - 'id_rubrique=' . intval($row['id']) |
|
| 322 | + 'id_rubrique='.intval($row['id']) |
|
| 323 | 323 | ); |
| 324 | 324 | } |
| 325 | 325 | |
@@ -345,7 +345,7 @@ discard block |
||
| 345 | 345 | sql_updateq( |
| 346 | 346 | 'spip_rubriques', |
| 347 | 347 | ['statut_tmp' => 'publie', 'date_tmp' => $row['date_h']], |
| 348 | - 'id_rubrique=' . intval($row['id']) |
|
| 348 | + 'id_rubrique='.intval($row['id']) |
|
| 349 | 349 | ); |
| 350 | 350 | $continuer = true; |
| 351 | 351 | } |
@@ -398,7 +398,7 @@ discard block |
||
| 398 | 398 | and $rows = sql_allfetsel( |
| 399 | 399 | 'A.id_rubrique AS id, R.id_secteur AS id_secteur, R.profondeur+1 as profondeur', |
| 400 | 400 | 'spip_rubriques AS A JOIN spip_rubriques AS R ON A.id_parent = R.id_rubrique', |
| 401 | - 'R.profondeur=' . intval($prof) . ' AND (A.id_secteur <> R.id_secteur OR A.profondeur > R.profondeur+1)', |
|
| 401 | + 'R.profondeur='.intval($prof).' AND (A.id_secteur <> R.id_secteur OR A.profondeur > R.profondeur+1)', |
|
| 402 | 402 | '', |
| 403 | 403 | 'R.id_secteur', |
| 404 | 404 | '0,100' |
@@ -437,11 +437,11 @@ discard block |
||
| 437 | 437 | and $rows = sql_allfetsel( |
| 438 | 438 | 'id_rubrique as id', |
| 439 | 439 | 'spip_rubriques', |
| 440 | - 'profondeur=' . intval($prof + 1) . ' AND id_parent NOT IN (' . sql_get_select( |
|
| 440 | + 'profondeur='.intval($prof + 1).' AND id_parent NOT IN ('.sql_get_select( |
|
| 441 | 441 | 'zzz.id_rubrique', |
| 442 | 442 | 'spip_rubriques AS zzz', |
| 443 | - 'zzz.profondeur=' . intval($prof) |
|
| 444 | - ) . ')', |
|
| 443 | + 'zzz.profondeur='.intval($prof) |
|
| 444 | + ).')', |
|
| 445 | 445 | '', |
| 446 | 446 | '', |
| 447 | 447 | '0,100' |
@@ -455,7 +455,7 @@ discard block |
||
| 455 | 455 | // si pas de rubrique a profondeur $prof+1 pas la peine de continuer |
| 456 | 456 | // si il reste des rubriques non vues, c'est une branche morte ou reference circulaire (base foireuse) |
| 457 | 457 | // on arrete les frais |
| 458 | - if (sql_countsel('spip_rubriques', 'profondeur=' . intval($prof + 1))) { |
|
| 458 | + if (sql_countsel('spip_rubriques', 'profondeur='.intval($prof + 1))) { |
|
| 459 | 459 | $prof++; |
| 460 | 460 | $continuer = true; |
| 461 | 461 | } |
@@ -463,12 +463,12 @@ discard block |
||
| 463 | 463 | |
| 464 | 464 | // loger si la table des rubriques semble foireuse |
| 465 | 465 | // et mettre un id_secteur=0 sur ces rubriques pour eviter toute selection par les boucles |
| 466 | - if (sql_countsel('spip_rubriques', 'profondeur>' . intval($prof + 1))) { |
|
| 466 | + if (sql_countsel('spip_rubriques', 'profondeur>'.intval($prof + 1))) { |
|
| 467 | 467 | spip_log( |
| 468 | - 'Les rubriques de profondeur>' . ($prof + 1) . ' semblent suspectes (branches morte ou reference circulaire dans les parents)', |
|
| 468 | + 'Les rubriques de profondeur>'.($prof + 1).' semblent suspectes (branches morte ou reference circulaire dans les parents)', |
|
| 469 | 469 | _LOG_CRITIQUE |
| 470 | 470 | ); |
| 471 | - sql_update('spip_rubriques', ['id_secteur' => 0], 'profondeur>' . intval($prof + 1)); |
|
| 471 | + sql_update('spip_rubriques', ['id_secteur' => 0], 'profondeur>'.intval($prof + 1)); |
|
| 472 | 472 | } |
| 473 | 473 | |
| 474 | 474 | // reparer les articles |
@@ -479,7 +479,7 @@ discard block |
||
| 479 | 479 | ); |
| 480 | 480 | |
| 481 | 481 | while ($row = sql_fetch($r)) { |
| 482 | - sql_update('spip_articles', ['id_secteur' => $row['secteur']], 'id_article=' . intval($row['id'])); |
|
| 482 | + sql_update('spip_articles', ['id_secteur' => $row['secteur']], 'id_article='.intval($row['id'])); |
|
| 483 | 483 | } |
| 484 | 484 | |
| 485 | 485 | // avertir les plugins qui peuvent faire leur mises a jour egalement |
@@ -510,7 +510,7 @@ discard block |
||
| 510 | 510 | $t = sql_updateq( |
| 511 | 511 | 'spip_rubriques', |
| 512 | 512 | ['lang' => $row['lang'], 'langue_choisie' => 'non'], |
| 513 | - 'id_rubrique=' . intval($id_rubrique) |
|
| 513 | + 'id_rubrique='.intval($id_rubrique) |
|
| 514 | 514 | ); |
| 515 | 515 | } |
| 516 | 516 | |
@@ -555,7 +555,7 @@ discard block |
||
| 555 | 555 | sql_updateq( |
| 556 | 556 | 'spip_articles', |
| 557 | 557 | ['lang' => $row['lang'], 'langue_choisie' => 'non'], |
| 558 | - 'id_article=' . intval($id_article) |
|
| 558 | + 'id_article='.intval($id_article) |
|
| 559 | 559 | ); |
| 560 | 560 | } |
| 561 | 561 | |
@@ -630,11 +630,11 @@ discard block |
||
| 630 | 630 | ]; |
| 631 | 631 | // generer un nom de fonction "anonyme" unique |
| 632 | 632 | do { |
| 633 | - $functionname = 'f_calculer_langues_utilisees_' . $boucle->id_table . '_' . time() . '_' . random_int(0, mt_getrandmax()); |
|
| 633 | + $functionname = 'f_calculer_langues_utilisees_'.$boucle->id_table.'_'.time().'_'.random_int(0, mt_getrandmax()); |
|
| 634 | 634 | } while (function_exists($functionname)); |
| 635 | 635 | $code = calculer_boucle('calculer_langues_utilisees', $boucles); |
| 636 | - $code = '$SP=0; $command=array();$command["connect"] = $connect = "' . $serveur . '"; $Pile=array(0=>array());' . "\n" . $code; |
|
| 637 | - $code = 'function ' . $functionname . '(){' . $code . '};$res = ' . $functionname . '();'; |
|
| 636 | + $code = '$SP=0; $command=array();$command["connect"] = $connect = "'.$serveur.'"; $Pile=array(0=>array());'."\n".$code; |
|
| 637 | + $code = 'function '.$functionname.'(){'.$code.'};$res = '.$functionname.'();'; |
|
| 638 | 638 | $res = ''; |
| 639 | 639 | eval($code); |
| 640 | 640 | $res = explode(',', $res); |
@@ -736,11 +736,11 @@ discard block |
||
| 736 | 736 | $maxiter-- and $filles = sql_allfetsel( |
| 737 | 737 | 'id_rubrique', |
| 738 | 738 | 'spip_rubriques', |
| 739 | - sql_in('id_parent', $r) . ' AND ' . sql_in('id_rubrique', $r, 'NOT') |
|
| 739 | + sql_in('id_parent', $r).' AND '.sql_in('id_rubrique', $r, 'NOT') |
|
| 740 | 740 | ) |
| 741 | 741 | ) { |
| 742 | 742 | $r = join(',', array_column($filles, 'id_rubrique')); |
| 743 | - $branche .= ',' . $r; |
|
| 743 | + $branche .= ','.$r; |
|
| 744 | 744 | } |
| 745 | 745 | |
| 746 | 746 | # securite pour ne pas plomber la conso memoire sur les sites prolifiques |
@@ -780,7 +780,7 @@ discard block |
||
| 780 | 780 | |
| 781 | 781 | if (isset($b[$id])) { |
| 782 | 782 | // Notre branche commence par la rubrique de depart si $tout=true |
| 783 | - return $tout ? (strlen($b[$id]) ? $b[$id] . ",$id" : $id) : $b[$id]; |
|
| 783 | + return $tout ? (strlen($b[$id]) ? $b[$id].",$id" : $id) : $b[$id]; |
|
| 784 | 784 | } |
| 785 | 785 | |
| 786 | 786 | $hier = ''; |
@@ -793,11 +793,11 @@ discard block |
||
| 793 | 793 | $maxiter-- and $parents = sql_allfetsel( |
| 794 | 794 | 'id_parent', |
| 795 | 795 | 'spip_rubriques', |
| 796 | - sql_in('id_rubrique', $ids_nouveaux_parents) . ' AND ' . sql_in('id_parent', $hier, 'NOT') |
|
| 796 | + sql_in('id_rubrique', $ids_nouveaux_parents).' AND '.sql_in('id_parent', $hier, 'NOT') |
|
| 797 | 797 | ) |
| 798 | 798 | ) { |
| 799 | 799 | $ids_nouveaux_parents = join(',', array_column($parents, 'id_parent')); |
| 800 | - $hier = $ids_nouveaux_parents . (strlen($hier) ? ',' . $hier : ''); |
|
| 800 | + $hier = $ids_nouveaux_parents.(strlen($hier) ? ','.$hier : ''); |
|
| 801 | 801 | } |
| 802 | 802 | |
| 803 | 803 | # securite pour ne pas plomber la conso memoire sur les sites prolifiques |
@@ -829,7 +829,7 @@ discard block |
||
| 829 | 829 | include_spip('base/abstract_sql'); |
| 830 | 830 | if ($check) { |
| 831 | 831 | $postdates = ($GLOBALS['meta']['post_dates'] == 'non') ? |
| 832 | - 'AND A.date <= ' . sql_quote(date('Y-m-d H:i:s')) : ''; |
|
| 832 | + 'AND A.date <= '.sql_quote(date('Y-m-d H:i:s')) : ''; |
|
| 833 | 833 | |
| 834 | 834 | $r = sql_select( |
| 835 | 835 | 'DISTINCT A.id_rubrique AS id', |
@@ -846,7 +846,7 @@ discard block |
||
| 846 | 846 | $t = sql_fetsel( |
| 847 | 847 | 'date', |
| 848 | 848 | 'spip_articles', |
| 849 | - "statut='publie' AND date > " . sql_quote(date('Y-m-d H:i:s')), |
|
| 849 | + "statut='publie' AND date > ".sql_quote(date('Y-m-d H:i:s')), |
|
| 850 | 850 | '', |
| 851 | 851 | 'date', |
| 852 | 852 | '1' |
@@ -902,7 +902,7 @@ discard block |
||
| 902 | 902 | $r = sql_getfetsel( |
| 903 | 903 | 'id_rubrique', |
| 904 | 904 | 'spip_rubriques', |
| 905 | - 'titre = ' . sql_quote($titre) . ' AND id_parent=' . intval($id_parent), |
|
| 905 | + 'titre = '.sql_quote($titre).' AND id_parent='.intval($id_parent), |
|
| 906 | 906 | $groupby = [], |
| 907 | 907 | $orderby = [], |
| 908 | 908 | $limit = '', |
@@ -938,7 +938,7 @@ discard block |
||
| 938 | 938 | sql_updateq( |
| 939 | 939 | 'spip_rubriques', |
| 940 | 940 | ['id_secteur' => $id_secteur, 'lang' => $lang], |
| 941 | - 'id_rubrique=' . intval($id_rubrique), |
|
| 941 | + 'id_rubrique='.intval($id_rubrique), |
|
| 942 | 942 | $desc = '', |
| 943 | 943 | $serveur |
| 944 | 944 | ); |
@@ -50,7 +50,7 @@ discard block |
||
| 50 | 50 | $_id = $e['id_table_objet']; |
| 51 | 51 | if (isset($contexte[$_id]) and $id = intval($contexte[$_id])) { |
| 52 | 52 | $table = $e['table_objet_sql']; |
| 53 | - $row = sql_fetsel('*', $table, "$_id=" . intval($id)); |
|
| 53 | + $row = sql_fetsel('*', $table, "$_id=".intval($id)); |
|
| 54 | 54 | if (isset($row['id_rubrique'])) { |
| 55 | 55 | $contexte['id_rubrique'] = $row['id_rubrique']; |
| 56 | 56 | if (isset($row['id_secteur'])) { |
@@ -117,8 +117,8 @@ discard block |
||
| 117 | 117 | $boutons_admin[$parent]->sousmenu = array_slice($boutons_admin[$parent]->sousmenu, 0, $position) |
| 118 | 118 | + [ |
| 119 | 119 | $id => new Bouton( |
| 120 | - ($icones and !empty($infos['icone'])) ? find_in_theme($infos['icone']) : '', // icone |
|
| 121 | - $infos['titre'], // titre |
|
| 120 | + ($icones and !empty($infos['icone'])) ? find_in_theme($infos['icone']) : '', // icone |
|
| 121 | + $infos['titre'], // titre |
|
| 122 | 122 | (isset($infos['action']) and $infos['action']) ? $infos['action'] : null, |
| 123 | 123 | (isset($infos['parametres']) and $infos['parametres']) ? $infos['parametres'] : null |
| 124 | 124 | ) |
@@ -135,8 +135,8 @@ discard block |
||
| 135 | 135 | $boutons_admin = array_slice($boutons_admin, 0, $position) |
| 136 | 136 | + [ |
| 137 | 137 | $id => new Bouton( |
| 138 | - ($icones and isset($infos['icone']) and $infos['icone']) ? find_in_theme($infos['icone']) : '', // icone |
|
| 139 | - $infos['titre'], // titre |
|
| 138 | + ($icones and isset($infos['icone']) and $infos['icone']) ? find_in_theme($infos['icone']) : '', // icone |
|
| 139 | + $infos['titre'], // titre |
|
| 140 | 140 | (isset($infos['action']) and $infos['action']) ? $infos['action'] : null, |
| 141 | 141 | (isset($infos['parametres']) and $infos['parametres']) ? $infos['parametres'] : null |
| 142 | 142 | ) |
@@ -181,7 +181,7 @@ discard block |
||
| 181 | 181 | $libelles = $isfavoris = $favoris = []; |
| 182 | 182 | foreach ($menu->sousmenu as $key => $item) { |
| 183 | 183 | $libelles[$key] = strtolower(translitteration(_T($item->libelle))); |
| 184 | - $isfavoris[$key] = (bool)$item->favori; |
|
| 184 | + $isfavoris[$key] = (bool) $item->favori; |
|
| 185 | 185 | $favoris[$key] = $item->favori; |
| 186 | 186 | } |
| 187 | 187 | if ($avec_favoris) { |
@@ -223,7 +223,7 @@ discard block |
||
| 223 | 223 | $url = str_replace('&', '&', $url); |
| 224 | 224 | while (preg_match(',[&?]([a-z_]+)=@([a-z_]+)@,i', $url, $matches)) { |
| 225 | 225 | if ($matches[2] == 'id_secteur' and !isset($contexte['id_secteur']) and isset($contexte['id_rubrique'])) { |
| 226 | - $contexte['id_secteur'] = sql_getfetsel('id_secteur', 'spip_rubriques', 'id_rubrique=' . intval($contexte['id_rubrique'])); |
|
| 226 | + $contexte['id_secteur'] = sql_getfetsel('id_secteur', 'spip_rubriques', 'id_rubrique='.intval($contexte['id_rubrique'])); |
|
| 227 | 227 | } |
| 228 | 228 | $val = _request($matches[2], $contexte); |
| 229 | 229 | $url = parametre_url($url, $matches[1], $val ?: '', '&'); |
@@ -43,7 +43,7 @@ discard block |
||
| 43 | 43 | $result = sql_select( |
| 44 | 44 | 'id_rubrique, id_parent, titre, descriptif, lang', |
| 45 | 45 | 'spip_rubriques', |
| 46 | - 'id_parent=' . intval($collection), |
|
| 46 | + 'id_parent='.intval($collection), |
|
| 47 | 47 | '', |
| 48 | 48 | '0+titre,titre', |
| 49 | 49 | "$debut,$limite" |
@@ -74,19 +74,18 @@ discard block |
||
| 74 | 74 | } |
| 75 | 75 | } |
| 76 | 76 | |
| 77 | - $lib_bouton = (!acces_restreint_rubrique($id_rubrique) ? '' : |
|
| 78 | - http_img_pack( |
|
| 77 | + $lib_bouton = (!acces_restreint_rubrique($id_rubrique) ? '' : http_img_pack( |
|
| 79 | 78 | 'auteur-0minirezo-16.png', |
| 80 | 79 | '', |
| 81 | 80 | " width='16' height='16'", |
| 82 | 81 | _T('image_administrer_rubrique') |
| 83 | - )) . |
|
| 84 | - " <a class='titremlien' dir='$lang_dir'" . |
|
| 85 | - ($row['lang'] !== $GLOBALS['spip_lang'] ? " hreflang='" . $row['lang'] . "'" : '') . |
|
| 86 | - " href='" . |
|
| 87 | - generer_url_entite($id_rubrique, 'rubrique') . |
|
| 88 | - "'><span class='titre'>" . |
|
| 89 | - $rang . $titre |
|
| 82 | + )). |
|
| 83 | + " <a class='titremlien' dir='$lang_dir'". |
|
| 84 | + ($row['lang'] !== $GLOBALS['spip_lang'] ? " hreflang='".$row['lang']."'" : ''). |
|
| 85 | + " href='". |
|
| 86 | + generer_url_entite($id_rubrique, 'rubrique'). |
|
| 87 | + "'><span class='titre'>". |
|
| 88 | + $rang.$titre |
|
| 90 | 89 | . '</span>' |
| 91 | 90 | . (is_string($logo) ? $logo : '') |
| 92 | 91 | . '</a>'; |
@@ -96,8 +95,8 @@ discard block |
||
| 96 | 95 | ; |
| 97 | 96 | |
| 98 | 97 | $res[] = |
| 99 | - debut_cadre_sous_rub(($id_parent ? 'rubrique-24.png' : 'secteur-24.png'), true, '', $titre) . |
|
| 100 | - $les_sous_enfants . |
|
| 98 | + debut_cadre_sous_rub(($id_parent ? 'rubrique-24.png' : 'secteur-24.png'), true, '', $titre). |
|
| 99 | + $les_sous_enfants. |
|
| 101 | 100 | fin_cadre_sous_rub(); |
| 102 | 101 | } |
| 103 | 102 | } |
@@ -116,7 +115,7 @@ discard block |
||
| 116 | 115 | * Le contenu du bloc dépliable |
| 117 | 116 | */ |
| 118 | 117 | function sous_enfant_rub($collection2) { |
| 119 | - $nb = sql_countsel('spip_rubriques', 'id_parent=' . intval($collection2)); |
|
| 118 | + $nb = sql_countsel('spip_rubriques', 'id_parent='.intval($collection2)); |
|
| 120 | 119 | |
| 121 | 120 | $retour = ''; |
| 122 | 121 | $pagination = ''; |
@@ -128,23 +127,23 @@ discard block |
||
| 128 | 127 | * Si > 500 on affiche une pagination |
| 129 | 128 | */ |
| 130 | 129 | if ($nb > $limite) { |
| 131 | - $debut = _request('debut_rubrique' . $collection2) ?: $debut; |
|
| 130 | + $debut = _request('debut_rubrique'.$collection2) ?: $debut; |
|
| 132 | 131 | $pagination = chercher_filtre('pagination'); |
| 133 | - $pagination = '<p class="pagination">' . $pagination( |
|
| 132 | + $pagination = '<p class="pagination">'.$pagination( |
|
| 134 | 133 | $nb, |
| 135 | - '_rubrique' . $collection2, |
|
| 134 | + '_rubrique'.$collection2, |
|
| 136 | 135 | $debut, |
| 137 | 136 | $limite, |
| 138 | 137 | true, |
| 139 | 138 | 'prive' |
| 140 | - ) . '</p>'; |
|
| 139 | + ).'</p>'; |
|
| 141 | 140 | $limite = $debut + $limite; |
| 142 | 141 | } |
| 143 | 142 | |
| 144 | 143 | $result = sql_select( |
| 145 | 144 | 'id_rubrique, id_parent, titre, lang', |
| 146 | 145 | 'spip_rubriques', |
| 147 | - 'id_parent=' . intval($collection2), |
|
| 146 | + 'id_parent='.intval($collection2), |
|
| 148 | 147 | '', |
| 149 | 148 | '0+titre,titre', |
| 150 | 149 | "$debut,$limite" |
@@ -164,14 +163,14 @@ discard block |
||
| 164 | 163 | changer_typo($row['lang']); |
| 165 | 164 | $lang_dir = lang_dir($row['lang']); |
| 166 | 165 | if (autoriser('voir', 'rubrique', $id_rubrique2)) { |
| 167 | - $retour .= "\n<li class='item' dir='$lang_dir'><a href='" . generer_url_entite( |
|
| 166 | + $retour .= "\n<li class='item' dir='$lang_dir'><a href='".generer_url_entite( |
|
| 168 | 167 | $id_rubrique2, |
| 169 | 168 | 'rubrique' |
| 170 | - ) . "'>" . $rang2 . $titre2 . "</a></li>\n"; |
|
| 169 | + )."'>".$rang2.$titre2."</a></li>\n"; |
|
| 171 | 170 | } |
| 172 | 171 | } |
| 173 | 172 | |
| 174 | - $retour = $pagination . $retour . $pagination; |
|
| 173 | + $retour = $pagination.$retour.$pagination; |
|
| 175 | 174 | |
| 176 | 175 | if (!$retour) { |
| 177 | 176 | return ''; |
@@ -180,7 +179,7 @@ discard block |
||
| 180 | 179 | return debut_block_depliable($debut > 0 ? true : false, "enfants$collection2") |
| 181 | 180 | . "\n<ul class='liste-items sous-sous-rub'>\n" |
| 182 | 181 | . $retour |
| 183 | - . "</ul>\n" . fin_block() . "\n\n"; |
|
| 182 | + . "</ul>\n".fin_block()."\n\n"; |
|
| 184 | 183 | } |
| 185 | 184 | |
| 186 | 185 | /** |
@@ -199,13 +198,13 @@ discard block |
||
| 199 | 198 | $debut = 0; |
| 200 | 199 | $limite = 500; |
| 201 | 200 | |
| 202 | - $nb = sql_countsel('spip_rubriques', 'id_parent=' . intval($id_rubrique)); |
|
| 201 | + $nb = sql_countsel('spip_rubriques', 'id_parent='.intval($id_rubrique)); |
|
| 203 | 202 | |
| 204 | 203 | if ($nb > $limite) { |
| 205 | - $debut = _request('debut_rubrique' . $id_rubrique) ?: $debut; |
|
| 204 | + $debut = _request('debut_rubrique'.$id_rubrique) ?: $debut; |
|
| 206 | 205 | $pagination = chercher_filtre('pagination'); |
| 207 | - $pagination = '<br class="nettoyeur"><p class="pagination">' . |
|
| 208 | - $pagination($nb, '_rubrique' . $id_rubrique, $debut, $limite, true, 'prive') . |
|
| 206 | + $pagination = '<br class="nettoyeur"><p class="pagination">'. |
|
| 207 | + $pagination($nb, '_rubrique'.$id_rubrique, $debut, $limite, true, 'prive'). |
|
| 209 | 208 | '</p>'; |
| 210 | 209 | } |
| 211 | 210 | |
@@ -204,8 +204,8 @@ discard block |
||
| 204 | 204 | $hsl = _couleur_hex_to_hsl($couleur); |
| 205 | 205 | $hsl = [ |
| 206 | 206 | 'h' => round($hsl['h'] * 360), |
| 207 | - 's' => round($hsl['s'] * 100) . '%', |
|
| 208 | - 'l' => round($hsl['l'] * 100) . '%' |
|
| 207 | + 's' => round($hsl['s'] * 100).'%', |
|
| 208 | + 'l' => round($hsl['l'] * 100).'%' |
|
| 209 | 209 | ]; |
| 210 | 210 | if ($format === null) { |
| 211 | 211 | return "hsl({$hsl['h']}, {$hsl['s']}, {$hsl['l']})"; |
@@ -384,11 +384,11 @@ discard block |
||
| 384 | 384 | $process = 'AUTO' |
| 385 | 385 | ) { |
| 386 | 386 | // PHP 7+ type hint |
| 387 | - $img = (string)$img; |
|
| 388 | - $taille_x = (int)$taille_x; |
|
| 389 | - $taille_y = (int)$taille_y; |
|
| 390 | - $force = (bool)$force; |
|
| 391 | - $process = (string)$process; |
|
| 387 | + $img = (string) $img; |
|
| 388 | + $taille_x = (int) $taille_x; |
|
| 389 | + $taille_y = (int) $taille_y; |
|
| 390 | + $force = (bool) $force; |
|
| 391 | + $process = (string) $process; |
|
| 392 | 392 | |
| 393 | 393 | if (!$img) { |
| 394 | 394 | return ''; |
@@ -465,11 +465,11 @@ discard block |
||
| 465 | 465 | $process = 'AUTO' |
| 466 | 466 | ) { |
| 467 | 467 | // PHP 7+ type hint |
| 468 | - $img = (string)$img; |
|
| 469 | - $taille = (int)$taille; |
|
| 470 | - $taille_y = (int)$taille_y; |
|
| 471 | - $force = (bool)$force; |
|
| 472 | - $process = (string)$process; |
|
| 468 | + $img = (string) $img; |
|
| 469 | + $taille = (int) $taille; |
|
| 470 | + $taille_y = (int) $taille_y; |
|
| 471 | + $force = (bool) $force; |
|
| 472 | + $process = (string) $process; |
|
| 473 | 473 | |
| 474 | 474 | // Determiner la taille x,y maxi |
| 475 | 475 | // prendre le reglage de previsu par defaut |
@@ -512,7 +512,7 @@ discard block |
||
| 512 | 512 | $background_color = 'white' |
| 513 | 513 | ) { |
| 514 | 514 | if (function_exists('image_recadre') && ($GLOBALS['meta']['image_process'] ?? '') === 'gd2') { |
| 515 | - return image_reduire(image_recadre($im, $width . ':' . $height, '-', $position, $background_color), $width, $height); |
|
| 515 | + return image_reduire(image_recadre($im, $width.':'.$height, '-', $position, $background_color), $width, $height); |
|
| 516 | 516 | } else { return image_passe_partout($im, $width, $height); |
| 517 | 517 | } |
| 518 | 518 | } |
@@ -533,9 +533,9 @@ discard block |
||
| 533 | 533 | **/ |
| 534 | 534 | function image_reduire_par($img, $val = 1, $force = false) { |
| 535 | 535 | // PHP 7+ type hint |
| 536 | - $img = (string)$img; |
|
| 537 | - $val = (int)$val; |
|
| 538 | - $force = (bool)$force; |
|
| 536 | + $img = (string) $img; |
|
| 537 | + $val = (int) $val; |
|
| 538 | + $force = (bool) $force; |
|
| 539 | 539 | |
| 540 | 540 | [$hauteur, $largeur] = taille_image($img); |
| 541 | 541 | |
@@ -53,11 +53,11 @@ discard block |
||
| 53 | 53 | |
| 54 | 54 | // si spip_log() dans mes_options, ou repertoire log/ non present, poser dans tmp/ |
| 55 | 55 | if (!defined('_DIR_LOG') or !$test_repertoire[$d]) { |
| 56 | - $logfile = _DIR_RACINE . _NOM_TEMPORAIRES_INACCESSIBLES . $logname . '.log'; |
|
| 56 | + $logfile = _DIR_RACINE._NOM_TEMPORAIRES_INACCESSIBLES.$logname.'.log'; |
|
| 57 | 57 | } |
| 58 | 58 | |
| 59 | 59 | $rotate = 0; |
| 60 | - $pid = '(pid ' . @getmypid() . ')'; |
|
| 60 | + $pid = '(pid '.@getmypid().')'; |
|
| 61 | 61 | |
| 62 | 62 | // accepter spip_log( Array ) |
| 63 | 63 | if (!is_string($message)) { |
@@ -72,10 +72,10 @@ discard block |
||
| 72 | 72 | $fi = substr($fi, strlen(_ROOT_RACINE)); |
| 73 | 73 | } |
| 74 | 74 | $fu = $debug[2]['function'] ?? ''; |
| 75 | - $debugverb = "$fi:L$l:$fu" . '():'; |
|
| 75 | + $debugverb = "$fi:L$l:$fu".'():'; |
|
| 76 | 76 | } |
| 77 | 77 | |
| 78 | - $m = date('Y-m-d H:i:s') . ' ' . ($GLOBALS['ip'] ?? '') . ' ' . $pid . ' ' |
|
| 78 | + $m = date('Y-m-d H:i:s').' '.($GLOBALS['ip'] ?? '').' '.$pid.' ' |
|
| 79 | 79 | //distinguer les logs prives et publics dans les grep |
| 80 | 80 | . $debugverb |
| 81 | 81 | . (test_espace_prive() ? ':Pri:' : ':Pub:') |
@@ -100,9 +100,9 @@ discard block |
||
| 100 | 100 | $rotate-- > 0 |
| 101 | 101 | and function_exists('spip_unlink') |
| 102 | 102 | ) { |
| 103 | - spip_unlink($logfile . '.' . $rotate); |
|
| 103 | + spip_unlink($logfile.'.'.$rotate); |
|
| 104 | 104 | while ($rotate--) { |
| 105 | - @rename($logfile . ($rotate ? '.' . $rotate : ''), $logfile . '.' . ($rotate + 1)); |
|
| 105 | + @rename($logfile.($rotate ? '.'.$rotate : ''), $logfile.'.'.($rotate + 1)); |
|
| 106 | 106 | } |
| 107 | 107 | } |
| 108 | 108 | |
@@ -134,7 +134,7 @@ discard block |
||
| 134 | 134 | |
| 135 | 135 | // ceci est la RegExp NO_REAL_NAME faisant hurler SpamAssassin |
| 136 | 136 | if (preg_match('/^["\s]*\<?\S+\@\S+\>?\s*$/', $from)) { |
| 137 | - $from .= ' (' . str_replace(')', '', translitteration(str_replace('@', ' at ', $from))) . ')'; |
|
| 137 | + $from .= ' ('.str_replace(')', '', translitteration(str_replace('@', ' at ', $from))).')'; |
|
| 138 | 138 | } |
| 139 | 139 | |
| 140 | 140 | // nettoyer les é ’, &emdash; etc... |
@@ -171,7 +171,7 @@ discard block |
||
| 171 | 171 | if (!_TEST_EMAIL_DEST) { |
| 172 | 172 | return false; |
| 173 | 173 | } else { |
| 174 | - $texte = "Dest : $destinataire\r\n" . $texte; |
|
| 174 | + $texte = "Dest : $destinataire\r\n".$texte; |
|
| 175 | 175 | $destinataire = _TEST_EMAIL_DEST; |
| 176 | 176 | } |
| 177 | 177 | } |
@@ -195,7 +195,7 @@ discard block |
||
| 195 | 195 | // Ajouter le Content-Type et consort s'il n'y est pas deja |
| 196 | 196 | if (strpos($headers, 'Content-Type: ') === false) { |
| 197 | 197 | $type = |
| 198 | - "Content-Type: text/plain;charset=\"$charset\";\n" . |
|
| 198 | + "Content-Type: text/plain;charset=\"$charset\";\n". |
|
| 199 | 199 | "Content-Transfer-Encoding: 8bit\n"; |
| 200 | 200 | } else { |
| 201 | 201 | $type = ''; |
@@ -207,17 +207,17 @@ discard block |
||
| 207 | 207 | $domain = $domain[0]; |
| 208 | 208 | } |
| 209 | 209 | else { |
| 210 | - $domain = '@unknown-' . md5($from) . '.org'; |
|
| 210 | + $domain = '@unknown-'.md5($from).'.org'; |
|
| 211 | 211 | } |
| 212 | - $uniq = random_int(0, mt_getrandmax()) . '_' . md5($to . $texte) . $domain; |
|
| 212 | + $uniq = random_int(0, mt_getrandmax()).'_'.md5($to.$texte).$domain; |
|
| 213 | 213 | |
| 214 | 214 | // Si multi-part, s'en servir comme borne ... |
| 215 | 215 | if ($parts) { |
| 216 | - $texte = "--$uniq\n$type\n" . $texte . "\n"; |
|
| 216 | + $texte = "--$uniq\n$type\n".$texte."\n"; |
|
| 217 | 217 | foreach ($parts as $part) { |
| 218 | - $n = strlen($part[1]) . ($part[0] ? "\n" : ''); |
|
| 218 | + $n = strlen($part[1]).($part[0] ? "\n" : ''); |
|
| 219 | 219 | $e = join("\n", $part[0]); |
| 220 | - $texte .= "\n--$uniq\nContent-Length: $n$e\n\n" . $part[1]; |
|
| 220 | + $texte .= "\n--$uniq\nContent-Length: $n$e\n\n".$part[1]; |
|
| 221 | 221 | } |
| 222 | 222 | $texte .= "\n\n--$uniq--\n"; |
| 223 | 223 | // Si boundary n'est pas entre guillemets, |
@@ -227,7 +227,7 @@ discard block |
||
| 227 | 227 | |
| 228 | 228 | // .. et s'en servir pour plaire a SpamAssassin |
| 229 | 229 | |
| 230 | - $mid = 'Message-Id: <' . $uniq . '>'; |
|
| 230 | + $mid = 'Message-Id: <'.$uniq.'>'; |
|
| 231 | 231 | |
| 232 | 232 | // indispensable pour les sites qui collent d'office From: serveur-http |
| 233 | 233 | // sauf si deja mis par l'envoyeur |
@@ -100,7 +100,7 @@ discard block |
||
| 100 | 100 | $res['message_ok'] = _T('info_modification_enregistree'); |
| 101 | 101 | if ($retour) { |
| 102 | 102 | if (strncmp($retour, 'javascript:', 11) == 0) { |
| 103 | - $res['message_ok'] .= '<script type="text/javascript">/*<![CDATA[*/' . substr($retour, 11) . '/*]]>*/</script>'; |
|
| 103 | + $res['message_ok'] .= '<script type="text/javascript">/*<![CDATA[*/'.substr($retour, 11).'/*]]>*/</script>'; |
|
| 104 | 104 | $res['editable'] = true; |
| 105 | 105 | } else { |
| 106 | 106 | $res['redirect'] = parametre_url($retour, $id_table_objet, $id); |
@@ -140,7 +140,7 @@ discard block |
||
| 140 | 140 | if (!isset($erreurs[$champ])) { |
| 141 | 141 | $erreurs[$champ] = ''; |
| 142 | 142 | } |
| 143 | - $erreurs[$champ] .= _T('alerte_modif_info_concourante') . "<br /><textarea readonly='readonly' class='forml'>" . entites_html($conflit['base']) . '</textarea>'; |
|
| 143 | + $erreurs[$champ] .= _T('alerte_modif_info_concourante')."<br /><textarea readonly='readonly' class='forml'>".entites_html($conflit['base']).'</textarea>'; |
|
| 144 | 144 | } |
| 145 | 145 | } |
| 146 | 146 | } |
@@ -218,7 +218,7 @@ discard block |
||
| 218 | 218 | if ( |
| 219 | 219 | $config_fonc |
| 220 | 220 | and !in_array($config_fonc, ['articles_edit_config', 'rubriques_edit_config', 'auteurs_edit_config']) |
| 221 | - and $config_fonc !== $table_objet . '_edit_config' |
|
| 221 | + and $config_fonc !== $table_objet.'_edit_config' |
|
| 222 | 222 | ) { |
| 223 | 223 | if ( |
| 224 | 224 | $args = test_formulaire_inclus_par_modele() |
@@ -233,12 +233,12 @@ discard block |
||
| 233 | 233 | // Appel direct dans un squelette |
| 234 | 234 | if (!$row) { |
| 235 | 235 | if (!$new or $lier_trad) { |
| 236 | - if ($select = charger_fonction('precharger_' . $type, 'inc', true)) { |
|
| 236 | + if ($select = charger_fonction('precharger_'.$type, 'inc', true)) { |
|
| 237 | 237 | $row = $select($id, $id_parent, $lier_trad); |
| 238 | 238 | // si on a une fonction precharger, elle pu faire un reglage de langue |
| 239 | 239 | $lang_default = (!empty($row['lang']) ? $row['lang'] : null); |
| 240 | 240 | } else { |
| 241 | - $row = sql_fetsel('*', $table_objet_sql, $id_table_objet . '=' . intval($id)); |
|
| 241 | + $row = sql_fetsel('*', $table_objet_sql, $id_table_objet.'='.intval($id)); |
|
| 242 | 242 | } |
| 243 | 243 | if (!$new) { |
| 244 | 244 | $md5 = controles_md5($row); |
@@ -288,7 +288,7 @@ discard block |
||
| 288 | 288 | if ($config_fonc) { |
| 289 | 289 | $contexte['config'] = $config = $config_fonc($contexte); |
| 290 | 290 | if (!$lang_default) { |
| 291 | - $lang_default = $config['langue'] ?? session_get('lang') ; |
|
| 291 | + $lang_default = $config['langue'] ?? session_get('lang'); |
|
| 292 | 292 | } |
| 293 | 293 | } |
| 294 | 294 | $config = $config + [ |
@@ -312,13 +312,12 @@ discard block |
||
| 312 | 312 | unset($contexte['lang']); |
| 313 | 313 | } |
| 314 | 314 | |
| 315 | - $contexte['_hidden'] = "<input type='hidden' name='editer_$type' value='oui' />\n" . |
|
| 316 | - (!$lier_trad ? '' : |
|
| 317 | - ("\n<input type='hidden' name='lier_trad' value='" . |
|
| 318 | - $lier_trad . |
|
| 319 | - "' />" . |
|
| 320 | - "\n<input type='hidden' name='changer_lang' value='" . |
|
| 321 | - $lang_default . |
|
| 315 | + $contexte['_hidden'] = "<input type='hidden' name='editer_$type' value='oui' />\n". |
|
| 316 | + (!$lier_trad ? '' : ("\n<input type='hidden' name='lier_trad' value='". |
|
| 317 | + $lier_trad. |
|
| 318 | + "' />". |
|
| 319 | + "\n<input type='hidden' name='changer_lang' value='". |
|
| 320 | + $lang_default. |
|
| 322 | 321 | "' />")) |
| 323 | 322 | . $hidden |
| 324 | 323 | . ($md5 ?? ''); |
@@ -358,14 +357,14 @@ discard block |
||
| 358 | 357 | $aider = charger_fonction('aider', 'inc'); |
| 359 | 358 | if (strlen($texte) > 28 * 1024) { |
| 360 | 359 | $texte = str_replace("\r\n", "\n", $texte); |
| 361 | - $pos = strpos($texte, "\n\n", 28 * 1024); // coupe para > 28 ko |
|
| 360 | + $pos = strpos($texte, "\n\n", 28 * 1024); // coupe para > 28 ko |
|
| 362 | 361 | if ($pos > 0 and $pos < 32 * 1024) { |
| 363 | - $debut = substr($texte, 0, $pos) . "\n\n<!--SPIP-->\n"; |
|
| 362 | + $debut = substr($texte, 0, $pos)."\n\n<!--SPIP-->\n"; |
|
| 364 | 363 | $suite = substr($texte, $pos + 2); |
| 365 | 364 | } else { |
| 366 | - $pos = strpos($texte, ' ', 28 * 1024); // sinon coupe espace |
|
| 365 | + $pos = strpos($texte, ' ', 28 * 1024); // sinon coupe espace |
|
| 367 | 366 | if (!($pos > 0 and $pos < 32 * 1024)) { |
| 368 | - $pos = 28 * 1024; // au pire (pas d'espace trouv'e) |
|
| 367 | + $pos = 28 * 1024; // au pire (pas d'espace trouv'e) |
|
| 369 | 368 | $decalage = 0; // si y'a pas d'espace, il ne faut pas perdre le caract`ere |
| 370 | 369 | } else { |
| 371 | 370 | $decalage = 1; |
@@ -396,13 +395,13 @@ discard block |
||
| 396 | 395 | } |
| 397 | 396 | |
| 398 | 397 | include_spip('inc/barre'); |
| 399 | - $textes_supplement = "<br /><span style='color: red'>" . _T('info_texte_long') . "</span>\n"; |
|
| 398 | + $textes_supplement = "<br /><span style='color: red'>"._T('info_texte_long')."</span>\n"; |
|
| 400 | 399 | $nombre = 0; |
| 401 | 400 | |
| 402 | 401 | while (strlen($texte) > 29 * 1024) { |
| 403 | 402 | $nombre++; |
| 404 | 403 | [$texte1, $texte] = coupe_trop_long($texte); |
| 405 | - $textes_supplement .= '<br />' . |
|
| 404 | + $textes_supplement .= '<br />'. |
|
| 406 | 405 | "<textarea id='texte$nombre' name='texte_plus[$nombre]'$att_text>$texte1</textarea>\n"; |
| 407 | 406 | } |
| 408 | 407 | |
@@ -485,7 +484,7 @@ discard block |
||
| 485 | 484 | $ctr = []; |
| 486 | 485 | foreach ($data as $key => $val) { |
| 487 | 486 | $m = md5($val ?? ''); |
| 488 | - $k = $prefixe . $key; |
|
| 487 | + $k = $prefixe.$key; |
|
| 489 | 488 | |
| 490 | 489 | switch ($format) { |
| 491 | 490 | case 'html': |
@@ -498,7 +497,7 @@ discard block |
||
| 498 | 497 | } |
| 499 | 498 | |
| 500 | 499 | if ($format === 'html') { |
| 501 | - return "\n\n<!-- controles md5 -->\n" . join("\n", $ctr) . "\n\n"; |
|
| 500 | + return "\n\n<!-- controles md5 -->\n".join("\n", $ctr)."\n\n"; |
|
| 502 | 501 | } else { |
| 503 | 502 | return $ctr; |
| 504 | 503 | } |
@@ -650,7 +649,7 @@ discard block |
||
| 650 | 649 | // On elimine les donnees non modifiees par le formulaire (mais |
| 651 | 650 | // potentiellement modifiees entre temps par un autre utilisateur) |
| 652 | 651 | foreach ($champs as $key => $val) { |
| 653 | - if (isset($ctr[$prefix . $key]) and $m = $ctr[$prefix . $key]) { |
|
| 652 | + if (isset($ctr[$prefix.$key]) and $m = $ctr[$prefix.$key]) { |
|
| 654 | 653 | if (is_scalar($val) and $m == md5($val)) { |
| 655 | 654 | unset($champs[$key]); |
| 656 | 655 | } |
@@ -679,7 +678,7 @@ discard block |
||
| 679 | 678 | // de conflit. |
| 680 | 679 | $ctrh = $ctrq = $conflits = []; |
| 681 | 680 | foreach (array_keys($champs) as $key) { |
| 682 | - if (isset($ctr[$prefix . $key]) and $m = $ctr[$prefix . $key]) { |
|
| 681 | + if (isset($ctr[$prefix.$key]) and $m = $ctr[$prefix.$key]) { |
|
| 683 | 682 | $ctrh[$key] = $m; |
| 684 | 683 | $ctrq[] = $key; |
| 685 | 684 | } |
@@ -713,9 +712,9 @@ discard block |
||
| 713 | 712 | */ |
| 714 | 713 | function display_conflit_champ($x) { |
| 715 | 714 | if (strstr($x, "\n") or strlen($x) > 80) { |
| 716 | - return "<textarea style='width:99%; height:10em;'>" . entites_html($x) . "</textarea>\n"; |
|
| 715 | + return "<textarea style='width:99%; height:10em;'>".entites_html($x)."</textarea>\n"; |
|
| 717 | 716 | } else { |
| 718 | - return "<input type='text' size='40' style='width:99%' value=\"" . entites_html($x) . "\" />\n"; |
|
| 717 | + return "<input type='text' size='40' style='width:99%' value=\"".entites_html($x)."\" />\n"; |
|
| 719 | 718 | } |
| 720 | 719 | } |
| 721 | 720 | |
@@ -755,11 +754,11 @@ discard block |
||
| 755 | 754 | ) : $champ; |
| 756 | 755 | |
| 757 | 756 | $diffs[] = "<h2>$titre</h2>\n" |
| 758 | - . '<h3>' . _T('info_conflit_edition_differences') . "</h3>\n" |
|
| 759 | - . "<div style='max-height:8em; overflow: auto; width:99%;'>" . $d . "</div>\n" |
|
| 760 | - . '<h4>' . _T('info_conflit_edition_votre_version') . '</h4>' |
|
| 757 | + . '<h3>'._T('info_conflit_edition_differences')."</h3>\n" |
|
| 758 | + . "<div style='max-height:8em; overflow: auto; width:99%;'>".$d."</div>\n" |
|
| 759 | + . '<h4>'._T('info_conflit_edition_votre_version').'</h4>' |
|
| 761 | 760 | . display_conflit_champ($a['post']) |
| 762 | - . '<h4>' . _T('info_conflit_edition_version_enregistree') . '</h4>' |
|
| 761 | + . '<h4>'._T('info_conflit_edition_version_enregistree').'</h4>' |
|
| 763 | 762 | . display_conflit_champ($base); |
| 764 | 763 | } |
| 765 | 764 | |
@@ -767,16 +766,16 @@ discard block |
||
| 767 | 766 | $id = uniqid(random_int(0, mt_getrandmax())); |
| 768 | 767 | $redirect = "<form action='$redirect' method='get' |
| 769 | 768 | id='$id' |
| 770 | - style='float:" . $GLOBALS['spip_lang_right'] . "; margin-top:2em;'>\n" |
|
| 769 | + style='float:".$GLOBALS['spip_lang_right']."; margin-top:2em;'>\n" |
|
| 771 | 770 | . form_hidden($redirect) |
| 772 | - . "<input type='submit' value='" . _T('icone_retour') . "' /> |
|
| 771 | + . "<input type='submit' value='"._T('icone_retour')."' /> |
|
| 773 | 772 | </form>\n"; |
| 774 | 773 | |
| 775 | 774 | // pour les documents, on est probablement en ajax : il faut ajaxer |
| 776 | 775 | if (_AJAX) { |
| 777 | 776 | $redirect .= '<script type="text/javascript">' |
| 778 | - . 'setTimeout(function(){$("#' . $id . '") |
|
| 779 | - .ajaxForm({target:$("#' . $id . '").parent()}); |
|
| 777 | + . 'setTimeout(function(){$("#'.$id.'") |
|
| 778 | + .ajaxForm({target:$("#' . $id.'").parent()}); |
|
| 780 | 779 | }, 200);' |
| 781 | 780 | . "</script>\n"; |
| 782 | 781 | } |
@@ -795,9 +794,9 @@ discard block |
||
| 795 | 794 | .diff-para-deplace .diff-supprime { background: #ffb8b8; border: 1px solid #808080; } |
| 796 | 795 | .diff-para-deplace .diff-deplace { background: #b8b8ff; border: 1px solid #808080; } |
| 797 | 796 | </style>' |
| 798 | - . '<p>' . _T('info_conflit_edition_avis_non_sauvegarde') . '</p>' |
|
| 799 | - . '<p>' . _T('texte_conflit_edition_correction') . '</p>' |
|
| 800 | - . "<div style='text-align:" . $GLOBALS['spip_lang_left'] . ";'>" |
|
| 797 | + . '<p>'._T('info_conflit_edition_avis_non_sauvegarde').'</p>' |
|
| 798 | + . '<p>'._T('texte_conflit_edition_correction').'</p>' |
|
| 799 | + . "<div style='text-align:".$GLOBALS['spip_lang_left'].";'>" |
|
| 801 | 800 | . join("\n", $diffs) |
| 802 | 801 | . "</div>\n" |
| 803 | 802 | |
@@ -96,7 +96,7 @@ discard block |
||
| 96 | 96 | } |
| 97 | 97 | |
| 98 | 98 | include_fichiers_fonctions(); |
| 99 | - foreach (['filtre_' . $fonc, 'filtre_' . $fonc . '_dist', $fonc] as $f) { |
|
| 99 | + foreach (['filtre_'.$fonc, 'filtre_'.$fonc.'_dist', $fonc] as $f) { |
|
| 100 | 100 | trouver_filtre_matrice($f); // charge des fichiers spécifiques éventuels |
| 101 | 101 | // fonction ou name\space\fonction |
| 102 | 102 | if (is_callable($f)) { |
@@ -223,7 +223,7 @@ discard block |
||
| 223 | 223 | // affichage "GIT [master: abcdef]" |
| 224 | 224 | $commit = $desc['commit_short'] ?? $desc['commit']; |
| 225 | 225 | if ($desc['branch']) { |
| 226 | - $commit = $desc['branch'] . ': ' . $commit; |
|
| 226 | + $commit = $desc['branch'].': '.$commit; |
|
| 227 | 227 | } |
| 228 | 228 | return "{$desc['vcs']} [$commit]"; |
| 229 | 229 | } |
@@ -242,9 +242,9 @@ discard block |
||
| 242 | 242 | } |
| 243 | 243 | |
| 244 | 244 | // version installee par GIT |
| 245 | - if (lire_fichier($dir . '/.git/HEAD', $c)) { |
|
| 245 | + if (lire_fichier($dir.'/.git/HEAD', $c)) { |
|
| 246 | 246 | $currentHead = trim(substr($c, 4)); |
| 247 | - if (lire_fichier($dir . '/.git/' . $currentHead, $hash)) { |
|
| 247 | + if (lire_fichier($dir.'/.git/'.$currentHead, $hash)) { |
|
| 248 | 248 | return [ |
| 249 | 249 | 'vcs' => 'GIT', |
| 250 | 250 | 'branch' => basename($currentHead), |
@@ -271,8 +271,8 @@ discard block |
||
| 271 | 271 | $dir = '.'; |
| 272 | 272 | } |
| 273 | 273 | // version installee par SVN |
| 274 | - if (file_exists($dir . '/.svn/wc.db') && class_exists(\SQLite3::class)) { |
|
| 275 | - $db = new SQLite3($dir . '/.svn/wc.db'); |
|
| 274 | + if (file_exists($dir.'/.svn/wc.db') && class_exists(\SQLite3::class)) { |
|
| 275 | + $db = new SQLite3($dir.'/.svn/wc.db'); |
|
| 276 | 276 | $result = $db->query('SELECT changed_revision FROM nodes WHERE local_relpath = "" LIMIT 1'); |
| 277 | 277 | if ($result) { |
| 278 | 278 | $row = $result->fetchArray(); |
@@ -290,12 +290,12 @@ discard block |
||
| 290 | 290 | |
| 291 | 291 | // La matrice est necessaire pour ne filtrer _que_ des fonctions definies dans filtres_images |
| 292 | 292 | // et laisser passer les fonctions personnelles baptisees image_... |
| 293 | -$GLOBALS['spip_matrice']['image_graver'] = true;//'inc/filtres_images_mini.php'; |
|
| 294 | -$GLOBALS['spip_matrice']['image_select'] = true;//'inc/filtres_images_mini.php'; |
|
| 295 | -$GLOBALS['spip_matrice']['image_reduire'] = true;//'inc/filtres_images_mini.php'; |
|
| 296 | -$GLOBALS['spip_matrice']['image_reduire_par'] = true;//'inc/filtres_images_mini.php'; |
|
| 297 | -$GLOBALS['spip_matrice']['image_passe_partout'] = true;//'inc/filtres_images_mini.php'; |
|
| 298 | -$GLOBALS['spip_matrice']['image_recadre_avec_fallback'] = true;//'inc/filtres_images_mini.php'; |
|
| 293 | +$GLOBALS['spip_matrice']['image_graver'] = true; //'inc/filtres_images_mini.php'; |
|
| 294 | +$GLOBALS['spip_matrice']['image_select'] = true; //'inc/filtres_images_mini.php'; |
|
| 295 | +$GLOBALS['spip_matrice']['image_reduire'] = true; //'inc/filtres_images_mini.php'; |
|
| 296 | +$GLOBALS['spip_matrice']['image_reduire_par'] = true; //'inc/filtres_images_mini.php'; |
|
| 297 | +$GLOBALS['spip_matrice']['image_passe_partout'] = true; //'inc/filtres_images_mini.php'; |
|
| 298 | +$GLOBALS['spip_matrice']['image_recadre_avec_fallback'] = true; //'inc/filtres_images_mini.php'; |
|
| 299 | 299 | |
| 300 | 300 | $GLOBALS['spip_matrice']['couleur_html_to_hex'] = 'inc/filtres_images_mini.php'; |
| 301 | 301 | $GLOBALS['spip_matrice']['couleur_hex_to_hsl'] = 'inc/filtres_images_mini.php'; |
@@ -454,8 +454,8 @@ discard block |
||
| 454 | 454 | */ |
| 455 | 455 | function filtre_debug($val, $key = null) { |
| 456 | 456 | $debug = ( |
| 457 | - is_null($key) ? '' : (var_export($key, true) . ' = ') |
|
| 458 | - ) . var_export($val, true); |
|
| 457 | + is_null($key) ? '' : (var_export($key, true).' = ') |
|
| 458 | + ).var_export($val, true); |
|
| 459 | 459 | |
| 460 | 460 | include_spip('inc/autoriser'); |
| 461 | 461 | if (autoriser('webmestre')) { |
@@ -509,7 +509,7 @@ discard block |
||
| 509 | 509 | $is_file = false; |
| 510 | 510 | } |
| 511 | 511 | if ($is_file) { |
| 512 | - $is_local_file = function ($path) { |
|
| 512 | + $is_local_file = function($path) { |
|
| 513 | 513 | if (strpos($path, '?') !== false) { |
| 514 | 514 | $path = supprimer_timestamp($path); |
| 515 | 515 | // remove ?24px added by find_in_theme on .svg files |
@@ -561,7 +561,7 @@ discard block |
||
| 561 | 561 | if (preg_match(",this[.]src=['\"]([^'\"]+)['\"],ims", $mouseover, $match)) { |
| 562 | 562 | $srcover = $match[1]; |
| 563 | 563 | array_shift($args); |
| 564 | - array_unshift($args, "<img src='" . $match[1] . "' />"); |
|
| 564 | + array_unshift($args, "<img src='".$match[1]."' />"); |
|
| 565 | 565 | $srcover_filter = call_user_func_array($filtre, $args); |
| 566 | 566 | $srcover_filter = extraire_attribut($srcover_filter, 'src'); |
| 567 | 567 | $reduit = str_replace($srcover, $srcover_filter, $reduit); |
@@ -928,7 +928,7 @@ discard block |
||
| 928 | 928 | // " -> " et tout ce genre de choses |
| 929 | 929 | $u = $GLOBALS['meta']['pcre_u']; |
| 930 | 930 | $texte = str_replace(' ', ' ', $texte); |
| 931 | - $texte = preg_replace('/\s{2,}/S' . $u, ' ', $texte); |
|
| 931 | + $texte = preg_replace('/\s{2,}/S'.$u, ' ', $texte); |
|
| 932 | 932 | // ne pas echapper les sinqle quotes car certains outils de syndication gerent mal |
| 933 | 933 | $texte = entites_html($texte, false, false); |
| 934 | 934 | // mais bien echapper les double quotes ! |
@@ -988,7 +988,7 @@ discard block |
||
| 988 | 988 | **/ |
| 989 | 989 | function supprimer_numero($texte) { |
| 990 | 990 | return preg_replace( |
| 991 | - ',^[[:space:]]*([0-9]+)([.)]|' . chr(194) . '?' . chr(176) . ')[[:space:]]+,S', |
|
| 991 | + ',^[[:space:]]*([0-9]+)([.)]|'.chr(194).'?'.chr(176).')[[:space:]]+,S', |
|
| 992 | 992 | '', |
| 993 | 993 | $texte |
| 994 | 994 | ); |
@@ -1016,7 +1016,7 @@ discard block |
||
| 1016 | 1016 | function recuperer_numero($texte) { |
| 1017 | 1017 | if ( |
| 1018 | 1018 | preg_match( |
| 1019 | - ',^[[:space:]]*([0-9]+)([.)]|' . chr(194) . '?' . chr(176) . ')[[:space:]]+,S', |
|
| 1019 | + ',^[[:space:]]*([0-9]+)([.)]|'.chr(194).'?'.chr(176).')[[:space:]]+,S', |
|
| 1020 | 1020 | $texte, |
| 1021 | 1021 | $regs |
| 1022 | 1022 | ) |
@@ -1107,8 +1107,8 @@ discard block |
||
| 1107 | 1107 | **/ |
| 1108 | 1108 | function textebrut($texte) { |
| 1109 | 1109 | $u = $GLOBALS['meta']['pcre_u']; |
| 1110 | - $texte = preg_replace('/\s+/S' . $u, ' ', $texte); |
|
| 1111 | - $texte = preg_replace('/<(p|br)( [^>]*)?' . '>/iS', "\n\n", $texte); |
|
| 1110 | + $texte = preg_replace('/\s+/S'.$u, ' ', $texte); |
|
| 1111 | + $texte = preg_replace('/<(p|br)( [^>]*)?'.'>/iS', "\n\n", $texte); |
|
| 1112 | 1112 | $texte = preg_replace("/^\n+/", '', $texte); |
| 1113 | 1113 | $texte = preg_replace("/\n+$/", '', $texte); |
| 1114 | 1114 | $texte = preg_replace("/\n +/", "\n", $texte); |
@@ -1142,7 +1142,7 @@ discard block |
||
| 1142 | 1142 | ) |
| 1143 | 1143 | ) { |
| 1144 | 1144 | foreach ($liens[0] as $a) { |
| 1145 | - $rel = 'noopener noreferrer ' . extraire_attribut($a, 'rel'); |
|
| 1145 | + $rel = 'noopener noreferrer '.extraire_attribut($a, 'rel'); |
|
| 1146 | 1146 | $ablank = inserer_attribut($a, 'rel', $rel); |
| 1147 | 1147 | $ablank = inserer_attribut($ablank, 'target', '_blank'); |
| 1148 | 1148 | $texte = str_replace($a, $ablank, $texte); |
@@ -1167,7 +1167,7 @@ discard block |
||
| 1167 | 1167 | foreach ($regs[0] as $a) { |
| 1168 | 1168 | $rel = extraire_attribut($a, 'rel'); |
| 1169 | 1169 | if (strpos($rel, 'nofollow') === false) { |
| 1170 | - $rel = 'nofollow' . ($rel ? " $rel" : ''); |
|
| 1170 | + $rel = 'nofollow'.($rel ? " $rel" : ''); |
|
| 1171 | 1171 | $anofollow = inserer_attribut($a, 'rel', $rel); |
| 1172 | 1172 | $texte = str_replace($a, $anofollow, $texte); |
| 1173 | 1173 | } |
@@ -1196,7 +1196,7 @@ discard block |
||
| 1196 | 1196 | $u = $GLOBALS['meta']['pcre_u']; |
| 1197 | 1197 | $texte = preg_replace('@</p>@iS', "\n", $texte); |
| 1198 | 1198 | $texte = preg_replace("@<p\b.*>@UiS", '<br />', $texte); |
| 1199 | - $texte = preg_replace('@^\s*<br />@S' . $u, '', $texte); |
|
| 1199 | + $texte = preg_replace('@^\s*<br />@S'.$u, '', $texte); |
|
| 1200 | 1200 | |
| 1201 | 1201 | return $texte; |
| 1202 | 1202 | } |
@@ -1227,7 +1227,7 @@ discard block |
||
| 1227 | 1227 | return $texte; |
| 1228 | 1228 | } |
| 1229 | 1229 | include_spip('inc/texte'); |
| 1230 | - $tag = preg_match(',</?(' . _BALISES_BLOCS . ')[>[:space:]],iS', $texte) ? |
|
| 1230 | + $tag = preg_match(',</?('._BALISES_BLOCS.')[>[:space:]],iS', $texte) ? |
|
| 1231 | 1231 | 'div' : 'span'; |
| 1232 | 1232 | |
| 1233 | 1233 | return "<$tag style='word-wrap:break-word;'>$texte</$tag>"; |
@@ -1339,7 +1339,7 @@ discard block |
||
| 1339 | 1339 | } |
| 1340 | 1340 | $u = $GLOBALS['meta']['pcre_u']; |
| 1341 | 1341 | if ($textebrut) { |
| 1342 | - $texte = preg_replace([",\n,", ',\s(?=\s),msS' . $u], [' ', ''], textebrut($texte)); |
|
| 1342 | + $texte = preg_replace([",\n,", ',\s(?=\s),msS'.$u], [' ', ''], textebrut($texte)); |
|
| 1343 | 1343 | } |
| 1344 | 1344 | $texte = texte_backend($texte); |
| 1345 | 1345 | $texte = str_replace(["'", '"'], [''', '"'], $texte); |
@@ -1374,7 +1374,7 @@ discard block |
||
| 1374 | 1374 | # un message pour abs_url |
| 1375 | 1375 | $GLOBALS['mode_abs_url'] = 'url'; |
| 1376 | 1376 | $url = trim($url); |
| 1377 | - $r = ',^(?:' . _PROTOCOLES_STD . '):?/?/?$,iS'; |
|
| 1377 | + $r = ',^(?:'._PROTOCOLES_STD.'):?/?/?$,iS'; |
|
| 1378 | 1378 | |
| 1379 | 1379 | return preg_match($r, $url) ? '' : ($entites ? entites_html($url) : $url); |
| 1380 | 1380 | } |
@@ -1578,14 +1578,14 @@ discard block |
||
| 1578 | 1578 | if (strpos($texte, '<') !== false) { |
| 1579 | 1579 | include_spip('inc/lien'); |
| 1580 | 1580 | if (defined('_PREG_MODELE')) { |
| 1581 | - $preg_modeles = '@' . _PREG_MODELE . '@imsS'; |
|
| 1581 | + $preg_modeles = '@'._PREG_MODELE.'@imsS'; |
|
| 1582 | 1582 | $texte = echappe_html($texte, '', true, $preg_modeles); |
| 1583 | 1583 | } |
| 1584 | 1584 | } |
| 1585 | 1585 | |
| 1586 | 1586 | $debut = ''; |
| 1587 | 1587 | $suite = $texte; |
| 1588 | - while ($t = strpos('-' . $suite, "\n", 1)) { |
|
| 1588 | + while ($t = strpos('-'.$suite, "\n", 1)) { |
|
| 1589 | 1589 | $debut .= substr($suite, 0, $t - 1); |
| 1590 | 1590 | $suite = substr($suite, $t); |
| 1591 | 1591 | $car = substr($suite, 0, 1); |
@@ -1603,11 +1603,11 @@ discard block |
||
| 1603 | 1603 | $suite = substr($suite, strlen($regs[0])); |
| 1604 | 1604 | } |
| 1605 | 1605 | } |
| 1606 | - $texte = $debut . $suite; |
|
| 1606 | + $texte = $debut.$suite; |
|
| 1607 | 1607 | |
| 1608 | 1608 | $texte = echappe_retour($texte); |
| 1609 | 1609 | |
| 1610 | - return $texte . $fin; |
|
| 1610 | + return $texte.$fin; |
|
| 1611 | 1611 | } |
| 1612 | 1612 | |
| 1613 | 1613 | |
@@ -1669,7 +1669,7 @@ discard block |
||
| 1669 | 1669 | } |
| 1670 | 1670 | |
| 1671 | 1671 | foreach ($regs as $reg) { |
| 1672 | - $cle = ($reg[1] ? $reg[1] . ':' : '') . $reg[2]; |
|
| 1672 | + $cle = ($reg[1] ? $reg[1].':' : '').$reg[2]; |
|
| 1673 | 1673 | $desc = $traduire($cle, $lang, true); |
| 1674 | 1674 | $l = $desc->langue; |
| 1675 | 1675 | // si pas de traduction, on laissera l'écriture de l'idiome entier dans le texte. |
@@ -1783,9 +1783,9 @@ discard block |
||
| 1783 | 1783 | // il ne faut pas echapper en div si propre produit un seul paragraphe |
| 1784 | 1784 | include_spip('inc/texte'); |
| 1785 | 1785 | $trad_propre = preg_replace(',(^<p[^>]*>|</p>$),Uims', '', propre($trad)); |
| 1786 | - $mode = preg_match(',</?(' . _BALISES_BLOCS . ')[>[:space:]],iS', $trad_propre) ? 'div' : 'span'; |
|
| 1786 | + $mode = preg_match(',</?('._BALISES_BLOCS.')[>[:space:]],iS', $trad_propre) ? 'div' : 'span'; |
|
| 1787 | 1787 | if ($mode === 'div') { |
| 1788 | - $trad = rtrim($trad) . "\n\n"; |
|
| 1788 | + $trad = rtrim($trad)."\n\n"; |
|
| 1789 | 1789 | } |
| 1790 | 1790 | $trad = code_echappement($trad, 'multi', false, $mode); |
| 1791 | 1791 | $trad = str_replace("'", '"', inserer_attribut($trad, 'lang', $l)); |
@@ -1981,7 +1981,7 @@ discard block |
||
| 1981 | 1981 | if (is_array($balise)) { |
| 1982 | 1982 | array_walk( |
| 1983 | 1983 | $balise, |
| 1984 | - function (&$a, $key, $t) { |
|
| 1984 | + function(&$a, $key, $t) { |
|
| 1985 | 1985 | $a = extraire_attribut($a, $t); |
| 1986 | 1986 | }, |
| 1987 | 1987 | $attribut |
@@ -2073,14 +2073,14 @@ discard block |
||
| 2073 | 2073 | |
| 2074 | 2074 | if ($old !== null) { |
| 2075 | 2075 | // Remplacer l'ancien attribut du meme nom |
| 2076 | - $balise = $r[1] . $insert . $r[5]; |
|
| 2076 | + $balise = $r[1].$insert.$r[5]; |
|
| 2077 | 2077 | } else { |
| 2078 | 2078 | // preferer une balise " />" (comme <img />) |
| 2079 | 2079 | if (preg_match(',/>,', $balise)) { |
| 2080 | - $balise = preg_replace(',\s?/>,S', $insert . ' />', $balise, 1); |
|
| 2080 | + $balise = preg_replace(',\s?/>,S', $insert.' />', $balise, 1); |
|
| 2081 | 2081 | } // sinon une balise <a ...> ... </a> |
| 2082 | 2082 | else { |
| 2083 | - $balise = preg_replace(',\s?>,S', $insert . '>', $balise, 1); |
|
| 2083 | + $balise = preg_replace(',\s?>,S', $insert.'>', $balise, 1); |
|
| 2084 | 2084 | } |
| 2085 | 2085 | } |
| 2086 | 2086 | |
@@ -2135,7 +2135,7 @@ discard block |
||
| 2135 | 2135 | if ( |
| 2136 | 2136 | $class_courante |
| 2137 | 2137 | and strpos($class_courante, (string) $c) !== false |
| 2138 | - and preg_match('/(^|\s)' . preg_quote($c) . '($|\s)/', $class_courante) |
|
| 2138 | + and preg_match('/(^|\s)'.preg_quote($c).'($|\s)/', $class_courante) |
|
| 2139 | 2139 | ) { |
| 2140 | 2140 | $is_class_presente = true; |
| 2141 | 2141 | } |
@@ -2143,12 +2143,12 @@ discard block |
||
| 2143 | 2143 | in_array($operation, ['ajouter', 'commuter']) |
| 2144 | 2144 | and !$is_class_presente |
| 2145 | 2145 | ) { |
| 2146 | - $class_new = ltrim(rtrim($class_new ?? '') . ' ' . $c); |
|
| 2146 | + $class_new = ltrim(rtrim($class_new ?? '').' '.$c); |
|
| 2147 | 2147 | } elseif ( |
| 2148 | 2148 | in_array($operation, ['supprimer', 'commuter']) |
| 2149 | 2149 | and $is_class_presente |
| 2150 | 2150 | ) { |
| 2151 | - $class_new = trim(preg_replace('/(^|\s)' . preg_quote($c) . '($|\s)/', "\\1", $class_new)); |
|
| 2151 | + $class_new = trim(preg_replace('/(^|\s)'.preg_quote($c).'($|\s)/', "\\1", $class_new)); |
|
| 2152 | 2152 | } |
| 2153 | 2153 | } |
| 2154 | 2154 | |
@@ -2211,7 +2211,7 @@ discard block |
||
| 2211 | 2211 | // Quelques fonctions de calcul arithmetique |
| 2212 | 2212 | // |
| 2213 | 2213 | function floatstr($a) { |
| 2214 | - return str_replace(',', '.', (string)floatval($a)); |
|
| 2214 | + return str_replace(',', '.', (string) floatval($a)); |
|
| 2215 | 2215 | } |
| 2216 | 2216 | function strize($f, $a, $b) { |
| 2217 | 2217 | return floatstr($f(floatstr($a), floatstr($b))); |
@@ -2347,13 +2347,13 @@ discard block |
||
| 2347 | 2347 | if (!defined('_TAGS_NOM_AUTEUR')) { |
| 2348 | 2348 | define('_TAGS_NOM_AUTEUR', ''); |
| 2349 | 2349 | } |
| 2350 | - $tags_acceptes = array_unique(explode(',', 'multi,' . _TAGS_NOM_AUTEUR)); |
|
| 2350 | + $tags_acceptes = array_unique(explode(',', 'multi,'._TAGS_NOM_AUTEUR)); |
|
| 2351 | 2351 | foreach ($tags_acceptes as $tag) { |
| 2352 | 2352 | if (strlen($tag)) { |
| 2353 | - $remp1[] = '<' . trim($tag) . '>'; |
|
| 2354 | - $remp1[] = '</' . trim($tag) . '>'; |
|
| 2355 | - $remp2[] = '\x60' . trim($tag) . '\x61'; |
|
| 2356 | - $remp2[] = '\x60/' . trim($tag) . '\x61'; |
|
| 2353 | + $remp1[] = '<'.trim($tag).'>'; |
|
| 2354 | + $remp1[] = '</'.trim($tag).'>'; |
|
| 2355 | + $remp2[] = '\x60'.trim($tag).'\x61'; |
|
| 2356 | + $remp2[] = '\x60/'.trim($tag).'\x61'; |
|
| 2357 | 2357 | } |
| 2358 | 2358 | } |
| 2359 | 2359 | $v_nom = str_replace($remp2, $remp1, supprimer_tags(str_replace($remp1, $remp2, $nom))); |
@@ -2407,7 +2407,7 @@ discard block |
||
| 2407 | 2407 | . http_img_pack( |
| 2408 | 2408 | 'attachment-16.png', |
| 2409 | 2409 | $t, |
| 2410 | - 'title="' . attribut_html($t) . '"' |
|
| 2410 | + 'title="'.attribut_html($t).'"' |
|
| 2411 | 2411 | ) |
| 2412 | 2412 | . '</a>', |
| 2413 | 2413 | $tag |
@@ -2471,10 +2471,10 @@ discard block |
||
| 2471 | 2471 | $fichier = basename($url); |
| 2472 | 2472 | |
| 2473 | 2473 | return '<a rel="enclosure"' |
| 2474 | - . ($url ? ' href="' . spip_htmlspecialchars($url) . '"' : '') |
|
| 2475 | - . ($type ? ' type="' . spip_htmlspecialchars($type) . '"' : '') |
|
| 2476 | - . ($length ? ' title="' . spip_htmlspecialchars($length) . '"' : '') |
|
| 2477 | - . '>' . $fichier . '</a>'; |
|
| 2474 | + . ($url ? ' href="'.spip_htmlspecialchars($url).'"' : '') |
|
| 2475 | + . ($type ? ' type="'.spip_htmlspecialchars($type).'"' : '') |
|
| 2476 | + . ($length ? ' title="'.spip_htmlspecialchars($length).'"' : '') |
|
| 2477 | + . '>'.$fichier.'</a>'; |
|
| 2478 | 2478 | } |
| 2479 | 2479 | |
| 2480 | 2480 | /** |
@@ -2502,9 +2502,9 @@ discard block |
||
| 2502 | 2502 | } # vieux data |
| 2503 | 2503 | $fichier = basename($url); |
| 2504 | 2504 | $enclosures[] = '<enclosure' |
| 2505 | - . ($url ? ' url="' . spip_htmlspecialchars($url) . '"' : '') |
|
| 2506 | - . ($type ? ' type="' . spip_htmlspecialchars($type) . '"' : '') |
|
| 2507 | - . ($length ? ' length="' . $length . '"' : '') |
|
| 2505 | + . ($url ? ' url="'.spip_htmlspecialchars($url).'"' : '') |
|
| 2506 | + . ($type ? ' type="'.spip_htmlspecialchars($type).'"' : '') |
|
| 2507 | + . ($length ? ' length="'.$length.'"' : '') |
|
| 2508 | 2508 | . ' />'; |
| 2509 | 2509 | } |
| 2510 | 2510 | } |
@@ -2530,7 +2530,7 @@ discard block |
||
| 2530 | 2530 | if (extraire_attribut($e, 'rel') == 'tag') { |
| 2531 | 2531 | $subjects .= '<dc:subject>' |
| 2532 | 2532 | . texte_backend(textebrut($e)) |
| 2533 | - . '</dc:subject>' . "\n"; |
|
| 2533 | + . '</dc:subject>'."\n"; |
|
| 2534 | 2534 | } |
| 2535 | 2535 | } |
| 2536 | 2536 | |
@@ -2566,7 +2566,7 @@ discard block |
||
| 2566 | 2566 | if (is_array($texte)) { |
| 2567 | 2567 | array_walk( |
| 2568 | 2568 | $texte, |
| 2569 | - function (&$a, $key, $t) { |
|
| 2569 | + function(&$a, $key, $t) { |
|
| 2570 | 2570 | $a = extraire_balise($a, $t); |
| 2571 | 2571 | }, |
| 2572 | 2572 | $tag |
@@ -2614,7 +2614,7 @@ discard block |
||
| 2614 | 2614 | if (is_array($texte)) { |
| 2615 | 2615 | array_walk( |
| 2616 | 2616 | $texte, |
| 2617 | - function (&$a, $key, $t) { |
|
| 2617 | + function(&$a, $key, $t) { |
|
| 2618 | 2618 | $a = extraire_balises($a, $t); |
| 2619 | 2619 | }, |
| 2620 | 2620 | $tag |
@@ -2746,7 +2746,7 @@ discard block |
||
| 2746 | 2746 | if ($fond != '404') { |
| 2747 | 2747 | $contexte = array_shift($p); |
| 2748 | 2748 | $contexte['page'] = $fond; |
| 2749 | - $action = preg_replace('/([?]' . preg_quote($fond) . '[^&=]*[0-9]+)(&|$)/', '?&', $action); |
|
| 2749 | + $action = preg_replace('/([?]'.preg_quote($fond).'[^&=]*[0-9]+)(&|$)/', '?&', $action); |
|
| 2750 | 2750 | } |
| 2751 | 2751 | } |
| 2752 | 2752 | // defaire ce qu'a injecte urls_decoder_url : a revoir en modifiant la signature de urls_decoder_url |
@@ -2801,9 +2801,9 @@ discard block |
||
| 2801 | 2801 | . '"' |
| 2802 | 2802 | . (is_null($val) |
| 2803 | 2803 | ? '' |
| 2804 | - : ' value="' . entites_html($val) . '"' |
|
| 2804 | + : ' value="'.entites_html($val).'"' |
|
| 2805 | 2805 | ) |
| 2806 | - . ' type="hidden"' . "\n/>"; |
|
| 2806 | + . ' type="hidden"'."\n/>"; |
|
| 2807 | 2807 | } |
| 2808 | 2808 | |
| 2809 | 2809 | return join('', $hidden); |
@@ -2913,7 +2913,7 @@ discard block |
||
| 2913 | 2913 | |
| 2914 | 2914 | return preg_replace_callback( |
| 2915 | 2915 | ",url\s*\(\s*['\"]?([^'\"/#\s][^:]*)['\"]?\s*\),Uims", |
| 2916 | - fn($x) => "url('" . suivre_lien($path, $x[1]) . "')", |
|
| 2916 | + fn($x) => "url('".suivre_lien($path, $x[1])."')", |
|
| 2917 | 2917 | $contenu |
| 2918 | 2918 | ); |
| 2919 | 2919 | } |
@@ -2974,14 +2974,14 @@ discard block |
||
| 2974 | 2974 | ) { |
| 2975 | 2975 | $distant = true; |
| 2976 | 2976 | $cssf = parse_url($css); |
| 2977 | - $cssf = $cssf['path'] . ($cssf['query'] ? '?' . $cssf['query'] : ''); |
|
| 2977 | + $cssf = $cssf['path'].($cssf['query'] ? '?'.$cssf['query'] : ''); |
|
| 2978 | 2978 | $cssf = preg_replace(',[?:&=],', '_', $cssf); |
| 2979 | 2979 | } else { |
| 2980 | 2980 | $distant = false; |
| 2981 | 2981 | $cssf = $css; |
| 2982 | 2982 | // 1. regarder d'abord si un fichier avec la bonne direction n'est pas aussi |
| 2983 | 2983 | //propose (rien a faire dans ce cas) |
| 2984 | - $f = preg_replace(',(_rtl)?\.css$,i', '_' . $ndir . '.css', $css); |
|
| 2984 | + $f = preg_replace(',(_rtl)?\.css$,i', '_'.$ndir.'.css', $css); |
|
| 2985 | 2985 | if (@file_exists($f)) { |
| 2986 | 2986 | return $f; |
| 2987 | 2987 | } |
@@ -2991,7 +2991,7 @@ discard block |
||
| 2991 | 2991 | $dir_var = sous_repertoire(_DIR_VAR, 'cache-css'); |
| 2992 | 2992 | $f = $dir_var |
| 2993 | 2993 | . preg_replace(',.*/(.*?)(_rtl)?\.css,', '\1', $cssf) |
| 2994 | - . '.' . substr(md5($cssf), 0, 4) . '_' . $ndir . '.css'; |
|
| 2994 | + . '.'.substr(md5($cssf), 0, 4).'_'.$ndir.'.css'; |
|
| 2995 | 2995 | |
| 2996 | 2996 | // la css peut etre distante (url absolue !) |
| 2997 | 2997 | if ($distant) { |
@@ -3037,8 +3037,8 @@ discard block |
||
| 3037 | 3037 | } // si la css_direction commence par $dir_var on la fait passer pour une absolue |
| 3038 | 3038 | elseif (substr($css_direction, 0, strlen($dir_var)) == $dir_var) { |
| 3039 | 3039 | $css_direction = substr($css_direction, strlen($dir_var)); |
| 3040 | - $src_faux_abs['/@@@@@@/' . $css_direction] = $css_direction; |
|
| 3041 | - $css_direction = '/@@@@@@/' . $css_direction; |
|
| 3040 | + $src_faux_abs['/@@@@@@/'.$css_direction] = $css_direction; |
|
| 3041 | + $css_direction = '/@@@@@@/'.$css_direction; |
|
| 3042 | 3042 | } |
| 3043 | 3043 | $src[] = $regs[0][$k]; |
| 3044 | 3044 | $src_direction_css[] = str_replace($import_css, $css_direction, $regs[0][$k]); |
@@ -3087,7 +3087,7 @@ discard block |
||
| 3087 | 3087 | |
| 3088 | 3088 | $f = basename($css, '.css'); |
| 3089 | 3089 | $f = sous_repertoire(_DIR_VAR, 'cache-css') |
| 3090 | - . preg_replace(',(.*?)(_rtl|_ltr)?$,', "\\1-urlabs-" . substr(md5("$css-urlabs"), 0, 4) . "\\2", $f) |
|
| 3090 | + . preg_replace(',(.*?)(_rtl|_ltr)?$,', "\\1-urlabs-".substr(md5("$css-urlabs"), 0, 4)."\\2", $f) |
|
| 3091 | 3091 | . '.css'; |
| 3092 | 3092 | |
| 3093 | 3093 | if ((@filemtime($f) > @filemtime($css)) and (_VAR_MODE != 'recalcul')) { |
@@ -3097,7 +3097,7 @@ discard block |
||
| 3097 | 3097 | if ($url_absolue_css == $css) { |
| 3098 | 3098 | if ( |
| 3099 | 3099 | strncmp($GLOBALS['meta']['adresse_site'], $css, $l = strlen($GLOBALS['meta']['adresse_site'])) != 0 |
| 3100 | - or !lire_fichier(_DIR_RACINE . substr($css, $l), $contenu) |
|
| 3100 | + or !lire_fichier(_DIR_RACINE.substr($css, $l), $contenu) |
|
| 3101 | 3101 | ) { |
| 3102 | 3102 | include_spip('inc/distant'); |
| 3103 | 3103 | $contenu = recuperer_url($css); |
@@ -3209,7 +3209,7 @@ discard block |
||
| 3209 | 3209 | $expression = str_replace('\/', '/', $expression); |
| 3210 | 3210 | $expression = str_replace('/', '\/', $expression); |
| 3211 | 3211 | |
| 3212 | - if (preg_match('/' . $expression . '/' . $modif, $texte ?? '', $r)) { |
|
| 3212 | + if (preg_match('/'.$expression.'/'.$modif, $texte ?? '', $r)) { |
|
| 3213 | 3213 | if (isset($r[$capte])) { |
| 3214 | 3214 | return $r[$capte]; |
| 3215 | 3215 | } else { |
@@ -3247,7 +3247,7 @@ discard block |
||
| 3247 | 3247 | $expression = str_replace('\/', '/', $expression); |
| 3248 | 3248 | $expression = str_replace('/', '\/', $expression); |
| 3249 | 3249 | |
| 3250 | - return preg_replace('/' . $expression . '/' . $modif, $replace, $texte); |
|
| 3250 | + return preg_replace('/'.$expression.'/'.$modif, $replace, $texte); |
|
| 3251 | 3251 | } |
| 3252 | 3252 | |
| 3253 | 3253 | |
@@ -3266,7 +3266,7 @@ discard block |
||
| 3266 | 3266 | function traiter_doublons_documents(&$doublons, $letexte) { |
| 3267 | 3267 | |
| 3268 | 3268 | // Verifier dans le texte & les notes (pas beau, helas) |
| 3269 | - $t = $letexte . $GLOBALS['les_notes']; |
|
| 3269 | + $t = $letexte.$GLOBALS['les_notes']; |
|
| 3270 | 3270 | |
| 3271 | 3271 | if ( |
| 3272 | 3272 | strstr($t, 'spip_document_') // evite le preg_match_all si inutile |
@@ -3280,7 +3280,7 @@ discard block |
||
| 3280 | 3280 | if (!isset($doublons['documents'])) { |
| 3281 | 3281 | $doublons['documents'] = ''; |
| 3282 | 3282 | } |
| 3283 | - $doublons['documents'] .= ',' . join(',', $matches[1]); |
|
| 3283 | + $doublons['documents'] .= ','.join(',', $matches[1]); |
|
| 3284 | 3284 | } |
| 3285 | 3285 | |
| 3286 | 3286 | return $letexte; |
@@ -3337,7 +3337,7 @@ discard block |
||
| 3337 | 3337 | if ($env) { |
| 3338 | 3338 | foreach ($env as $i => $j) { |
| 3339 | 3339 | if (is_string($j) and !in_array($i, $ignore_params)) { |
| 3340 | - $texte .= "<param name='" . attribut_html($i) . "'\n\tvalue='" . attribut_html($j) . "' />"; |
|
| 3340 | + $texte .= "<param name='".attribut_html($i)."'\n\tvalue='".attribut_html($j)."' />"; |
|
| 3341 | 3341 | } |
| 3342 | 3342 | } |
| 3343 | 3343 | } |
@@ -3376,7 +3376,7 @@ discard block |
||
| 3376 | 3376 | if ($env) { |
| 3377 | 3377 | foreach ($env as $i => $j) { |
| 3378 | 3378 | if (is_string($j) and !in_array($i, $ignore_params)) { |
| 3379 | - $texte .= attribut_html($i) . "='" . attribut_html($j) . "' "; |
|
| 3379 | + $texte .= attribut_html($i)."='".attribut_html($j)."' "; |
|
| 3380 | 3380 | } |
| 3381 | 3381 | } |
| 3382 | 3382 | } |
@@ -3450,10 +3450,10 @@ discard block |
||
| 3450 | 3450 | // si il y a un .svg a la bonne taille (-16.svg) a cote, on l'utilise en remplacement du -16.png |
| 3451 | 3451 | if ( |
| 3452 | 3452 | preg_match(',-(\d+)[.](png|gif|svg)$,', $img_file, $m) |
| 3453 | - and $variante_svg_generique = substr($img_file, 0, -strlen($m[0])) . '-xx.svg' |
|
| 3453 | + and $variante_svg_generique = substr($img_file, 0, -strlen($m[0])).'-xx.svg' |
|
| 3454 | 3454 | and file_exists($variante_svg_generique) |
| 3455 | 3455 | ) { |
| 3456 | - if ($variante_svg_size = substr($variante_svg_generique, 0, -6) . $m[1] . '.svg' and file_exists($variante_svg_size)) { |
|
| 3456 | + if ($variante_svg_size = substr($variante_svg_generique, 0, -6).$m[1].'.svg' and file_exists($variante_svg_size)) { |
|
| 3457 | 3457 | $img_file = $variante_svg_size; |
| 3458 | 3458 | } |
| 3459 | 3459 | else { |
@@ -3511,7 +3511,7 @@ discard block |
||
| 3511 | 3511 | return ''; |
| 3512 | 3512 | } |
| 3513 | 3513 | } |
| 3514 | - $atts .= " width='" . $largeur . "' height='" . $hauteur . "'"; |
|
| 3514 | + $atts .= " width='".$largeur."' height='".$hauteur."'"; |
|
| 3515 | 3515 | } |
| 3516 | 3516 | |
| 3517 | 3517 | if (file_exists($img_file)) { |
@@ -3521,14 +3521,14 @@ discard block |
||
| 3521 | 3521 | $alt = ''; |
| 3522 | 3522 | } |
| 3523 | 3523 | elseif ($alt or $alt === '') { |
| 3524 | - $alt = " alt='" . attribut_html($alt) . "'"; |
|
| 3524 | + $alt = " alt='".attribut_html($alt)."'"; |
|
| 3525 | 3525 | } |
| 3526 | 3526 | else { |
| 3527 | - $alt = " alt='" . attribut_html($title) . "'"; |
|
| 3527 | + $alt = " alt='".attribut_html($title)."'"; |
|
| 3528 | 3528 | } |
| 3529 | 3529 | return "<img src='$img_file'$alt" |
| 3530 | - . ($title ? ' title="' . attribut_html($title) . '"' : '') |
|
| 3531 | - . ' ' . ltrim($atts) |
|
| 3530 | + . ($title ? ' title="'.attribut_html($title).'"' : '') |
|
| 3531 | + . ' '.ltrim($atts) |
|
| 3532 | 3532 | . ' />'; |
| 3533 | 3533 | } |
| 3534 | 3534 | |
@@ -3542,10 +3542,10 @@ discard block |
||
| 3542 | 3542 | */ |
| 3543 | 3543 | function http_style_background($img, $att = '', $size = null) { |
| 3544 | 3544 | if ($size and is_numeric($size)) { |
| 3545 | - $size = trim($size) . 'px'; |
|
| 3545 | + $size = trim($size).'px'; |
|
| 3546 | 3546 | } |
| 3547 | - return " style='background" . |
|
| 3548 | - ($att ? '' : '-image') . ': url("' . chemin_image($img) . '")' . ($att ? (' ' . $att) : '') . ';' |
|
| 3547 | + return " style='background". |
|
| 3548 | + ($att ? '' : '-image').': url("'.chemin_image($img).'")'.($att ? (' '.$att) : '').';' |
|
| 3549 | 3549 | . ($size ? "background-size:{$size};" : '') |
| 3550 | 3550 | . "'"; |
| 3551 | 3551 | } |
@@ -3660,7 +3660,7 @@ discard block |
||
| 3660 | 3660 | $img = http_img_pack( |
| 3661 | 3661 | $img, |
| 3662 | 3662 | $alt, |
| 3663 | - $class ? " class='" . attribut_html($class) . "'" : '', |
|
| 3663 | + $class ? " class='".attribut_html($class)."'" : '', |
|
| 3664 | 3664 | '', |
| 3665 | 3665 | ['chemin_image' => false, 'utiliser_suffixe_size' => false] |
| 3666 | 3666 | ); |
@@ -3745,7 +3745,7 @@ discard block |
||
| 3745 | 3745 | $balise_svg_source = $balise_svg; |
| 3746 | 3746 | |
| 3747 | 3747 | // entete XML à supprimer |
| 3748 | - $svg = preg_replace(',^\s*<\?xml[^>]*\?' . '>,', '', $svg); |
|
| 3748 | + $svg = preg_replace(',^\s*<\?xml[^>]*\?'.'>,', '', $svg); |
|
| 3749 | 3749 | |
| 3750 | 3750 | // IE est toujours mon ami |
| 3751 | 3751 | $balise_svg = inserer_attribut($balise_svg, 'focusable', 'false'); |
@@ -3763,9 +3763,9 @@ discard block |
||
| 3763 | 3763 | // regler le alt |
| 3764 | 3764 | if ($alt) { |
| 3765 | 3765 | $balise_svg = inserer_attribut($balise_svg, 'role', 'img'); |
| 3766 | - $id = 'img-svg-title-' . substr(md5("$img_file:$svg:$alt"), 0, 4); |
|
| 3766 | + $id = 'img-svg-title-'.substr(md5("$img_file:$svg:$alt"), 0, 4); |
|
| 3767 | 3767 | $balise_svg = inserer_attribut($balise_svg, 'aria-labelledby', $id); |
| 3768 | - $title = "<title id=\"$id\">" . entites_html($alt) . "</title>\n"; |
|
| 3768 | + $title = "<title id=\"$id\">".entites_html($alt)."</title>\n"; |
|
| 3769 | 3769 | $balise_svg .= $title; |
| 3770 | 3770 | } |
| 3771 | 3771 | else { |
@@ -3813,7 +3813,7 @@ discard block |
||
| 3813 | 3813 | if (is_array($tableau)) { |
| 3814 | 3814 | foreach ($tableau as $k => $v) { |
| 3815 | 3815 | $res = recuperer_fond( |
| 3816 | - 'modeles/' . $modele, |
|
| 3816 | + 'modeles/'.$modele, |
|
| 3817 | 3817 | array_merge(['cle' => $k], (is_array($v) ? $v : ['valeur' => $v])) |
| 3818 | 3818 | ); |
| 3819 | 3819 | $texte .= $res; |
@@ -3998,7 +3998,7 @@ discard block |
||
| 3998 | 3998 | } |
| 3999 | 3999 | |
| 4000 | 4000 | $c = serialize($c); |
| 4001 | - $cle = calculer_cle_action($form . $c); |
|
| 4001 | + $cle = calculer_cle_action($form.$c); |
|
| 4002 | 4002 | $c = "$cle:$c"; |
| 4003 | 4003 | |
| 4004 | 4004 | // on ne stocke pas les contextes dans des fichiers en cache |
@@ -4056,15 +4056,15 @@ discard block |
||
| 4056 | 4056 | } |
| 4057 | 4057 | // toujours encoder l'url source dans le bloc ajax |
| 4058 | 4058 | $r = self(); |
| 4059 | - $r = ' data-origin="' . $r . '"'; |
|
| 4059 | + $r = ' data-origin="'.$r.'"'; |
|
| 4060 | 4060 | $class = 'ajaxbloc'; |
| 4061 | 4061 | if ($ajaxid and is_string($ajaxid)) { |
| 4062 | 4062 | // ajaxid est normalement conforme a un nom de classe css |
| 4063 | 4063 | // on ne verifie pas la conformite, mais on passe entites_html par dessus par precaution |
| 4064 | - $class .= ' ajax-id-' . entites_html($ajaxid); |
|
| 4064 | + $class .= ' ajax-id-'.entites_html($ajaxid); |
|
| 4065 | 4065 | } |
| 4066 | 4066 | |
| 4067 | - return "<div class='$class' " . "data-ajax-env='$env'$r>\n$emboite</div><!--ajaxbloc-->\n"; |
|
| 4067 | + return "<div class='$class' "."data-ajax-env='$env'$r>\n$emboite</div><!--ajaxbloc-->\n"; |
|
| 4068 | 4068 | } |
| 4069 | 4069 | |
| 4070 | 4070 | /** |
@@ -4108,7 +4108,7 @@ discard block |
||
| 4108 | 4108 | $cle = substr($c, 0, $p); |
| 4109 | 4109 | $c = substr($c, $p + 1); |
| 4110 | 4110 | |
| 4111 | - if ($cle == calculer_cle_action($form . $c)) { |
|
| 4111 | + if ($cle == calculer_cle_action($form.$c)) { |
|
| 4112 | 4112 | $env = @unserialize($c); |
| 4113 | 4113 | return $env; |
| 4114 | 4114 | } |
@@ -4229,13 +4229,13 @@ discard block |
||
| 4229 | 4229 | } |
| 4230 | 4230 | } |
| 4231 | 4231 | } |
| 4232 | - $att .= 'class="' . ($class ? attribut_html($class) . ' ' : '') . (defined('_LIEN_OU_EXPOSE_CLASS_ON') ? _LIEN_OU_EXPOSE_CLASS_ON : 'on') . '"'; |
|
| 4232 | + $att .= 'class="'.($class ? attribut_html($class).' ' : '').(defined('_LIEN_OU_EXPOSE_CLASS_ON') ? _LIEN_OU_EXPOSE_CLASS_ON : 'on').'"'; |
|
| 4233 | 4233 | } else { |
| 4234 | 4234 | $bal = 'a'; |
| 4235 | 4235 | $att = "href='$url'" |
| 4236 | - . ($title ? " title='" . attribut_html($title) . "'" : '') |
|
| 4237 | - . ($class ? " class='" . attribut_html($class) . "'" : '') |
|
| 4238 | - . ($rel ? " rel='" . attribut_html($rel) . "'" : '') |
|
| 4236 | + . ($title ? " title='".attribut_html($title)."'" : '') |
|
| 4237 | + . ($class ? " class='".attribut_html($class)."'" : '') |
|
| 4238 | + . ($rel ? " rel='".attribut_html($rel)."'" : '') |
|
| 4239 | 4239 | . $evt; |
| 4240 | 4240 | } |
| 4241 | 4241 | if ($libelle === null) { |
@@ -4374,7 +4374,7 @@ discard block |
||
| 4374 | 4374 | |
| 4375 | 4375 | // Icône |
| 4376 | 4376 | $icone = http_img_pack($fond, $alt, "width='$size' height='$size'"); |
| 4377 | - $icone = '<span class="icone-image' . ($fonction ? " icone-fonction icone-fonction-$fonction" : '') . "\">$icone</span>"; |
|
| 4377 | + $icone = '<span class="icone-image'.($fonction ? " icone-fonction icone-fonction-$fonction" : '')."\">$icone</span>"; |
|
| 4378 | 4378 | |
| 4379 | 4379 | // Markup final |
| 4380 | 4380 | if ($type == 'lien') { |
@@ -4651,20 +4651,20 @@ discard block |
||
| 4651 | 4651 | $class_form = 'ajax'; |
| 4652 | 4652 | $class = str_replace('ajax', '', $class); |
| 4653 | 4653 | } |
| 4654 | - $class_btn = 'submit ' . trim($class); |
|
| 4654 | + $class_btn = 'submit '.trim($class); |
|
| 4655 | 4655 | |
| 4656 | 4656 | if ($confirm) { |
| 4657 | - $confirm = 'confirm("' . attribut_html($confirm) . '")'; |
|
| 4657 | + $confirm = 'confirm("'.attribut_html($confirm).'")'; |
|
| 4658 | 4658 | if ($callback) { |
| 4659 | 4659 | $callback = "$confirm?($callback):false"; |
| 4660 | 4660 | } else { |
| 4661 | 4661 | $callback = $confirm; |
| 4662 | 4662 | } |
| 4663 | 4663 | } |
| 4664 | - $onclick = $callback ? " onclick='return " . addcslashes($callback, "'") . "'" : ''; |
|
| 4664 | + $onclick = $callback ? " onclick='return ".addcslashes($callback, "'")."'" : ''; |
|
| 4665 | 4665 | $title = $title ? " title='$title'" : ''; |
| 4666 | 4666 | |
| 4667 | - return "<form class='bouton_action_post $class_form' method='post' action='$url'><div>" . form_hidden($url) |
|
| 4667 | + return "<form class='bouton_action_post $class_form' method='post' action='$url'><div>".form_hidden($url) |
|
| 4668 | 4668 | . "<button type='submit' class='$class_btn'$title$onclick>$libelle</button></div></form>"; |
| 4669 | 4669 | } |
| 4670 | 4670 | |
@@ -4729,14 +4729,14 @@ discard block |
||
| 4729 | 4729 | $champ_titre = ''; |
| 4730 | 4730 | if ($demande_titre) { |
| 4731 | 4731 | // si pas de titre declare mais champ titre, il sera peuple par le select * |
| 4732 | - $champ_titre = (!empty($desc['titre'])) ? ', ' . $desc['titre'] : ''; |
|
| 4732 | + $champ_titre = (!empty($desc['titre'])) ? ', '.$desc['titre'] : ''; |
|
| 4733 | 4733 | } |
| 4734 | 4734 | include_spip('base/abstract_sql'); |
| 4735 | 4735 | include_spip('base/connect_sql'); |
| 4736 | 4736 | $objets[$type_objet][$id_objet] = sql_fetsel( |
| 4737 | - '*' . $champ_titre, |
|
| 4737 | + '*'.$champ_titre, |
|
| 4738 | 4738 | $desc['table_sql'], |
| 4739 | - id_table_objet($type_objet) . ' = ' . intval($id_objet) |
|
| 4739 | + id_table_objet($type_objet).' = '.intval($id_objet) |
|
| 4740 | 4740 | ); |
| 4741 | 4741 | |
| 4742 | 4742 | // Toujours noter la longueur d'introduction, même si pas demandé cette fois-ci |
@@ -4814,8 +4814,7 @@ discard block |
||
| 4814 | 4814 | if (isset($ligne_sql['chapo'])) { |
| 4815 | 4815 | $chapo = $ligne_sql['chapo']; |
| 4816 | 4816 | $texte = strlen($descriptif) ? |
| 4817 | - '' : |
|
| 4818 | - "$chapo \n\n $texte"; |
|
| 4817 | + '' : "$chapo \n\n $texte"; |
|
| 4819 | 4818 | } |
| 4820 | 4819 | |
| 4821 | 4820 | // Longueur en paramètre, sinon celle renseignée dans la description de l'objet, sinon valeur en dur |
@@ -4882,7 +4881,7 @@ discard block |
||
| 4882 | 4881 | return $texte; |
| 4883 | 4882 | } |
| 4884 | 4883 | |
| 4885 | - $traitement = str_replace('%s', "'" . texte_script($texte) . "'", $traitement); |
|
| 4884 | + $traitement = str_replace('%s', "'".texte_script($texte)."'", $traitement); |
|
| 4886 | 4885 | |
| 4887 | 4886 | // Fournir $connect et $Pile[0] au traitement si besoin |
| 4888 | 4887 | $Pile = [0 => $env]; |
@@ -4916,7 +4915,7 @@ discard block |
||
| 4916 | 4915 | } |
| 4917 | 4916 | $url = generer_url_entite($id_objet, $objet, '', '', $connect); |
| 4918 | 4917 | |
| 4919 | - return "<a href='$url' class='$objet'>" . couper($titre, $longueur) . '</a>'; |
|
| 4918 | + return "<a href='$url' class='$objet'>".couper($titre, $longueur).'</a>'; |
|
| 4920 | 4919 | } |
| 4921 | 4920 | |
| 4922 | 4921 | |
@@ -4935,10 +4934,10 @@ discard block |
||
| 4935 | 4934 | function wrap($texte, $wrap) { |
| 4936 | 4935 | $balises = extraire_balises($wrap); |
| 4937 | 4936 | if (preg_match_all(",<([a-z]\w*)\b[^>]*>,UimsS", $wrap, $regs, PREG_PATTERN_ORDER)) { |
| 4938 | - $texte = $wrap . $texte; |
|
| 4937 | + $texte = $wrap.$texte; |
|
| 4939 | 4938 | $regs = array_reverse($regs[1]); |
| 4940 | - $wrap = '</' . implode('></', $regs) . '>'; |
|
| 4941 | - $texte = $texte . $wrap; |
|
| 4939 | + $wrap = '</'.implode('></', $regs).'>'; |
|
| 4940 | + $texte = $texte.$wrap; |
|
| 4942 | 4941 | } |
| 4943 | 4942 | |
| 4944 | 4943 | return $texte; |
@@ -4969,7 +4968,7 @@ discard block |
||
| 4969 | 4968 | |
| 4970 | 4969 | // caster $u en array si besoin |
| 4971 | 4970 | if (is_object($u)) { |
| 4972 | - $u = (array)$u; |
|
| 4971 | + $u = (array) $u; |
|
| 4973 | 4972 | } |
| 4974 | 4973 | |
| 4975 | 4974 | if (is_array($u)) { |
@@ -4991,7 +4990,7 @@ discard block |
||
| 4991 | 4990 | // sinon on passe a la ligne et on indente |
| 4992 | 4991 | $i_str = str_pad('', $indent, ' '); |
| 4993 | 4992 | foreach ($u as $k => $v) { |
| 4994 | - $out .= $join . $i_str . "$k: " . filtre_print_dist($v, $join, $indent + 2); |
|
| 4993 | + $out .= $join.$i_str."$k: ".filtre_print_dist($v, $join, $indent + 2); |
|
| 4995 | 4994 | } |
| 4996 | 4995 | |
| 4997 | 4996 | return $out; |
@@ -5045,7 +5044,7 @@ discard block |
||
| 5045 | 5044 | * @return string |
| 5046 | 5045 | */ |
| 5047 | 5046 | function objet_icone($objet, $taille = 24, $class = '') { |
| 5048 | - $icone = objet_info($objet, 'icone_objet') . '-' . $taille . '.png'; |
|
| 5047 | + $icone = objet_info($objet, 'icone_objet').'-'.$taille.'.png'; |
|
| 5049 | 5048 | $icone = chemin_image($icone); |
| 5050 | 5049 | $balise_img = charger_filtre('balise_img'); |
| 5051 | 5050 | |
@@ -5071,7 +5070,7 @@ discard block |
||
| 5071 | 5070 | */ |
| 5072 | 5071 | function objet_T($objet, $chaine, $args = [], $options = []) { |
| 5073 | 5072 | $chaine = explode(':', $chaine); |
| 5074 | - if ($t = _T($objet . ':' . end($chaine), $args, array_merge($options, ['force' => false]))) { |
|
| 5073 | + if ($t = _T($objet.':'.end($chaine), $args, array_merge($options, ['force' => false]))) { |
|
| 5075 | 5074 | return $t; |
| 5076 | 5075 | } |
| 5077 | 5076 | $chaine = implode(':', $chaine); |
@@ -5137,7 +5136,7 @@ discard block |
||
| 5137 | 5136 | $cache = recuperer_fond($fond, $contexte, $options, $connect); |
| 5138 | 5137 | |
| 5139 | 5138 | // calculer le nom de la css |
| 5140 | - $dir_var = sous_repertoire(_DIR_VAR, 'cache-' . $extension); |
|
| 5139 | + $dir_var = sous_repertoire(_DIR_VAR, 'cache-'.$extension); |
|
| 5141 | 5140 | $nom_safe = preg_replace(',\W,', '_', str_replace('.', '_', $fond)); |
| 5142 | 5141 | $contexte_implicite = calculer_contexte_implicite(); |
| 5143 | 5142 | |
@@ -5145,14 +5144,14 @@ discard block |
||
| 5145 | 5144 | // mais on peut hasher selon le contenu a la demande, si plusieurs contextes produisent un meme contenu |
| 5146 | 5145 | // reduit la variabilite du nom et donc le nombre de css concatenees possibles in fine |
| 5147 | 5146 | if (isset($options['hash_on_content']) and $options['hash_on_content']) { |
| 5148 | - $hash = md5($contexte_implicite['host'] . '::' . $cache); |
|
| 5147 | + $hash = md5($contexte_implicite['host'].'::'.$cache); |
|
| 5149 | 5148 | } |
| 5150 | 5149 | else { |
| 5151 | 5150 | unset($contexte_implicite['notes']); // pas pertinent pour signaler un changeemnt de contenu pour des css/js |
| 5152 | 5151 | ksort($contexte); |
| 5153 | - $hash = md5($fond . json_encode($contexte_implicite, JSON_THROW_ON_ERROR) . json_encode($contexte, JSON_THROW_ON_ERROR) . $connect); |
|
| 5152 | + $hash = md5($fond.json_encode($contexte_implicite, JSON_THROW_ON_ERROR).json_encode($contexte, JSON_THROW_ON_ERROR).$connect); |
|
| 5154 | 5153 | } |
| 5155 | - $filename = $dir_var . $extension . "dyn-$nom_safe-" . substr($hash, 0, 8) . ".$extension"; |
|
| 5154 | + $filename = $dir_var.$extension."dyn-$nom_safe-".substr($hash, 0, 8).".$extension"; |
|
| 5156 | 5155 | |
| 5157 | 5156 | // mettre a jour le fichier si il n'existe pas |
| 5158 | 5157 | // ou trop ancien |
@@ -5160,8 +5159,8 @@ discard block |
||
| 5160 | 5159 | // et recopie sur le fichier cible uniquement si il change |
| 5161 | 5160 | if ( |
| 5162 | 5161 | !file_exists($filename) |
| 5163 | - or !file_exists($filename . '.last') |
|
| 5164 | - or (isset($cache['lastmodified']) and $cache['lastmodified'] and filemtime($filename . '.last') < $cache['lastmodified']) |
|
| 5162 | + or !file_exists($filename.'.last') |
|
| 5163 | + or (isset($cache['lastmodified']) and $cache['lastmodified'] and filemtime($filename.'.last') < $cache['lastmodified']) |
|
| 5165 | 5164 | or (defined('_VAR_MODE') and _VAR_MODE == 'recalcul') |
| 5166 | 5165 | ) { |
| 5167 | 5166 | $contenu = $cache['texte']; |
@@ -5182,10 +5181,10 @@ discard block |
||
| 5182 | 5181 | } |
| 5183 | 5182 | // pas de date dans le commentaire car sinon ca invalide le md5 et force la maj |
| 5184 | 5183 | // mais on peut mettre un md5 du contenu, ce qui donne un aperu rapide si la feuille a change ou non |
| 5185 | - $comment .= "}\n md5:" . md5($contenu) . " */\n"; |
|
| 5184 | + $comment .= "}\n md5:".md5($contenu)." */\n"; |
|
| 5186 | 5185 | } |
| 5187 | 5186 | // et ecrire le fichier si il change |
| 5188 | - ecrire_fichier_calcule_si_modifie($filename, $comment . $contenu, false, true); |
|
| 5187 | + ecrire_fichier_calcule_si_modifie($filename, $comment.$contenu, false, true); |
|
| 5189 | 5188 | } |
| 5190 | 5189 | |
| 5191 | 5190 | return timestamp($filename); |
@@ -5411,7 +5410,7 @@ discard block |
||
| 5411 | 5410 | if ($e > 0 and strlen($mid) > 8) { |
| 5412 | 5411 | $mid = '***...***'; |
| 5413 | 5412 | } |
| 5414 | - return substr($passe, 0, $e) . $mid . ($e > 0 ? substr($passe, -$e) : ''); |
|
| 5413 | + return substr($passe, 0, $e).$mid.($e > 0 ? substr($passe, -$e) : ''); |
|
| 5415 | 5414 | } |
| 5416 | 5415 | |
| 5417 | 5416 | |
@@ -5473,7 +5472,7 @@ discard block |
||
| 5473 | 5472 | case 'id': |
| 5474 | 5473 | case 'anchor': |
| 5475 | 5474 | if (preg_match(',^\d,', $texte)) { |
| 5476 | - $texte = substr($type, 0, 1) . $texte; |
|
| 5475 | + $texte = substr($type, 0, 1).$texte; |
|
| 5477 | 5476 | } |
| 5478 | 5477 | } |
| 5479 | 5478 | |
@@ -5483,9 +5482,9 @@ discard block |
||
| 5483 | 5482 | |
| 5484 | 5483 | if (strlen($texte) < $longueur_mini and $longueur_mini < $longueur_maxi) { |
| 5485 | 5484 | if (preg_match(',^\d,', $texte)) { |
| 5486 | - $texte = ($type ? substr($type, 0, 1) : 's') . $texte; |
|
| 5485 | + $texte = ($type ? substr($type, 0, 1) : 's').$texte; |
|
| 5487 | 5486 | } |
| 5488 | - $texte .= $separateur . md5($original); |
|
| 5487 | + $texte .= $separateur.md5($original); |
|
| 5489 | 5488 | $texte = substr($texte, 0, $longueur_mini); |
| 5490 | 5489 | } |
| 5491 | 5490 | |