@@ -77,8 +77,7 @@ discard block |
||
| 77 | 77 | break; // stop on a trouvé le bon champ |
| 78 | 78 | } |
| 79 | 79 | } |
| 80 | - } |
|
| 81 | - else { |
|
| 80 | + } else { |
|
| 82 | 81 | $statuts_publies = array('publie'); |
| 83 | 82 | } |
| 84 | 83 | |
@@ -105,10 +104,12 @@ discard block |
||
| 105 | 104 | } |
| 106 | 105 | } |
| 107 | 106 | |
| 108 | - if ($neuf) // Sauver la date de la derniere mise a jour (pour menu_rubriques) |
|
| 107 | + if ($neuf) { |
|
| 108 | + // Sauver la date de la derniere mise a jour (pour menu_rubriques) |
|
| 109 | 109 | { |
| 110 | 110 | ecrire_meta("date_calcul_rubriques", date("U")); |
| 111 | 111 | } |
| 112 | + } |
|
| 112 | 113 | |
| 113 | 114 | $langues = calculer_langues_utilisees(); |
| 114 | 115 | ecrire_meta('langues_utilisees', $langues); |
@@ -115,10 +115,12 @@ discard block |
||
| 115 | 115 | |
| 116 | 116 | // et reparagrapher si necessaire (coherence avec le cas descriptif) |
| 117 | 117 | // une introduction a tojours un <p> |
| 118 | - if ($GLOBALS['toujours_paragrapher']) // Fermer les paragraphes |
|
| 118 | + if ($GLOBALS['toujours_paragrapher']) { |
|
| 119 | + // Fermer les paragraphes |
|
| 119 | 120 | { |
| 120 | 121 | $texte = paragrapher($texte, $GLOBALS['toujours_paragrapher']); |
| 121 | 122 | } |
| 123 | + } |
|
| 122 | 124 | |
| 123 | 125 | return $texte; |
| 124 | 126 | } |
@@ -207,8 +209,7 @@ discard block |
||
| 207 | 209 | $pagination['type_pagination'] = $modele; |
| 208 | 210 | if (trouver_fond('pagination_'.$modele, 'modeles')) { |
| 209 | 211 | $modele = '_' . $modele; |
| 210 | - } |
|
| 211 | - else { |
|
| 212 | + } else { |
|
| 212 | 213 | $modele = ''; |
| 213 | 214 | } |
| 214 | 215 | } |
@@ -295,8 +296,7 @@ discard block |
||
| 295 | 296 | if ($ids) { |
| 296 | 297 | $ids = array_column($ids, 'id_objet'); |
| 297 | 298 | return implode(',', $ids); |
| 298 | - } |
|
| 299 | - else { |
|
| 299 | + } else { |
|
| 300 | 300 | return "0"; |
| 301 | 301 | } |
| 302 | 302 | } |
@@ -981,8 +981,9 @@ discard block |
||
| 981 | 981 | static $tables = array(); |
| 982 | 982 | if (!isset($tables[$serveur])){ |
| 983 | 983 | $tables[$serveur] = array(); |
| 984 | - if (!function_exists("sql_alltable")) |
|
| 985 | - include_spip("base/abstract_sql"); |
|
| 984 | + if (!function_exists("sql_alltable")) { |
|
| 985 | + include_spip("base/abstract_sql"); |
|
| 986 | + } |
|
| 986 | 987 | $ts = sql_alltable('%',$serveur); // toutes les tables |
| 987 | 988 | foreach ($ts as $t){ |
| 988 | 989 | $tables[$serveur][$t] = $t; |
@@ -1384,8 +1385,7 @@ discard block |
||
| 1384 | 1385 | 'champ' => $parent_methode['champ'], |
| 1385 | 1386 | 'table' => $table, |
| 1386 | 1387 | ); |
| 1387 | - } |
|
| 1388 | - elseif (isset($parent_methode['champ_type'])) { |
|
| 1388 | + } elseif (isset($parent_methode['champ_type'])) { |
|
| 1389 | 1389 | $parent = array( |
| 1390 | 1390 | 'objet' => $ligne[$parent_methode['champ_type']], |
| 1391 | 1391 | 'id_objet' => intval($ligne[$parent_methode['champ']]), |
@@ -50,11 +50,9 @@ discard block |
||
| 50 | 50 | $port and !is_numeric($socket = $port) |
| 51 | 51 | and (!$host or $host=='localhost')) { |
| 52 | 52 | $link = @mysqli_connect($host, $login, $pass, '', null, $socket); |
| 53 | - } |
|
| 54 | - elseif ($port) { |
|
| 53 | + } elseif ($port) { |
|
| 55 | 54 | $link = @mysqli_connect($host, $login, $pass, '', $port); |
| 56 | - } |
|
| 57 | - else { |
|
| 55 | + } else { |
|
| 58 | 56 | $link = @mysqli_connect($host, $login, $pass); |
| 59 | 57 | } |
| 60 | 58 | |
@@ -1612,8 +1610,7 @@ discard block |
||
| 1612 | 1610 | if (!$type) { |
| 1613 | 1611 | if (is_bool($v)) { |
| 1614 | 1612 | return strval(intval($v)); |
| 1615 | - } |
|
| 1616 | - elseif (is_numeric($v)) { |
|
| 1613 | + } elseif (is_numeric($v)) { |
|
| 1617 | 1614 | return strval($v); |
| 1618 | 1615 | } |
| 1619 | 1616 | return "'" . addslashes($v) . "'"; |
@@ -2000,8 +2000,7 @@ |
||
| 2000 | 2000 | // si on ne connait pas le type on le deduit de $v autant que possible |
| 2001 | 2001 | if (is_bool($v)) { |
| 2002 | 2002 | return strval(intval($v)); |
| 2003 | - } |
|
| 2004 | - elseif (is_numeric($v)) { |
|
| 2003 | + } elseif (is_numeric($v)) { |
|
| 2005 | 2004 | return strval($v); |
| 2006 | 2005 | } |
| 2007 | 2006 | } |
@@ -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('action/ajouter_documents'); |
| 44 | 40 | $extension = pathinfo($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); |
@@ -511,11 +511,12 @@ |
||
| 511 | 511 | $position = 'focus', |
| 512 | 512 | $background_color = 'white' |
| 513 | 513 | ) { |
| 514 | - if (function_exists('image_recadre') && ($GLOBALS['meta']['image_process'] ?? '') === 'gd2') |
|
| 515 | - return image_reduire(image_recadre($im, $width.':'.$height, '-', $position, $background_color), $width, $height); |
|
| 516 | - else |
|
| 517 | - return image_passe_partout($im, $width, $height); |
|
| 518 | -} |
|
| 514 | + if (function_exists('image_recadre') && ($GLOBALS['meta']['image_process'] ?? '') === 'gd2') { |
|
| 515 | + return image_reduire(image_recadre($im, $width.':'.$height, '-', $position, $background_color), $width, $height); |
|
| 516 | + } else { |
|
| 517 | + return image_passe_partout($im, $width, $height); |
|
| 518 | + } |
|
| 519 | + } |
|
| 519 | 520 | |
| 520 | 521 | /** |
| 521 | 522 | * Réduit les images d'un certain facteur |