@@ -207,8 +207,7 @@ discard block |
||
| 207 | 207 | $pagination['type_pagination'] = $modele; |
| 208 | 208 | if (trouver_fond('pagination_' . $modele, 'modeles')) { |
| 209 | 209 | $modele = '_' . $modele; |
| 210 | - } |
|
| 211 | - else { |
|
| 210 | + } else { |
|
| 212 | 211 | $modele = ''; |
| 213 | 212 | } |
| 214 | 213 | } |
@@ -295,8 +294,7 @@ discard block |
||
| 295 | 294 | if ($ids) { |
| 296 | 295 | $ids = array_column($ids, 'id_objet'); |
| 297 | 296 | return implode(',', $ids); |
| 298 | - } |
|
| 299 | - else { |
|
| 297 | + } else { |
|
| 300 | 298 | return '0'; |
| 301 | 299 | } |
| 302 | 300 | } |
@@ -1395,8 +1395,7 @@ |
||
| 1395 | 1395 | 'champ' => $parent_methode['champ'], |
| 1396 | 1396 | 'table' => $table, |
| 1397 | 1397 | ]; |
| 1398 | - } |
|
| 1399 | - elseif (isset($parent_methode['champ_type'])) { |
|
| 1398 | + } elseif (isset($parent_methode['champ_type'])) { |
|
| 1400 | 1399 | $parent = [ |
| 1401 | 1400 | 'objet' => $ligne[$parent_methode['champ_type']], |
| 1402 | 1401 | 'id_objet' => intval($ligne[$parent_methode['champ']]), |
@@ -561,11 +561,9 @@ discard block |
||
| 561 | 561 | if (!isset($msg[$p])) { |
| 562 | 562 | if (isset($resume['erreur']) and $resume['erreur']) { |
| 563 | 563 | $msg[$p] = [$resume['erreur']]; |
| 564 | - } |
|
| 565 | - elseif (!plugin_version_compatible($k['compatibilite'], $GLOBALS['spip_version_branche'], 'spip')) { |
|
| 564 | + } elseif (!plugin_version_compatible($k['compatibilite'], $GLOBALS['spip_version_branche'], 'spip')) { |
|
| 566 | 565 | $msg[$p] = [plugin_message_incompatibilite($k['compatibilite'], $GLOBALS['spip_version_branche'], 'SPIP', 'necessite')]; |
| 567 | - } |
|
| 568 | - elseif (!$msg[$p] = plugin_necessite($k['necessite'], $liste, 'necessite')) { |
|
| 566 | + } elseif (!$msg[$p] = plugin_necessite($k['necessite'], $liste, 'necessite')) { |
|
| 569 | 567 | $msg[$p] = plugin_necessite($k['utilise'], $liste, 'utilise'); |
| 570 | 568 | } |
| 571 | 569 | } else { |
@@ -954,8 +952,7 @@ discard block |
||
| 954 | 952 | if (is_dir(constant($dir_type) . $plug . '/squelettes/')) { |
| 955 | 953 | $chemins['public'][] = "_DIR_PLUGIN_{$prefix}.'squelettes/'"; |
| 956 | 954 | } |
| 957 | - } |
|
| 958 | - else { |
|
| 955 | + } else { |
|
| 959 | 956 | foreach ($info['chemin'] as $chemin) { |
| 960 | 957 | if ( |
| 961 | 958 | !isset($chemin['version']) or plugin_version_compatible( |
@@ -1425,8 +1422,7 @@ discard block |
||
| 1425 | 1422 | echo "\n" . ($ok ? 'OK ' : '/!\ ') . textebrut($titre) . "\n", |
| 1426 | 1423 | $trace, |
| 1427 | 1424 | "\n"; |
| 1428 | - } |
|
| 1429 | - else { |
|
| 1425 | + } else { |
|
| 1430 | 1426 | include_spip('inc/filtres_boites'); |
| 1431 | 1427 | echo "<div class='install-plugins svp_retour'>" |
| 1432 | 1428 | . boite_ouvrir($titre, ($ok ? 'success' : 'error')) |
@@ -1463,8 +1459,7 @@ discard block |
||
| 1463 | 1459 | if (file_exists($nom)) { |
| 1464 | 1460 | if (substr($nom, -4) == '.php') { |
| 1465 | 1461 | $fichier_tmp = substr($nom, 0, -4) . '.tmp.php'; |
| 1466 | - } |
|
| 1467 | - else { |
|
| 1462 | + } else { |
|
| 1468 | 1463 | $fichier_tmp = $nom . '.tmp'; |
| 1469 | 1464 | } |
| 1470 | 1465 | file_put_contents($fichier_tmp, $contenu); |
@@ -212,8 +212,7 @@ |
||
| 212 | 212 | function heures_minutes($numdate, $forme = '') { |
| 213 | 213 | if ($forme != 'abbr') { |
| 214 | 214 | return _T('date_fmt_heures_minutes', ['h' => heures($numdate), 'm' => minutes($numdate)]); |
| 215 | - } |
|
| 216 | - else { |
|
| 215 | + } else { |
|
| 217 | 216 | return _T('date_fmt_heures_minutes_court', ['h' => heures($numdate), 'm' => minutes($numdate)]); |
| 218 | 217 | } |
| 219 | 218 | } |
@@ -524,8 +524,7 @@ discard block |
||
| 524 | 524 | process_image_svg_identite($ret); |
| 525 | 525 | $ret['creer'] = false; |
| 526 | 526 | } |
| 527 | - } |
|
| 528 | - else { |
|
| 527 | + } else { |
|
| 529 | 528 | if (!function_exists($ret['fonction_imagecreatefrom'])) { |
| 530 | 529 | return false; |
| 531 | 530 | } |
@@ -628,8 +627,7 @@ discard block |
||
| 628 | 627 | |
| 629 | 628 | if (isset($info['mime'])) { |
| 630 | 629 | $mime = $info['mime']; |
| 631 | - } |
|
| 632 | - else { |
|
| 630 | + } else { |
|
| 633 | 631 | $mime = image_type_to_mime_type($info[2]); |
| 634 | 632 | } |
| 635 | 633 | |
@@ -1408,9 +1406,7 @@ discard block |
||
| 1408 | 1406 | if ($srcWidth and $srcWidth <= $maxWidth and $srcHeight <= $maxHeight) { |
| 1409 | 1407 | $vignette = $destination . '.' . $format; |
| 1410 | 1408 | @copy($image, $vignette); |
| 1411 | - } |
|
| 1412 | - |
|
| 1413 | - elseif ($valeurs['format_source'] === 'svg') { |
|
| 1409 | + } elseif ($valeurs['format_source'] === 'svg') { |
|
| 1414 | 1410 | if ($svg = svg_redimensionner($valeurs['fichier'], $destWidth, $destHeight)) { |
| 1415 | 1411 | $format_sortie = 'svg'; |
| 1416 | 1412 | $vignette = $destination . '.' . $format_sortie; |
@@ -1846,8 +1842,7 @@ discard block |
||
| 1846 | 1842 | $date = test_espace_prive() ? ('?' . $date) : ''; |
| 1847 | 1843 | |
| 1848 | 1844 | return _image_ecrire_tag($image, ['src' => "$logo$date", 'width' => $destWidth, 'height' => $destHeight]); |
| 1849 | - } |
|
| 1850 | - else { |
|
| 1845 | + } else { |
|
| 1851 | 1846 | # BMP, tiff ... les redacteurs osent tout! |
| 1852 | 1847 | return $img; |
| 1853 | 1848 | } |
@@ -193,11 +193,9 @@ |
||
| 193 | 193 | |
| 194 | 194 | if ($statut and test_espace_prive()) { |
| 195 | 195 | $corps = bouton_action(_T('public:accueil_site'), generer_url_ecrire('accueil')); |
| 196 | - } |
|
| 197 | - elseif (!empty($_COOKIE['spip_admin'])) { |
|
| 196 | + } elseif (!empty($_COOKIE['spip_admin'])) { |
|
| 198 | 197 | $corps = bouton_action(_T('public:lien_connecter'), generer_url_public('login')); |
| 199 | - } |
|
| 200 | - else { |
|
| 198 | + } else { |
|
| 201 | 199 | $corps = bouton_action(_T('public:accueil_site'), $GLOBALS['meta']['adresse_site']); |
| 202 | 200 | } |
| 203 | 201 | $corps = "<div class='boutons'>$corps</div>"; |
@@ -173,8 +173,7 @@ |
||
| 173 | 173 | // sinon on ecrit directement sur stdout |
| 174 | 174 | if ($options['envoyer'] and $options['envoyer'] !== 'attachment') { |
| 175 | 175 | $fichier = 'php://output'; |
| 176 | - } |
|
| 177 | - else { |
|
| 176 | + } else { |
|
| 178 | 177 | $fichier = sous_repertoire(_DIR_CACHE, 'export') . $filename; |
| 179 | 178 | } |
| 180 | 179 | |
@@ -63,8 +63,7 @@ discard block |
||
| 63 | 63 | } |
| 64 | 64 | if (is_null($maxlen)) { |
| 65 | 65 | $image = file_get_contents($fichier); |
| 66 | - } |
|
| 67 | - else { |
|
| 66 | + } else { |
|
| 68 | 67 | $image = file_get_contents($fichier, false, null, 0, $maxlen); |
| 69 | 68 | } |
| 70 | 69 | // est-ce bien une image svg ? |
@@ -190,8 +189,7 @@ discard block |
||
| 190 | 189 | |
| 191 | 190 | if ($start === false or $start === 'end') { |
| 192 | 191 | $svg = str_replace('</svg>', $shapes . '</svg>', $svg); |
| 193 | - } |
|
| 194 | - else { |
|
| 192 | + } else { |
|
| 195 | 193 | $p = stripos($svg, '<svg'); |
| 196 | 194 | $p = strpos($svg, '>', $p); |
| 197 | 195 | $svg = substr_replace($svg, $shapes, $p + 1, 0); |
@@ -253,8 +251,7 @@ discard block |
||
| 253 | 251 | if (strpos($couleur, 'rgb(') === 0) { |
| 254 | 252 | $c = explode(',', substr($couleur, 4)); |
| 255 | 253 | $couleur = _couleur_dec_to_hex(intval($c[0]), intval($c[1]), intval($c[2])); |
| 256 | - } |
|
| 257 | - else { |
|
| 254 | + } else { |
|
| 258 | 255 | $couleur = couleur_html_to_hex($couleur); |
| 259 | 256 | } |
| 260 | 257 | $couleur = '#' . ltrim($couleur, '#'); |
@@ -305,17 +302,14 @@ discard block |
||
| 305 | 302 | and $w = svg_dimension_to_pixels($attributs['width']) |
| 306 | 303 | ) { |
| 307 | 304 | $width = $w; |
| 308 | - } |
|
| 309 | - else { |
|
| 305 | + } else { |
|
| 310 | 306 | // si on recupere la taille de la viewbox mais si la viewbox est petite on met un multiplicateur pour la taille finale |
| 311 | 307 | $width = $viewBox[2]; |
| 312 | 308 | if ($width < 1) { |
| 313 | 309 | $coeff = max($coeff, 1000); |
| 314 | - } |
|
| 315 | - elseif ($width < 10) { |
|
| 310 | + } elseif ($width < 10) { |
|
| 316 | 311 | $coeff = max($coeff, 100); |
| 317 | - } |
|
| 318 | - elseif ($width < 100) { |
|
| 312 | + } elseif ($width < 100) { |
|
| 319 | 313 | $coeff = max($coeff, 10); |
| 320 | 314 | } |
| 321 | 315 | } |
@@ -324,16 +318,13 @@ discard block |
||
| 324 | 318 | and $h = svg_dimension_to_pixels($attributs['height']) |
| 325 | 319 | ) { |
| 326 | 320 | $height = $h; |
| 327 | - } |
|
| 328 | - else { |
|
| 321 | + } else { |
|
| 329 | 322 | $height = $viewBox[3]; |
| 330 | 323 | if ($height < 1) { |
| 331 | 324 | $coeff = max($coeff, 1000); |
| 332 | - } |
|
| 333 | - elseif ($height < 10) { |
|
| 325 | + } elseif ($height < 10) { |
|
| 334 | 326 | $coeff = max($coeff, 100); |
| 335 | - } |
|
| 336 | - elseif ($height < 100) { |
|
| 327 | + } elseif ($height < 100) { |
|
| 337 | 328 | $coeff = max($coeff, 10); |
| 338 | 329 | } |
| 339 | 330 | } |
@@ -475,8 +466,7 @@ discard block |
||
| 475 | 466 | if (isset($attributs['viewBox'])) { |
| 476 | 467 | $viewBox = explode(' ', $attributs['viewBox']); |
| 477 | 468 | $rect = '<rect x="' . $viewBox[0] . '" y="' . $viewBox[1] . '" width="' . $viewBox[2] . '" height="' . $viewBox[3] . "\" fill=\"$background_color\"/>"; |
| 478 | - } |
|
| 479 | - else { |
|
| 469 | + } else { |
|
| 480 | 470 | $rect = "<rect width=\"100%\" height=\"100%\" fill=\"$background_color\"/>"; |
| 481 | 471 | } |
| 482 | 472 | $svg = svg_insert_shapes($svg, $rect); |
@@ -505,8 +495,7 @@ discard block |
||
| 505 | 495 | if (isset($attributs['viewBox'])) { |
| 506 | 496 | $viewBox = explode(' ', $attributs['viewBox']); |
| 507 | 497 | $rect = '<rect x="' . $viewBox[0] . '" y="' . $viewBox[1] . '" width="' . $viewBox[2] . '" height="' . $viewBox[3] . "\" fill=\"$background_color\" opacity=\"$opacity\"/>"; |
| 508 | - } |
|
| 509 | - else { |
|
| 498 | + } else { |
|
| 510 | 499 | $rect = "<rect width=\"100%\" height=\"100%\" fill=\"$background_color\"/>"; |
| 511 | 500 | } |
| 512 | 501 | $svg = svg_insert_shapes($svg, $rect, false); |
@@ -627,8 +616,7 @@ discard block |
||
| 627 | 616 | $x = intval($viewBox[0]) + intval($viewBox[2] / 2); |
| 628 | 617 | $mx = -$x; |
| 629 | 618 | $transform = "translate($x, 0) $transform translate($mx, 0)"; |
| 630 | - } |
|
| 631 | - else { |
|
| 619 | + } else { |
|
| 632 | 620 | $transform = 'scale(1,-1)'; |
| 633 | 621 | |
| 634 | 622 | $y = intval($viewBox[1]) + intval($viewBox[3] / 2); |
@@ -689,8 +677,7 @@ discard block |
||
| 689 | 677 | $c = array_shift($colors); |
| 690 | 678 | if (strlen($c) == 4) { |
| 691 | 679 | $short[] = $c; |
| 692 | - } |
|
| 693 | - else { |
|
| 680 | + } else { |
|
| 694 | 681 | $long[] = $c; |
| 695 | 682 | } |
| 696 | 683 | } |
@@ -341,8 +341,7 @@ |
||
| 341 | 341 | ) { |
| 342 | 342 | if ($use_copy) { |
| 343 | 343 | @copy($fichier_tmp, $fichier); |
| 344 | - } |
|
| 345 | - else { |
|
| 344 | + } else { |
|
| 346 | 345 | @rename($fichier_tmp, $fichier); |
| 347 | 346 | } |
| 348 | 347 | // eviter que PHP ne reserve le vieux timestamp |