@@ -92,7 +92,7 @@ discard block |
||
| 92 | 92 | |
| 93 | 93 | return $f; |
| 94 | 94 | } |
| 95 | - foreach (array('filtre_' . $fonc, 'filtre_' . $fonc . '_dist', $fonc) as $f) { |
|
| 95 | + foreach (array('filtre_'.$fonc, 'filtre_'.$fonc.'_dist', $fonc) as $f) { |
|
| 96 | 96 | trouver_filtre_matrice($f); // charge des fichiers spécifiques éventuels |
| 97 | 97 | // fonction ou name\space\fonction |
| 98 | 98 | if (is_callable($f)) { |
@@ -159,7 +159,7 @@ discard block |
||
| 159 | 159 | function spip_version() { |
| 160 | 160 | $version = $GLOBALS['spip_version_affichee']; |
| 161 | 161 | if ($svn_revision = version_svn_courante(_DIR_RACINE)) { |
| 162 | - $version .= ($svn_revision < 0 ? ' SVN' : '') . ' [' . abs($svn_revision) . ']'; |
|
| 162 | + $version .= ($svn_revision < 0 ? ' SVN' : '').' ['.abs($svn_revision).']'; |
|
| 163 | 163 | } |
| 164 | 164 | |
| 165 | 165 | return $version; |
@@ -186,15 +186,15 @@ discard block |
||
| 186 | 186 | } |
| 187 | 187 | |
| 188 | 188 | // version installee par paquet ZIP |
| 189 | - if (lire_fichier($dir . '/svn.revision', $c) |
|
| 189 | + if (lire_fichier($dir.'/svn.revision', $c) |
|
| 190 | 190 | and preg_match(',Revision: (\d+),', $c, $d) |
| 191 | 191 | ) { |
| 192 | 192 | return intval($d[1]); |
| 193 | 193 | } |
| 194 | 194 | |
| 195 | 195 | // version installee par SVN |
| 196 | - if (file_exists($dir . '/.svn/wc.db') && class_exists('SQLite3')) { |
|
| 197 | - $db = new SQLite3($dir . '/.svn/wc.db'); |
|
| 196 | + if (file_exists($dir.'/.svn/wc.db') && class_exists('SQLite3')) { |
|
| 197 | + $db = new SQLite3($dir.'/.svn/wc.db'); |
|
| 198 | 198 | $result = $db->query('SELECT changed_revision FROM nodes WHERE local_relpath = "" LIMIT 1'); |
| 199 | 199 | if ($result) { |
| 200 | 200 | $row = $result->fetchArray(); |
@@ -202,7 +202,7 @@ discard block |
||
| 202 | 202 | return -$row['changed_revision']; |
| 203 | 203 | } |
| 204 | 204 | } |
| 205 | - } else if (lire_fichier($dir . '/.svn/entries', $c) |
|
| 205 | + } else if (lire_fichier($dir.'/.svn/entries', $c) |
|
| 206 | 206 | and ( |
| 207 | 207 | (preg_match_all( |
| 208 | 208 | ',committed-rev="([0-9]+)",', $c, $r1, PREG_PATTERN_ORDER) |
@@ -222,11 +222,11 @@ discard block |
||
| 222 | 222 | |
| 223 | 223 | // La matrice est necessaire pour ne filtrer _que_ des fonctions definies dans filtres_images |
| 224 | 224 | // et laisser passer les fonctions personnelles baptisees image_... |
| 225 | -$GLOBALS['spip_matrice']['image_graver'] = true;//'inc/filtres_images_mini.php'; |
|
| 226 | -$GLOBALS['spip_matrice']['image_select'] = true;//'inc/filtres_images_mini.php'; |
|
| 227 | -$GLOBALS['spip_matrice']['image_reduire'] = true;//'inc/filtres_images_mini.php'; |
|
| 228 | -$GLOBALS['spip_matrice']['image_reduire_par'] = true;//'inc/filtres_images_mini.php'; |
|
| 229 | -$GLOBALS['spip_matrice']['image_passe_partout'] = true;//'inc/filtres_images_mini.php'; |
|
| 225 | +$GLOBALS['spip_matrice']['image_graver'] = true; //'inc/filtres_images_mini.php'; |
|
| 226 | +$GLOBALS['spip_matrice']['image_select'] = true; //'inc/filtres_images_mini.php'; |
|
| 227 | +$GLOBALS['spip_matrice']['image_reduire'] = true; //'inc/filtres_images_mini.php'; |
|
| 228 | +$GLOBALS['spip_matrice']['image_reduire_par'] = true; //'inc/filtres_images_mini.php'; |
|
| 229 | +$GLOBALS['spip_matrice']['image_passe_partout'] = true; //'inc/filtres_images_mini.php'; |
|
| 230 | 230 | |
| 231 | 231 | $GLOBALS['spip_matrice']['couleur_html_to_hex'] = 'inc/filtres_images_mini.php'; |
| 232 | 232 | $GLOBALS['spip_matrice']['couleur_foncer'] = 'inc/filtres_images_mini.php'; |
@@ -372,8 +372,8 @@ discard block |
||
| 372 | 372 | */ |
| 373 | 373 | function filtre_debug($val, $key = null) { |
| 374 | 374 | $debug = ( |
| 375 | - is_null($key) ? '' : (var_export($key, true) . " = ") |
|
| 376 | - ) . var_export($val, true); |
|
| 375 | + is_null($key) ? '' : (var_export($key, true)." = ") |
|
| 376 | + ).var_export($val, true); |
|
| 377 | 377 | |
| 378 | 378 | include_spip('inc/autoriser'); |
| 379 | 379 | if (autoriser('webmestre')) { |
@@ -461,7 +461,7 @@ discard block |
||
| 461 | 461 | if (preg_match(",this[.]src=['\"]([^'\"]+)['\"],ims", $mouseover, $match)) { |
| 462 | 462 | $srcover = $match[1]; |
| 463 | 463 | array_shift($args); |
| 464 | - array_unshift($args, "<img src='" . $match[1] . "' />"); |
|
| 464 | + array_unshift($args, "<img src='".$match[1]."' />"); |
|
| 465 | 465 | $srcover_filter = call_user_func_array($filtre, $args); |
| 466 | 466 | $srcover_filter = extraire_attribut($srcover_filter, 'src'); |
| 467 | 467 | $reduit = str_replace($srcover, $srcover_filter, $reduit); |
@@ -811,7 +811,7 @@ discard block |
||
| 811 | 811 | // " -> " et tout ce genre de choses |
| 812 | 812 | $u = $GLOBALS['meta']['pcre_u']; |
| 813 | 813 | $texte = str_replace(" ", " ", $texte); |
| 814 | - $texte = preg_replace('/\s{2,}/S' . $u, " ", $texte); |
|
| 814 | + $texte = preg_replace('/\s{2,}/S'.$u, " ", $texte); |
|
| 815 | 815 | // ne pas echapper les sinqle quotes car certains outils de syndication gerent mal |
| 816 | 816 | $texte = entites_html($texte, false, false); |
| 817 | 817 | // mais bien echapper les double quotes ! |
@@ -871,7 +871,7 @@ discard block |
||
| 871 | 871 | **/ |
| 872 | 872 | function supprimer_numero($texte) { |
| 873 | 873 | return preg_replace( |
| 874 | - ",^[[:space:]]*([0-9]+)([.)]|" . chr(194) . '?' . chr(176) . ")[[:space:]]+,S", |
|
| 874 | + ",^[[:space:]]*([0-9]+)([.)]|".chr(194).'?'.chr(176).")[[:space:]]+,S", |
|
| 875 | 875 | "", $texte); |
| 876 | 876 | } |
| 877 | 877 | |
@@ -896,7 +896,7 @@ discard block |
||
| 896 | 896 | **/ |
| 897 | 897 | function recuperer_numero($texte) { |
| 898 | 898 | if (preg_match( |
| 899 | - ",^[[:space:]]*([0-9]+)([.)]|" . chr(194) . '?' . chr(176) . ")[[:space:]]+,S", |
|
| 899 | + ",^[[:space:]]*([0-9]+)([.)]|".chr(194).'?'.chr(176).")[[:space:]]+,S", |
|
| 900 | 900 | $texte, $regs)) { |
| 901 | 901 | return strval($regs[1]); |
| 902 | 902 | } else { |
@@ -981,8 +981,8 @@ discard block |
||
| 981 | 981 | **/ |
| 982 | 982 | function textebrut($texte) { |
| 983 | 983 | $u = $GLOBALS['meta']['pcre_u']; |
| 984 | - $texte = preg_replace('/\s+/S' . $u, " ", $texte); |
|
| 985 | - $texte = preg_replace("/<(p|br)( [^>]*)?" . ">/iS", "\n\n", $texte); |
|
| 984 | + $texte = preg_replace('/\s+/S'.$u, " ", $texte); |
|
| 985 | + $texte = preg_replace("/<(p|br)( [^>]*)?".">/iS", "\n\n", $texte); |
|
| 986 | 986 | $texte = preg_replace("/^\n+/", "", $texte); |
| 987 | 987 | $texte = preg_replace("/\n+$/", "", $texte); |
| 988 | 988 | $texte = preg_replace("/\n +/", "\n", $texte); |
@@ -1010,7 +1010,7 @@ discard block |
||
| 1010 | 1010 | if (preg_match_all(",(<a\s+[^>]*https?://[^>]*class=[\"']spip_(out|url)\b[^>]+>),imsS", |
| 1011 | 1011 | $texte, $liens, PREG_PATTERN_ORDER)) { |
| 1012 | 1012 | foreach ($liens[0] as $a) { |
| 1013 | - $rel = 'noopener noreferrer ' . extraire_attribut($a, 'rel'); |
|
| 1013 | + $rel = 'noopener noreferrer '.extraire_attribut($a, 'rel'); |
|
| 1014 | 1014 | $ablank = inserer_attribut($a, 'rel', $rel); |
| 1015 | 1015 | $ablank = inserer_attribut($ablank, 'target', '_blank'); |
| 1016 | 1016 | $texte = str_replace($a, $ablank, $texte); |
@@ -1035,7 +1035,7 @@ discard block |
||
| 1035 | 1035 | foreach ($regs[0] as $a) { |
| 1036 | 1036 | $rel = extraire_attribut($a, "rel"); |
| 1037 | 1037 | if (strpos($rel, "nofollow") === false) { |
| 1038 | - $rel = "nofollow" . ($rel ? " $rel" : ""); |
|
| 1038 | + $rel = "nofollow".($rel ? " $rel" : ""); |
|
| 1039 | 1039 | $anofollow = inserer_attribut($a, "rel", $rel); |
| 1040 | 1040 | $texte = str_replace($a, $anofollow, $texte); |
| 1041 | 1041 | } |
@@ -1064,7 +1064,7 @@ discard block |
||
| 1064 | 1064 | $u = $GLOBALS['meta']['pcre_u']; |
| 1065 | 1065 | $texte = preg_replace("@</p>@iS", "\n", $texte); |
| 1066 | 1066 | $texte = preg_replace("@<p\b.*>@UiS", "<br />", $texte); |
| 1067 | - $texte = preg_replace("@^\s*<br />@S" . $u, "", $texte); |
|
| 1067 | + $texte = preg_replace("@^\s*<br />@S".$u, "", $texte); |
|
| 1068 | 1068 | |
| 1069 | 1069 | return $texte; |
| 1070 | 1070 | } |
@@ -1094,7 +1094,7 @@ discard block |
||
| 1094 | 1094 | return $texte; |
| 1095 | 1095 | } |
| 1096 | 1096 | include_spip('inc/texte'); |
| 1097 | - $tag = preg_match(',</?(' . _BALISES_BLOCS . ')[>[:space:]],iS', $texte) ? |
|
| 1097 | + $tag = preg_match(',</?('._BALISES_BLOCS.')[>[:space:]],iS', $texte) ? |
|
| 1098 | 1098 | 'div' : 'span'; |
| 1099 | 1099 | |
| 1100 | 1100 | return "<$tag style='word-wrap:break-word;'>$texte</$tag>"; |
@@ -1203,7 +1203,7 @@ discard block |
||
| 1203 | 1203 | function attribut_html($texte, $textebrut = true) { |
| 1204 | 1204 | $u = $GLOBALS['meta']['pcre_u']; |
| 1205 | 1205 | if ($textebrut) { |
| 1206 | - $texte = preg_replace(array(",\n,", ",\s(?=\s),msS" . $u), array(" ", ""), textebrut($texte)); |
|
| 1206 | + $texte = preg_replace(array(",\n,", ",\s(?=\s),msS".$u), array(" ", ""), textebrut($texte)); |
|
| 1207 | 1207 | } |
| 1208 | 1208 | $texte = texte_backend($texte); |
| 1209 | 1209 | $texte = str_replace(array("'", '"'), array(''', '"'), $texte); |
@@ -1232,7 +1232,7 @@ discard block |
||
| 1232 | 1232 | # un message pour abs_url |
| 1233 | 1233 | $GLOBALS['mode_abs_url'] = 'url'; |
| 1234 | 1234 | $url = trim($url); |
| 1235 | - $r = ",^(?:" . _PROTOCOLES_STD . '):?/?/?$,iS'; |
|
| 1235 | + $r = ",^(?:"._PROTOCOLES_STD.'):?/?/?$,iS'; |
|
| 1236 | 1236 | |
| 1237 | 1237 | return preg_match($r, $url) ? '' : ($entites ? entites_html($url) : $url); |
| 1238 | 1238 | } |
@@ -1434,14 +1434,14 @@ discard block |
||
| 1434 | 1434 | if (strpos($texte, "<") !== false) { |
| 1435 | 1435 | include_spip('inc/lien'); |
| 1436 | 1436 | if (defined('_PREG_MODELE')) { |
| 1437 | - $preg_modeles = "@" . _PREG_MODELE . "@imsS"; |
|
| 1437 | + $preg_modeles = "@"._PREG_MODELE."@imsS"; |
|
| 1438 | 1438 | $texte = echappe_html($texte, '', true, $preg_modeles); |
| 1439 | 1439 | } |
| 1440 | 1440 | } |
| 1441 | 1441 | |
| 1442 | 1442 | $debut = ''; |
| 1443 | 1443 | $suite = $texte; |
| 1444 | - while ($t = strpos('-' . $suite, "\n", 1)) { |
|
| 1444 | + while ($t = strpos('-'.$suite, "\n", 1)) { |
|
| 1445 | 1445 | $debut .= substr($suite, 0, $t - 1); |
| 1446 | 1446 | $suite = substr($suite, $t); |
| 1447 | 1447 | $car = substr($suite, 0, 1); |
@@ -1458,11 +1458,11 @@ discard block |
||
| 1458 | 1458 | $suite = substr($suite, strlen($regs[0])); |
| 1459 | 1459 | } |
| 1460 | 1460 | } |
| 1461 | - $texte = $debut . $suite; |
|
| 1461 | + $texte = $debut.$suite; |
|
| 1462 | 1462 | |
| 1463 | 1463 | $texte = echappe_retour($texte); |
| 1464 | 1464 | |
| 1465 | - return $texte . $fin; |
|
| 1465 | + return $texte.$fin; |
|
| 1466 | 1466 | } |
| 1467 | 1467 | |
| 1468 | 1468 | |
@@ -1523,7 +1523,7 @@ discard block |
||
| 1523 | 1523 | } |
| 1524 | 1524 | |
| 1525 | 1525 | foreach ($regs as $reg) { |
| 1526 | - $cle = ($reg[1] ? $reg[1] . ':' : '') . $reg[2]; |
|
| 1526 | + $cle = ($reg[1] ? $reg[1].':' : '').$reg[2]; |
|
| 1527 | 1527 | $desc = $traduire($cle, $lang, true); |
| 1528 | 1528 | $l = $desc->langue; |
| 1529 | 1529 | // si pas de traduction, on laissera l'écriture de l'idiome entier dans le texte. |
@@ -1636,7 +1636,7 @@ discard block |
||
| 1636 | 1636 | // il ne faut pas echapper en div si propre produit un seul paragraphe |
| 1637 | 1637 | include_spip('inc/texte'); |
| 1638 | 1638 | $trad_propre = preg_replace(",(^<p[^>]*>|</p>$),Uims", "", propre($trad)); |
| 1639 | - $mode = preg_match(',</?(' . _BALISES_BLOCS . ')[>[:space:]],iS', $trad_propre) ? 'div' : 'span'; |
|
| 1639 | + $mode = preg_match(',</?('._BALISES_BLOCS.')[>[:space:]],iS', $trad_propre) ? 'div' : 'span'; |
|
| 1640 | 1640 | $trad = code_echappement($trad, 'multi', false, $mode); |
| 1641 | 1641 | $trad = str_replace("'", '"', inserer_attribut($trad, 'lang', $l)); |
| 1642 | 1642 | if (lang_dir($l) !== lang_dir($lang)) { |
@@ -1829,7 +1829,7 @@ discard block |
||
| 1829 | 1829 | if (is_array($balise)) { |
| 1830 | 1830 | array_walk( |
| 1831 | 1831 | $balise, |
| 1832 | - function(&$a, $key, $t){ |
|
| 1832 | + function(&$a, $key, $t) { |
|
| 1833 | 1833 | $a = extraire_attribut($a, $t); |
| 1834 | 1834 | }, |
| 1835 | 1835 | $attribut |
@@ -1916,14 +1916,14 @@ discard block |
||
| 1916 | 1916 | |
| 1917 | 1917 | if ($old !== null) { |
| 1918 | 1918 | // Remplacer l'ancien attribut du meme nom |
| 1919 | - $balise = $r[1] . $insert . $r[5]; |
|
| 1919 | + $balise = $r[1].$insert.$r[5]; |
|
| 1920 | 1920 | } else { |
| 1921 | 1921 | // preferer une balise " />" (comme <img />) |
| 1922 | 1922 | if (preg_match(',/>,', $balise)) { |
| 1923 | - $balise = preg_replace(",\s?/>,S", $insert . " />", $balise, 1); |
|
| 1923 | + $balise = preg_replace(",\s?/>,S", $insert." />", $balise, 1); |
|
| 1924 | 1924 | } // sinon une balise <a ...> ... </a> |
| 1925 | 1925 | else { |
| 1926 | - $balise = preg_replace(",\s?>,S", $insert . ">", $balise, 1); |
|
| 1926 | + $balise = preg_replace(",\s?>,S", $insert.">", $balise, 1); |
|
| 1927 | 1927 | } |
| 1928 | 1928 | } |
| 1929 | 1929 | |
@@ -1965,8 +1965,8 @@ discard block |
||
| 1965 | 1965 | // |
| 1966 | 1966 | // Quelques fonctions de calcul arithmetique |
| 1967 | 1967 | // |
| 1968 | -function floatstr($a) { return str_replace(',','.',(string)floatval($a)); } |
|
| 1969 | -function strize($f, $a, $b) { return floatstr($f(floatstr($a),floatstr($b))); } |
|
| 1968 | +function floatstr($a) { return str_replace(',', '.', (string) floatval($a)); } |
|
| 1969 | +function strize($f, $a, $b) { return floatstr($f(floatstr($a), floatstr($b))); } |
|
| 1970 | 1970 | |
| 1971 | 1971 | /** |
| 1972 | 1972 | * Additionne 2 nombres |
@@ -1986,7 +1986,7 @@ discard block |
||
| 1986 | 1986 | function plus($a, $b) { |
| 1987 | 1987 | return $a + $b; |
| 1988 | 1988 | } |
| 1989 | -function strplus($a, $b) {return strize('plus', $a, $b);} |
|
| 1989 | +function strplus($a, $b) {return strize('plus', $a, $b); } |
|
| 1990 | 1990 | /** |
| 1991 | 1991 | * Soustrait 2 nombres |
| 1992 | 1992 | * |
@@ -2005,7 +2005,7 @@ discard block |
||
| 2005 | 2005 | function moins($a, $b) { |
| 2006 | 2006 | return $a - $b; |
| 2007 | 2007 | } |
| 2008 | -function strmoins($a, $b) {return strize('moins', $a, $b);} |
|
| 2008 | +function strmoins($a, $b) {return strize('moins', $a, $b); } |
|
| 2009 | 2009 | |
| 2010 | 2010 | /** |
| 2011 | 2011 | * Multiplie 2 nombres |
@@ -2026,7 +2026,7 @@ discard block |
||
| 2026 | 2026 | function mult($a, $b) { |
| 2027 | 2027 | return $a * $b; |
| 2028 | 2028 | } |
| 2029 | -function strmult($a, $b) {return strize('mult', $a, $b);} |
|
| 2029 | +function strmult($a, $b) {return strize('mult', $a, $b); } |
|
| 2030 | 2030 | |
| 2031 | 2031 | /** |
| 2032 | 2032 | * Divise 2 nombres |
@@ -2047,7 +2047,7 @@ discard block |
||
| 2047 | 2047 | function div($a, $b) { |
| 2048 | 2048 | return $b ? $a / $b : 0; |
| 2049 | 2049 | } |
| 2050 | -function strdiv($a, $b) {return strize('div', $a, $b);} |
|
| 2050 | +function strdiv($a, $b) {return strize('div', $a, $b); } |
|
| 2051 | 2051 | |
| 2052 | 2052 | /** |
| 2053 | 2053 | * Retourne le modulo 2 nombres |
@@ -2088,13 +2088,13 @@ discard block |
||
| 2088 | 2088 | if (!defined('_TAGS_NOM_AUTEUR')) { |
| 2089 | 2089 | define('_TAGS_NOM_AUTEUR', ''); |
| 2090 | 2090 | } |
| 2091 | - $tags_acceptes = array_unique(explode(',', 'multi,' . _TAGS_NOM_AUTEUR)); |
|
| 2091 | + $tags_acceptes = array_unique(explode(',', 'multi,'._TAGS_NOM_AUTEUR)); |
|
| 2092 | 2092 | foreach ($tags_acceptes as $tag) { |
| 2093 | 2093 | if (strlen($tag)) { |
| 2094 | - $remp1[] = '<' . trim($tag) . '>'; |
|
| 2095 | - $remp1[] = '</' . trim($tag) . '>'; |
|
| 2096 | - $remp2[] = '\x60' . trim($tag) . '\x61'; |
|
| 2097 | - $remp2[] = '\x60/' . trim($tag) . '\x61'; |
|
| 2094 | + $remp1[] = '<'.trim($tag).'>'; |
|
| 2095 | + $remp1[] = '</'.trim($tag).'>'; |
|
| 2096 | + $remp2[] = '\x60'.trim($tag).'\x61'; |
|
| 2097 | + $remp2[] = '\x60/'.trim($tag).'\x61'; |
|
| 2098 | 2098 | } |
| 2099 | 2099 | } |
| 2100 | 2100 | $v_nom = str_replace($remp2, $remp1, supprimer_tags(str_replace($remp1, $remp2, $nom))); |
@@ -2157,7 +2157,7 @@ discard block |
||
| 2157 | 2157 | $s[] = preg_replace(',>[^<]+</a>,S', |
| 2158 | 2158 | '>' |
| 2159 | 2159 | . http_img_pack('attachment-16.png', $t, |
| 2160 | - 'title="' . attribut_html($t) . '"') |
|
| 2160 | + 'title="'.attribut_html($t).'"') |
|
| 2161 | 2161 | . '</a>', $tag); |
| 2162 | 2162 | } |
| 2163 | 2163 | } |
@@ -2218,10 +2218,10 @@ discard block |
||
| 2218 | 2218 | $fichier = basename($url); |
| 2219 | 2219 | |
| 2220 | 2220 | return '<a rel="enclosure"' |
| 2221 | - . ($url ? ' href="' . spip_htmlspecialchars($url) . '"' : '') |
|
| 2222 | - . ($type ? ' type="' . spip_htmlspecialchars($type) . '"' : '') |
|
| 2223 | - . ($length ? ' title="' . spip_htmlspecialchars($length) . '"' : '') |
|
| 2224 | - . '>' . $fichier . '</a>'; |
|
| 2221 | + . ($url ? ' href="'.spip_htmlspecialchars($url).'"' : '') |
|
| 2222 | + . ($type ? ' type="'.spip_htmlspecialchars($type).'"' : '') |
|
| 2223 | + . ($length ? ' title="'.spip_htmlspecialchars($length).'"' : '') |
|
| 2224 | + . '>'.$fichier.'</a>'; |
|
| 2225 | 2225 | } |
| 2226 | 2226 | |
| 2227 | 2227 | /** |
@@ -2249,9 +2249,9 @@ discard block |
||
| 2249 | 2249 | } # vieux data |
| 2250 | 2250 | $fichier = basename($url); |
| 2251 | 2251 | $enclosures[] = '<enclosure' |
| 2252 | - . ($url ? ' url="' . spip_htmlspecialchars($url) . '"' : '') |
|
| 2253 | - . ($type ? ' type="' . spip_htmlspecialchars($type) . '"' : '') |
|
| 2254 | - . ($length ? ' length="' . $length . '"' : '') |
|
| 2252 | + . ($url ? ' url="'.spip_htmlspecialchars($url).'"' : '') |
|
| 2253 | + . ($type ? ' type="'.spip_htmlspecialchars($type).'"' : '') |
|
| 2254 | + . ($length ? ' length="'.$length.'"' : '') |
|
| 2255 | 2255 | . ' />'; |
| 2256 | 2256 | } |
| 2257 | 2257 | } |
@@ -2277,7 +2277,7 @@ discard block |
||
| 2277 | 2277 | if (extraire_attribut($e, rel) == 'tag') { |
| 2278 | 2278 | $subjects .= '<dc:subject>' |
| 2279 | 2279 | . texte_backend(textebrut($e)) |
| 2280 | - . '</dc:subject>' . "\n"; |
|
| 2280 | + . '</dc:subject>'."\n"; |
|
| 2281 | 2281 | } |
| 2282 | 2282 | } |
| 2283 | 2283 | |
@@ -2313,7 +2313,7 @@ discard block |
||
| 2313 | 2313 | if (is_array($texte)) { |
| 2314 | 2314 | array_walk( |
| 2315 | 2315 | $texte, |
| 2316 | - function(&$a, $key, $t){ |
|
| 2316 | + function(&$a, $key, $t) { |
|
| 2317 | 2317 | $a = extraire_balise($a, $t); |
| 2318 | 2318 | }, |
| 2319 | 2319 | $tag |
@@ -2357,7 +2357,7 @@ discard block |
||
| 2357 | 2357 | if (is_array($texte)) { |
| 2358 | 2358 | array_walk( |
| 2359 | 2359 | $texte, |
| 2360 | - function(&$a, $key, $t){ |
|
| 2360 | + function(&$a, $key, $t) { |
|
| 2361 | 2361 | $a = extraire_balises($a, $t); |
| 2362 | 2362 | }, |
| 2363 | 2363 | $tag |
@@ -2483,7 +2483,7 @@ discard block |
||
| 2483 | 2483 | if ($fond != '404') { |
| 2484 | 2484 | $contexte = array_shift($p); |
| 2485 | 2485 | $contexte['page'] = $fond; |
| 2486 | - $action = preg_replace('/([?]' . preg_quote($fond) . '[^&=]*[0-9]+)(&|$)/', '?&', $action); |
|
| 2486 | + $action = preg_replace('/([?]'.preg_quote($fond).'[^&=]*[0-9]+)(&|$)/', '?&', $action); |
|
| 2487 | 2487 | } |
| 2488 | 2488 | } |
| 2489 | 2489 | // defaire ce qu'a injecte urls_decoder_url : a revoir en modifiant la signature de urls_decoder_url |
@@ -2538,9 +2538,9 @@ discard block |
||
| 2538 | 2538 | . '"' |
| 2539 | 2539 | . (is_null($val) |
| 2540 | 2540 | ? '' |
| 2541 | - : ' value="' . entites_html($val) . '"' |
|
| 2541 | + : ' value="'.entites_html($val).'"' |
|
| 2542 | 2542 | ) |
| 2543 | - . ' type="hidden"' . "\n/>"; |
|
| 2543 | + . ' type="hidden"'."\n/>"; |
|
| 2544 | 2544 | } |
| 2545 | 2545 | |
| 2546 | 2546 | return join("", $hidden); |
@@ -2703,12 +2703,12 @@ discard block |
||
| 2703 | 2703 | if ($pas < 1) { |
| 2704 | 2704 | return ''; |
| 2705 | 2705 | } |
| 2706 | - $ancre = 'pagination' . $nom; // #pagination_articles |
|
| 2707 | - $debut = 'debut' . $nom; // 'debut_articles' |
|
| 2706 | + $ancre = 'pagination'.$nom; // #pagination_articles |
|
| 2707 | + $debut = 'debut'.$nom; // 'debut_articles' |
|
| 2708 | 2708 | |
| 2709 | 2709 | // n'afficher l'ancre qu'une fois |
| 2710 | 2710 | if (!isset($ancres[$ancre])) { |
| 2711 | - $bloc_ancre = $ancres[$ancre] = "<a name='" . $ancre . "' id='" . $ancre . "'></a>"; |
|
| 2711 | + $bloc_ancre = $ancres[$ancre] = "<a name='".$ancre."' id='".$ancre."'></a>"; |
|
| 2712 | 2712 | } else { |
| 2713 | 2713 | $bloc_ancre = ''; |
| 2714 | 2714 | } |
@@ -2739,7 +2739,7 @@ discard block |
||
| 2739 | 2739 | } |
| 2740 | 2740 | |
| 2741 | 2741 | if ($modele) { |
| 2742 | - $modele = '_' . $modele; |
|
| 2742 | + $modele = '_'.$modele; |
|
| 2743 | 2743 | } |
| 2744 | 2744 | |
| 2745 | 2745 | return recuperer_fond("modeles/pagination$modele", $pagination, array('trim' => true), $connect); |
@@ -2764,7 +2764,7 @@ discard block |
||
| 2764 | 2764 | return preg_replace_callback( |
| 2765 | 2765 | ",url\s*\(\s*['\"]?([^'\"/#\s][^:]*)['\"]?\s*\),Uims", |
| 2766 | 2766 | function($x) use ($path) { |
| 2767 | - return "url('" . suivre_lien($path, $x[1]) . "')"; |
|
| 2767 | + return "url('".suivre_lien($path, $x[1])."')"; |
|
| 2768 | 2768 | }, |
| 2769 | 2769 | $contenu |
| 2770 | 2770 | ); |
@@ -2826,14 +2826,14 @@ discard block |
||
| 2826 | 2826 | ) { |
| 2827 | 2827 | $distant = true; |
| 2828 | 2828 | $cssf = parse_url($css); |
| 2829 | - $cssf = $cssf['path'] . ($cssf['query'] ? "?" . $cssf['query'] : ""); |
|
| 2829 | + $cssf = $cssf['path'].($cssf['query'] ? "?".$cssf['query'] : ""); |
|
| 2830 | 2830 | $cssf = preg_replace(',[?:&=],', "_", $cssf); |
| 2831 | 2831 | } else { |
| 2832 | 2832 | $distant = false; |
| 2833 | 2833 | $cssf = $css; |
| 2834 | 2834 | // 1. regarder d'abord si un fichier avec la bonne direction n'est pas aussi |
| 2835 | 2835 | //propose (rien a faire dans ce cas) |
| 2836 | - $f = preg_replace(',(_rtl)?\.css$,i', '_' . $ndir . '.css', $css); |
|
| 2836 | + $f = preg_replace(',(_rtl)?\.css$,i', '_'.$ndir.'.css', $css); |
|
| 2837 | 2837 | if (@file_exists($f)) { |
| 2838 | 2838 | return $f; |
| 2839 | 2839 | } |
@@ -2843,7 +2843,7 @@ discard block |
||
| 2843 | 2843 | $dir_var = sous_repertoire(_DIR_VAR, 'cache-css'); |
| 2844 | 2844 | $f = $dir_var |
| 2845 | 2845 | . preg_replace(',.*/(.*?)(_rtl)?\.css,', '\1', $cssf) |
| 2846 | - . '.' . substr(md5($cssf), 0, 4) . '_' . $ndir . '.css'; |
|
| 2846 | + . '.'.substr(md5($cssf), 0, 4).'_'.$ndir.'.css'; |
|
| 2847 | 2847 | |
| 2848 | 2848 | // la css peut etre distante (url absolue !) |
| 2849 | 2849 | if ($distant) { |
@@ -2888,8 +2888,8 @@ discard block |
||
| 2888 | 2888 | } // si la css_direction commence par $dir_var on la fait passer pour une absolue |
| 2889 | 2889 | elseif (substr($css_direction, 0, strlen($dir_var)) == $dir_var) { |
| 2890 | 2890 | $css_direction = substr($css_direction, strlen($dir_var)); |
| 2891 | - $src_faux_abs["/@@@@@@/" . $css_direction] = $css_direction; |
|
| 2892 | - $css_direction = "/@@@@@@/" . $css_direction; |
|
| 2891 | + $src_faux_abs["/@@@@@@/".$css_direction] = $css_direction; |
|
| 2892 | + $css_direction = "/@@@@@@/".$css_direction; |
|
| 2893 | 2893 | } |
| 2894 | 2894 | $src[] = $regs[0][$k]; |
| 2895 | 2895 | $src_direction_css[] = str_replace($import_css, $css_direction, $regs[0][$k]); |
@@ -2938,7 +2938,7 @@ discard block |
||
| 2938 | 2938 | |
| 2939 | 2939 | $f = basename($css, '.css'); |
| 2940 | 2940 | $f = sous_repertoire(_DIR_VAR, 'cache-css') |
| 2941 | - . preg_replace(",(.*?)(_rtl|_ltr)?$,", "\\1-urlabs-" . substr(md5("$css-urlabs"), 0, 4) . "\\2", $f) |
|
| 2941 | + . preg_replace(",(.*?)(_rtl|_ltr)?$,", "\\1-urlabs-".substr(md5("$css-urlabs"), 0, 4)."\\2", $f) |
|
| 2942 | 2942 | . '.css'; |
| 2943 | 2943 | |
| 2944 | 2944 | if ((@filemtime($f) > @filemtime($css)) and (_VAR_MODE != 'recalcul')) { |
@@ -2947,7 +2947,7 @@ discard block |
||
| 2947 | 2947 | |
| 2948 | 2948 | if ($url_absolue_css == $css) { |
| 2949 | 2949 | if (strncmp($GLOBALS['meta']['adresse_site'], $css, $l = strlen($GLOBALS['meta']['adresse_site'])) != 0 |
| 2950 | - or !lire_fichier(_DIR_RACINE . substr($css, $l), $contenu) |
|
| 2950 | + or !lire_fichier(_DIR_RACINE.substr($css, $l), $contenu) |
|
| 2951 | 2951 | ) { |
| 2952 | 2952 | include_spip('inc/distant'); |
| 2953 | 2953 | if (!$contenu = recuperer_page($css)) { |
@@ -3057,7 +3057,7 @@ discard block |
||
| 3057 | 3057 | $expression = str_replace("\/", "/", $expression); |
| 3058 | 3058 | $expression = str_replace("/", "\/", $expression); |
| 3059 | 3059 | |
| 3060 | - if (preg_match('/' . $expression . '/' . $modif, $texte, $r)) { |
|
| 3060 | + if (preg_match('/'.$expression.'/'.$modif, $texte, $r)) { |
|
| 3061 | 3061 | if (isset($r[$capte])) { |
| 3062 | 3062 | return $r[$capte]; |
| 3063 | 3063 | } else { |
@@ -3095,7 +3095,7 @@ discard block |
||
| 3095 | 3095 | $expression = str_replace("\/", "/", $expression); |
| 3096 | 3096 | $expression = str_replace("/", "\/", $expression); |
| 3097 | 3097 | |
| 3098 | - return preg_replace('/' . $expression . '/' . $modif, $replace, $texte); |
|
| 3098 | + return preg_replace('/'.$expression.'/'.$modif, $replace, $texte); |
|
| 3099 | 3099 | } |
| 3100 | 3100 | |
| 3101 | 3101 | |
@@ -3114,7 +3114,7 @@ discard block |
||
| 3114 | 3114 | function traiter_doublons_documents(&$doublons, $letexte) { |
| 3115 | 3115 | |
| 3116 | 3116 | // Verifier dans le texte & les notes (pas beau, helas) |
| 3117 | - $t = $letexte . $GLOBALS['les_notes']; |
|
| 3117 | + $t = $letexte.$GLOBALS['les_notes']; |
|
| 3118 | 3118 | |
| 3119 | 3119 | if (strstr($t, 'spip_document_') // evite le preg_match_all si inutile |
| 3120 | 3120 | and preg_match_all( |
@@ -3124,7 +3124,7 @@ discard block |
||
| 3124 | 3124 | if (!isset($doublons['documents'])) { |
| 3125 | 3125 | $doublons['documents'] = ""; |
| 3126 | 3126 | } |
| 3127 | - $doublons['documents'] .= "," . join(',', $matches[1]); |
|
| 3127 | + $doublons['documents'] .= ",".join(',', $matches[1]); |
|
| 3128 | 3128 | } |
| 3129 | 3129 | |
| 3130 | 3130 | return $letexte; |
@@ -3181,7 +3181,7 @@ discard block |
||
| 3181 | 3181 | if ($env) { |
| 3182 | 3182 | foreach ($env as $i => $j) { |
| 3183 | 3183 | if (is_string($j) and !in_array($i, $ignore_params)) { |
| 3184 | - $texte .= "<param name='" . $i . "'\n\tvalue='" . $j . "' />"; |
|
| 3184 | + $texte .= "<param name='".$i."'\n\tvalue='".$j."' />"; |
|
| 3185 | 3185 | } |
| 3186 | 3186 | } |
| 3187 | 3187 | } |
@@ -3220,7 +3220,7 @@ discard block |
||
| 3220 | 3220 | if ($env) { |
| 3221 | 3221 | foreach ($env as $i => $j) { |
| 3222 | 3222 | if (is_string($j) and !in_array($i, $ignore_params)) { |
| 3223 | - $texte .= $i . "='" . $j . "' "; |
|
| 3223 | + $texte .= $i."='".$j."' "; |
|
| 3224 | 3224 | } |
| 3225 | 3225 | } |
| 3226 | 3226 | } |
@@ -3304,19 +3304,19 @@ discard block |
||
| 3304 | 3304 | |
| 3305 | 3305 | $img_file = $img; |
| 3306 | 3306 | if ($p = strpos($img_file, '?')) { |
| 3307 | - $img_file = substr($img_file,0, $p); |
|
| 3307 | + $img_file = substr($img_file, 0, $p); |
|
| 3308 | 3308 | } |
| 3309 | 3309 | if (!isset($options['chemin_image']) or $options['chemin_image'] == true) { |
| 3310 | 3310 | $img_file = chemin_image($img); |
| 3311 | 3311 | } |
| 3312 | 3312 | else { |
| 3313 | - if (!isset($options['variante_svg_si_possible']) or $options['variante_svg_si_possible'] == true){ |
|
| 3313 | + if (!isset($options['variante_svg_si_possible']) or $options['variante_svg_si_possible'] == true) { |
|
| 3314 | 3314 | // on peut fournir une icone generique -xx.svg qui fera le job dans toutes les tailles, et qui est prioritaire sur le png |
| 3315 | 3315 | // si il y a un .svg a la bonne taille (-16.svg) a cote, on l'utilise en remplacement du -16.png |
| 3316 | 3316 | if (preg_match(',-(\d+)[.](png|gif|svg)$,', $img_file, $m) |
| 3317 | - and $variante_svg_generique = substr($img_file, 0, -strlen($m[0])) . "-xx.svg" |
|
| 3317 | + and $variante_svg_generique = substr($img_file, 0, -strlen($m[0]))."-xx.svg" |
|
| 3318 | 3318 | and file_exists($variante_svg_generique)) { |
| 3319 | - if ($variante_svg_size = substr($variante_svg_generique,0,-6) . $m[1] . ".svg" and file_exists($variante_svg_size)) { |
|
| 3319 | + if ($variante_svg_size = substr($variante_svg_generique, 0, -6).$m[1].".svg" and file_exists($variante_svg_size)) { |
|
| 3320 | 3320 | $img_file = $variante_svg_size; |
| 3321 | 3321 | } |
| 3322 | 3322 | else { |
@@ -3341,15 +3341,15 @@ discard block |
||
| 3341 | 3341 | return ""; |
| 3342 | 3342 | } |
| 3343 | 3343 | } |
| 3344 | - $atts .= " width='" . $largeur . "' height='" . $hauteur . "'"; |
|
| 3344 | + $atts .= " width='".$largeur."' height='".$hauteur."'"; |
|
| 3345 | 3345 | } |
| 3346 | 3346 | |
| 3347 | 3347 | if (file_exists($img_file)) { |
| 3348 | 3348 | $img_file = timestamp($img_file); |
| 3349 | 3349 | } |
| 3350 | - return "<img src='$img_file' alt='" . attribut_html($alt ? $alt : $title) . "'" |
|
| 3351 | - . ($title ? ' title="' . attribut_html($title) . '"' : '') |
|
| 3352 | - . " " . ltrim($atts) |
|
| 3350 | + return "<img src='$img_file' alt='".attribut_html($alt ? $alt : $title)."'" |
|
| 3351 | + . ($title ? ' title="'.attribut_html($title).'"' : '') |
|
| 3352 | + . " ".ltrim($atts) |
|
| 3353 | 3353 | . " />"; |
| 3354 | 3354 | } |
| 3355 | 3355 | |
@@ -3361,12 +3361,12 @@ discard block |
||
| 3361 | 3361 | * @param string $size |
| 3362 | 3362 | * @return string |
| 3363 | 3363 | */ |
| 3364 | -function http_style_background($img, $att = '', $size=null) { |
|
| 3365 | - if ($size and is_numeric($size)){ |
|
| 3366 | - $size = trim($size) . "px"; |
|
| 3364 | +function http_style_background($img, $att = '', $size = null) { |
|
| 3365 | + if ($size and is_numeric($size)) { |
|
| 3366 | + $size = trim($size)."px"; |
|
| 3367 | 3367 | } |
| 3368 | - return " style='background" . |
|
| 3369 | - ($att ? "" : "-image") . ": url(\"" . chemin_image($img) . "\")" . ($att ? (' ' . $att) : '') . ";" |
|
| 3368 | + return " style='background". |
|
| 3369 | + ($att ? "" : "-image").": url(\"".chemin_image($img)."\")".($att ? (' '.$att) : '').";" |
|
| 3370 | 3370 | . ($size ? "background-size:{$size};" : '') |
| 3371 | 3371 | . "'"; |
| 3372 | 3372 | } |
@@ -3383,8 +3383,8 @@ discard block |
||
| 3383 | 3383 | * @return string |
| 3384 | 3384 | * Code HTML de la balise IMG |
| 3385 | 3385 | */ |
| 3386 | -function filtre_balise_img_dist($img, $alt = "", $class = "", $width=null) { |
|
| 3387 | - $atts = $class ? " class='" . attribut_html($class) . "'" : ''; |
|
| 3386 | +function filtre_balise_img_dist($img, $alt = "", $class = "", $width = null) { |
|
| 3387 | + $atts = $class ? " class='".attribut_html($class)."'" : ''; |
|
| 3388 | 3388 | // ecriture courte : on donne le width en 2e arg |
| 3389 | 3389 | if (empty($width) and is_numeric($alt)) { |
| 3390 | 3390 | $width = $alt; |
@@ -3422,18 +3422,18 @@ discard block |
||
| 3422 | 3422 | $balise_svg_source = $balise_svg; |
| 3423 | 3423 | |
| 3424 | 3424 | // entete XML à supprimer |
| 3425 | - $svg = preg_replace(',^\s*<\?xml[^>]*\?' . '>,', '', $svg); |
|
| 3425 | + $svg = preg_replace(',^\s*<\?xml[^>]*\?'.'>,', '', $svg); |
|
| 3426 | 3426 | |
| 3427 | 3427 | // IE est toujours mon ami |
| 3428 | 3428 | $balise_svg = inserer_attribut($balise_svg, 'focusable', 'false'); |
| 3429 | 3429 | if ($class) { |
| 3430 | 3430 | $balise_svg = inserer_attribut($balise_svg, 'class', $class); |
| 3431 | 3431 | } |
| 3432 | - if ($alt){ |
|
| 3432 | + if ($alt) { |
|
| 3433 | 3433 | $balise_svg = inserer_attribut($balise_svg, 'role', 'img'); |
| 3434 | - $id = "img-svg-title-" . substr(md5("$file:$svg:$alt"),0,4); |
|
| 3434 | + $id = "img-svg-title-".substr(md5("$file:$svg:$alt"), 0, 4); |
|
| 3435 | 3435 | $balise_svg = inserer_attribut($balise_svg, 'aria-labelledby', $id); |
| 3436 | - $title = "<title id=\"$id\">" . entites_html($alt)."</title>\n"; |
|
| 3436 | + $title = "<title id=\"$id\">".entites_html($alt)."</title>\n"; |
|
| 3437 | 3437 | $balise_svg .= $title; |
| 3438 | 3438 | } |
| 3439 | 3439 | else { |
@@ -3467,7 +3467,7 @@ discard block |
||
| 3467 | 3467 | $texte = ''; |
| 3468 | 3468 | if (is_array($tableau)) { |
| 3469 | 3469 | foreach ($tableau as $k => $v) { |
| 3470 | - $res = recuperer_fond('modeles/' . $modele, |
|
| 3470 | + $res = recuperer_fond('modeles/'.$modele, |
|
| 3471 | 3471 | array_merge(array('cle' => $k), (is_array($v) ? $v : array('valeur' => $v))) |
| 3472 | 3472 | ); |
| 3473 | 3473 | $texte .= $res; |
@@ -3644,7 +3644,7 @@ discard block |
||
| 3644 | 3644 | } |
| 3645 | 3645 | |
| 3646 | 3646 | $c = serialize($c); |
| 3647 | - $cle = calculer_cle_action($form . $c); |
|
| 3647 | + $cle = calculer_cle_action($form.$c); |
|
| 3648 | 3648 | $c = "$cle:$c"; |
| 3649 | 3649 | |
| 3650 | 3650 | // on ne stocke pas les contextes dans des fichiers caches |
@@ -3694,15 +3694,15 @@ discard block |
||
| 3694 | 3694 | } |
| 3695 | 3695 | // toujours encoder l'url source dans le bloc ajax |
| 3696 | 3696 | $r = self(); |
| 3697 | - $r = ' data-origin="' . $r . '"'; |
|
| 3697 | + $r = ' data-origin="'.$r.'"'; |
|
| 3698 | 3698 | $class = 'ajaxbloc'; |
| 3699 | 3699 | if ($ajaxid and is_string($ajaxid)) { |
| 3700 | 3700 | // ajaxid est normalement conforme a un nom de classe css |
| 3701 | 3701 | // on ne verifie pas la conformite, mais on passe entites_html par dessus par precaution |
| 3702 | - $class .= ' ajax-id-' . entites_html($ajaxid); |
|
| 3702 | + $class .= ' ajax-id-'.entites_html($ajaxid); |
|
| 3703 | 3703 | } |
| 3704 | 3704 | |
| 3705 | - return "<div class='$class' " . "data-ajax-env='$env'$r>\n$emboite</div><!--ajaxbloc-->\n"; |
|
| 3705 | + return "<div class='$class' "."data-ajax-env='$env'$r>\n$emboite</div><!--ajaxbloc-->\n"; |
|
| 3706 | 3706 | } |
| 3707 | 3707 | |
| 3708 | 3708 | /** |
@@ -3741,11 +3741,11 @@ discard block |
||
| 3741 | 3741 | // extraire la signature en debut de contexte |
| 3742 | 3742 | // et la verifier avant de deserializer |
| 3743 | 3743 | // format : signature:donneesserializees |
| 3744 | - if ($p = strpos($c,":")){ |
|
| 3745 | - $cle = substr($c,0,$p); |
|
| 3746 | - $c = substr($c,$p+1); |
|
| 3744 | + if ($p = strpos($c, ":")) { |
|
| 3745 | + $cle = substr($c, 0, $p); |
|
| 3746 | + $c = substr($c, $p + 1); |
|
| 3747 | 3747 | |
| 3748 | - if ($cle == calculer_cle_action($form . $c)) { |
|
| 3748 | + if ($cle == calculer_cle_action($form.$c)) { |
|
| 3749 | 3749 | $env = @unserialize($c); |
| 3750 | 3750 | return $env; |
| 3751 | 3751 | } |
@@ -3846,9 +3846,9 @@ discard block |
||
| 3846 | 3846 | } else { |
| 3847 | 3847 | $bal = 'a'; |
| 3848 | 3848 | $att = "href='$url'" |
| 3849 | - . ($title ? " title='" . attribut_html($title) . "'" : '') |
|
| 3850 | - . ($class ? " class='" . attribut_html($class) . "'" : '') |
|
| 3851 | - . ($rel ? " rel='" . attribut_html($rel) . "'" : '') |
|
| 3849 | + . ($title ? " title='".attribut_html($title)."'" : '') |
|
| 3850 | + . ($class ? " class='".attribut_html($class)."'" : '') |
|
| 3851 | + . ($rel ? " rel='".attribut_html($rel)."'" : '') |
|
| 3852 | 3852 | . $evt; |
| 3853 | 3853 | } |
| 3854 | 3854 | if ($libelle === null) { |
@@ -3923,7 +3923,7 @@ discard block |
||
| 3923 | 3923 | } |
| 3924 | 3924 | |
| 3925 | 3925 | // ajouter le type d'objet dans la class de l'icone |
| 3926 | - $class .= " " . substr(basename($fond), 0, -4); |
|
| 3926 | + $class .= " ".substr(basename($fond), 0, -4); |
|
| 3927 | 3927 | |
| 3928 | 3928 | $alt = attribut_html($texte); |
| 3929 | 3929 | $title = " title=\"$alt\""; // est-ce pertinent de doubler le alt par un title ? |
@@ -3947,7 +3947,7 @@ discard block |
||
| 3947 | 3947 | } |
| 3948 | 3948 | |
| 3949 | 3949 | $icone = http_img_pack($fond, $alt, "width='$size' height='$size'"); |
| 3950 | - $icone = "<span class=\"icone-image".($fonction ? " icone-fonction icone-fonction-$fonction" : "") . "\">$icone</span>"; |
|
| 3950 | + $icone = "<span class=\"icone-image".($fonction ? " icone-fonction icone-fonction-$fonction" : "")."\">$icone</span>"; |
|
| 3951 | 3951 | |
| 3952 | 3952 | if ($type == 'lien') { |
| 3953 | 3953 | return "<span class='icone s$size $class'>" |
@@ -4177,13 +4177,13 @@ discard block |
||
| 4177 | 4177 | $res = ""; |
| 4178 | 4178 | foreach ($boutons as $page => $detail) { |
| 4179 | 4179 | if ($detail->icone and strlen(trim($detail->icone))) { |
| 4180 | - $res .= "\n.navigation_avec_icones #bando1_$page {background-image:url(" . $detail->icone . ");}"; |
|
| 4180 | + $res .= "\n.navigation_avec_icones #bando1_$page {background-image:url(".$detail->icone.");}"; |
|
| 4181 | 4181 | } |
| 4182 | 4182 | $selecteur = (in_array($page, array('outils_rapides', 'outils_collaboratifs')) ? "" : ".navigation_avec_icones "); |
| 4183 | 4183 | if (is_array($detail->sousmenu)) { |
| 4184 | 4184 | foreach ($detail->sousmenu as $souspage => $sousdetail) { |
| 4185 | 4185 | if ($sousdetail->icone and strlen(trim($sousdetail->icone))) { |
| 4186 | - $res .= "\n$selecteur.bando2_$souspage {background-image:url(" . $sousdetail->icone . ");}"; |
|
| 4186 | + $res .= "\n$selecteur.bando2_$souspage {background-image:url(".$sousdetail->icone.");}"; |
|
| 4187 | 4187 | } |
| 4188 | 4188 | } |
| 4189 | 4189 | } |
@@ -4209,17 +4209,17 @@ discard block |
||
| 4209 | 4209 | */ |
| 4210 | 4210 | function bouton_action($libelle, $url, $class = "", $confirm = "", $title = "", $callback = "") { |
| 4211 | 4211 | if ($confirm) { |
| 4212 | - $confirm = "confirm(\"" . attribut_html($confirm) . "\")"; |
|
| 4212 | + $confirm = "confirm(\"".attribut_html($confirm)."\")"; |
|
| 4213 | 4213 | if ($callback) { |
| 4214 | 4214 | $callback = "$confirm?($callback):false"; |
| 4215 | 4215 | } else { |
| 4216 | 4216 | $callback = $confirm; |
| 4217 | 4217 | } |
| 4218 | 4218 | } |
| 4219 | - $onclick = $callback ? " onclick='return " . addcslashes($callback, "'") . "'" : ""; |
|
| 4219 | + $onclick = $callback ? " onclick='return ".addcslashes($callback, "'")."'" : ""; |
|
| 4220 | 4220 | $title = $title ? " title='$title'" : ""; |
| 4221 | 4221 | |
| 4222 | - return "<form class='bouton_action_post $class' method='post' action='$url'><div>" . form_hidden($url) |
|
| 4222 | + return "<form class='bouton_action_post $class' method='post' action='$url'><div>".form_hidden($url) |
|
| 4223 | 4223 | . "<button type='submit' class='submit'$title$onclick>$libelle</button></div></form>"; |
| 4224 | 4224 | } |
| 4225 | 4225 | |
@@ -4358,14 +4358,14 @@ discard block |
||
| 4358 | 4358 | $champ_titre = ""; |
| 4359 | 4359 | if ($demande_titre) { |
| 4360 | 4360 | // si pas de titre declare mais champ titre, il sera peuple par le select * |
| 4361 | - $champ_titre = (!empty($desc['titre'])) ? ', ' . $desc['titre'] : ''; |
|
| 4361 | + $champ_titre = (!empty($desc['titre'])) ? ', '.$desc['titre'] : ''; |
|
| 4362 | 4362 | } |
| 4363 | 4363 | include_spip('base/abstract_sql'); |
| 4364 | 4364 | include_spip('base/connect_sql'); |
| 4365 | 4365 | $objets[$type_objet][$id_objet] = sql_fetsel( |
| 4366 | - '*' . $champ_titre, |
|
| 4366 | + '*'.$champ_titre, |
|
| 4367 | 4367 | $desc['table_sql'], |
| 4368 | - id_table_objet($type_objet) . ' = ' . intval($id_objet) |
|
| 4368 | + id_table_objet($type_objet).' = '.intval($id_objet) |
|
| 4369 | 4369 | ); |
| 4370 | 4370 | } |
| 4371 | 4371 | |
@@ -4435,7 +4435,7 @@ discard block |
||
| 4435 | 4435 | return $texte; |
| 4436 | 4436 | } |
| 4437 | 4437 | |
| 4438 | - $traitement = str_replace('%s', "'" . texte_script($texte) . "'", $traitement); |
|
| 4438 | + $traitement = str_replace('%s', "'".texte_script($texte)."'", $traitement); |
|
| 4439 | 4439 | |
| 4440 | 4440 | // Fournir $connect et $Pile[0] au traitement si besoin |
| 4441 | 4441 | $Pile = array(0 => $env); |
@@ -4469,7 +4469,7 @@ discard block |
||
| 4469 | 4469 | } |
| 4470 | 4470 | $url = generer_url_entite($id_objet, $objet, '', '', $connect); |
| 4471 | 4471 | |
| 4472 | - return "<a href='$url' class='$objet'>" . couper($titre, $longueur) . "</a>"; |
|
| 4472 | + return "<a href='$url' class='$objet'>".couper($titre, $longueur)."</a>"; |
|
| 4473 | 4473 | } |
| 4474 | 4474 | |
| 4475 | 4475 | |
@@ -4488,10 +4488,10 @@ discard block |
||
| 4488 | 4488 | function wrap($texte, $wrap) { |
| 4489 | 4489 | $balises = extraire_balises($wrap); |
| 4490 | 4490 | if (preg_match_all(",<([a-z]\w*)\b[^>]*>,UimsS", $wrap, $regs, PREG_PATTERN_ORDER)) { |
| 4491 | - $texte = $wrap . $texte; |
|
| 4491 | + $texte = $wrap.$texte; |
|
| 4492 | 4492 | $regs = array_reverse($regs[1]); |
| 4493 | - $wrap = "</" . implode("></", $regs) . ">"; |
|
| 4494 | - $texte = $texte . $wrap; |
|
| 4493 | + $wrap = "</".implode("></", $regs).">"; |
|
| 4494 | + $texte = $texte.$wrap; |
|
| 4495 | 4495 | } |
| 4496 | 4496 | |
| 4497 | 4497 | return $texte; |
@@ -4522,7 +4522,7 @@ discard block |
||
| 4522 | 4522 | |
| 4523 | 4523 | // caster $u en array si besoin |
| 4524 | 4524 | if (is_object($u)) { |
| 4525 | - $u = (array)$u; |
|
| 4525 | + $u = (array) $u; |
|
| 4526 | 4526 | } |
| 4527 | 4527 | |
| 4528 | 4528 | if (is_array($u)) { |
@@ -4543,7 +4543,7 @@ discard block |
||
| 4543 | 4543 | // sinon on passe a la ligne et on indente |
| 4544 | 4544 | $i_str = str_pad("", $indent, " "); |
| 4545 | 4545 | foreach ($u as $k => $v) { |
| 4546 | - $out .= $join . $i_str . "$k: " . filtre_print_dist($v, $join, $indent + 2); |
|
| 4546 | + $out .= $join.$i_str."$k: ".filtre_print_dist($v, $join, $indent + 2); |
|
| 4547 | 4547 | } |
| 4548 | 4548 | |
| 4549 | 4549 | return $out; |
@@ -4596,8 +4596,8 @@ discard block |
||
| 4596 | 4596 | * @param string $class |
| 4597 | 4597 | * @return string |
| 4598 | 4598 | */ |
| 4599 | -function objet_icone($objet, $taille = 24, $class='') { |
|
| 4600 | - $icone = objet_info($objet, 'icone_objet') . "-" . $taille . ".png"; |
|
| 4599 | +function objet_icone($objet, $taille = 24, $class = '') { |
|
| 4600 | + $icone = objet_info($objet, 'icone_objet')."-".$taille.".png"; |
|
| 4601 | 4601 | $icone = chemin_image($icone); |
| 4602 | 4602 | $balise_img = charger_filtre('balise_img'); |
| 4603 | 4603 | |
@@ -4621,12 +4621,12 @@ discard block |
||
| 4621 | 4621 | * @param array $options |
| 4622 | 4622 | * @return string |
| 4623 | 4623 | */ |
| 4624 | -function objet_T($objet, $chaine, $args = array(), $options = array()){ |
|
| 4625 | - $chaine = explode(':',$chaine); |
|
| 4626 | - if ($t = _T($objet . ':' . end($chaine), $args, array_merge($options, array('force'=>false)))) { |
|
| 4624 | +function objet_T($objet, $chaine, $args = array(), $options = array()) { |
|
| 4625 | + $chaine = explode(':', $chaine); |
|
| 4626 | + if ($t = _T($objet.':'.end($chaine), $args, array_merge($options, array('force'=>false)))) { |
|
| 4627 | 4627 | return $t; |
| 4628 | 4628 | } |
| 4629 | - $chaine = implode(':',$chaine); |
|
| 4629 | + $chaine = implode(':', $chaine); |
|
| 4630 | 4630 | return _T($chaine, $args, $options); |
| 4631 | 4631 | } |
| 4632 | 4632 | |
@@ -4686,11 +4686,11 @@ discard block |
||
| 4686 | 4686 | $cache = recuperer_fond($fond, $contexte, $options, $connect); |
| 4687 | 4687 | |
| 4688 | 4688 | // calculer le nom de la css |
| 4689 | - $dir_var = sous_repertoire(_DIR_VAR, 'cache-' . $extension); |
|
| 4689 | + $dir_var = sous_repertoire(_DIR_VAR, 'cache-'.$extension); |
|
| 4690 | 4690 | $nom_safe = preg_replace(",\W,", '_', str_replace('.', '_', $fond)); |
| 4691 | 4691 | $contexte_implicite = calculer_contexte_implicite(); |
| 4692 | - $filename = $dir_var . $extension . "dyn-$nom_safe-" |
|
| 4693 | - . substr(md5($fond . serialize($contexte_implicite) . serialize($contexte) . $connect), 0, 8) |
|
| 4692 | + $filename = $dir_var.$extension."dyn-$nom_safe-" |
|
| 4693 | + . substr(md5($fond.serialize($contexte_implicite).serialize($contexte).$connect), 0, 8) |
|
| 4694 | 4694 | . ".$extension"; |
| 4695 | 4695 | |
| 4696 | 4696 | // mettre a jour le fichier si il n'existe pas |
@@ -4698,8 +4698,8 @@ discard block |
||
| 4698 | 4698 | // le dernier fichier produit est toujours suffixe par .last |
| 4699 | 4699 | // et recopie sur le fichier cible uniquement si il change |
| 4700 | 4700 | if (!file_exists($filename) |
| 4701 | - or !file_exists($filename . ".last") |
|
| 4702 | - or (isset($cache['lastmodified']) and $cache['lastmodified'] and filemtime($filename . ".last") < $cache['lastmodified']) |
|
| 4701 | + or !file_exists($filename.".last") |
|
| 4702 | + or (isset($cache['lastmodified']) and $cache['lastmodified'] and filemtime($filename.".last") < $cache['lastmodified']) |
|
| 4703 | 4703 | or (defined('_VAR_MODE') and _VAR_MODE == 'recalcul') |
| 4704 | 4704 | ) { |
| 4705 | 4705 | $contenu = $cache['texte']; |
@@ -4718,15 +4718,15 @@ discard block |
||
| 4718 | 4718 | } |
| 4719 | 4719 | // pas de date dans le commentaire car sinon ca invalide le md5 et force la maj |
| 4720 | 4720 | // mais on peut mettre un md5 du contenu, ce qui donne un aperu rapide si la feuille a change ou non |
| 4721 | - $comment .= "}\n md5:" . md5($contenu) . " */\n"; |
|
| 4721 | + $comment .= "}\n md5:".md5($contenu)." */\n"; |
|
| 4722 | 4722 | } |
| 4723 | 4723 | // et ecrire le fichier |
| 4724 | - ecrire_fichier($filename . ".last", $comment . $contenu); |
|
| 4724 | + ecrire_fichier($filename.".last", $comment.$contenu); |
|
| 4725 | 4725 | // regarder si on recopie |
| 4726 | 4726 | if (!file_exists($filename) |
| 4727 | - or md5_file($filename) !== md5_file($filename . ".last") |
|
| 4727 | + or md5_file($filename) !== md5_file($filename.".last") |
|
| 4728 | 4728 | ) { |
| 4729 | - @copy($filename . ".last", $filename); |
|
| 4729 | + @copy($filename.".last", $filename); |
|
| 4730 | 4730 | clearstatcache(true, $filename); // eviter que PHP ne reserve le vieux timestamp |
| 4731 | 4731 | } |
| 4732 | 4732 | } |