@@ -164,8 +164,7 @@ discard block |
||
| 164 | 164 | |
| 165 | 165 | if ($start === false || $start === 'end') { |
| 166 | 166 | $svg = str_replace('</svg>', $shapes . '</svg>', $svg); |
| 167 | - } |
|
| 168 | - else { |
|
| 167 | + } else { |
|
| 169 | 168 | $p = stripos($svg, '<svg'); |
| 170 | 169 | $p = strpos($svg, '>', $p); |
| 171 | 170 | $svg = substr_replace($svg, $shapes, $p + 1, 0); |
@@ -224,8 +223,7 @@ discard block |
||
| 224 | 223 | if (str_starts_with($couleur, 'rgb(')) { |
| 225 | 224 | $c = explode(',', substr($couleur, 4)); |
| 226 | 225 | $couleur = _couleur_dec_to_hex((int) $c[0], (int) $c[1], (int) $c[2]); |
| 227 | - } |
|
| 228 | - else { |
|
| 226 | + } else { |
|
| 229 | 227 | $couleur = couleur_html_to_hex($couleur); |
| 230 | 228 | } |
| 231 | 229 | return '#' . ltrim($couleur, '#'); |
@@ -281,17 +279,14 @@ discard block |
||
| 281 | 279 | // si pas de height valide, on suppose l'image carree |
| 282 | 280 | $viewBox[3] = $width; |
| 283 | 281 | } |
| 284 | - } |
|
| 285 | - else { |
|
| 282 | + } else { |
|
| 286 | 283 | // si on recupere la taille de la viewbox mais si la viewbox est petite on met un multiplicateur pour la taille finale |
| 287 | 284 | $width = $viewBox[2]; |
| 288 | 285 | if ($width < 1) { |
| 289 | 286 | $coeff = max($coeff, 1000); |
| 290 | - } |
|
| 291 | - elseif ($width < 10) { |
|
| 287 | + } elseif ($width < 10) { |
|
| 292 | 288 | $coeff = max($coeff, 100); |
| 293 | - } |
|
| 294 | - elseif ($width < 100) { |
|
| 289 | + } elseif ($width < 100) { |
|
| 295 | 290 | $coeff = max($coeff, 10); |
| 296 | 291 | } |
| 297 | 292 | } |
@@ -304,16 +299,13 @@ discard block |
||
| 304 | 299 | if (empty($attributs['viewBox'])) { |
| 305 | 300 | $viewBox[3] = $height; |
| 306 | 301 | } |
| 307 | - } |
|
| 308 | - else { |
|
| 302 | + } else { |
|
| 309 | 303 | $height = $viewBox[3]; |
| 310 | 304 | if ($height < 1) { |
| 311 | 305 | $coeff = max($coeff, 1000); |
| 312 | - } |
|
| 313 | - elseif ($height < 10) { |
|
| 306 | + } elseif ($height < 10) { |
|
| 314 | 307 | $coeff = max($coeff, 100); |
| 315 | - } |
|
| 316 | - elseif ($height < 100) { |
|
| 308 | + } elseif ($height < 100) { |
|
| 317 | 309 | $coeff = max($coeff, 10); |
| 318 | 310 | } |
| 319 | 311 | } |
@@ -454,8 +446,7 @@ discard block |
||
| 454 | 446 | if (isset($attributs['viewBox'])) { |
| 455 | 447 | $viewBox = explode(' ', $attributs['viewBox']); |
| 456 | 448 | $rect = '<rect x="' . $viewBox[0] . '" y="' . $viewBox[1] . '" width="' . $viewBox[2] . '" height="' . $viewBox[3] . "\" fill=\"$background_color\"/>"; |
| 457 | - } |
|
| 458 | - else { |
|
| 449 | + } else { |
|
| 459 | 450 | $rect = "<rect width=\"100%\" height=\"100%\" fill=\"$background_color\"/>"; |
| 460 | 451 | } |
| 461 | 452 | $svg = svg_insert_shapes($svg, $rect); |
@@ -484,8 +475,7 @@ discard block |
||
| 484 | 475 | if (isset($attributs['viewBox'])) { |
| 485 | 476 | $viewBox = explode(' ', $attributs['viewBox']); |
| 486 | 477 | $rect = '<rect x="' . $viewBox[0] . '" y="' . $viewBox[1] . '" width="' . $viewBox[2] . '" height="' . $viewBox[3] . "\" fill=\"$background_color\" opacity=\"$opacity\"/>"; |
| 487 | - } |
|
| 488 | - else { |
|
| 478 | + } else { |
|
| 489 | 479 | $rect = "<rect width=\"100%\" height=\"100%\" fill=\"$background_color\"/>"; |
| 490 | 480 | } |
| 491 | 481 | $svg = svg_insert_shapes($svg, $rect, false); |
@@ -606,8 +596,7 @@ discard block |
||
| 606 | 596 | $x = (int) $viewBox[0] + (int) ($viewBox[2] / 2); |
| 607 | 597 | $mx = -$x; |
| 608 | 598 | $transform = "translate($x, 0) $transform translate($mx, 0)"; |
| 609 | - } |
|
| 610 | - else { |
|
| 599 | + } else { |
|
| 611 | 600 | $transform = 'scale(1,-1)'; |
| 612 | 601 | |
| 613 | 602 | $y = (int) $viewBox[1] + (int) ($viewBox[3] / 2); |
@@ -666,8 +655,7 @@ discard block |
||
| 666 | 655 | $c = array_shift($colors); |
| 667 | 656 | if (strlen($c) == 4) { |
| 668 | 657 | $short[] = $c; |
| 669 | - } |
|
| 670 | - else { |
|
| 658 | + } else { |
|
| 671 | 659 | $long[] = $c; |
| 672 | 660 | } |
| 673 | 661 | } |
@@ -114,11 +114,9 @@ discard block |
||
| 114 | 114 | |
| 115 | 115 | if ($statut && test_espace_prive()) { |
| 116 | 116 | $footer = bouton_action(_T('public:accueil_site'), generer_url_ecrire('accueil')); |
| 117 | - } |
|
| 118 | - elseif (!empty($_COOKIE['spip_admin'])) { |
|
| 117 | + } elseif (!empty($_COOKIE['spip_admin'])) { |
|
| 119 | 118 | $footer = bouton_action(_T('public:lien_connecter'), generer_url_public('login')); |
| 120 | - } |
|
| 121 | - else { |
|
| 119 | + } else { |
|
| 122 | 120 | $footer = bouton_action(_T('public:accueil_site'), $GLOBALS['meta']['adresse_site'] ?? ''); |
| 123 | 121 | } |
| 124 | 122 | |
@@ -130,12 +128,10 @@ discard block |
||
| 130 | 128 | . $titre |
| 131 | 129 | . '</div>'; |
| 132 | 130 | $options['titre'] = ''; |
| 133 | - } |
|
| 134 | - else { |
|
| 131 | + } else { |
|
| 135 | 132 | $options['titre'] = $titre; |
| 136 | 133 | } |
| 137 | - } |
|
| 138 | - else { |
|
| 134 | + } else { |
|
| 139 | 135 | $options['titre'] = $titre; |
| 140 | 136 | } |
| 141 | 137 | $options['page_title'] = $titre; |
@@ -32,13 +32,9 @@ discard block |
||
| 32 | 32 | |
| 33 | 33 | if (_request('supprimer_image_fond_login')) { |
| 34 | 34 | // rien à tester |
| 35 | - } |
|
| 36 | - |
|
| 37 | - elseif (_request('supprimer_couleur_login')) { |
|
| 35 | + } elseif (_request('supprimer_couleur_login')) { |
|
| 38 | 36 | // rien à tester |
| 39 | - } |
|
| 40 | - |
|
| 41 | - elseif (!empty($_FILES['upload_image_fond_login'])) { |
|
| 37 | + } elseif (!empty($_FILES['upload_image_fond_login'])) { |
|
| 42 | 38 | $file = $_FILES['upload_image_fond_login']; |
| 43 | 39 | include_spip('inc/documents'); |
| 44 | 40 | $extension = pathinfo((string) $file['name'], PATHINFO_EXTENSION); |
@@ -74,14 +70,10 @@ discard block |
||
| 74 | 70 | |
| 75 | 71 | if (_request('supprimer_image_fond_login')) { |
| 76 | 72 | @unlink($dest); |
| 77 | - } |
|
| 78 | - |
|
| 79 | - elseif (_request('supprimer_couleur_login')) { |
|
| 73 | + } elseif (_request('supprimer_couleur_login')) { |
|
| 80 | 74 | effacer_config('couleur_login'); |
| 81 | 75 | set_request('couleur_login', null); |
| 82 | - } |
|
| 83 | - |
|
| 84 | - elseif (!empty($_FILES['upload_image_fond_login'])) { |
|
| 76 | + } elseif (!empty($_FILES['upload_image_fond_login'])) { |
|
| 85 | 77 | $file = $_FILES['upload_image_fond_login']; |
| 86 | 78 | include_spip('inc/documents'); |
| 87 | 79 | deplacer_fichier_upload($file['tmp_name'], $dest); |
@@ -2069,8 +2069,7 @@ discard block |
||
| 2069 | 2069 | // Champ joker * des iterateurs DATA qui accepte tout |
| 2070 | 2070 | if (@array_key_exists('*', $desc['field'])) { |
| 2071 | 2071 | $desc['field'][$col_vraie ?: $col] = ''; // on veut pas de cast INT par defaut car le type peut etre n'importe quoi dans les boucles DATA |
| 2072 | - } |
|
| 2073 | - else { |
|
| 2072 | + } else { |
|
| 2074 | 2073 | $r = calculer_critere_infixe_externe($boucle, $crit, $op, $desc, $col, $col_alias, $table); |
| 2075 | 2074 | if (!$r) { |
| 2076 | 2075 | return ''; |
@@ -2112,8 +2111,7 @@ discard block |
||
| 2112 | 2111 | . ((isset($r[2]) && $r[2]) ? $r[2] : ",''") |
| 2113 | 2112 | . ",'" . addslashes((string) $type_cast_quote) . "'"; |
| 2114 | 2113 | $val[0] = "sql_quote($r)"; |
| 2115 | - } |
|
| 2116 | - elseif ( |
|
| 2114 | + } elseif ( |
|
| 2117 | 2115 | str_contains((string) $val[0], '@@defaultcast@@') |
| 2118 | 2116 | && preg_match("/'@@defaultcast@@'\s*\)\s*\z/ms", (string) $val[0], $r) |
| 2119 | 2117 | ) { |
@@ -182,8 +182,7 @@ |
||
| 182 | 182 | // sinon on ecrit directement sur stdout |
| 183 | 183 | if ($options['envoyer'] && $options['envoyer'] !== 'attachment') { |
| 184 | 184 | $fichier = 'php://output'; |
| 185 | - } |
|
| 186 | - else { |
|
| 185 | + } else { |
|
| 187 | 186 | $fichier = sous_repertoire(_DIR_CACHE, 'export') . $basename; |
| 188 | 187 | } |
| 189 | 188 | |
@@ -336,8 +336,7 @@ |
||
| 336 | 336 | if (!autoriser('modifier', $type, (int) $id)) { |
| 337 | 337 | $contexte['editable'] = ''; |
| 338 | 338 | } |
| 339 | - } |
|
| 340 | - else { |
|
| 339 | + } else { |
|
| 341 | 340 | if (!autoriser('creer', $type, 0, null, ['id_parent' => $id_parent])) { |
| 342 | 341 | $contexte['editable'] = ''; |
| 343 | 342 | } |
@@ -267,8 +267,7 @@ discard block |
||
| 267 | 267 | if ($id === '*') { |
| 268 | 268 | unset($GLOBALS['autoriser_exception'][$faire][$type]); |
| 269 | 269 | unset($autorisation[$faire][$type]); |
| 270 | - } |
|
| 271 | - else { |
|
| 270 | + } else { |
|
| 272 | 271 | unset($GLOBALS['autoriser_exception'][$faire][$type][$id]); |
| 273 | 272 | unset($autorisation[$faire][$type][$id]); |
| 274 | 273 | } |
@@ -635,8 +634,7 @@ discard block |
||
| 635 | 634 | function autoriser_rubrique_creer_dist(string $faire, string $type, $id, array $qui, array $opt): bool { |
| 636 | 635 | if (!empty($opt['id_parent'])) { |
| 637 | 636 | return autoriser('creerrubriquedans', 'rubrique', $opt['id_parent'], $qui); |
| 638 | - } |
|
| 639 | - else { |
|
| 637 | + } else { |
|
| 640 | 638 | return autoriser('defaut', null, 0, $qui, $opt); |
| 641 | 639 | } |
| 642 | 640 | } |
@@ -791,8 +789,7 @@ discard block |
||
| 791 | 789 | if (!empty($opt['id_parent'])) { |
| 792 | 790 | // creerarticledans rappelle autoriser(creer,article) sans id, donc on verifiera condition du else aussi |
| 793 | 791 | return autoriser('creerarticledans', 'rubrique', $opt['id_parent'], $qui); |
| 794 | - } |
|
| 795 | - else { |
|
| 792 | + } else { |
|
| 796 | 793 | return (sql_countsel('spip_rubriques') > 0 && in_array($qui['statut'], ['0minirezo', '1comite'])); |
| 797 | 794 | } |
| 798 | 795 | } |
@@ -615,8 +615,7 @@ discard block |
||
| 615 | 615 | if (!$srcSize) { |
| 616 | 616 | $poids_img[$src] = filesize($src); |
| 617 | 617 | } |
| 618 | - } |
|
| 619 | - elseif (str_contains($src, '<svg')) { |
|
| 618 | + } elseif (str_contains($src, '<svg')) { |
|
| 620 | 619 | include_spip('inc/svg'); |
| 621 | 620 | if ($attrs = svg_lire_attributs($src)) { |
| 622 | 621 | [$width, $height, $viewbox] = svg_getimagesize_from_attr($attrs); |
@@ -3421,8 +3420,7 @@ discard block |
||
| 3421 | 3420 | } |
| 3422 | 3421 | if (!isset($options['chemin_image']) || $options['chemin_image'] == true) { |
| 3423 | 3422 | $img_file = chemin_image($img); |
| 3424 | - } |
|
| 3425 | - else { |
|
| 3423 | + } else { |
|
| 3426 | 3424 | if (!isset($options['variante_svg_si_possible']) || $options['variante_svg_si_possible'] == true) { |
| 3427 | 3425 | $img_file = http_img_variante_svg_si_possible($img_file); |
| 3428 | 3426 | } |
@@ -3449,11 +3447,9 @@ discard block |
||
| 3449 | 3447 | } |
| 3450 | 3448 | if ($alt === false) { |
| 3451 | 3449 | $alt = ''; |
| 3452 | - } |
|
| 3453 | - elseif ($alt || $alt === '') { |
|
| 3450 | + } elseif ($alt || $alt === '') { |
|
| 3454 | 3451 | $alt = " alt='" . attribut_html($alt) . "'"; |
| 3455 | - } |
|
| 3456 | - else { |
|
| 3452 | + } else { |
|
| 3457 | 3453 | $alt = " alt='" . attribut_html($title) . "'"; |
| 3458 | 3454 | } |
| 3459 | 3455 | return "<img src='" . attribut_html($img_file) . "'$alt" |
@@ -3580,8 +3576,7 @@ discard block |
||
| 3580 | 3576 | if (!is_null($class)) { |
| 3581 | 3577 | $img = strlen((string) $class) ? inserer_attribut($img, 'class', $class) : vider_attribut($img, 'class'); |
| 3582 | 3578 | } |
| 3583 | - } |
|
| 3584 | - else { |
|
| 3579 | + } else { |
|
| 3585 | 3580 | $img = http_img_pack( |
| 3586 | 3581 | $img, |
| 3587 | 3582 | $alt, |
@@ -3689,8 +3684,7 @@ discard block |
||
| 3689 | 3684 | $balise_svg = inserer_attribut($balise_svg, 'aria-labelledby', $id); |
| 3690 | 3685 | $title = "<title id=\"$id\">" . entites_html($alt) . "</title>\n"; |
| 3691 | 3686 | $balise_svg .= $title; |
| 3692 | - } |
|
| 3693 | - else { |
|
| 3687 | + } else { |
|
| 3694 | 3688 | $balise_svg = inserer_attribut($balise_svg, 'aria-hidden', 'true'); |
| 3695 | 3689 | } |
| 3696 | 3690 | |
@@ -5081,8 +5075,7 @@ discard block |
||
| 5081 | 5075 | // reduit la variabilite du nom et donc le nombre de css concatenees possibles in fine |
| 5082 | 5076 | if (isset($options['hash_on_content']) && $options['hash_on_content']) { |
| 5083 | 5077 | $hash = md5((string) ($contexte_implicite['host'] . '::' . $cache)); |
| 5084 | - } |
|
| 5085 | - else { |
|
| 5078 | + } else { |
|
| 5086 | 5079 | unset($contexte_implicite['notes']); // pas pertinent pour signaler un changeemnt de contenu pour des css/js |
| 5087 | 5080 | ksort($contexte); |
| 5088 | 5081 | $hash = md5($fond . json_encode($contexte_implicite, JSON_THROW_ON_ERROR) . json_encode($contexte, JSON_THROW_ON_ERROR) . $connect); |
@@ -1391,8 +1391,7 @@ |
||
| 1391 | 1391 | 'champ' => $parent_methode['champ'], |
| 1392 | 1392 | 'table' => $table, |
| 1393 | 1393 | ]; |
| 1394 | - } |
|
| 1395 | - elseif (isset($parent_methode['champ_type'])) { |
|
| 1394 | + } elseif (isset($parent_methode['champ_type'])) { |
|
| 1396 | 1395 | $parent = [ |
| 1397 | 1396 | 'objet' => $ligne[$parent_methode['champ_type']], |
| 1398 | 1397 | 'id_objet' => (int) $ligne[$parent_methode['champ']], |