@@ -39,7 +39,7 @@ discard block |
||
| 39 | 39 | |
| 40 | 40 | // Typographie |
| 41 | 41 | $vars->add('--spip-font-size', $Pile[0]['font-size']); |
| 42 | - $vars->add('--spip-line-height', $Pile[0]['line-height']); |
|
| 42 | + $vars->add('--spip-line-height', $Pile[0]['line-height']); |
|
| 43 | 43 | $vars->add('--spip-text-indent', $Pile[0]['text-indent']); |
| 44 | 44 | $vars->add('--spip-font-family', $Pile[0]['font-family']); |
| 45 | 45 | |
@@ -49,8 +49,8 @@ discard block |
||
| 49 | 49 | |
| 50 | 50 | // Espacements pour le rythme vertical et les gouttières |
| 51 | 51 | // Basés sur la hauteur d'une ligne de texte à la racine du document |
| 52 | - $vars->add('--spip-spacing-y', round(strmult($Pile[0]['font-size'], $Pile[0]['line-height']), 4) . 'rem'); |
|
| 53 | - $vars->add('--spip-spacing-x', round(strmult($Pile[0]['font-size'], $Pile[0]['line-height']), 4) . 'rem'); |
|
| 52 | + $vars->add('--spip-spacing-y', round(strmult($Pile[0]['font-size'], $Pile[0]['line-height']), 4).'rem'); |
|
| 53 | + $vars->add('--spip-spacing-x', round(strmult($Pile[0]['font-size'], $Pile[0]['line-height']), 4).'rem'); |
|
| 54 | 54 | $vars->add('--spip-margin-bottom', $Pile[0]['margin-bottom']); // À déprécier |
| 55 | 55 | |
| 56 | 56 | // Bordures |
@@ -60,20 +60,20 @@ discard block |
||
| 60 | 60 | |
| 61 | 61 | // Ombres portées |
| 62 | 62 | $shadow_mini = |
| 63 | - '0 0.05em 0.1em hsla(0, 0%, 0%, 0.33),' . |
|
| 64 | - '0 0.1em 0.15em hsla(0, 0%, 0%, 0.05),' . |
|
| 63 | + '0 0.05em 0.1em hsla(0, 0%, 0%, 0.33),'. |
|
| 64 | + '0 0.1em 0.15em hsla(0, 0%, 0%, 0.05),'. |
|
| 65 | 65 | '0 0.1em 0.25em hsla(0, 0%, 0%, 0.05)'; |
| 66 | 66 | $shadow = |
| 67 | - '0 0.05em 0.15em hsla(0, 0%, 0%, 0.33),' . |
|
| 68 | - '0 0.1em 0.25em hsla(0, 0%, 0%, 0.05),' . |
|
| 67 | + '0 0.05em 0.15em hsla(0, 0%, 0%, 0.33),'. |
|
| 68 | + '0 0.1em 0.25em hsla(0, 0%, 0%, 0.05),'. |
|
| 69 | 69 | '0 0.1em 0.5em hsla(0, 0%, 0%, 0.05)'; |
| 70 | 70 | $shadow_large = |
| 71 | - '0 0.05em 0.15em hsla(0, 0%, 0%, 0.1),' . |
|
| 72 | - '0 0.2em 0.5em hsla(0, 0%, 0%, 0.1),' . |
|
| 71 | + '0 0.05em 0.15em hsla(0, 0%, 0%, 0.1),'. |
|
| 72 | + '0 0.2em 0.5em hsla(0, 0%, 0%, 0.1),'. |
|
| 73 | 73 | '0 0.2em 1em hsla(0, 0%, 0%, 0.075)'; |
| 74 | 74 | $shadow_huge = |
| 75 | - '0 0.1em 0.25em hsla(0, 0%, 0%, 0.1),' . |
|
| 76 | - '0 0.25em 1em hsla(0, 0%, 0%, 0.1),' . |
|
| 75 | + '0 0.1em 0.25em hsla(0, 0%, 0%, 0.1),'. |
|
| 76 | + '0 0.25em 1em hsla(0, 0%, 0%, 0.1),'. |
|
| 77 | 77 | '0 0.5em 2em hsla(0, 0%, 0%, 0.075)'; |
| 78 | 78 | $vars->add('--spip-box-shadow-mini', $shadow_mini); |
| 79 | 79 | $vars->add('--spip-box-shadow-mini-hover', $shadow); |
@@ -94,7 +94,7 @@ discard block |
||
| 94 | 94 | } |
| 95 | 95 | |
| 96 | 96 | include_fichiers_fonctions(); |
| 97 | - foreach (array('filtre_' . $fonc, 'filtre_' . $fonc . '_dist', $fonc) as $f) { |
|
| 97 | + foreach (array('filtre_'.$fonc, 'filtre_'.$fonc.'_dist', $fonc) as $f) { |
|
| 98 | 98 | trouver_filtre_matrice($f); // charge des fichiers spécifiques éventuels |
| 99 | 99 | // fonction ou name\space\fonction |
| 100 | 100 | if (is_callable($f)) { |
@@ -221,7 +221,7 @@ discard block |
||
| 221 | 221 | // affichage "GIT [master: abcdef]" |
| 222 | 222 | $commit = isset($desc['commit_short']) ? $desc['commit_short'] : $desc['commit']; |
| 223 | 223 | if ($desc['branch']) { |
| 224 | - $commit = $desc['branch'] . ': ' . $commit; |
|
| 224 | + $commit = $desc['branch'].': '.$commit; |
|
| 225 | 225 | } |
| 226 | 226 | return "{$desc['vcs']} [$commit]"; |
| 227 | 227 | } |
@@ -240,9 +240,9 @@ discard block |
||
| 240 | 240 | } |
| 241 | 241 | |
| 242 | 242 | // version installee par GIT |
| 243 | - if (lire_fichier($dir . '/.git/HEAD', $c)) { |
|
| 243 | + if (lire_fichier($dir.'/.git/HEAD', $c)) { |
|
| 244 | 244 | $currentHead = trim(substr($c, 4)); |
| 245 | - if (lire_fichier($dir . '/.git/' . $currentHead, $hash)) { |
|
| 245 | + if (lire_fichier($dir.'/.git/'.$currentHead, $hash)) { |
|
| 246 | 246 | return [ |
| 247 | 247 | 'vcs' => 'GIT', |
| 248 | 248 | 'branch' => basename($currentHead), |
@@ -269,8 +269,8 @@ discard block |
||
| 269 | 269 | $dir = '.'; |
| 270 | 270 | } |
| 271 | 271 | // version installee par SVN |
| 272 | - if (file_exists($dir . '/.svn/wc.db') && class_exists('SQLite3')) { |
|
| 273 | - $db = new SQLite3($dir . '/.svn/wc.db'); |
|
| 272 | + if (file_exists($dir.'/.svn/wc.db') && class_exists('SQLite3')) { |
|
| 273 | + $db = new SQLite3($dir.'/.svn/wc.db'); |
|
| 274 | 274 | $result = $db->query('SELECT changed_revision FROM nodes WHERE local_relpath = "" LIMIT 1'); |
| 275 | 275 | if ($result) { |
| 276 | 276 | $row = $result->fetchArray(); |
@@ -309,12 +309,12 @@ discard block |
||
| 309 | 309 | |
| 310 | 310 | // La matrice est necessaire pour ne filtrer _que_ des fonctions definies dans filtres_images |
| 311 | 311 | // et laisser passer les fonctions personnelles baptisees image_... |
| 312 | -$GLOBALS['spip_matrice']['image_graver'] = true;//'inc/filtres_images_mini.php'; |
|
| 313 | -$GLOBALS['spip_matrice']['image_select'] = true;//'inc/filtres_images_mini.php'; |
|
| 314 | -$GLOBALS['spip_matrice']['image_reduire'] = true;//'inc/filtres_images_mini.php'; |
|
| 315 | -$GLOBALS['spip_matrice']['image_reduire_par'] = true;//'inc/filtres_images_mini.php'; |
|
| 316 | -$GLOBALS['spip_matrice']['image_passe_partout'] = true;//'inc/filtres_images_mini.php'; |
|
| 317 | -$GLOBALS['spip_matrice']['image_recadre_avec_fallback'] = true;//'inc/filtres_images_mini.php'; |
|
| 312 | +$GLOBALS['spip_matrice']['image_graver'] = true; //'inc/filtres_images_mini.php'; |
|
| 313 | +$GLOBALS['spip_matrice']['image_select'] = true; //'inc/filtres_images_mini.php'; |
|
| 314 | +$GLOBALS['spip_matrice']['image_reduire'] = true; //'inc/filtres_images_mini.php'; |
|
| 315 | +$GLOBALS['spip_matrice']['image_reduire_par'] = true; //'inc/filtres_images_mini.php'; |
|
| 316 | +$GLOBALS['spip_matrice']['image_passe_partout'] = true; //'inc/filtres_images_mini.php'; |
|
| 317 | +$GLOBALS['spip_matrice']['image_recadre_avec_fallback'] = true; //'inc/filtres_images_mini.php'; |
|
| 318 | 318 | |
| 319 | 319 | $GLOBALS['spip_matrice']['couleur_html_to_hex'] = 'inc/filtres_images_mini.php'; |
| 320 | 320 | $GLOBALS['spip_matrice']['couleur_hex_to_hsl'] = 'inc/filtres_images_mini.php'; |
@@ -473,8 +473,8 @@ discard block |
||
| 473 | 473 | */ |
| 474 | 474 | function filtre_debug($val, $key = null) { |
| 475 | 475 | $debug = ( |
| 476 | - is_null($key) ? '' : (var_export($key, true) . " = ") |
|
| 477 | - ) . var_export($val, true); |
|
| 476 | + is_null($key) ? '' : (var_export($key, true)." = ") |
|
| 477 | + ).var_export($val, true); |
|
| 478 | 478 | |
| 479 | 479 | include_spip('inc/autoriser'); |
| 480 | 480 | if (autoriser('webmestre')) { |
@@ -573,7 +573,7 @@ discard block |
||
| 573 | 573 | if (preg_match(",this[.]src=['\"]([^'\"]+)['\"],ims", $mouseover, $match)) { |
| 574 | 574 | $srcover = $match[1]; |
| 575 | 575 | array_shift($args); |
| 576 | - array_unshift($args, "<img src='" . $match[1] . "' />"); |
|
| 576 | + array_unshift($args, "<img src='".$match[1]."' />"); |
|
| 577 | 577 | $srcover_filter = call_user_func_array($filtre, $args); |
| 578 | 578 | $srcover_filter = extraire_attribut($srcover_filter, 'src'); |
| 579 | 579 | $reduit = str_replace($srcover, $srcover_filter, $reduit); |
@@ -644,14 +644,14 @@ discard block |
||
| 644 | 644 | $hauteur_img[$src] = $srcHeight = $srcsize[1]; |
| 645 | 645 | } |
| 646 | 646 | } |
| 647 | - elseif(strpos($src, "<svg") !== false) { |
|
| 647 | + elseif (strpos($src, "<svg") !== false) { |
|
| 648 | 648 | include_spip('inc/svg'); |
| 649 | - if ($attrs = svg_lire_attributs($src)){ |
|
| 649 | + if ($attrs = svg_lire_attributs($src)) { |
|
| 650 | 650 | list($width, $height, $viewbox) = svg_getimagesize_from_attr($attrs); |
| 651 | - if (!$srcWidth){ |
|
| 651 | + if (!$srcWidth) { |
|
| 652 | 652 | $largeur_img[$src] = $srcWidth = $width; |
| 653 | 653 | } |
| 654 | - if (!$srcHeight){ |
|
| 654 | + if (!$srcHeight) { |
|
| 655 | 655 | $hauteur_img[$src] = $srcHeight = $height; |
| 656 | 656 | } |
| 657 | 657 | } |
@@ -935,7 +935,7 @@ discard block |
||
| 935 | 935 | // " -> " et tout ce genre de choses |
| 936 | 936 | $u = $GLOBALS['meta']['pcre_u']; |
| 937 | 937 | $texte = str_replace(" ", " ", $texte); |
| 938 | - $texte = preg_replace('/\s{2,}/S' . $u, " ", $texte); |
|
| 938 | + $texte = preg_replace('/\s{2,}/S'.$u, " ", $texte); |
|
| 939 | 939 | // ne pas echapper les sinqle quotes car certains outils de syndication gerent mal |
| 940 | 940 | $texte = entites_html($texte, false, false); |
| 941 | 941 | // mais bien echapper les double quotes ! |
@@ -995,7 +995,7 @@ discard block |
||
| 995 | 995 | **/ |
| 996 | 996 | function supprimer_numero($texte) { |
| 997 | 997 | return preg_replace( |
| 998 | - ",^[[:space:]]*([0-9]+)([.)]|" . chr(194) . '?' . chr(176) . ")[[:space:]]+,S", |
|
| 998 | + ",^[[:space:]]*([0-9]+)([.)]|".chr(194).'?'.chr(176).")[[:space:]]+,S", |
|
| 999 | 999 | "", $texte); |
| 1000 | 1000 | } |
| 1001 | 1001 | |
@@ -1020,7 +1020,7 @@ discard block |
||
| 1020 | 1020 | **/ |
| 1021 | 1021 | function recuperer_numero($texte) { |
| 1022 | 1022 | if (preg_match( |
| 1023 | - ",^[[:space:]]*([0-9]+)([.)]|" . chr(194) . '?' . chr(176) . ")[[:space:]]+,S", |
|
| 1023 | + ",^[[:space:]]*([0-9]+)([.)]|".chr(194).'?'.chr(176).")[[:space:]]+,S", |
|
| 1024 | 1024 | $texte, $regs)) { |
| 1025 | 1025 | return strval($regs[1]); |
| 1026 | 1026 | } else { |
@@ -1105,8 +1105,8 @@ discard block |
||
| 1105 | 1105 | **/ |
| 1106 | 1106 | function textebrut($texte) { |
| 1107 | 1107 | $u = $GLOBALS['meta']['pcre_u']; |
| 1108 | - $texte = preg_replace('/\s+/S' . $u, " ", $texte); |
|
| 1109 | - $texte = preg_replace("/<(p|br)( [^>]*)?" . ">/iS", "\n\n", $texte); |
|
| 1108 | + $texte = preg_replace('/\s+/S'.$u, " ", $texte); |
|
| 1109 | + $texte = preg_replace("/<(p|br)( [^>]*)?".">/iS", "\n\n", $texte); |
|
| 1110 | 1110 | $texte = preg_replace("/^\n+/", "", $texte); |
| 1111 | 1111 | $texte = preg_replace("/\n+$/", "", $texte); |
| 1112 | 1112 | $texte = preg_replace("/\n +/", "\n", $texte); |
@@ -1134,7 +1134,7 @@ discard block |
||
| 1134 | 1134 | if (preg_match_all(",(<a\s+[^>]*https?://[^>]*class=[\"']spip_(out|url)\b[^>]+>),imsS", |
| 1135 | 1135 | $texte, $liens, PREG_PATTERN_ORDER)) { |
| 1136 | 1136 | foreach ($liens[0] as $a) { |
| 1137 | - $rel = 'noopener noreferrer ' . extraire_attribut($a, 'rel'); |
|
| 1137 | + $rel = 'noopener noreferrer '.extraire_attribut($a, 'rel'); |
|
| 1138 | 1138 | $ablank = inserer_attribut($a, 'rel', $rel); |
| 1139 | 1139 | $ablank = inserer_attribut($ablank, 'target', '_blank'); |
| 1140 | 1140 | $texte = str_replace($a, $ablank, $texte); |
@@ -1159,7 +1159,7 @@ discard block |
||
| 1159 | 1159 | foreach ($regs[0] as $a) { |
| 1160 | 1160 | $rel = extraire_attribut($a, "rel"); |
| 1161 | 1161 | if (strpos($rel, "nofollow") === false) { |
| 1162 | - $rel = "nofollow" . ($rel ? " $rel" : ""); |
|
| 1162 | + $rel = "nofollow".($rel ? " $rel" : ""); |
|
| 1163 | 1163 | $anofollow = inserer_attribut($a, "rel", $rel); |
| 1164 | 1164 | $texte = str_replace($a, $anofollow, $texte); |
| 1165 | 1165 | } |
@@ -1188,7 +1188,7 @@ discard block |
||
| 1188 | 1188 | $u = $GLOBALS['meta']['pcre_u']; |
| 1189 | 1189 | $texte = preg_replace("@</p>@iS", "\n", $texte); |
| 1190 | 1190 | $texte = preg_replace("@<p\b.*>@UiS", "<br />", $texte); |
| 1191 | - $texte = preg_replace("@^\s*<br />@S" . $u, "", $texte); |
|
| 1191 | + $texte = preg_replace("@^\s*<br />@S".$u, "", $texte); |
|
| 1192 | 1192 | |
| 1193 | 1193 | return $texte; |
| 1194 | 1194 | } |
@@ -1218,7 +1218,7 @@ discard block |
||
| 1218 | 1218 | return $texte; |
| 1219 | 1219 | } |
| 1220 | 1220 | include_spip('inc/texte'); |
| 1221 | - $tag = preg_match(',</?(' . _BALISES_BLOCS . ')[>[:space:]],iS', $texte) ? |
|
| 1221 | + $tag = preg_match(',</?('._BALISES_BLOCS.')[>[:space:]],iS', $texte) ? |
|
| 1222 | 1222 | 'div' : 'span'; |
| 1223 | 1223 | |
| 1224 | 1224 | return "<$tag style='word-wrap:break-word;'>$texte</$tag>"; |
@@ -1327,7 +1327,7 @@ discard block |
||
| 1327 | 1327 | function attribut_html($texte, $textebrut = true) { |
| 1328 | 1328 | $u = $GLOBALS['meta']['pcre_u']; |
| 1329 | 1329 | if ($textebrut) { |
| 1330 | - $texte = preg_replace(array(",\n,", ",\s(?=\s),msS" . $u), array(" ", ""), textebrut($texte)); |
|
| 1330 | + $texte = preg_replace(array(",\n,", ",\s(?=\s),msS".$u), array(" ", ""), textebrut($texte)); |
|
| 1331 | 1331 | } |
| 1332 | 1332 | $texte = texte_backend($texte); |
| 1333 | 1333 | $texte = str_replace(array("'", '"'), array(''', '"'), $texte); |
@@ -1356,7 +1356,7 @@ discard block |
||
| 1356 | 1356 | # un message pour abs_url |
| 1357 | 1357 | $GLOBALS['mode_abs_url'] = 'url'; |
| 1358 | 1358 | $url = trim($url); |
| 1359 | - $r = ",^(?:" . _PROTOCOLES_STD . '):?/?/?$,iS'; |
|
| 1359 | + $r = ",^(?:"._PROTOCOLES_STD.'):?/?/?$,iS'; |
|
| 1360 | 1360 | |
| 1361 | 1361 | return preg_match($r, $url) ? '' : ($entites ? entites_html($url) : $url); |
| 1362 | 1362 | } |
@@ -1558,14 +1558,14 @@ discard block |
||
| 1558 | 1558 | if (strpos($texte, "<") !== false) { |
| 1559 | 1559 | include_spip('inc/lien'); |
| 1560 | 1560 | if (defined('_PREG_MODELE')) { |
| 1561 | - $preg_modeles = "@" . _PREG_MODELE . "@imsS"; |
|
| 1561 | + $preg_modeles = "@"._PREG_MODELE."@imsS"; |
|
| 1562 | 1562 | $texte = echappe_html($texte, '', true, $preg_modeles); |
| 1563 | 1563 | } |
| 1564 | 1564 | } |
| 1565 | 1565 | |
| 1566 | 1566 | $debut = ''; |
| 1567 | 1567 | $suite = $texte; |
| 1568 | - while ($t = strpos('-' . $suite, "\n", 1)) { |
|
| 1568 | + while ($t = strpos('-'.$suite, "\n", 1)) { |
|
| 1569 | 1569 | $debut .= substr($suite, 0, $t - 1); |
| 1570 | 1570 | $suite = substr($suite, $t); |
| 1571 | 1571 | $car = substr($suite, 0, 1); |
@@ -1582,11 +1582,11 @@ discard block |
||
| 1582 | 1582 | $suite = substr($suite, strlen($regs[0])); |
| 1583 | 1583 | } |
| 1584 | 1584 | } |
| 1585 | - $texte = $debut . $suite; |
|
| 1585 | + $texte = $debut.$suite; |
|
| 1586 | 1586 | |
| 1587 | 1587 | $texte = echappe_retour($texte); |
| 1588 | 1588 | |
| 1589 | - return $texte . $fin; |
|
| 1589 | + return $texte.$fin; |
|
| 1590 | 1590 | } |
| 1591 | 1591 | |
| 1592 | 1592 | |
@@ -1647,7 +1647,7 @@ discard block |
||
| 1647 | 1647 | } |
| 1648 | 1648 | |
| 1649 | 1649 | foreach ($regs as $reg) { |
| 1650 | - $cle = ($reg[1] ? $reg[1] . ':' : '') . $reg[2]; |
|
| 1650 | + $cle = ($reg[1] ? $reg[1].':' : '').$reg[2]; |
|
| 1651 | 1651 | $desc = $traduire($cle, $lang, true); |
| 1652 | 1652 | $l = $desc->langue; |
| 1653 | 1653 | // si pas de traduction, on laissera l'écriture de l'idiome entier dans le texte. |
@@ -1760,9 +1760,9 @@ discard block |
||
| 1760 | 1760 | // il ne faut pas echapper en div si propre produit un seul paragraphe |
| 1761 | 1761 | include_spip('inc/texte'); |
| 1762 | 1762 | $trad_propre = preg_replace(",(^<p[^>]*>|</p>$),Uims", "", propre($trad)); |
| 1763 | - $mode = preg_match(',</?(' . _BALISES_BLOCS . ')[>[:space:]],iS', $trad_propre) ? 'div' : 'span'; |
|
| 1763 | + $mode = preg_match(',</?('._BALISES_BLOCS.')[>[:space:]],iS', $trad_propre) ? 'div' : 'span'; |
|
| 1764 | 1764 | if ($mode === 'div') { |
| 1765 | - $trad = rtrim($trad) . "\n\n"; |
|
| 1765 | + $trad = rtrim($trad)."\n\n"; |
|
| 1766 | 1766 | } |
| 1767 | 1767 | $trad = code_echappement($trad, 'multi', false, $mode); |
| 1768 | 1768 | $trad = str_replace("'", '"', inserer_attribut($trad, 'lang', $l)); |
@@ -1956,7 +1956,7 @@ discard block |
||
| 1956 | 1956 | if (is_array($balise)) { |
| 1957 | 1957 | array_walk( |
| 1958 | 1958 | $balise, |
| 1959 | - function(&$a, $key, $t){ |
|
| 1959 | + function(&$a, $key, $t) { |
|
| 1960 | 1960 | $a = extraire_attribut($a, $t); |
| 1961 | 1961 | }, |
| 1962 | 1962 | $attribut |
@@ -2043,14 +2043,14 @@ discard block |
||
| 2043 | 2043 | |
| 2044 | 2044 | if ($old !== null) { |
| 2045 | 2045 | // Remplacer l'ancien attribut du meme nom |
| 2046 | - $balise = $r[1] . $insert . $r[5]; |
|
| 2046 | + $balise = $r[1].$insert.$r[5]; |
|
| 2047 | 2047 | } else { |
| 2048 | 2048 | // preferer une balise " />" (comme <img />) |
| 2049 | 2049 | if (preg_match(',/>,', $balise)) { |
| 2050 | - $balise = preg_replace(",\s?/>,S", $insert . " />", $balise, 1); |
|
| 2050 | + $balise = preg_replace(",\s?/>,S", $insert." />", $balise, 1); |
|
| 2051 | 2051 | } // sinon une balise <a ...> ... </a> |
| 2052 | 2052 | else { |
| 2053 | - $balise = preg_replace(",\s?>,S", $insert . ">", $balise, 1); |
|
| 2053 | + $balise = preg_replace(",\s?>,S", $insert.">", $balise, 1); |
|
| 2054 | 2054 | } |
| 2055 | 2055 | } |
| 2056 | 2056 | |
@@ -2083,7 +2083,7 @@ discard block |
||
| 2083 | 2083 | * @param string $operation |
| 2084 | 2084 | * @return string |
| 2085 | 2085 | */ |
| 2086 | -function modifier_class($balise, $class, $operation='ajouter') { |
|
| 2086 | +function modifier_class($balise, $class, $operation = 'ajouter') { |
|
| 2087 | 2087 | if (is_string($class)) { |
| 2088 | 2088 | $class = explode(' ', trim($class)); |
| 2089 | 2089 | } |
@@ -2108,7 +2108,7 @@ discard block |
||
| 2108 | 2108 | } |
| 2109 | 2109 | if (in_array($operation, ['ajouter', 'commuter']) |
| 2110 | 2110 | and !$is_class_presente) { |
| 2111 | - $class_new = rtrim($class_new) . " " . $c; |
|
| 2111 | + $class_new = rtrim($class_new)." ".$c; |
|
| 2112 | 2112 | } |
| 2113 | 2113 | elseif (in_array($operation, ['supprimer', 'commuter']) |
| 2114 | 2114 | and $is_class_presente) { |
@@ -2136,7 +2136,7 @@ discard block |
||
| 2136 | 2136 | * @param string|array $class |
| 2137 | 2137 | * @return string |
| 2138 | 2138 | */ |
| 2139 | -function ajouter_class($balise, $class){ |
|
| 2139 | +function ajouter_class($balise, $class) { |
|
| 2140 | 2140 | return modifier_class($balise, $class, 'ajouter'); |
| 2141 | 2141 | } |
| 2142 | 2142 | |
@@ -2146,7 +2146,7 @@ discard block |
||
| 2146 | 2146 | * @param string|array $class |
| 2147 | 2147 | * @return string |
| 2148 | 2148 | */ |
| 2149 | -function supprimer_class($balise, $class){ |
|
| 2149 | +function supprimer_class($balise, $class) { |
|
| 2150 | 2150 | return modifier_class($balise, $class, 'supprimer'); |
| 2151 | 2151 | } |
| 2152 | 2152 | |
@@ -2157,7 +2157,7 @@ discard block |
||
| 2157 | 2157 | * @param string|array $class |
| 2158 | 2158 | * @return string |
| 2159 | 2159 | */ |
| 2160 | -function commuter_class($balise, $class){ |
|
| 2160 | +function commuter_class($balise, $class) { |
|
| 2161 | 2161 | return modifier_class($balise, $class, 'commuter'); |
| 2162 | 2162 | } |
| 2163 | 2163 | |
@@ -2177,8 +2177,8 @@ discard block |
||
| 2177 | 2177 | // |
| 2178 | 2178 | // Quelques fonctions de calcul arithmetique |
| 2179 | 2179 | // |
| 2180 | -function floatstr($a) { return str_replace(',','.',(string)floatval($a)); } |
|
| 2181 | -function strize($f, $a, $b) { return floatstr($f(floatstr($a),floatstr($b))); } |
|
| 2180 | +function floatstr($a) { return str_replace(',', '.', (string) floatval($a)); } |
|
| 2181 | +function strize($f, $a, $b) { return floatstr($f(floatstr($a), floatstr($b))); } |
|
| 2182 | 2182 | |
| 2183 | 2183 | /** |
| 2184 | 2184 | * Additionne 2 nombres |
@@ -2198,7 +2198,7 @@ discard block |
||
| 2198 | 2198 | function plus($a, $b) { |
| 2199 | 2199 | return $a + $b; |
| 2200 | 2200 | } |
| 2201 | -function strplus($a, $b) {return strize('plus', $a, $b);} |
|
| 2201 | +function strplus($a, $b) {return strize('plus', $a, $b); } |
|
| 2202 | 2202 | /** |
| 2203 | 2203 | * Soustrait 2 nombres |
| 2204 | 2204 | * |
@@ -2217,7 +2217,7 @@ discard block |
||
| 2217 | 2217 | function moins($a, $b) { |
| 2218 | 2218 | return $a - $b; |
| 2219 | 2219 | } |
| 2220 | -function strmoins($a, $b) {return strize('moins', $a, $b);} |
|
| 2220 | +function strmoins($a, $b) {return strize('moins', $a, $b); } |
|
| 2221 | 2221 | |
| 2222 | 2222 | /** |
| 2223 | 2223 | * Multiplie 2 nombres |
@@ -2238,7 +2238,7 @@ discard block |
||
| 2238 | 2238 | function mult($a, $b) { |
| 2239 | 2239 | return $a * $b; |
| 2240 | 2240 | } |
| 2241 | -function strmult($a, $b) {return strize('mult', $a, $b);} |
|
| 2241 | +function strmult($a, $b) {return strize('mult', $a, $b); } |
|
| 2242 | 2242 | |
| 2243 | 2243 | /** |
| 2244 | 2244 | * Divise 2 nombres |
@@ -2259,7 +2259,7 @@ discard block |
||
| 2259 | 2259 | function div($a, $b) { |
| 2260 | 2260 | return $b ? $a / $b : 0; |
| 2261 | 2261 | } |
| 2262 | -function strdiv($a, $b) {return strize('div', $a, $b);} |
|
| 2262 | +function strdiv($a, $b) {return strize('div', $a, $b); } |
|
| 2263 | 2263 | |
| 2264 | 2264 | /** |
| 2265 | 2265 | * Retourne le modulo 2 nombres |
@@ -2300,13 +2300,13 @@ discard block |
||
| 2300 | 2300 | if (!defined('_TAGS_NOM_AUTEUR')) { |
| 2301 | 2301 | define('_TAGS_NOM_AUTEUR', ''); |
| 2302 | 2302 | } |
| 2303 | - $tags_acceptes = array_unique(explode(',', 'multi,' . _TAGS_NOM_AUTEUR)); |
|
| 2303 | + $tags_acceptes = array_unique(explode(',', 'multi,'._TAGS_NOM_AUTEUR)); |
|
| 2304 | 2304 | foreach ($tags_acceptes as $tag) { |
| 2305 | 2305 | if (strlen($tag)) { |
| 2306 | - $remp1[] = '<' . trim($tag) . '>'; |
|
| 2307 | - $remp1[] = '</' . trim($tag) . '>'; |
|
| 2308 | - $remp2[] = '\x60' . trim($tag) . '\x61'; |
|
| 2309 | - $remp2[] = '\x60/' . trim($tag) . '\x61'; |
|
| 2306 | + $remp1[] = '<'.trim($tag).'>'; |
|
| 2307 | + $remp1[] = '</'.trim($tag).'>'; |
|
| 2308 | + $remp2[] = '\x60'.trim($tag).'\x61'; |
|
| 2309 | + $remp2[] = '\x60/'.trim($tag).'\x61'; |
|
| 2310 | 2310 | } |
| 2311 | 2311 | } |
| 2312 | 2312 | $v_nom = str_replace($remp2, $remp1, supprimer_tags(str_replace($remp1, $remp2, $nom))); |
@@ -2356,7 +2356,7 @@ discard block |
||
| 2356 | 2356 | $s[] = preg_replace(',>[^<]+</a>,S', |
| 2357 | 2357 | '>' |
| 2358 | 2358 | . http_img_pack('attachment-16.png', $t, |
| 2359 | - 'title="' . attribut_html($t) . '"') |
|
| 2359 | + 'title="'.attribut_html($t).'"') |
|
| 2360 | 2360 | . '</a>', $tag); |
| 2361 | 2361 | } |
| 2362 | 2362 | } |
@@ -2417,10 +2417,10 @@ discard block |
||
| 2417 | 2417 | $fichier = basename($url); |
| 2418 | 2418 | |
| 2419 | 2419 | return '<a rel="enclosure"' |
| 2420 | - . ($url ? ' href="' . spip_htmlspecialchars($url) . '"' : '') |
|
| 2421 | - . ($type ? ' type="' . spip_htmlspecialchars($type) . '"' : '') |
|
| 2422 | - . ($length ? ' title="' . spip_htmlspecialchars($length) . '"' : '') |
|
| 2423 | - . '>' . $fichier . '</a>'; |
|
| 2420 | + . ($url ? ' href="'.spip_htmlspecialchars($url).'"' : '') |
|
| 2421 | + . ($type ? ' type="'.spip_htmlspecialchars($type).'"' : '') |
|
| 2422 | + . ($length ? ' title="'.spip_htmlspecialchars($length).'"' : '') |
|
| 2423 | + . '>'.$fichier.'</a>'; |
|
| 2424 | 2424 | } |
| 2425 | 2425 | |
| 2426 | 2426 | /** |
@@ -2448,9 +2448,9 @@ discard block |
||
| 2448 | 2448 | } # vieux data |
| 2449 | 2449 | $fichier = basename($url); |
| 2450 | 2450 | $enclosures[] = '<enclosure' |
| 2451 | - . ($url ? ' url="' . spip_htmlspecialchars($url) . '"' : '') |
|
| 2452 | - . ($type ? ' type="' . spip_htmlspecialchars($type) . '"' : '') |
|
| 2453 | - . ($length ? ' length="' . $length . '"' : '') |
|
| 2451 | + . ($url ? ' url="'.spip_htmlspecialchars($url).'"' : '') |
|
| 2452 | + . ($type ? ' type="'.spip_htmlspecialchars($type).'"' : '') |
|
| 2453 | + . ($length ? ' length="'.$length.'"' : '') |
|
| 2454 | 2454 | . ' />'; |
| 2455 | 2455 | } |
| 2456 | 2456 | } |
@@ -2476,7 +2476,7 @@ discard block |
||
| 2476 | 2476 | if (extraire_attribut($e, 'rel') == 'tag') { |
| 2477 | 2477 | $subjects .= '<dc:subject>' |
| 2478 | 2478 | . texte_backend(textebrut($e)) |
| 2479 | - . '</dc:subject>' . "\n"; |
|
| 2479 | + . '</dc:subject>'."\n"; |
|
| 2480 | 2480 | } |
| 2481 | 2481 | } |
| 2482 | 2482 | |
@@ -2512,7 +2512,7 @@ discard block |
||
| 2512 | 2512 | if (is_array($texte)) { |
| 2513 | 2513 | array_walk( |
| 2514 | 2514 | $texte, |
| 2515 | - function(&$a, $key, $t){ |
|
| 2515 | + function(&$a, $key, $t) { |
|
| 2516 | 2516 | $a = extraire_balise($a, $t); |
| 2517 | 2517 | }, |
| 2518 | 2518 | $tag |
@@ -2556,7 +2556,7 @@ discard block |
||
| 2556 | 2556 | if (is_array($texte)) { |
| 2557 | 2557 | array_walk( |
| 2558 | 2558 | $texte, |
| 2559 | - function(&$a, $key, $t){ |
|
| 2559 | + function(&$a, $key, $t) { |
|
| 2560 | 2560 | $a = extraire_balises($a, $t); |
| 2561 | 2561 | }, |
| 2562 | 2562 | $tag |
@@ -2682,7 +2682,7 @@ discard block |
||
| 2682 | 2682 | if ($fond != '404') { |
| 2683 | 2683 | $contexte = array_shift($p); |
| 2684 | 2684 | $contexte['page'] = $fond; |
| 2685 | - $action = preg_replace('/([?]' . preg_quote($fond) . '[^&=]*[0-9]+)(&|$)/', '?&', $action); |
|
| 2685 | + $action = preg_replace('/([?]'.preg_quote($fond).'[^&=]*[0-9]+)(&|$)/', '?&', $action); |
|
| 2686 | 2686 | } |
| 2687 | 2687 | } |
| 2688 | 2688 | // defaire ce qu'a injecte urls_decoder_url : a revoir en modifiant la signature de urls_decoder_url |
@@ -2737,9 +2737,9 @@ discard block |
||
| 2737 | 2737 | . '"' |
| 2738 | 2738 | . (is_null($val) |
| 2739 | 2739 | ? '' |
| 2740 | - : ' value="' . entites_html($val) . '"' |
|
| 2740 | + : ' value="'.entites_html($val).'"' |
|
| 2741 | 2741 | ) |
| 2742 | - . ' type="hidden"' . "\n/>"; |
|
| 2742 | + . ' type="hidden"'."\n/>"; |
|
| 2743 | 2743 | } |
| 2744 | 2744 | |
| 2745 | 2745 | return join("", $hidden); |
@@ -2850,7 +2850,7 @@ discard block |
||
| 2850 | 2850 | return preg_replace_callback( |
| 2851 | 2851 | ",url\s*\(\s*['\"]?([^'\"/#\s][^:]*)['\"]?\s*\),Uims", |
| 2852 | 2852 | function($x) use ($path) { |
| 2853 | - return "url('" . suivre_lien($path, $x[1]) . "')"; |
|
| 2853 | + return "url('".suivre_lien($path, $x[1])."')"; |
|
| 2854 | 2854 | }, |
| 2855 | 2855 | $contenu |
| 2856 | 2856 | ); |
@@ -2912,14 +2912,14 @@ discard block |
||
| 2912 | 2912 | ) { |
| 2913 | 2913 | $distant = true; |
| 2914 | 2914 | $cssf = parse_url($css); |
| 2915 | - $cssf = $cssf['path'] . ($cssf['query'] ? "?" . $cssf['query'] : ""); |
|
| 2915 | + $cssf = $cssf['path'].($cssf['query'] ? "?".$cssf['query'] : ""); |
|
| 2916 | 2916 | $cssf = preg_replace(',[?:&=],', "_", $cssf); |
| 2917 | 2917 | } else { |
| 2918 | 2918 | $distant = false; |
| 2919 | 2919 | $cssf = $css; |
| 2920 | 2920 | // 1. regarder d'abord si un fichier avec la bonne direction n'est pas aussi |
| 2921 | 2921 | //propose (rien a faire dans ce cas) |
| 2922 | - $f = preg_replace(',(_rtl)?\.css$,i', '_' . $ndir . '.css', $css); |
|
| 2922 | + $f = preg_replace(',(_rtl)?\.css$,i', '_'.$ndir.'.css', $css); |
|
| 2923 | 2923 | if (@file_exists($f)) { |
| 2924 | 2924 | return $f; |
| 2925 | 2925 | } |
@@ -2929,7 +2929,7 @@ discard block |
||
| 2929 | 2929 | $dir_var = sous_repertoire(_DIR_VAR, 'cache-css'); |
| 2930 | 2930 | $f = $dir_var |
| 2931 | 2931 | . preg_replace(',.*/(.*?)(_rtl)?\.css,', '\1', $cssf) |
| 2932 | - . '.' . substr(md5($cssf), 0, 4) . '_' . $ndir . '.css'; |
|
| 2932 | + . '.'.substr(md5($cssf), 0, 4).'_'.$ndir.'.css'; |
|
| 2933 | 2933 | |
| 2934 | 2934 | // la css peut etre distante (url absolue !) |
| 2935 | 2935 | if ($distant) { |
@@ -2974,8 +2974,8 @@ discard block |
||
| 2974 | 2974 | } // si la css_direction commence par $dir_var on la fait passer pour une absolue |
| 2975 | 2975 | elseif (substr($css_direction, 0, strlen($dir_var)) == $dir_var) { |
| 2976 | 2976 | $css_direction = substr($css_direction, strlen($dir_var)); |
| 2977 | - $src_faux_abs["/@@@@@@/" . $css_direction] = $css_direction; |
|
| 2978 | - $css_direction = "/@@@@@@/" . $css_direction; |
|
| 2977 | + $src_faux_abs["/@@@@@@/".$css_direction] = $css_direction; |
|
| 2978 | + $css_direction = "/@@@@@@/".$css_direction; |
|
| 2979 | 2979 | } |
| 2980 | 2980 | $src[] = $regs[0][$k]; |
| 2981 | 2981 | $src_direction_css[] = str_replace($import_css, $css_direction, $regs[0][$k]); |
@@ -3024,7 +3024,7 @@ discard block |
||
| 3024 | 3024 | |
| 3025 | 3025 | $f = basename($css, '.css'); |
| 3026 | 3026 | $f = sous_repertoire(_DIR_VAR, 'cache-css') |
| 3027 | - . preg_replace(",(.*?)(_rtl|_ltr)?$,", "\\1-urlabs-" . substr(md5("$css-urlabs"), 0, 4) . "\\2", $f) |
|
| 3027 | + . preg_replace(",(.*?)(_rtl|_ltr)?$,", "\\1-urlabs-".substr(md5("$css-urlabs"), 0, 4)."\\2", $f) |
|
| 3028 | 3028 | . '.css'; |
| 3029 | 3029 | |
| 3030 | 3030 | if ((@filemtime($f) > @filemtime($css)) and (_VAR_MODE != 'recalcul')) { |
@@ -3033,7 +3033,7 @@ discard block |
||
| 3033 | 3033 | |
| 3034 | 3034 | if ($url_absolue_css == $css) { |
| 3035 | 3035 | if (strncmp($GLOBALS['meta']['adresse_site'], $css, $l = strlen($GLOBALS['meta']['adresse_site'])) != 0 |
| 3036 | - or !lire_fichier(_DIR_RACINE . substr($css, $l), $contenu) |
|
| 3036 | + or !lire_fichier(_DIR_RACINE.substr($css, $l), $contenu) |
|
| 3037 | 3037 | ) { |
| 3038 | 3038 | include_spip('inc/distant'); |
| 3039 | 3039 | if (!$contenu = recuperer_page($css)) { |
@@ -3143,7 +3143,7 @@ discard block |
||
| 3143 | 3143 | $expression = str_replace("\/", "/", $expression); |
| 3144 | 3144 | $expression = str_replace("/", "\/", $expression); |
| 3145 | 3145 | |
| 3146 | - if (preg_match('/' . $expression . '/' . $modif, $texte, $r)) { |
|
| 3146 | + if (preg_match('/'.$expression.'/'.$modif, $texte, $r)) { |
|
| 3147 | 3147 | if (isset($r[$capte])) { |
| 3148 | 3148 | return $r[$capte]; |
| 3149 | 3149 | } else { |
@@ -3181,7 +3181,7 @@ discard block |
||
| 3181 | 3181 | $expression = str_replace("\/", "/", $expression); |
| 3182 | 3182 | $expression = str_replace("/", "\/", $expression); |
| 3183 | 3183 | |
| 3184 | - return preg_replace('/' . $expression . '/' . $modif, $replace, $texte); |
|
| 3184 | + return preg_replace('/'.$expression.'/'.$modif, $replace, $texte); |
|
| 3185 | 3185 | } |
| 3186 | 3186 | |
| 3187 | 3187 | |
@@ -3200,7 +3200,7 @@ discard block |
||
| 3200 | 3200 | function traiter_doublons_documents(&$doublons, $letexte) { |
| 3201 | 3201 | |
| 3202 | 3202 | // Verifier dans le texte & les notes (pas beau, helas) |
| 3203 | - $t = $letexte . $GLOBALS['les_notes']; |
|
| 3203 | + $t = $letexte.$GLOBALS['les_notes']; |
|
| 3204 | 3204 | |
| 3205 | 3205 | if (strstr($t, 'spip_document_') // evite le preg_match_all si inutile |
| 3206 | 3206 | and preg_match_all( |
@@ -3210,7 +3210,7 @@ discard block |
||
| 3210 | 3210 | if (!isset($doublons['documents'])) { |
| 3211 | 3211 | $doublons['documents'] = ""; |
| 3212 | 3212 | } |
| 3213 | - $doublons['documents'] .= "," . join(',', $matches[1]); |
|
| 3213 | + $doublons['documents'] .= ",".join(',', $matches[1]); |
|
| 3214 | 3214 | } |
| 3215 | 3215 | |
| 3216 | 3216 | return $letexte; |
@@ -3267,7 +3267,7 @@ discard block |
||
| 3267 | 3267 | if ($env) { |
| 3268 | 3268 | foreach ($env as $i => $j) { |
| 3269 | 3269 | if (is_string($j) and !in_array($i, $ignore_params)) { |
| 3270 | - $texte .= "<param name='" . attribut_html($i) . "'\n\tvalue='" . attribut_html($j) . "' />"; |
|
| 3270 | + $texte .= "<param name='".attribut_html($i)."'\n\tvalue='".attribut_html($j)."' />"; |
|
| 3271 | 3271 | } |
| 3272 | 3272 | } |
| 3273 | 3273 | } |
@@ -3306,7 +3306,7 @@ discard block |
||
| 3306 | 3306 | if ($env) { |
| 3307 | 3307 | foreach ($env as $i => $j) { |
| 3308 | 3308 | if (is_string($j) and !in_array($i, $ignore_params)) { |
| 3309 | - $texte .= attribut_html($i) . "='" . attribut_html($j) . "' "; |
|
| 3309 | + $texte .= attribut_html($i)."='".attribut_html($j)."' "; |
|
| 3310 | 3310 | } |
| 3311 | 3311 | } |
| 3312 | 3312 | } |
@@ -3390,19 +3390,19 @@ discard block |
||
| 3390 | 3390 | |
| 3391 | 3391 | $img_file = $img; |
| 3392 | 3392 | if ($p = strpos($img_file, '?')) { |
| 3393 | - $img_file = substr($img_file,0, $p); |
|
| 3393 | + $img_file = substr($img_file, 0, $p); |
|
| 3394 | 3394 | } |
| 3395 | 3395 | if (!isset($options['chemin_image']) or $options['chemin_image'] == true) { |
| 3396 | 3396 | $img_file = chemin_image($img); |
| 3397 | 3397 | } |
| 3398 | 3398 | else { |
| 3399 | - if (!isset($options['variante_svg_si_possible']) or $options['variante_svg_si_possible'] == true){ |
|
| 3399 | + if (!isset($options['variante_svg_si_possible']) or $options['variante_svg_si_possible'] == true) { |
|
| 3400 | 3400 | // on peut fournir une icone generique -xx.svg qui fera le job dans toutes les tailles, et qui est prioritaire sur le png |
| 3401 | 3401 | // si il y a un .svg a la bonne taille (-16.svg) a cote, on l'utilise en remplacement du -16.png |
| 3402 | 3402 | if (preg_match(',-(\d+)[.](png|gif|svg)$,', $img_file, $m) |
| 3403 | - and $variante_svg_generique = substr($img_file, 0, -strlen($m[0])) . "-xx.svg" |
|
| 3403 | + and $variante_svg_generique = substr($img_file, 0, -strlen($m[0]))."-xx.svg" |
|
| 3404 | 3404 | and file_exists($variante_svg_generique)) { |
| 3405 | - if ($variante_svg_size = substr($variante_svg_generique,0,-6) . $m[1] . ".svg" and file_exists($variante_svg_size)) { |
|
| 3405 | + if ($variante_svg_size = substr($variante_svg_generique, 0, -6).$m[1].".svg" and file_exists($variante_svg_size)) { |
|
| 3406 | 3406 | $img_file = $variante_svg_size; |
| 3407 | 3407 | } |
| 3408 | 3408 | else { |
@@ -3427,7 +3427,7 @@ discard block |
||
| 3427 | 3427 | return ""; |
| 3428 | 3428 | } |
| 3429 | 3429 | } |
| 3430 | - $atts .= " width='" . $largeur . "' height='" . $hauteur . "'"; |
|
| 3430 | + $atts .= " width='".$largeur."' height='".$hauteur."'"; |
|
| 3431 | 3431 | } |
| 3432 | 3432 | |
| 3433 | 3433 | if (file_exists($img_file)) { |
@@ -3436,15 +3436,15 @@ discard block |
||
| 3436 | 3436 | if ($alt === false) { |
| 3437 | 3437 | $alt = ''; |
| 3438 | 3438 | } |
| 3439 | - elseif($alt or $alt==='') { |
|
| 3439 | + elseif ($alt or $alt === '') { |
|
| 3440 | 3440 | $alt = " alt='".attribut_html($alt)."'"; |
| 3441 | 3441 | } |
| 3442 | 3442 | else { |
| 3443 | 3443 | $alt = " alt='".attribut_html($title)."'"; |
| 3444 | 3444 | } |
| 3445 | 3445 | return "<img src='$img_file'$alt" |
| 3446 | - . ($title ? ' title="' . attribut_html($title) . '"' : '') |
|
| 3447 | - . " " . ltrim($atts) |
|
| 3446 | + . ($title ? ' title="'.attribut_html($title).'"' : '') |
|
| 3447 | + . " ".ltrim($atts) |
|
| 3448 | 3448 | . " />"; |
| 3449 | 3449 | } |
| 3450 | 3450 | |
@@ -3456,12 +3456,12 @@ discard block |
||
| 3456 | 3456 | * @param string $size |
| 3457 | 3457 | * @return string |
| 3458 | 3458 | */ |
| 3459 | -function http_style_background($img, $att = '', $size=null) { |
|
| 3460 | - if ($size and is_numeric($size)){ |
|
| 3461 | - $size = trim($size) . "px"; |
|
| 3459 | +function http_style_background($img, $att = '', $size = null) { |
|
| 3460 | + if ($size and is_numeric($size)) { |
|
| 3461 | + $size = trim($size)."px"; |
|
| 3462 | 3462 | } |
| 3463 | - return " style='background" . |
|
| 3464 | - ($att ? "" : "-image") . ": url(\"" . chemin_image($img) . "\")" . ($att ? (' ' . $att) : '') . ";" |
|
| 3463 | + return " style='background". |
|
| 3464 | + ($att ? "" : "-image").": url(\"".chemin_image($img)."\")".($att ? (' '.$att) : '').";" |
|
| 3465 | 3465 | . ($size ? "background-size:{$size};" : '') |
| 3466 | 3466 | . "'"; |
| 3467 | 3467 | } |
@@ -3487,7 +3487,7 @@ discard block |
||
| 3487 | 3487 | $args[] = $maybe_size; |
| 3488 | 3488 | $maybe_size = null; |
| 3489 | 3489 | } |
| 3490 | - while (count($args)<2) { |
|
| 3490 | + while (count($args) < 2) { |
|
| 3491 | 3491 | $args[] = null; // default alt or class |
| 3492 | 3492 | } |
| 3493 | 3493 | $args[] = $maybe_size; |
@@ -3497,7 +3497,7 @@ discard block |
||
| 3497 | 3497 | |
| 3498 | 3498 | function helper_filtre_balise_img_svg_size($img, $size) { |
| 3499 | 3499 | // si size est de la forme '@2x' c'est un coeff multiplicateur sur la densite |
| 3500 | - if (strpos($size, '@') === 0 and substr($size,-1) === 'x') { |
|
| 3500 | + if (strpos($size, '@') === 0 and substr($size, -1) === 'x') { |
|
| 3501 | 3501 | $coef = floatval(substr($size, 1, -1)); |
| 3502 | 3502 | list($h, $w) = taille_image($img); |
| 3503 | 3503 | $height = intval(round($h / $coef)); |
@@ -3552,7 +3552,7 @@ discard block |
||
| 3552 | 3552 | * @return string |
| 3553 | 3553 | * Code HTML de la balise IMG |
| 3554 | 3554 | */ |
| 3555 | -function filtre_balise_img_dist($img, $alt = '', $class = null, $size=null) { |
|
| 3555 | +function filtre_balise_img_dist($img, $alt = '', $class = null, $size = null) { |
|
| 3556 | 3556 | |
| 3557 | 3557 | list($alt, $class, $size) = helper_filtre_balise_img_svg_arguments($alt, $class, $size); |
| 3558 | 3558 | |
@@ -3571,7 +3571,7 @@ discard block |
||
| 3571 | 3571 | } |
| 3572 | 3572 | } |
| 3573 | 3573 | else { |
| 3574 | - $img = http_img_pack($img, $alt, $class ? " class='" . attribut_html($class) . "'" : '', '', |
|
| 3574 | + $img = http_img_pack($img, $alt, $class ? " class='".attribut_html($class)."'" : '', '', |
|
| 3575 | 3575 | array('chemin_image' => false, 'utiliser_suffixe_size' => false)); |
| 3576 | 3576 | if (is_null($alt)) { |
| 3577 | 3577 | $img = vider_attribut($img, 'alt'); |
@@ -3617,16 +3617,16 @@ discard block |
||
| 3617 | 3617 | * @return string |
| 3618 | 3618 | * Code HTML de la balise SVG |
| 3619 | 3619 | */ |
| 3620 | -function filtre_balise_svg_dist($img, $alt = '', $class = null, $size=null) { |
|
| 3620 | +function filtre_balise_svg_dist($img, $alt = '', $class = null, $size = null) { |
|
| 3621 | 3621 | |
| 3622 | 3622 | $img = trim($img); |
| 3623 | 3623 | $img_file = $img; |
| 3624 | - if (strpos($img, '<svg') === false){ |
|
| 3625 | - if ($p = strpos($img_file, '?')){ |
|
| 3624 | + if (strpos($img, '<svg') === false) { |
|
| 3625 | + if ($p = strpos($img_file, '?')) { |
|
| 3626 | 3626 | $img_file = substr($img_file, 0, $p); |
| 3627 | 3627 | } |
| 3628 | 3628 | |
| 3629 | - if (!$img_file or !$svg = file_get_contents($img_file)){ |
|
| 3629 | + if (!$img_file or !$svg = file_get_contents($img_file)) { |
|
| 3630 | 3630 | return ''; |
| 3631 | 3631 | } |
| 3632 | 3632 | } |
@@ -3641,7 +3641,7 @@ discard block |
||
| 3641 | 3641 | $balise_svg_source = $balise_svg; |
| 3642 | 3642 | |
| 3643 | 3643 | // entete XML à supprimer |
| 3644 | - $svg = preg_replace(',^\s*<\?xml[^>]*\?' . '>,', '', $svg); |
|
| 3644 | + $svg = preg_replace(',^\s*<\?xml[^>]*\?'.'>,', '', $svg); |
|
| 3645 | 3645 | |
| 3646 | 3646 | // IE est toujours mon ami |
| 3647 | 3647 | $balise_svg = inserer_attribut($balise_svg, 'focusable', 'false'); |
@@ -3657,11 +3657,11 @@ discard block |
||
| 3657 | 3657 | } |
| 3658 | 3658 | |
| 3659 | 3659 | // regler le alt |
| 3660 | - if ($alt){ |
|
| 3660 | + if ($alt) { |
|
| 3661 | 3661 | $balise_svg = inserer_attribut($balise_svg, 'role', 'img'); |
| 3662 | - $id = "img-svg-title-" . substr(md5("$img_file:$svg:$alt"),0,4); |
|
| 3662 | + $id = "img-svg-title-".substr(md5("$img_file:$svg:$alt"), 0, 4); |
|
| 3663 | 3663 | $balise_svg = inserer_attribut($balise_svg, 'aria-labelledby', $id); |
| 3664 | - $title = "<title id=\"$id\">" . entites_html($alt)."</title>\n"; |
|
| 3664 | + $title = "<title id=\"$id\">".entites_html($alt)."</title>\n"; |
|
| 3665 | 3665 | $balise_svg .= $title; |
| 3666 | 3666 | } |
| 3667 | 3667 | else { |
@@ -3705,7 +3705,7 @@ discard block |
||
| 3705 | 3705 | $texte = ''; |
| 3706 | 3706 | if (is_array($tableau)) { |
| 3707 | 3707 | foreach ($tableau as $k => $v) { |
| 3708 | - $res = recuperer_fond('modeles/' . $modele, |
|
| 3708 | + $res = recuperer_fond('modeles/'.$modele, |
|
| 3709 | 3709 | array_merge(array('cle' => $k), (is_array($v) ? $v : array('valeur' => $v))) |
| 3710 | 3710 | ); |
| 3711 | 3711 | $texte .= $res; |
@@ -3882,7 +3882,7 @@ discard block |
||
| 3882 | 3882 | } |
| 3883 | 3883 | |
| 3884 | 3884 | $c = serialize($c); |
| 3885 | - $cle = calculer_cle_action($form . $c); |
|
| 3885 | + $cle = calculer_cle_action($form.$c); |
|
| 3886 | 3886 | $c = "$cle:$c"; |
| 3887 | 3887 | |
| 3888 | 3888 | // on ne stocke pas les contextes dans des fichiers en cache |
@@ -3939,15 +3939,15 @@ discard block |
||
| 3939 | 3939 | } |
| 3940 | 3940 | // toujours encoder l'url source dans le bloc ajax |
| 3941 | 3941 | $r = self(); |
| 3942 | - $r = ' data-origin="' . $r . '"'; |
|
| 3942 | + $r = ' data-origin="'.$r.'"'; |
|
| 3943 | 3943 | $class = 'ajaxbloc'; |
| 3944 | 3944 | if ($ajaxid and is_string($ajaxid)) { |
| 3945 | 3945 | // ajaxid est normalement conforme a un nom de classe css |
| 3946 | 3946 | // on ne verifie pas la conformite, mais on passe entites_html par dessus par precaution |
| 3947 | - $class .= ' ajax-id-' . entites_html($ajaxid); |
|
| 3947 | + $class .= ' ajax-id-'.entites_html($ajaxid); |
|
| 3948 | 3948 | } |
| 3949 | 3949 | |
| 3950 | - return "<div class='$class' " . "data-ajax-env='$env'$r>\n$emboite</div><!--ajaxbloc-->\n"; |
|
| 3950 | + return "<div class='$class' "."data-ajax-env='$env'$r>\n$emboite</div><!--ajaxbloc-->\n"; |
|
| 3951 | 3951 | } |
| 3952 | 3952 | |
| 3953 | 3953 | /** |
@@ -3986,11 +3986,11 @@ discard block |
||
| 3986 | 3986 | // extraire la signature en debut de contexte |
| 3987 | 3987 | // et la verifier avant de deserializer |
| 3988 | 3988 | // format : signature:donneesserializees |
| 3989 | - if ($p = strpos($c,":")){ |
|
| 3990 | - $cle = substr($c,0,$p); |
|
| 3991 | - $c = substr($c,$p+1); |
|
| 3989 | + if ($p = strpos($c, ":")) { |
|
| 3990 | + $cle = substr($c, 0, $p); |
|
| 3991 | + $c = substr($c, $p + 1); |
|
| 3992 | 3992 | |
| 3993 | - if ($cle == calculer_cle_action($form . $c)) { |
|
| 3993 | + if ($cle == calculer_cle_action($form.$c)) { |
|
| 3994 | 3994 | $env = @unserialize($c); |
| 3995 | 3995 | return $env; |
| 3996 | 3996 | } |
@@ -4096,24 +4096,24 @@ discard block |
||
| 4096 | 4096 | $att = ""; |
| 4097 | 4097 | // si $on passe la balise et optionnelement une ou ++classe |
| 4098 | 4098 | // a.active span.selected.active etc.... |
| 4099 | - if (is_string($on) and (strncmp($on, 'a', 1)==0 or strncmp($on, 'span', 4)==0 or strncmp($on, 'strong', 6)==0)){ |
|
| 4099 | + if (is_string($on) and (strncmp($on, 'a', 1) == 0 or strncmp($on, 'span', 4) == 0 or strncmp($on, 'strong', 6) == 0)) { |
|
| 4100 | 4100 | $on = explode(".", $on); |
| 4101 | 4101 | // on verifie que c'est exactement une des 3 balises a, span ou strong |
| 4102 | - if (in_array(reset($on), array('a', 'span', 'strong'))){ |
|
| 4102 | + if (in_array(reset($on), array('a', 'span', 'strong'))) { |
|
| 4103 | 4103 | $bal = array_shift($on); |
| 4104 | 4104 | $class = implode(" ", $on); |
| 4105 | - if ($bal=="a"){ |
|
| 4105 | + if ($bal == "a") { |
|
| 4106 | 4106 | $att = 'href="#" '; |
| 4107 | 4107 | } |
| 4108 | 4108 | } |
| 4109 | 4109 | } |
| 4110 | - $att .= 'class="' . ($class ? attribut_html($class) . ' ' : '') . (defined('_LIEN_OU_EXPOSE_CLASS_ON') ? _LIEN_OU_EXPOSE_CLASS_ON : 'on') . '"'; |
|
| 4110 | + $att .= 'class="'.($class ? attribut_html($class).' ' : '').(defined('_LIEN_OU_EXPOSE_CLASS_ON') ? _LIEN_OU_EXPOSE_CLASS_ON : 'on').'"'; |
|
| 4111 | 4111 | } else { |
| 4112 | 4112 | $bal = 'a'; |
| 4113 | 4113 | $att = "href='$url'" |
| 4114 | - . ($title ? " title='" . attribut_html($title) . "'" : '') |
|
| 4115 | - . ($class ? " class='" . attribut_html($class) . "'" : '') |
|
| 4116 | - . ($rel ? " rel='" . attribut_html($rel) . "'" : '') |
|
| 4114 | + . ($title ? " title='".attribut_html($title)."'" : '') |
|
| 4115 | + . ($class ? " class='".attribut_html($class)."'" : '') |
|
| 4116 | + . ($rel ? " rel='".attribut_html($rel)."'" : '') |
|
| 4117 | 4117 | . $evt; |
| 4118 | 4118 | } |
| 4119 | 4119 | if ($libelle === null) { |
@@ -4248,7 +4248,7 @@ discard block |
||
| 4248 | 4248 | |
| 4249 | 4249 | // Icône |
| 4250 | 4250 | $icone = http_img_pack($fond, $alt, "width='$size' height='$size'"); |
| 4251 | - $icone = "<span class=\"icone-image".($fonction ? " icone-fonction icone-fonction-$fonction" : "") . "\">$icone</span>"; |
|
| 4251 | + $icone = "<span class=\"icone-image".($fonction ? " icone-fonction icone-fonction-$fonction" : "")."\">$icone</span>"; |
|
| 4252 | 4252 | |
| 4253 | 4253 | // Markup final |
| 4254 | 4254 | if ($type == 'lien') { |
@@ -4482,7 +4482,7 @@ discard block |
||
| 4482 | 4482 | if (is_array($detail->sousmenu)) { |
| 4483 | 4483 | foreach ($detail->sousmenu as $souspage => $sousdetail) { |
| 4484 | 4484 | if ($sousdetail->icone and strlen(trim($sousdetail->icone))) { |
| 4485 | - $res .= "\n$selecteur.bando2_$souspage {background-image:url(" . $sousdetail->icone . ");}"; |
|
| 4485 | + $res .= "\n$selecteur.bando2_$souspage {background-image:url(".$sousdetail->icone.");}"; |
|
| 4486 | 4486 | } |
| 4487 | 4487 | } |
| 4488 | 4488 | } |
@@ -4519,20 +4519,20 @@ discard block |
||
| 4519 | 4519 | $class_form = 'ajax'; |
| 4520 | 4520 | $class = str_replace('ajax', '', $class); |
| 4521 | 4521 | } |
| 4522 | - $class_btn = 'submit ' . trim($class); |
|
| 4522 | + $class_btn = 'submit '.trim($class); |
|
| 4523 | 4523 | |
| 4524 | 4524 | if ($confirm) { |
| 4525 | - $confirm = "confirm(\"" . attribut_html($confirm) . "\")"; |
|
| 4525 | + $confirm = "confirm(\"".attribut_html($confirm)."\")"; |
|
| 4526 | 4526 | if ($callback) { |
| 4527 | 4527 | $callback = "$confirm?($callback):false"; |
| 4528 | 4528 | } else { |
| 4529 | 4529 | $callback = $confirm; |
| 4530 | 4530 | } |
| 4531 | 4531 | } |
| 4532 | - $onclick = $callback ? " onclick='return " . addcslashes($callback, "'") . "'" : ""; |
|
| 4532 | + $onclick = $callback ? " onclick='return ".addcslashes($callback, "'")."'" : ""; |
|
| 4533 | 4533 | $title = $title ? " title='$title'" : ''; |
| 4534 | 4534 | |
| 4535 | - return "<form class='bouton_action_post $class_form' method='post' action='$url'><div>" . form_hidden($url) |
|
| 4535 | + return "<form class='bouton_action_post $class_form' method='post' action='$url'><div>".form_hidden($url) |
|
| 4536 | 4536 | . "<button type='submit' class='$class_btn'$title$onclick>$libelle</button></div></form>"; |
| 4537 | 4537 | } |
| 4538 | 4538 | |
@@ -4593,14 +4593,14 @@ discard block |
||
| 4593 | 4593 | $champ_titre = ""; |
| 4594 | 4594 | if ($demande_titre) { |
| 4595 | 4595 | // si pas de titre declare mais champ titre, il sera peuple par le select * |
| 4596 | - $champ_titre = (!empty($desc['titre'])) ? ', ' . $desc['titre'] : ''; |
|
| 4596 | + $champ_titre = (!empty($desc['titre'])) ? ', '.$desc['titre'] : ''; |
|
| 4597 | 4597 | } |
| 4598 | 4598 | include_spip('base/abstract_sql'); |
| 4599 | 4599 | include_spip('base/connect_sql'); |
| 4600 | 4600 | $objets[$type_objet][$id_objet] = sql_fetsel( |
| 4601 | - '*' . $champ_titre, |
|
| 4601 | + '*'.$champ_titre, |
|
| 4602 | 4602 | $desc['table_sql'], |
| 4603 | - id_table_objet($type_objet) . ' = ' . intval($id_objet) |
|
| 4603 | + id_table_objet($type_objet).' = '.intval($id_objet) |
|
| 4604 | 4604 | ); |
| 4605 | 4605 | } |
| 4606 | 4606 | |
@@ -4670,7 +4670,7 @@ discard block |
||
| 4670 | 4670 | return $texte; |
| 4671 | 4671 | } |
| 4672 | 4672 | |
| 4673 | - $traitement = str_replace('%s', "'" . texte_script($texte) . "'", $traitement); |
|
| 4673 | + $traitement = str_replace('%s', "'".texte_script($texte)."'", $traitement); |
|
| 4674 | 4674 | |
| 4675 | 4675 | // Fournir $connect et $Pile[0] au traitement si besoin |
| 4676 | 4676 | $Pile = array(0 => $env); |
@@ -4704,7 +4704,7 @@ discard block |
||
| 4704 | 4704 | } |
| 4705 | 4705 | $url = generer_url_entite($id_objet, $objet, '', '', $connect); |
| 4706 | 4706 | |
| 4707 | - return "<a href='$url' class='$objet'>" . couper($titre, $longueur) . "</a>"; |
|
| 4707 | + return "<a href='$url' class='$objet'>".couper($titre, $longueur)."</a>"; |
|
| 4708 | 4708 | } |
| 4709 | 4709 | |
| 4710 | 4710 | |
@@ -4723,10 +4723,10 @@ discard block |
||
| 4723 | 4723 | function wrap($texte, $wrap) { |
| 4724 | 4724 | $balises = extraire_balises($wrap); |
| 4725 | 4725 | if (preg_match_all(",<([a-z]\w*)\b[^>]*>,UimsS", $wrap, $regs, PREG_PATTERN_ORDER)) { |
| 4726 | - $texte = $wrap . $texte; |
|
| 4726 | + $texte = $wrap.$texte; |
|
| 4727 | 4727 | $regs = array_reverse($regs[1]); |
| 4728 | - $wrap = "</" . implode("></", $regs) . ">"; |
|
| 4729 | - $texte = $texte . $wrap; |
|
| 4728 | + $wrap = "</".implode("></", $regs).">"; |
|
| 4729 | + $texte = $texte.$wrap; |
|
| 4730 | 4730 | } |
| 4731 | 4731 | |
| 4732 | 4732 | return $texte; |
@@ -4757,7 +4757,7 @@ discard block |
||
| 4757 | 4757 | |
| 4758 | 4758 | // caster $u en array si besoin |
| 4759 | 4759 | if (is_object($u)) { |
| 4760 | - $u = (array)$u; |
|
| 4760 | + $u = (array) $u; |
|
| 4761 | 4761 | } |
| 4762 | 4762 | |
| 4763 | 4763 | if (is_array($u)) { |
@@ -4778,7 +4778,7 @@ discard block |
||
| 4778 | 4778 | // sinon on passe a la ligne et on indente |
| 4779 | 4779 | $i_str = str_pad("", $indent, " "); |
| 4780 | 4780 | foreach ($u as $k => $v) { |
| 4781 | - $out .= $join . $i_str . "$k: " . filtre_print_dist($v, $join, $indent + 2); |
|
| 4781 | + $out .= $join.$i_str."$k: ".filtre_print_dist($v, $join, $indent + 2); |
|
| 4782 | 4782 | } |
| 4783 | 4783 | |
| 4784 | 4784 | return $out; |
@@ -4831,8 +4831,8 @@ discard block |
||
| 4831 | 4831 | * @param string $class |
| 4832 | 4832 | * @return string |
| 4833 | 4833 | */ |
| 4834 | -function objet_icone($objet, $taille = 24, $class='') { |
|
| 4835 | - $icone = objet_info($objet, 'icone_objet') . "-" . $taille . ".png"; |
|
| 4834 | +function objet_icone($objet, $taille = 24, $class = '') { |
|
| 4835 | + $icone = objet_info($objet, 'icone_objet')."-".$taille.".png"; |
|
| 4836 | 4836 | $icone = chemin_image($icone); |
| 4837 | 4837 | $balise_img = charger_filtre('balise_img'); |
| 4838 | 4838 | |
@@ -4856,12 +4856,12 @@ discard block |
||
| 4856 | 4856 | * @param array $options |
| 4857 | 4857 | * @return string |
| 4858 | 4858 | */ |
| 4859 | -function objet_T($objet, $chaine, $args = array(), $options = array()){ |
|
| 4860 | - $chaine = explode(':',$chaine); |
|
| 4861 | - if ($t = _T($objet . ':' . end($chaine), $args, array_merge($options, array('force'=>false)))) { |
|
| 4859 | +function objet_T($objet, $chaine, $args = array(), $options = array()) { |
|
| 4860 | + $chaine = explode(':', $chaine); |
|
| 4861 | + if ($t = _T($objet.':'.end($chaine), $args, array_merge($options, array('force'=>false)))) { |
|
| 4862 | 4862 | return $t; |
| 4863 | 4863 | } |
| 4864 | - $chaine = implode(':',$chaine); |
|
| 4864 | + $chaine = implode(':', $chaine); |
|
| 4865 | 4865 | return _T($chaine, $args, $options); |
| 4866 | 4866 | } |
| 4867 | 4867 | |
@@ -4921,7 +4921,7 @@ discard block |
||
| 4921 | 4921 | $cache = recuperer_fond($fond, $contexte, $options, $connect); |
| 4922 | 4922 | |
| 4923 | 4923 | // calculer le nom de la css |
| 4924 | - $dir_var = sous_repertoire(_DIR_VAR, 'cache-' . $extension); |
|
| 4924 | + $dir_var = sous_repertoire(_DIR_VAR, 'cache-'.$extension); |
|
| 4925 | 4925 | $nom_safe = preg_replace(",\W,", '_', str_replace('.', '_', $fond)); |
| 4926 | 4926 | $contexte_implicite = calculer_contexte_implicite(); |
| 4927 | 4927 | |
@@ -4929,22 +4929,22 @@ discard block |
||
| 4929 | 4929 | // mais on peut hasher selon le contenu a la demande, si plusieurs contextes produisent un meme contenu |
| 4930 | 4930 | // reduit la variabilite du nom et donc le nombre de css concatenees possibles in fine |
| 4931 | 4931 | if (isset($options['hash_on_content']) and $options['hash_on_content']) { |
| 4932 | - $hash = md5($contexte_implicite['host'] . '::'. $cache); |
|
| 4932 | + $hash = md5($contexte_implicite['host'].'::'.$cache); |
|
| 4933 | 4933 | } |
| 4934 | 4934 | else { |
| 4935 | 4935 | unset($contexte_implicite['notes']); // pas pertinent pour signaler un changeemnt de contenu pour des css/js |
| 4936 | 4936 | ksort($contexte); |
| 4937 | - $hash = md5($fond . json_encode($contexte_implicite) . json_encode($contexte) . $connect); |
|
| 4937 | + $hash = md5($fond.json_encode($contexte_implicite).json_encode($contexte).$connect); |
|
| 4938 | 4938 | } |
| 4939 | - $filename = $dir_var . $extension . "dyn-$nom_safe-" . substr($hash, 0, 8) . ".$extension"; |
|
| 4939 | + $filename = $dir_var.$extension."dyn-$nom_safe-".substr($hash, 0, 8).".$extension"; |
|
| 4940 | 4940 | |
| 4941 | 4941 | // mettre a jour le fichier si il n'existe pas |
| 4942 | 4942 | // ou trop ancien |
| 4943 | 4943 | // le dernier fichier produit est toujours suffixe par .last |
| 4944 | 4944 | // et recopie sur le fichier cible uniquement si il change |
| 4945 | 4945 | if (!file_exists($filename) |
| 4946 | - or !file_exists($filename . ".last") |
|
| 4947 | - or (isset($cache['lastmodified']) and $cache['lastmodified'] and filemtime($filename . ".last") < $cache['lastmodified']) |
|
| 4946 | + or !file_exists($filename.".last") |
|
| 4947 | + or (isset($cache['lastmodified']) and $cache['lastmodified'] and filemtime($filename.".last") < $cache['lastmodified']) |
|
| 4948 | 4948 | or (defined('_VAR_MODE') and _VAR_MODE == 'recalcul') |
| 4949 | 4949 | ) { |
| 4950 | 4950 | $contenu = $cache['texte']; |
@@ -4963,10 +4963,10 @@ discard block |
||
| 4963 | 4963 | } |
| 4964 | 4964 | // pas de date dans le commentaire car sinon ca invalide le md5 et force la maj |
| 4965 | 4965 | // mais on peut mettre un md5 du contenu, ce qui donne un aperu rapide si la feuille a change ou non |
| 4966 | - $comment .= "}\n md5:" . md5($contenu) . " */\n"; |
|
| 4966 | + $comment .= "}\n md5:".md5($contenu)." */\n"; |
|
| 4967 | 4967 | } |
| 4968 | 4968 | // et ecrire le fichier si il change |
| 4969 | - ecrire_fichier_calcule_si_modifie($filename, $comment . $contenu, false, true); |
|
| 4969 | + ecrire_fichier_calcule_si_modifie($filename, $comment.$contenu, false, true); |
|
| 4970 | 4970 | } |
| 4971 | 4971 | |
| 4972 | 4972 | return timestamp($filename); |
@@ -5161,11 +5161,11 @@ discard block |
||
| 5161 | 5161 | function spip_affiche_mot_de_passe_masque($passe, $afficher_partiellement = false, $portion_pourcent = null) { |
| 5162 | 5162 | $l = strlen($passe); |
| 5163 | 5163 | |
| 5164 | - if ($l<=8 or !$afficher_partiellement){ |
|
| 5164 | + if ($l <= 8 or !$afficher_partiellement) { |
|
| 5165 | 5165 | if (!$l) { |
| 5166 | 5166 | return ''; // montrer qu'il y a pas de mot de passe si il y en a pas |
| 5167 | 5167 | } |
| 5168 | - return str_pad('',$afficher_partiellement ? $l : 16,'*'); |
|
| 5168 | + return str_pad('', $afficher_partiellement ? $l : 16, '*'); |
|
| 5169 | 5169 | } |
| 5170 | 5170 | |
| 5171 | 5171 | if (is_null($portion_pourcent)) { |
@@ -5179,11 +5179,11 @@ discard block |
||
| 5179 | 5179 | } |
| 5180 | 5180 | $e = intval(ceil($l * $portion_pourcent / 100 / 2)); |
| 5181 | 5181 | $e = max($e, 0); |
| 5182 | - $mid = str_pad('',$l-2*$e,'*'); |
|
| 5183 | - if ($e>0 and strlen($mid)>8){ |
|
| 5182 | + $mid = str_pad('', $l - 2 * $e, '*'); |
|
| 5183 | + if ($e > 0 and strlen($mid) > 8) { |
|
| 5184 | 5184 | $mid = '***...***'; |
| 5185 | 5185 | } |
| 5186 | - return substr($passe,0,$e) . $mid . ($e > 0 ? substr($passe,-$e) : ''); |
|
| 5186 | + return substr($passe, 0, $e).$mid.($e > 0 ? substr($passe, -$e) : ''); |
|
| 5187 | 5187 | } |
| 5188 | 5188 | |
| 5189 | 5189 | |
@@ -5205,9 +5205,9 @@ discard block |
||
| 5205 | 5205 | function identifiant_slug($texte, $type = '', $options = array()) { |
| 5206 | 5206 | |
| 5207 | 5207 | $original = $texte; |
| 5208 | - $separateur = (isset($options['separateur'])?$options['separateur']:'_'); |
|
| 5209 | - $longueur_maxi = (isset($options['longueur_maxi'])?$options['longueur_maxi']:60); |
|
| 5210 | - $longueur_mini = (isset($options['longueur_mini'])?$options['longueur_mini']:0); |
|
| 5208 | + $separateur = (isset($options['separateur']) ? $options['separateur'] : '_'); |
|
| 5209 | + $longueur_maxi = (isset($options['longueur_maxi']) ? $options['longueur_maxi'] : 60); |
|
| 5210 | + $longueur_mini = (isset($options['longueur_mini']) ? $options['longueur_mini'] : 0); |
|
| 5211 | 5211 | |
| 5212 | 5212 | if (!function_exists('translitteration')) { |
| 5213 | 5213 | include_spip('inc/charsets'); |
@@ -5249,15 +5249,15 @@ discard block |
||
| 5249 | 5249 | } |
| 5250 | 5250 | } |
| 5251 | 5251 | |
| 5252 | - if (strlen($texte)>$longueur_maxi) { |
|
| 5252 | + if (strlen($texte) > $longueur_maxi) { |
|
| 5253 | 5253 | $texte = substr($texte, 0, $longueur_maxi); |
| 5254 | 5254 | } |
| 5255 | 5255 | |
| 5256 | 5256 | if (strlen($texte) < $longueur_mini and $longueur_mini < $longueur_maxi) { |
| 5257 | 5257 | if (preg_match(',^\d,', $texte)) { |
| 5258 | - $texte = ($type ? substr($type,0,1) : "s") . $texte; |
|
| 5258 | + $texte = ($type ? substr($type, 0, 1) : "s").$texte; |
|
| 5259 | 5259 | } |
| 5260 | - $texte .= $separateur . md5($original); |
|
| 5260 | + $texte .= $separateur.md5($original); |
|
| 5261 | 5261 | $texte = substr($texte, 0, $longueur_mini); |
| 5262 | 5262 | } |
| 5263 | 5263 | |
@@ -39,12 +39,12 @@ discard block |
||
| 39 | 39 | // on renvoi un 401 qui fait echouer la requete ajax silencieusement |
| 40 | 40 | if (!autoriser('ecrire')) { |
| 41 | 41 | $retour = |
| 42 | - '<ul class="deroulant__sous-menu" data-profondeur="1">' . |
|
| 43 | - '<li class="deroulant__item deroulant__item_plan plan_site" data-profondeur="1">' . |
|
| 44 | - '<a class="deroulant__lien" href="' . generer_url_ecrire('accueil') . '" data-profondeur="1">' . |
|
| 45 | - '<span class="libelle">' . _T('public:lien_connecter') . '</span>' . |
|
| 46 | - '</a>' . |
|
| 47 | - '</li>' . |
|
| 42 | + '<ul class="deroulant__sous-menu" data-profondeur="1">'. |
|
| 43 | + '<li class="deroulant__item deroulant__item_plan plan_site" data-profondeur="1">'. |
|
| 44 | + '<a class="deroulant__lien" href="'.generer_url_ecrire('accueil').'" data-profondeur="1">'. |
|
| 45 | + '<span class="libelle">'._T('public:lien_connecter').'</span>'. |
|
| 46 | + '</a>'. |
|
| 47 | + '</li>'. |
|
| 48 | 48 | '</ul>'; |
| 49 | 49 | include_spip('inc/actions'); |
| 50 | 50 | ajax_retour($retour); |
@@ -52,7 +52,7 @@ discard block |
||
| 52 | 52 | } |
| 53 | 53 | |
| 54 | 54 | if ($date = intval(_request('date'))) { |
| 55 | - header("Last-Modified: " . gmdate("D, d M Y H:i:s", $date) . " GMT"); |
|
| 55 | + header("Last-Modified: ".gmdate("D, d M Y H:i:s", $date)." GMT"); |
|
| 56 | 56 | } |
| 57 | 57 | |
| 58 | 58 | $r = gen_liste_rubriques(); |
@@ -61,7 +61,7 @@ discard block |
||
| 61 | 61 | and !strstr($_SERVER['SERVER_SOFTWARE'], 'IIS/') |
| 62 | 62 | ) { |
| 63 | 63 | include_spip('inc/headers'); |
| 64 | - header('Content-Type: text/html; charset=' . $GLOBALS['meta']['charset']); |
|
| 64 | + header('Content-Type: text/html; charset='.$GLOBALS['meta']['charset']); |
|
| 65 | 65 | http_status(304); |
| 66 | 66 | exit; |
| 67 | 67 | } else { |
@@ -83,8 +83,8 @@ discard block |
||
| 83 | 83 | **/ |
| 84 | 84 | function menu_rubriques($complet = true) { |
| 85 | 85 | $ret = '<li class="deroulant__item deroulant__item_tout toutsite" data-profondeur="1">' |
| 86 | - . '<a class="deroulant__lien" href="' . generer_url_ecrire('plan') . '" data-profondeur="1">' |
|
| 87 | - . '<span class="libelle">' . _T('info_tout_site') . '</span>' |
|
| 86 | + . '<a class="deroulant__lien" href="'.generer_url_ecrire('plan').'" data-profondeur="1">' |
|
| 87 | + . '<span class="libelle">'._T('info_tout_site').'</span>' |
|
| 88 | 88 | . '</a>' |
| 89 | 89 | . '</li>'; |
| 90 | 90 | |
@@ -143,8 +143,8 @@ discard block |
||
| 143 | 143 | static $zmax = 6; |
| 144 | 144 | $profondeur_next = $profondeur + 1; |
| 145 | 145 | |
| 146 | - $nav = '<a class="deroulant__lien" href="' . generer_url_entite($id_rubrique, 'rubrique', '', '', false) . "\" data-profondeur=\"$profondeur\">" |
|
| 147 | - . '<span class="libelle">' . supprimer_tags(preg_replace(',[\x00-\x1f]+,', ' ', $titre_rubrique)) . '</span>' |
|
| 146 | + $nav = '<a class="deroulant__lien" href="'.generer_url_entite($id_rubrique, 'rubrique', '', '', false)."\" data-profondeur=\"$profondeur\">" |
|
| 147 | + . '<span class="libelle">'.supprimer_tags(preg_replace(',[\x00-\x1f]+,', ' ', $titre_rubrique)).'</span>' |
|
| 148 | 148 | . "</a>\n"; |
| 149 | 149 | |
| 150 | 150 | // Limiter volontairement le nombre de sous-menus |