@@ -329,8 +329,7 @@ |
||
| 329 | 329 | if (!autoriser('modifier', $type, intval($id))){ |
| 330 | 330 | $valeurs['editable'] = ''; |
| 331 | 331 | } |
| 332 | - } |
|
| 333 | - else { |
|
| 332 | + } else { |
|
| 334 | 333 | if (!autoriser('creer', $type, 0, null, ['id_parent' => $id_parent])) { |
| 335 | 334 | $valeurs['editable'] = ''; |
| 336 | 335 | } |
@@ -237,8 +237,7 @@ discard block |
||
| 237 | 237 | if ($id === '*') { |
| 238 | 238 | unset($GLOBALS['autoriser_exception'][$faire][$type]); |
| 239 | 239 | unset($autorisation[$faire][$type]); |
| 240 | - } |
|
| 241 | - else { |
|
| 240 | + } else { |
|
| 242 | 241 | unset($GLOBALS['autoriser_exception'][$faire][$type][$id]); |
| 243 | 242 | unset($autorisation[$faire][$type][$id]); |
| 244 | 243 | } |
@@ -592,8 +591,7 @@ discard block |
||
| 592 | 591 | function autoriser_rubrique_creer_dist($faire, $type, $id, $qui, $opt) { |
| 593 | 592 | if (!empty($opt['id_parent'])) { |
| 594 | 593 | return autoriser('creerrubriquedans', 'rubrique', $opt['id_parent'], $qui); |
| 595 | - } |
|
| 596 | - else { |
|
| 594 | + } else { |
|
| 597 | 595 | return autoriser('defaut', null, null, $qui, $opt); |
| 598 | 596 | } |
| 599 | 597 | } |
@@ -739,8 +737,7 @@ discard block |
||
| 739 | 737 | if (!empty($opt['id_parent'])) { |
| 740 | 738 | // creerarticledans rappelle autoriser(creer,article) sans id, donc on verifiera condition du else aussi |
| 741 | 739 | return autoriser('creerarticledans', 'rubrique', $opt['id_parent'], $qui); |
| 742 | - } |
|
| 743 | - else { |
|
| 740 | + } else { |
|
| 744 | 741 | return (sql_countsel('spip_rubriques') > 0 and in_array($qui['statut'], array('0minirezo', '1comite'))); |
| 745 | 742 | } |
| 746 | 743 | } |
@@ -192,11 +192,9 @@ |
||
| 192 | 192 | |
| 193 | 193 | if ($statut AND test_espace_prive()) { |
| 194 | 194 | $corps = bouton_action(_T('public:accueil_site'),generer_url_ecrire('accueil')); |
| 195 | - } |
|
| 196 | - elseif (!empty($_COOKIE['spip_admin'])) { |
|
| 195 | + } elseif (!empty($_COOKIE['spip_admin'])) { |
|
| 197 | 196 | $corps = bouton_action(_T('public:lien_connecter'),generer_url_public('login')); |
| 198 | - } |
|
| 199 | - else { |
|
| 197 | + } else { |
|
| 200 | 198 | $corps = bouton_action(_T('public:accueil_site'),$GLOBALS['meta']['adresse_site']); |
| 201 | 199 | } |
| 202 | 200 | $corps = "<div class='boutons'>$corps</div>"; |
@@ -85,8 +85,7 @@ |
||
| 85 | 85 | $url_action = self(); |
| 86 | 86 | $action = _request('action'); |
| 87 | 87 | $url_action = parametre_url($url_action, 'action', $action, '&'); |
| 88 | - } |
|
| 89 | - else { |
|
| 88 | + } else { |
|
| 90 | 89 | $action = parametre_url($url_action, 'action'); |
| 91 | 90 | } |
| 92 | 91 | |
@@ -555,11 +555,9 @@ discard block |
||
| 555 | 555 | if (!isset($msg[$p])) { |
| 556 | 556 | if (isset($resume['erreur']) and $resume['erreur']) { |
| 557 | 557 | $msg[$p] = array($resume['erreur']); |
| 558 | - } |
|
| 559 | - elseif (!plugin_version_compatible($k['compatibilite'], $GLOBALS['spip_version_branche'], 'spip')) { |
|
| 558 | + } elseif (!plugin_version_compatible($k['compatibilite'], $GLOBALS['spip_version_branche'], 'spip')) { |
|
| 560 | 559 | $msg[$p] = array(plugin_message_incompatibilite($k['compatibilite'], $GLOBALS['spip_version_branche'], 'SPIP', 'necessite')); |
| 561 | - } |
|
| 562 | - elseif (!$msg[$p] = plugin_necessite($k['necessite'], $liste, 'necessite')) { |
|
| 560 | + } elseif (!$msg[$p] = plugin_necessite($k['necessite'], $liste, 'necessite')) { |
|
| 563 | 561 | $msg[$p] = plugin_necessite($k['utilise'], $liste, 'utilise'); |
| 564 | 562 | } |
| 565 | 563 | } else { |
@@ -942,8 +940,7 @@ discard block |
||
| 942 | 940 | if (is_dir(constant($dir_type) . $plug . '/squelettes/')) { |
| 943 | 941 | $chemins['public'][] = "_DIR_PLUGIN_{$prefix}.'squelettes/'"; |
| 944 | 942 | } |
| 945 | - } |
|
| 946 | - else{ |
|
| 943 | + } else{ |
|
| 947 | 944 | foreach ($info['chemin'] as $chemin) { |
| 948 | 945 | if (!isset($chemin['version']) or plugin_version_compatible($chemin['version'], |
| 949 | 946 | $GLOBALS['spip_version_branche'], 'spip') |
@@ -1166,10 +1163,12 @@ discard block |
||
| 1166 | 1163 | } |
| 1167 | 1164 | $nom = $nomlower; |
| 1168 | 1165 | // une action vide est une declaration qui ne doit pas etre compilee ! |
| 1169 | - if (!isset($GLOBALS['spip_pipeline'][$nom])) // creer le pipeline eventuel |
|
| 1166 | + if (!isset($GLOBALS['spip_pipeline'][$nom])) { |
|
| 1167 | + // creer le pipeline eventuel |
|
| 1170 | 1168 | { |
| 1171 | 1169 | $GLOBALS['spip_pipeline'][$nom] = ""; |
| 1172 | 1170 | } |
| 1171 | + } |
|
| 1173 | 1172 | if ($action) { |
| 1174 | 1173 | if (strpos($GLOBALS['spip_pipeline'][$nom], "|$prefix$action") === false) { |
| 1175 | 1174 | $GLOBALS['spip_pipeline'][$nom] = preg_replace(",(\|\||$),", "|$prefix$action\\1", |
@@ -1430,8 +1429,7 @@ discard block |
||
| 1430 | 1429 | if (file_exists($nom)) { |
| 1431 | 1430 | if (substr($nom, -4) == '.php') { |
| 1432 | 1431 | $fichier_tmp = substr($nom, 0, -4) . '.tmp.php'; |
| 1433 | - } |
|
| 1434 | - else { |
|
| 1432 | + } else { |
|
| 1435 | 1433 | $fichier_tmp = $nom . '.tmp'; |
| 1436 | 1434 | } |
| 1437 | 1435 | file_put_contents($fichier_tmp, $contenu); |
@@ -205,8 +205,7 @@ |
||
| 205 | 205 | // Marie Toto <[email protected]> => @toto.com |
| 206 | 206 | if (preg_match('/@[^\s>]+/', $from, $domain)) { |
| 207 | 207 | $domain = $domain[0]; |
| 208 | - } |
|
| 209 | - else { |
|
| 208 | + } else { |
|
| 210 | 209 | $domain = "@unknown-".md5($from).'.org'; |
| 211 | 210 | } |
| 212 | 211 | $uniq = rand() . '_' . md5($to . $texte) . $domain; |
@@ -359,8 +359,7 @@ |
||
| 359 | 359 | function generer_htpass($pass) { |
| 360 | 360 | if ($generer_htpass = charger_fonction('generer_htpass', 'inc', true)) { |
| 361 | 361 | return $generer_htpass($pass); |
| 362 | - } |
|
| 363 | - elseif (function_exists('crypt')) { |
|
| 362 | + } elseif (function_exists('crypt')) { |
|
| 364 | 363 | return crypt($pass, initialiser_sel()); |
| 365 | 364 | } |
| 366 | 365 | return ''; |
@@ -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 | } |