@@ -19,22 +19,22 @@ |
||
| 19 | 19 | * |
| 20 | 20 | */ |
| 21 | 21 | function balise_INFO__dist($p){ |
| 22 | - $info = $p->nom_champ; |
|
| 23 | - $type_objet = interprete_argument_balise(1,$p); |
|
| 24 | - $id_objet = interprete_argument_balise(2,$p); |
|
| 25 | - if ($info === 'INFO_' or !$type_objet or !$id_objet) { |
|
| 26 | - $msg = _T('zbug_balise_sans_argument', array('balise' => ' INFO_')); |
|
| 27 | - erreur_squelette($msg, $p); |
|
| 28 | - $p->interdire_scripts = true; |
|
| 29 | - return $p; |
|
| 30 | - } |
|
| 31 | - else { |
|
| 32 | - $info_sql = strtolower(substr($info,5)); |
|
| 33 | - $code = "generer_info_entite($id_objet, $type_objet, '$info_sql'".($p->etoile?","._q($p->etoile):"").")"; |
|
| 34 | - $p->code = champ_sql($info, $p, $code); |
|
| 35 | - $p->interdire_scripts = true; |
|
| 36 | - return $p; |
|
| 37 | - } |
|
| 22 | + $info = $p->nom_champ; |
|
| 23 | + $type_objet = interprete_argument_balise(1,$p); |
|
| 24 | + $id_objet = interprete_argument_balise(2,$p); |
|
| 25 | + if ($info === 'INFO_' or !$type_objet or !$id_objet) { |
|
| 26 | + $msg = _T('zbug_balise_sans_argument', array('balise' => ' INFO_')); |
|
| 27 | + erreur_squelette($msg, $p); |
|
| 28 | + $p->interdire_scripts = true; |
|
| 29 | + return $p; |
|
| 30 | + } |
|
| 31 | + else { |
|
| 32 | + $info_sql = strtolower(substr($info,5)); |
|
| 33 | + $code = "generer_info_entite($id_objet, $type_objet, '$info_sql'".($p->etoile?","._q($p->etoile):"").")"; |
|
| 34 | + $p->code = champ_sql($info, $p, $code); |
|
| 35 | + $p->interdire_scripts = true; |
|
| 36 | + return $p; |
|
| 37 | + } |
|
| 38 | 38 | } |
| 39 | 39 | |
| 40 | 40 | ?> |
@@ -18,10 +18,10 @@ discard block |
||
| 18 | 18 | * se reporter a sa documentation |
| 19 | 19 | * |
| 20 | 20 | */ |
| 21 | -function balise_INFO__dist($p){ |
|
| 21 | +function balise_INFO__dist($p) { |
|
| 22 | 22 | $info = $p->nom_champ; |
| 23 | - $type_objet = interprete_argument_balise(1,$p); |
|
| 24 | - $id_objet = interprete_argument_balise(2,$p); |
|
| 23 | + $type_objet = interprete_argument_balise(1, $p); |
|
| 24 | + $id_objet = interprete_argument_balise(2, $p); |
|
| 25 | 25 | if ($info === 'INFO_' or !$type_objet or !$id_objet) { |
| 26 | 26 | $msg = _T('zbug_balise_sans_argument', array('balise' => ' INFO_')); |
| 27 | 27 | erreur_squelette($msg, $p); |
@@ -29,8 +29,8 @@ discard block |
||
| 29 | 29 | return $p; |
| 30 | 30 | } |
| 31 | 31 | else { |
| 32 | - $info_sql = strtolower(substr($info,5)); |
|
| 33 | - $code = "generer_info_entite($id_objet, $type_objet, '$info_sql'".($p->etoile?","._q($p->etoile):"").")"; |
|
| 32 | + $info_sql = strtolower(substr($info, 5)); |
|
| 33 | + $code = "generer_info_entite($id_objet, $type_objet, '$info_sql'".($p->etoile ? ","._q($p->etoile) : "").")"; |
|
| 34 | 34 | $p->code = champ_sql($info, $p, $code); |
| 35 | 35 | $p->interdire_scripts = true; |
| 36 | 36 | return $p; |
@@ -10,7 +10,9 @@ discard block |
||
| 10 | 10 | * Pour plus de details voir le fichier COPYING.txt ou l'aide en ligne. * |
| 11 | 11 | \***************************************************************************/ |
| 12 | 12 | |
| 13 | -if (!defined('_ECRIRE_INC_VERSION')) return; |
|
| 13 | +if (!defined('_ECRIRE_INC_VERSION')) { |
|
| 14 | + return; |
|
| 15 | +} |
|
| 14 | 16 | |
| 15 | 17 | /** |
| 16 | 18 | * Generer n'importe quel info pour un objet : #INFO_TITRE{article, #ENV{id_article}} |
@@ -27,8 +29,7 @@ discard block |
||
| 27 | 29 | erreur_squelette($msg, $p); |
| 28 | 30 | $p->interdire_scripts = true; |
| 29 | 31 | return $p; |
| 30 | - } |
|
| 31 | - else { |
|
| 32 | + } else { |
|
| 32 | 33 | $info_sql = strtolower(substr($info,5)); |
| 33 | 34 | $code = "generer_info_entite($id_objet, $type_objet, '$info_sql'".($p->etoile?","._q($p->etoile):"").")"; |
| 34 | 35 | $p->code = champ_sql($info, $p, $code); |
@@ -19,21 +19,21 @@ |
||
| 19 | 19 | |
| 20 | 20 | // http://doc.spip.org/@balise_MENU_LANG |
| 21 | 21 | function balise_MENU_LANG ($p) { |
| 22 | - return calculer_balise_dynamique($p,'MENU_LANG', array('lang')); |
|
| 22 | + return calculer_balise_dynamique($p,'MENU_LANG', array('lang')); |
|
| 23 | 23 | } |
| 24 | 24 | |
| 25 | 25 | // s'il n'y a qu'une langue eviter definitivement la balise ?php |
| 26 | 26 | // http://doc.spip.org/@balise_MENU_LANG_stat |
| 27 | 27 | function balise_MENU_LANG_stat ($args, $context_compil) { |
| 28 | - if (strpos($GLOBALS['meta']['langues_multilingue'],',') === false) return ''; |
|
| 29 | - return $args; |
|
| 28 | + if (strpos($GLOBALS['meta']['langues_multilingue'],',') === false) return ''; |
|
| 29 | + return $args; |
|
| 30 | 30 | } |
| 31 | 31 | |
| 32 | 32 | // normalement $opt sera toujours non vide suite au test ci-dessus |
| 33 | 33 | // http://doc.spip.org/@balise_MENU_LANG_dyn |
| 34 | 34 | function balise_MENU_LANG_dyn($opt) { |
| 35 | - include_spip('balise/menu_lang_ecrire'); |
|
| 36 | - return menu_lang_pour_tous('var_lang', $opt); |
|
| 35 | + include_spip('balise/menu_lang_ecrire'); |
|
| 36 | + return menu_lang_pour_tous('var_lang', $opt); |
|
| 37 | 37 | } |
| 38 | 38 | |
| 39 | 39 | ?> |
@@ -18,14 +18,14 @@ |
||
| 18 | 18 | |
| 19 | 19 | |
| 20 | 20 | // http://doc.spip.org/@balise_MENU_LANG |
| 21 | -function balise_MENU_LANG ($p) { |
|
| 22 | - return calculer_balise_dynamique($p,'MENU_LANG', array('lang')); |
|
| 21 | +function balise_MENU_LANG($p) { |
|
| 22 | + return calculer_balise_dynamique($p, 'MENU_LANG', array('lang')); |
|
| 23 | 23 | } |
| 24 | 24 | |
| 25 | 25 | // s'il n'y a qu'une langue eviter definitivement la balise ?php |
| 26 | 26 | // http://doc.spip.org/@balise_MENU_LANG_stat |
| 27 | -function balise_MENU_LANG_stat ($args, $context_compil) { |
|
| 28 | - if (strpos($GLOBALS['meta']['langues_multilingue'],',') === false) return ''; |
|
| 27 | +function balise_MENU_LANG_stat($args, $context_compil) { |
|
| 28 | + if (strpos($GLOBALS['meta']['langues_multilingue'], ',') === false) return ''; |
|
| 29 | 29 | return $args; |
| 30 | 30 | } |
| 31 | 31 | |
@@ -10,7 +10,9 @@ discard block |
||
| 10 | 10 | * Pour plus de details voir le fichier COPYING.txt ou l'aide en ligne. * |
| 11 | 11 | \***************************************************************************/ |
| 12 | 12 | |
| 13 | -if (!defined('_ECRIRE_INC_VERSION')) return; |
|
| 13 | +if (!defined('_ECRIRE_INC_VERSION')) { |
|
| 14 | + return; |
|
| 15 | +} |
|
| 14 | 16 | |
| 15 | 17 | // #MENU_LANG affiche le menu des langues de l'espace public |
| 16 | 18 | // et preselectionne celle la globale $lang |
@@ -25,7 +27,9 @@ discard block |
||
| 25 | 27 | // s'il n'y a qu'une langue eviter definitivement la balise ?php |
| 26 | 28 | // http://doc.spip.org/@balise_MENU_LANG_stat |
| 27 | 29 | function balise_MENU_LANG_stat ($args, $context_compil) { |
| 28 | - if (strpos($GLOBALS['meta']['langues_multilingue'],',') === false) return ''; |
|
| 30 | + if (strpos($GLOBALS['meta']['langues_multilingue'],',') === false) { |
|
| 31 | + return ''; |
|
| 32 | + } |
|
| 29 | 33 | return $args; |
| 30 | 34 | } |
| 31 | 35 | |
@@ -20,42 +20,42 @@ |
||
| 20 | 20 | |
| 21 | 21 | // http://doc.spip.org/@balise_FORMULAIRE_ECRIRE_AUTEUR |
| 22 | 22 | function balise_FORMULAIRE_ECRIRE_AUTEUR ($p) { |
| 23 | - return calculer_balise_dynamique($p,'FORMULAIRE_ECRIRE_AUTEUR', array('id_auteur', 'id_article', 'email')); |
|
| 23 | + return calculer_balise_dynamique($p,'FORMULAIRE_ECRIRE_AUTEUR', array('id_auteur', 'id_article', 'email')); |
|
| 24 | 24 | } |
| 25 | 25 | |
| 26 | 26 | // http://doc.spip.org/@balise_FORMULAIRE_ECRIRE_AUTEUR_stat |
| 27 | 27 | function balise_FORMULAIRE_ECRIRE_AUTEUR_stat($args, $context_compil) { |
| 28 | - include_spip('inc/filtres'); |
|
| 29 | - // Pas d'id_auteur ni d'id_article ? Erreur de contexte |
|
| 30 | - $id = intval($args[1]); |
|
| 31 | - if (!$args[0] AND !$id) { |
|
| 32 | - $msg = array('zbug_champ_hors_motif', |
|
| 33 | - array ('champ' => 'FORMULAIRE_ECRIRE_AUTEUR', |
|
| 34 | - 'motif' => 'AUTEURS/ARTICLES')); |
|
| 35 | - |
|
| 36 | - erreur_squelette($msg, $context_compil); |
|
| 37 | - return ''; |
|
| 38 | - } |
|
| 39 | - // Si on est dans un contexte article, |
|
| 40 | - // sortir tous les mails des auteurs de l'article |
|
| 41 | - if (!$args[0] AND $id) { |
|
| 42 | - $r = ''; |
|
| 43 | - $s = sql_allfetsel('email', |
|
| 44 | - 'spip_auteurs AS A LEFT JOIN spip_auteurs_liens AS L ON (A.id_auteur=L.id_auteur AND L.objet=\'article\')', |
|
| 45 | - "A.email != '' AND L.id_objet=$id"); |
|
| 46 | - foreach($s as $row) { |
|
| 47 | - if (email_valide($row['email'])) |
|
| 48 | - $r .= ', '.$row['email']; |
|
| 49 | - } |
|
| 50 | - $args[2] = substr($r, 2); |
|
| 51 | - } |
|
| 52 | - |
|
| 53 | - // On ne peut pas ecrire a un auteur dont le mail n'est pas valide |
|
| 54 | - if (!$args[2] OR !email_valide($args[2])) |
|
| 55 | - return ''; |
|
| 56 | - |
|
| 57 | - // OK |
|
| 58 | - return $args; |
|
| 28 | + include_spip('inc/filtres'); |
|
| 29 | + // Pas d'id_auteur ni d'id_article ? Erreur de contexte |
|
| 30 | + $id = intval($args[1]); |
|
| 31 | + if (!$args[0] AND !$id) { |
|
| 32 | + $msg = array('zbug_champ_hors_motif', |
|
| 33 | + array ('champ' => 'FORMULAIRE_ECRIRE_AUTEUR', |
|
| 34 | + 'motif' => 'AUTEURS/ARTICLES')); |
|
| 35 | + |
|
| 36 | + erreur_squelette($msg, $context_compil); |
|
| 37 | + return ''; |
|
| 38 | + } |
|
| 39 | + // Si on est dans un contexte article, |
|
| 40 | + // sortir tous les mails des auteurs de l'article |
|
| 41 | + if (!$args[0] AND $id) { |
|
| 42 | + $r = ''; |
|
| 43 | + $s = sql_allfetsel('email', |
|
| 44 | + 'spip_auteurs AS A LEFT JOIN spip_auteurs_liens AS L ON (A.id_auteur=L.id_auteur AND L.objet=\'article\')', |
|
| 45 | + "A.email != '' AND L.id_objet=$id"); |
|
| 46 | + foreach($s as $row) { |
|
| 47 | + if (email_valide($row['email'])) |
|
| 48 | + $r .= ', '.$row['email']; |
|
| 49 | + } |
|
| 50 | + $args[2] = substr($r, 2); |
|
| 51 | + } |
|
| 52 | + |
|
| 53 | + // On ne peut pas ecrire a un auteur dont le mail n'est pas valide |
|
| 54 | + if (!$args[2] OR !email_valide($args[2])) |
|
| 55 | + return ''; |
|
| 56 | + |
|
| 57 | + // OK |
|
| 58 | + return $args; |
|
| 59 | 59 | } |
| 60 | 60 | |
| 61 | 61 | ?> |
@@ -19,8 +19,8 @@ discard block |
||
| 19 | 19 | |
| 20 | 20 | |
| 21 | 21 | // http://doc.spip.org/@balise_FORMULAIRE_ECRIRE_AUTEUR |
| 22 | -function balise_FORMULAIRE_ECRIRE_AUTEUR ($p) { |
|
| 23 | - return calculer_balise_dynamique($p,'FORMULAIRE_ECRIRE_AUTEUR', array('id_auteur', 'id_article', 'email')); |
|
| 22 | +function balise_FORMULAIRE_ECRIRE_AUTEUR($p) { |
|
| 23 | + return calculer_balise_dynamique($p, 'FORMULAIRE_ECRIRE_AUTEUR', array('id_auteur', 'id_article', 'email')); |
|
| 24 | 24 | } |
| 25 | 25 | |
| 26 | 26 | // http://doc.spip.org/@balise_FORMULAIRE_ECRIRE_AUTEUR_stat |
@@ -30,7 +30,7 @@ discard block |
||
| 30 | 30 | $id = intval($args[1]); |
| 31 | 31 | if (!$args[0] AND !$id) { |
| 32 | 32 | $msg = array('zbug_champ_hors_motif', |
| 33 | - array ('champ' => 'FORMULAIRE_ECRIRE_AUTEUR', |
|
| 33 | + array('champ' => 'FORMULAIRE_ECRIRE_AUTEUR', |
|
| 34 | 34 | 'motif' => 'AUTEURS/ARTICLES')); |
| 35 | 35 | |
| 36 | 36 | erreur_squelette($msg, $context_compil); |
@@ -43,7 +43,7 @@ discard block |
||
| 43 | 43 | $s = sql_allfetsel('email', |
| 44 | 44 | 'spip_auteurs AS A LEFT JOIN spip_auteurs_liens AS L ON (A.id_auteur=L.id_auteur AND L.objet=\'article\')', |
| 45 | 45 | "A.email != '' AND L.id_objet=$id"); |
| 46 | - foreach($s as $row) { |
|
| 46 | + foreach ($s as $row) { |
|
| 47 | 47 | if (email_valide($row['email'])) |
| 48 | 48 | $r .= ', '.$row['email']; |
| 49 | 49 | } |
@@ -10,7 +10,9 @@ discard block |
||
| 10 | 10 | * Pour plus de details voir le fichier COPYING.txt ou l'aide en ligne. * |
| 11 | 11 | \***************************************************************************/ |
| 12 | 12 | |
| 13 | -if (!defined('_ECRIRE_INC_VERSION')) return; |
|
| 13 | +if (!defined('_ECRIRE_INC_VERSION')) { |
|
| 14 | + return; |
|
| 15 | +} |
|
| 14 | 16 | |
| 15 | 17 | include_spip('base/abstract_sql'); |
| 16 | 18 | |
@@ -44,15 +46,17 @@ discard block |
||
| 44 | 46 | 'spip_auteurs AS A LEFT JOIN spip_auteurs_liens AS L ON (A.id_auteur=L.id_auteur AND L.objet=\'article\')', |
| 45 | 47 | "A.email != '' AND L.id_objet=$id"); |
| 46 | 48 | foreach($s as $row) { |
| 47 | - if (email_valide($row['email'])) |
|
| 48 | - $r .= ', '.$row['email']; |
|
| 49 | + if (email_valide($row['email'])) { |
|
| 50 | + $r .= ', '.$row['email']; |
|
| 51 | + } |
|
| 49 | 52 | } |
| 50 | 53 | $args[2] = substr($r, 2); |
| 51 | 54 | } |
| 52 | 55 | |
| 53 | 56 | // On ne peut pas ecrire a un auteur dont le mail n'est pas valide |
| 54 | - if (!$args[2] OR !email_valide($args[2])) |
|
| 55 | - return ''; |
|
| 57 | + if (!$args[2] OR !email_valide($args[2])) { |
|
| 58 | + return ''; |
|
| 59 | + } |
|
| 56 | 60 | |
| 57 | 61 | // OK |
| 58 | 62 | return $args; |
@@ -19,15 +19,15 @@ |
||
| 19 | 19 | // $args[0] = url destination apres logout [(#URL_LOGOUT{url})] |
| 20 | 20 | // http://doc.spip.org/@balise_URL_LOGOUT_stat |
| 21 | 21 | function balise_URL_LOGOUT_stat ($args, $context_compil) { |
| 22 | - $url = isset($args[0]) ? $args[0] : ''; |
|
| 23 | - return array($url); |
|
| 22 | + $url = isset($args[0]) ? $args[0] : ''; |
|
| 23 | + return array($url); |
|
| 24 | 24 | } |
| 25 | 25 | |
| 26 | 26 | // http://doc.spip.org/@balise_URL_LOGOUT_dyn |
| 27 | 27 | function balise_URL_LOGOUT_dyn($cible) { |
| 28 | 28 | |
| 29 | - if (!$GLOBALS['visiteur_session']['login'] AND !$GLOBALS['visiteur_session']['statut']) return ''; |
|
| 29 | + if (!$GLOBALS['visiteur_session']['login'] AND !$GLOBALS['visiteur_session']['statut']) return ''; |
|
| 30 | 30 | |
| 31 | - return generer_url_action('logout',"logout=public&url=" . rawurlencode($cible ? $cible : self('&'))); |
|
| 31 | + return generer_url_action('logout',"logout=public&url=" . rawurlencode($cible ? $cible : self('&'))); |
|
| 32 | 32 | } |
| 33 | 33 | ?> |
@@ -13,12 +13,12 @@ discard block |
||
| 13 | 13 | if (!defined('_ECRIRE_INC_VERSION')) return; |
| 14 | 14 | |
| 15 | 15 | // http://doc.spip.org/@balise_URL_LOGOUT |
| 16 | -function balise_URL_LOGOUT ($p) {return calculer_balise_dynamique($p,'URL_LOGOUT', array()); |
|
| 16 | +function balise_URL_LOGOUT($p) {return calculer_balise_dynamique($p, 'URL_LOGOUT', array()); |
|
| 17 | 17 | } |
| 18 | 18 | |
| 19 | 19 | // $args[0] = url destination apres logout [(#URL_LOGOUT{url})] |
| 20 | 20 | // http://doc.spip.org/@balise_URL_LOGOUT_stat |
| 21 | -function balise_URL_LOGOUT_stat ($args, $context_compil) { |
|
| 21 | +function balise_URL_LOGOUT_stat($args, $context_compil) { |
|
| 22 | 22 | $url = isset($args[0]) ? $args[0] : ''; |
| 23 | 23 | return array($url); |
| 24 | 24 | } |
@@ -28,6 +28,6 @@ discard block |
||
| 28 | 28 | |
| 29 | 29 | if (!$GLOBALS['visiteur_session']['login'] AND !$GLOBALS['visiteur_session']['statut']) return ''; |
| 30 | 30 | |
| 31 | - return generer_url_action('logout',"logout=public&url=" . rawurlencode($cible ? $cible : self('&'))); |
|
| 31 | + return generer_url_action('logout', "logout=public&url=".rawurlencode($cible ? $cible : self('&'))); |
|
| 32 | 32 | } |
| 33 | 33 | ?> |
@@ -10,7 +10,9 @@ discard block |
||
| 10 | 10 | * Pour plus de details voir le fichier COPYING.txt ou l'aide en ligne. * |
| 11 | 11 | \***************************************************************************/ |
| 12 | 12 | |
| 13 | -if (!defined('_ECRIRE_INC_VERSION')) return; |
|
| 13 | +if (!defined('_ECRIRE_INC_VERSION')) { |
|
| 14 | + return; |
|
| 15 | +} |
|
| 14 | 16 | |
| 15 | 17 | // http://doc.spip.org/@balise_URL_LOGOUT |
| 16 | 18 | function balise_URL_LOGOUT ($p) {return calculer_balise_dynamique($p,'URL_LOGOUT', array()); |
@@ -26,7 +28,9 @@ discard block |
||
| 26 | 28 | // http://doc.spip.org/@balise_URL_LOGOUT_dyn |
| 27 | 29 | function balise_URL_LOGOUT_dyn($cible) { |
| 28 | 30 | |
| 29 | - if (!$GLOBALS['visiteur_session']['login'] AND !$GLOBALS['visiteur_session']['statut']) return ''; |
|
| 31 | + if (!$GLOBALS['visiteur_session']['login'] AND !$GLOBALS['visiteur_session']['statut']) { |
|
| 32 | + return ''; |
|
| 33 | + } |
|
| 30 | 34 | |
| 31 | 35 | return generer_url_action('logout',"logout=public&url=" . rawurlencode($cible ? $cible : self('&'))); |
| 32 | 36 | } |
@@ -22,7 +22,7 @@ discard block |
||
| 22 | 22 | |
| 23 | 23 | function balise_CONFIGURER_METAS_dist($p) { |
| 24 | 24 | |
| 25 | - return calculer_balise_dynamique($p, $p->nom_champ, array()); |
|
| 25 | + return calculer_balise_dynamique($p, $p->nom_champ, array()); |
|
| 26 | 26 | } |
| 27 | 27 | |
| 28 | 28 | // A l'execution on dispose du nom du squelette, on verifie qu'il existe. |
@@ -31,12 +31,12 @@ discard block |
||
| 31 | 31 | |
| 32 | 32 | function balise_CONFIGURER_METAS_dyn($form) { |
| 33 | 33 | |
| 34 | - include_spip('balise/formulaire_'); |
|
| 35 | - if (!existe_formulaire($form)) return ''; |
|
| 36 | - $args = func_get_args(); |
|
| 37 | - $contexte = balise_FORMULAIRE__contexte('configurer_metas', $args); |
|
| 38 | - if (!is_array($contexte)) return $contexte; |
|
| 39 | - return array('formulaires/' . $form, 3600, $contexte); |
|
| 34 | + include_spip('balise/formulaire_'); |
|
| 35 | + if (!existe_formulaire($form)) return ''; |
|
| 36 | + $args = func_get_args(); |
|
| 37 | + $contexte = balise_FORMULAIRE__contexte('configurer_metas', $args); |
|
| 38 | + if (!is_array($contexte)) return $contexte; |
|
| 39 | + return array('formulaires/' . $form, 3600, $contexte); |
|
| 40 | 40 | } |
| 41 | 41 | |
| 42 | 42 | ?> |
@@ -36,7 +36,7 @@ |
||
| 36 | 36 | $args = func_get_args(); |
| 37 | 37 | $contexte = balise_FORMULAIRE__contexte('configurer_metas', $args); |
| 38 | 38 | if (!is_array($contexte)) return $contexte; |
| 39 | - return array('formulaires/' . $form, 3600, $contexte); |
|
| 39 | + return array('formulaires/'.$form, 3600, $contexte); |
|
| 40 | 40 | } |
| 41 | 41 | |
| 42 | 42 | ?> |
@@ -10,7 +10,9 @@ discard block |
||
| 10 | 10 | * Pour plus de details voir le fichier COPYING.txt ou l'aide en ligne. * |
| 11 | 11 | \***************************************************************************/ |
| 12 | 12 | |
| 13 | -if (!defined('_ECRIRE_INC_VERSION')) return; |
|
| 13 | +if (!defined('_ECRIRE_INC_VERSION')) { |
|
| 14 | + return; |
|
| 15 | +} |
|
| 14 | 16 | |
| 15 | 17 | // Une balise qui prend en argument un squelette suppose contenir un FORM |
| 16 | 18 | // et gere ses saises automatiquement dans une table SQL a 2 colonnes |
@@ -32,10 +34,14 @@ discard block |
||
| 32 | 34 | function balise_CONFIGURER_METAS_dyn($form) { |
| 33 | 35 | |
| 34 | 36 | include_spip('balise/formulaire_'); |
| 35 | - if (!existe_formulaire($form)) return ''; |
|
| 37 | + if (!existe_formulaire($form)) { |
|
| 38 | + return ''; |
|
| 39 | + } |
|
| 36 | 40 | $args = func_get_args(); |
| 37 | 41 | $contexte = balise_FORMULAIRE__contexte('configurer_metas', $args); |
| 38 | - if (!is_array($contexte)) return $contexte; |
|
| 42 | + if (!is_array($contexte)) { |
|
| 43 | + return $contexte; |
|
| 44 | + } |
|
| 39 | 45 | return array('formulaires/' . $form, 3600, $contexte); |
| 40 | 46 | } |
| 41 | 47 | |
@@ -14,14 +14,14 @@ discard block |
||
| 14 | 14 | |
| 15 | 15 | // http://doc.spip.org/@balise_FORMULAIRE_ADMIN |
| 16 | 16 | function balise_FORMULAIRE_ADMIN ($p) { |
| 17 | - return calculer_balise_dynamique($p,'FORMULAIRE_ADMIN', array()); |
|
| 17 | + return calculer_balise_dynamique($p,'FORMULAIRE_ADMIN', array()); |
|
| 18 | 18 | } |
| 19 | 19 | |
| 20 | 20 | # on ne peut rien dire au moment de l'execution du squelette |
| 21 | 21 | |
| 22 | 22 | // http://doc.spip.org/@balise_FORMULAIRE_ADMIN_stat |
| 23 | 23 | function balise_FORMULAIRE_ADMIN_stat($args, $context_compil) { |
| 24 | - return $args; |
|
| 24 | + return $args; |
|
| 25 | 25 | } |
| 26 | 26 | |
| 27 | 27 | # les boutons admin sont mis d'autorite si absents |
@@ -34,57 +34,57 @@ discard block |
||
| 34 | 34 | // http://doc.spip.org/@balise_FORMULAIRE_ADMIN_dyn |
| 35 | 35 | function balise_FORMULAIRE_ADMIN_dyn($float='', $debug='') { |
| 36 | 36 | |
| 37 | - global $use_cache; |
|
| 38 | - static $dejafait = false; |
|
| 37 | + global $use_cache; |
|
| 38 | + static $dejafait = false; |
|
| 39 | 39 | |
| 40 | - if (!@$_COOKIE['spip_admin']) |
|
| 41 | - return ''; |
|
| 40 | + if (!@$_COOKIE['spip_admin']) |
|
| 41 | + return ''; |
|
| 42 | 42 | |
| 43 | - if (!is_array($debug)) { |
|
| 44 | - if ($dejafait) |
|
| 45 | - return ''; |
|
| 46 | - } else { |
|
| 47 | - if ($dejafait) { |
|
| 48 | - if (empty($debug['sourcefile'])) return ''; |
|
| 49 | - foreach($debug['sourcefile'] as $k => $v) { |
|
| 50 | - if (strpos($v,'administration.') !== false) |
|
| 51 | - return $debug['resultat'][$k . 'tout']; |
|
| 52 | - } |
|
| 53 | - return ''; |
|
| 54 | - } |
|
| 55 | - } |
|
| 43 | + if (!is_array($debug)) { |
|
| 44 | + if ($dejafait) |
|
| 45 | + return ''; |
|
| 46 | + } else { |
|
| 47 | + if ($dejafait) { |
|
| 48 | + if (empty($debug['sourcefile'])) return ''; |
|
| 49 | + foreach($debug['sourcefile'] as $k => $v) { |
|
| 50 | + if (strpos($v,'administration.') !== false) |
|
| 51 | + return $debug['resultat'][$k . 'tout']; |
|
| 52 | + } |
|
| 53 | + return ''; |
|
| 54 | + } |
|
| 55 | + } |
|
| 56 | 56 | |
| 57 | - include_spip('inc/autoriser'); |
|
| 58 | - include_spip('base/abstract_sql'); |
|
| 57 | + include_spip('inc/autoriser'); |
|
| 58 | + include_spip('base/abstract_sql'); |
|
| 59 | 59 | |
| 60 | 60 | |
| 61 | - $dejafait = true; |
|
| 61 | + $dejafait = true; |
|
| 62 | 62 | |
| 63 | - // Preparer le #ENV des boutons |
|
| 63 | + // Preparer le #ENV des boutons |
|
| 64 | 64 | |
| 65 | - $env = admin_objet(); |
|
| 65 | + $env = admin_objet(); |
|
| 66 | 66 | |
| 67 | - // Pas de "modifier ce..." ? -> donner "acces a l'espace prive" |
|
| 68 | - if (!$env) |
|
| 69 | - $env['ecrire'] = _DIR_RESTREINT_ABS; |
|
| 67 | + // Pas de "modifier ce..." ? -> donner "acces a l'espace prive" |
|
| 68 | + if (!$env) |
|
| 69 | + $env['ecrire'] = _DIR_RESTREINT_ABS; |
|
| 70 | 70 | |
| 71 | - $env['divclass'] = $float; |
|
| 72 | - $env['lang'] = admin_lang(); |
|
| 73 | - $env['calcul'] = (_request('var_mode') ? 'recalcul' : 'calcul'); |
|
| 74 | - $env['debug'] = ((defined('_VAR_PREVIEW') AND _VAR_PREVIEW) ? "" : admin_debug()); |
|
| 75 | - $env['analyser'] = (!$env['debug'] AND !$GLOBALS['xhtml']) ? '' : admin_valider(); |
|
| 76 | - $env['inclure'] = ((defined('_VAR_INCLURE') AND _VAR_INCLURE)?'inclure':''); |
|
| 71 | + $env['divclass'] = $float; |
|
| 72 | + $env['lang'] = admin_lang(); |
|
| 73 | + $env['calcul'] = (_request('var_mode') ? 'recalcul' : 'calcul'); |
|
| 74 | + $env['debug'] = ((defined('_VAR_PREVIEW') AND _VAR_PREVIEW) ? "" : admin_debug()); |
|
| 75 | + $env['analyser'] = (!$env['debug'] AND !$GLOBALS['xhtml']) ? '' : admin_valider(); |
|
| 76 | + $env['inclure'] = ((defined('_VAR_INCLURE') AND _VAR_INCLURE)?'inclure':''); |
|
| 77 | 77 | |
| 78 | - if (!$use_cache) |
|
| 79 | - $env['use_cache'] = ' *'; |
|
| 78 | + if (!$use_cache) |
|
| 79 | + $env['use_cache'] = ' *'; |
|
| 80 | 80 | |
| 81 | - if (isset($debug['validation'])) { |
|
| 82 | - $env['xhtml_error'] = $debug['validation']; |
|
| 83 | - } |
|
| 81 | + if (isset($debug['validation'])) { |
|
| 82 | + $env['xhtml_error'] = $debug['validation']; |
|
| 83 | + } |
|
| 84 | 84 | |
| 85 | - $env['_pipelines']['formulaire_admin']=array(); |
|
| 85 | + $env['_pipelines']['formulaire_admin']=array(); |
|
| 86 | 86 | |
| 87 | - return array('formulaires/administration', 0, $env); |
|
| 87 | + return array('formulaires/administration', 0, $env); |
|
| 88 | 88 | } |
| 89 | 89 | |
| 90 | 90 | // Afficher le bouton 'Modifier ce...' |
@@ -95,65 +95,65 @@ discard block |
||
| 95 | 95 | // http://doc.spip.org/@admin_objet |
| 96 | 96 | function admin_objet() |
| 97 | 97 | { |
| 98 | - include_spip('inc/urls'); |
|
| 99 | - $env = array(); |
|
| 100 | - |
|
| 101 | - $trouver_table = charger_fonction('trouver_table','base'); |
|
| 102 | - $objets = urls_liste_objets(false); |
|
| 103 | - $objets = array_diff($objets, array('rubrique')); |
|
| 104 | - $objets = array_reverse($objets); |
|
| 105 | - array_unshift($objets, 'rubrique'); |
|
| 106 | - foreach ($objets as $obj) { |
|
| 107 | - $type = $obj; |
|
| 108 | - if ($type==objet_type($type,false) |
|
| 109 | - AND $_id_type = id_table_objet($type) |
|
| 110 | - AND isset($GLOBALS['contexte'][$_id_type]) |
|
| 111 | - AND $id = $GLOBALS['contexte'][$_id_type] |
|
| 112 | - AND !is_array($id) |
|
| 113 | - AND $id=intval($id)) { |
|
| 114 | - $id = sql_getfetsel($_id_type, table_objet_sql($type), "$_id_type=".intval($id)); |
|
| 115 | - if ($id) { |
|
| 116 | - $env[$_id_type] = $id; |
|
| 117 | - $env['objet'] = $type; |
|
| 118 | - $env['id_objet'] = $id; |
|
| 119 | - $env['voir_'.$obj] = |
|
| 120 | - str_replace('&', '&', generer_url_entite($id,$obj,'','',false)); |
|
| 121 | - if ($desc = $trouver_table(table_objet_sql($type)) |
|
| 122 | - AND isset($desc['field']['id_rubrique']) |
|
| 123 | - AND $type != 'rubrique') { |
|
| 124 | - unset($env['id_rubrique']); |
|
| 125 | - unset($env['voir_rubrique']); |
|
| 126 | - if (admin_preview($type, $id, $desc)) |
|
| 127 | - $env['preview']=parametre_url(self(),'var_mode','preview','&'); |
|
| 128 | - } |
|
| 129 | - } |
|
| 130 | - } |
|
| 131 | - } |
|
| 132 | - return $env; |
|
| 98 | + include_spip('inc/urls'); |
|
| 99 | + $env = array(); |
|
| 100 | + |
|
| 101 | + $trouver_table = charger_fonction('trouver_table','base'); |
|
| 102 | + $objets = urls_liste_objets(false); |
|
| 103 | + $objets = array_diff($objets, array('rubrique')); |
|
| 104 | + $objets = array_reverse($objets); |
|
| 105 | + array_unshift($objets, 'rubrique'); |
|
| 106 | + foreach ($objets as $obj) { |
|
| 107 | + $type = $obj; |
|
| 108 | + if ($type==objet_type($type,false) |
|
| 109 | + AND $_id_type = id_table_objet($type) |
|
| 110 | + AND isset($GLOBALS['contexte'][$_id_type]) |
|
| 111 | + AND $id = $GLOBALS['contexte'][$_id_type] |
|
| 112 | + AND !is_array($id) |
|
| 113 | + AND $id=intval($id)) { |
|
| 114 | + $id = sql_getfetsel($_id_type, table_objet_sql($type), "$_id_type=".intval($id)); |
|
| 115 | + if ($id) { |
|
| 116 | + $env[$_id_type] = $id; |
|
| 117 | + $env['objet'] = $type; |
|
| 118 | + $env['id_objet'] = $id; |
|
| 119 | + $env['voir_'.$obj] = |
|
| 120 | + str_replace('&', '&', generer_url_entite($id,$obj,'','',false)); |
|
| 121 | + if ($desc = $trouver_table(table_objet_sql($type)) |
|
| 122 | + AND isset($desc['field']['id_rubrique']) |
|
| 123 | + AND $type != 'rubrique') { |
|
| 124 | + unset($env['id_rubrique']); |
|
| 125 | + unset($env['voir_rubrique']); |
|
| 126 | + if (admin_preview($type, $id, $desc)) |
|
| 127 | + $env['preview']=parametre_url(self(),'var_mode','preview','&'); |
|
| 128 | + } |
|
| 129 | + } |
|
| 130 | + } |
|
| 131 | + } |
|
| 132 | + return $env; |
|
| 133 | 133 | } |
| 134 | 134 | |
| 135 | 135 | |
| 136 | 136 | // http://doc.spip.org/@admin_preview |
| 137 | 137 | function admin_preview($type, $id, $desc=null) |
| 138 | 138 | { |
| 139 | - if (defined('_VAR_PREVIEW') AND _VAR_PREVIEW) return ''; |
|
| 139 | + if (defined('_VAR_PREVIEW') AND _VAR_PREVIEW) return ''; |
|
| 140 | 140 | |
| 141 | - if (!$desc) { |
|
| 142 | - $trouver_table = charger_fonction('trouver_table','base'); |
|
| 143 | - $desc = $trouver_table(table_objet_sql($type)); |
|
| 144 | - } |
|
| 145 | - if (!$desc OR !isset($desc['field']['statut'])) |
|
| 146 | - return ''; |
|
| 141 | + if (!$desc) { |
|
| 142 | + $trouver_table = charger_fonction('trouver_table','base'); |
|
| 143 | + $desc = $trouver_table(table_objet_sql($type)); |
|
| 144 | + } |
|
| 145 | + if (!$desc OR !isset($desc['field']['statut'])) |
|
| 146 | + return ''; |
|
| 147 | 147 | |
| 148 | - include_spip('inc/autoriser'); |
|
| 149 | - if (!autoriser('previsualiser')) return ''; |
|
| 148 | + include_spip('inc/autoriser'); |
|
| 149 | + if (!autoriser('previsualiser')) return ''; |
|
| 150 | 150 | |
| 151 | - $notpub = sql_in("statut", array('prop', 'prive')); |
|
| 151 | + $notpub = sql_in("statut", array('prop', 'prive')); |
|
| 152 | 152 | |
| 153 | - if ($type == 'article' AND $GLOBALS['meta']['post_dates'] != 'oui') |
|
| 154 | - $notpub .= " OR (statut='publie' AND date>".sql_quote(date('Y-m-d H:i:s')).")"; |
|
| 153 | + if ($type == 'article' AND $GLOBALS['meta']['post_dates'] != 'oui') |
|
| 154 | + $notpub .= " OR (statut='publie' AND date>".sql_quote(date('Y-m-d H:i:s')).")"; |
|
| 155 | 155 | |
| 156 | - return sql_fetsel('1', table_objet_sql($type), id_table_objet($type)."=".$id." AND ($notpub)"); |
|
| 156 | + return sql_fetsel('1', table_objet_sql($type), id_table_objet($type)."=".$id." AND ($notpub)"); |
|
| 157 | 157 | } |
| 158 | 158 | |
| 159 | 159 | // |
@@ -163,40 +163,40 @@ discard block |
||
| 163 | 163 | // http://doc.spip.org/@admin_lang |
| 164 | 164 | function admin_lang() |
| 165 | 165 | { |
| 166 | - $alang = sql_getfetsel('lang', 'spip_auteurs', "login=" . sql_quote(preg_replace(',^@,','',@$_COOKIE['spip_admin']))); |
|
| 167 | - if (!$alang) return ''; |
|
| 166 | + $alang = sql_getfetsel('lang', 'spip_auteurs', "login=" . sql_quote(preg_replace(',^@,','',@$_COOKIE['spip_admin']))); |
|
| 167 | + if (!$alang) return ''; |
|
| 168 | 168 | |
| 169 | - $l = lang_select($alang); |
|
| 170 | - $alang = $GLOBALS['spip_lang']; |
|
| 171 | - if ($l) lang_select(); |
|
| 172 | - return $alang; |
|
| 169 | + $l = lang_select($alang); |
|
| 170 | + $alang = $GLOBALS['spip_lang']; |
|
| 171 | + if ($l) lang_select(); |
|
| 172 | + return $alang; |
|
| 173 | 173 | } |
| 174 | 174 | |
| 175 | 175 | // http://doc.spip.org/@admin_valider |
| 176 | 176 | function admin_valider() |
| 177 | 177 | { |
| 178 | - global $xhtml; |
|
| 178 | + global $xhtml; |
|
| 179 | 179 | |
| 180 | - return ((@$xhtml !== 'true') ? |
|
| 181 | - (parametre_url(self(), 'var_mode', 'debug', '&') |
|
| 182 | - .'&var_mode_affiche=validation') : |
|
| 183 | - ('http://validator.w3.org/check?uri=' |
|
| 184 | - . rawurlencode("http://" . $_SERVER['HTTP_HOST'] . nettoyer_uri()))); |
|
| 180 | + return ((@$xhtml !== 'true') ? |
|
| 181 | + (parametre_url(self(), 'var_mode', 'debug', '&') |
|
| 182 | + .'&var_mode_affiche=validation') : |
|
| 183 | + ('http://validator.w3.org/check?uri=' |
|
| 184 | + . rawurlencode("http://" . $_SERVER['HTTP_HOST'] . nettoyer_uri()))); |
|
| 185 | 185 | } |
| 186 | 186 | |
| 187 | 187 | // http://doc.spip.org/@admin_debug |
| 188 | 188 | function admin_debug() |
| 189 | 189 | { |
| 190 | - return (( |
|
| 191 | - (isset($GLOBALS['forcer_debug']) AND $GLOBALS['forcer_debug']) |
|
| 192 | - OR (isset($GLOBALS['bouton_admin_debug']) AND $GLOBALS['bouton_admin_debug']) |
|
| 193 | - OR ( |
|
| 194 | - defined('_VAR_MODE') AND _VAR_MODE == 'debug' |
|
| 195 | - AND $_COOKIE['spip_debug'] |
|
| 196 | - ) |
|
| 197 | - ) AND autoriser('debug') |
|
| 198 | - ) |
|
| 199 | - ? parametre_url(self(),'var_mode', 'debug', '&'): ''; |
|
| 190 | + return (( |
|
| 191 | + (isset($GLOBALS['forcer_debug']) AND $GLOBALS['forcer_debug']) |
|
| 192 | + OR (isset($GLOBALS['bouton_admin_debug']) AND $GLOBALS['bouton_admin_debug']) |
|
| 193 | + OR ( |
|
| 194 | + defined('_VAR_MODE') AND _VAR_MODE == 'debug' |
|
| 195 | + AND $_COOKIE['spip_debug'] |
|
| 196 | + ) |
|
| 197 | + ) AND autoriser('debug') |
|
| 198 | + ) |
|
| 199 | + ? parametre_url(self(),'var_mode', 'debug', '&'): ''; |
|
| 200 | 200 | } |
| 201 | 201 | |
| 202 | 202 | ?> |
@@ -13,8 +13,8 @@ discard block |
||
| 13 | 13 | if (!defined('_ECRIRE_INC_VERSION')) return; |
| 14 | 14 | |
| 15 | 15 | // http://doc.spip.org/@balise_FORMULAIRE_ADMIN |
| 16 | -function balise_FORMULAIRE_ADMIN ($p) { |
|
| 17 | - return calculer_balise_dynamique($p,'FORMULAIRE_ADMIN', array()); |
|
| 16 | +function balise_FORMULAIRE_ADMIN($p) { |
|
| 17 | + return calculer_balise_dynamique($p, 'FORMULAIRE_ADMIN', array()); |
|
| 18 | 18 | } |
| 19 | 19 | |
| 20 | 20 | # on ne peut rien dire au moment de l'execution du squelette |
@@ -32,7 +32,7 @@ discard block |
||
| 32 | 32 | # Le debuger transmet donc ses donnees, et cette balise y retrouve son petit. |
| 33 | 33 | |
| 34 | 34 | // http://doc.spip.org/@balise_FORMULAIRE_ADMIN_dyn |
| 35 | -function balise_FORMULAIRE_ADMIN_dyn($float='', $debug='') { |
|
| 35 | +function balise_FORMULAIRE_ADMIN_dyn($float = '', $debug = '') { |
|
| 36 | 36 | |
| 37 | 37 | global $use_cache; |
| 38 | 38 | static $dejafait = false; |
@@ -46,9 +46,9 @@ discard block |
||
| 46 | 46 | } else { |
| 47 | 47 | if ($dejafait) { |
| 48 | 48 | if (empty($debug['sourcefile'])) return ''; |
| 49 | - foreach($debug['sourcefile'] as $k => $v) { |
|
| 50 | - if (strpos($v,'administration.') !== false) |
|
| 51 | - return $debug['resultat'][$k . 'tout']; |
|
| 49 | + foreach ($debug['sourcefile'] as $k => $v) { |
|
| 50 | + if (strpos($v, 'administration.') !== false) |
|
| 51 | + return $debug['resultat'][$k.'tout']; |
|
| 52 | 52 | } |
| 53 | 53 | return ''; |
| 54 | 54 | } |
@@ -73,7 +73,7 @@ discard block |
||
| 73 | 73 | $env['calcul'] = (_request('var_mode') ? 'recalcul' : 'calcul'); |
| 74 | 74 | $env['debug'] = ((defined('_VAR_PREVIEW') AND _VAR_PREVIEW) ? "" : admin_debug()); |
| 75 | 75 | $env['analyser'] = (!$env['debug'] AND !$GLOBALS['xhtml']) ? '' : admin_valider(); |
| 76 | - $env['inclure'] = ((defined('_VAR_INCLURE') AND _VAR_INCLURE)?'inclure':''); |
|
| 76 | + $env['inclure'] = ((defined('_VAR_INCLURE') AND _VAR_INCLURE) ? 'inclure' : ''); |
|
| 77 | 77 | |
| 78 | 78 | if (!$use_cache) |
| 79 | 79 | $env['use_cache'] = ' *'; |
@@ -82,7 +82,7 @@ discard block |
||
| 82 | 82 | $env['xhtml_error'] = $debug['validation']; |
| 83 | 83 | } |
| 84 | 84 | |
| 85 | - $env['_pipelines']['formulaire_admin']=array(); |
|
| 85 | + $env['_pipelines']['formulaire_admin'] = array(); |
|
| 86 | 86 | |
| 87 | 87 | return array('formulaires/administration', 0, $env); |
| 88 | 88 | } |
@@ -98,33 +98,33 @@ discard block |
||
| 98 | 98 | include_spip('inc/urls'); |
| 99 | 99 | $env = array(); |
| 100 | 100 | |
| 101 | - $trouver_table = charger_fonction('trouver_table','base'); |
|
| 101 | + $trouver_table = charger_fonction('trouver_table', 'base'); |
|
| 102 | 102 | $objets = urls_liste_objets(false); |
| 103 | 103 | $objets = array_diff($objets, array('rubrique')); |
| 104 | 104 | $objets = array_reverse($objets); |
| 105 | 105 | array_unshift($objets, 'rubrique'); |
| 106 | 106 | foreach ($objets as $obj) { |
| 107 | 107 | $type = $obj; |
| 108 | - if ($type==objet_type($type,false) |
|
| 108 | + if ($type == objet_type($type, false) |
|
| 109 | 109 | AND $_id_type = id_table_objet($type) |
| 110 | 110 | AND isset($GLOBALS['contexte'][$_id_type]) |
| 111 | 111 | AND $id = $GLOBALS['contexte'][$_id_type] |
| 112 | 112 | AND !is_array($id) |
| 113 | - AND $id=intval($id)) { |
|
| 113 | + AND $id = intval($id)) { |
|
| 114 | 114 | $id = sql_getfetsel($_id_type, table_objet_sql($type), "$_id_type=".intval($id)); |
| 115 | 115 | if ($id) { |
| 116 | 116 | $env[$_id_type] = $id; |
| 117 | 117 | $env['objet'] = $type; |
| 118 | 118 | $env['id_objet'] = $id; |
| 119 | 119 | $env['voir_'.$obj] = |
| 120 | - str_replace('&', '&', generer_url_entite($id,$obj,'','',false)); |
|
| 120 | + str_replace('&', '&', generer_url_entite($id, $obj, '', '', false)); |
|
| 121 | 121 | if ($desc = $trouver_table(table_objet_sql($type)) |
| 122 | 122 | AND isset($desc['field']['id_rubrique']) |
| 123 | 123 | AND $type != 'rubrique') { |
| 124 | 124 | unset($env['id_rubrique']); |
| 125 | 125 | unset($env['voir_rubrique']); |
| 126 | 126 | if (admin_preview($type, $id, $desc)) |
| 127 | - $env['preview']=parametre_url(self(),'var_mode','preview','&'); |
|
| 127 | + $env['preview'] = parametre_url(self(), 'var_mode', 'preview', '&'); |
|
| 128 | 128 | } |
| 129 | 129 | } |
| 130 | 130 | } |
@@ -134,12 +134,12 @@ discard block |
||
| 134 | 134 | |
| 135 | 135 | |
| 136 | 136 | // http://doc.spip.org/@admin_preview |
| 137 | -function admin_preview($type, $id, $desc=null) |
|
| 137 | +function admin_preview($type, $id, $desc = null) |
|
| 138 | 138 | { |
| 139 | 139 | if (defined('_VAR_PREVIEW') AND _VAR_PREVIEW) return ''; |
| 140 | 140 | |
| 141 | 141 | if (!$desc) { |
| 142 | - $trouver_table = charger_fonction('trouver_table','base'); |
|
| 142 | + $trouver_table = charger_fonction('trouver_table', 'base'); |
|
| 143 | 143 | $desc = $trouver_table(table_objet_sql($type)); |
| 144 | 144 | } |
| 145 | 145 | if (!$desc OR !isset($desc['field']['statut'])) |
@@ -150,7 +150,7 @@ discard block |
||
| 150 | 150 | |
| 151 | 151 | $notpub = sql_in("statut", array('prop', 'prive')); |
| 152 | 152 | |
| 153 | - if ($type == 'article' AND $GLOBALS['meta']['post_dates'] != 'oui') |
|
| 153 | + if ($type == 'article' AND $GLOBALS['meta']['post_dates'] != 'oui') |
|
| 154 | 154 | $notpub .= " OR (statut='publie' AND date>".sql_quote(date('Y-m-d H:i:s')).")"; |
| 155 | 155 | |
| 156 | 156 | return sql_fetsel('1', table_objet_sql($type), id_table_objet($type)."=".$id." AND ($notpub)"); |
@@ -163,7 +163,7 @@ discard block |
||
| 163 | 163 | // http://doc.spip.org/@admin_lang |
| 164 | 164 | function admin_lang() |
| 165 | 165 | { |
| 166 | - $alang = sql_getfetsel('lang', 'spip_auteurs', "login=" . sql_quote(preg_replace(',^@,','',@$_COOKIE['spip_admin']))); |
|
| 166 | + $alang = sql_getfetsel('lang', 'spip_auteurs', "login=".sql_quote(preg_replace(',^@,', '', @$_COOKIE['spip_admin']))); |
|
| 167 | 167 | if (!$alang) return ''; |
| 168 | 168 | |
| 169 | 169 | $l = lang_select($alang); |
@@ -179,9 +179,8 @@ discard block |
||
| 179 | 179 | |
| 180 | 180 | return ((@$xhtml !== 'true') ? |
| 181 | 181 | (parametre_url(self(), 'var_mode', 'debug', '&') |
| 182 | - .'&var_mode_affiche=validation') : |
|
| 183 | - ('http://validator.w3.org/check?uri=' |
|
| 184 | - . rawurlencode("http://" . $_SERVER['HTTP_HOST'] . nettoyer_uri()))); |
|
| 182 | + .'&var_mode_affiche=validation') : ('http://validator.w3.org/check?uri=' |
|
| 183 | + . rawurlencode("http://".$_SERVER['HTTP_HOST'].nettoyer_uri()))); |
|
| 185 | 184 | } |
| 186 | 185 | |
| 187 | 186 | // http://doc.spip.org/@admin_debug |
@@ -196,7 +195,7 @@ discard block |
||
| 196 | 195 | ) |
| 197 | 196 | ) AND autoriser('debug') |
| 198 | 197 | ) |
| 199 | - ? parametre_url(self(),'var_mode', 'debug', '&'): ''; |
|
| 198 | + ? parametre_url(self(), 'var_mode', 'debug', '&') : ''; |
|
| 200 | 199 | } |
| 201 | 200 | |
| 202 | 201 | ?> |
@@ -10,7 +10,9 @@ discard block |
||
| 10 | 10 | * Pour plus de details voir le fichier COPYING.txt ou l'aide en ligne. * |
| 11 | 11 | \***************************************************************************/ |
| 12 | 12 | |
| 13 | -if (!defined('_ECRIRE_INC_VERSION')) return; |
|
| 13 | +if (!defined('_ECRIRE_INC_VERSION')) { |
|
| 14 | + return; |
|
| 15 | +} |
|
| 14 | 16 | |
| 15 | 17 | // http://doc.spip.org/@balise_FORMULAIRE_ADMIN |
| 16 | 18 | function balise_FORMULAIRE_ADMIN ($p) { |
@@ -37,18 +39,23 @@ discard block |
||
| 37 | 39 | global $use_cache; |
| 38 | 40 | static $dejafait = false; |
| 39 | 41 | |
| 40 | - if (!@$_COOKIE['spip_admin']) |
|
| 41 | - return ''; |
|
| 42 | + if (!@$_COOKIE['spip_admin']) { |
|
| 43 | + return ''; |
|
| 44 | + } |
|
| 42 | 45 | |
| 43 | 46 | if (!is_array($debug)) { |
| 44 | - if ($dejafait) |
|
| 45 | - return ''; |
|
| 47 | + if ($dejafait) { |
|
| 48 | + return ''; |
|
| 49 | + } |
|
| 46 | 50 | } else { |
| 47 | 51 | if ($dejafait) { |
| 48 | - if (empty($debug['sourcefile'])) return ''; |
|
| 52 | + if (empty($debug['sourcefile'])) { |
|
| 53 | + return ''; |
|
| 54 | + } |
|
| 49 | 55 | foreach($debug['sourcefile'] as $k => $v) { |
| 50 | - if (strpos($v,'administration.') !== false) |
|
| 51 | - return $debug['resultat'][$k . 'tout']; |
|
| 56 | + if (strpos($v,'administration.') !== false) { |
|
| 57 | + return $debug['resultat'][$k . 'tout']; |
|
| 58 | + } |
|
| 52 | 59 | } |
| 53 | 60 | return ''; |
| 54 | 61 | } |
@@ -65,8 +72,9 @@ discard block |
||
| 65 | 72 | $env = admin_objet(); |
| 66 | 73 | |
| 67 | 74 | // Pas de "modifier ce..." ? -> donner "acces a l'espace prive" |
| 68 | - if (!$env) |
|
| 69 | - $env['ecrire'] = _DIR_RESTREINT_ABS; |
|
| 75 | + if (!$env) { |
|
| 76 | + $env['ecrire'] = _DIR_RESTREINT_ABS; |
|
| 77 | + } |
|
| 70 | 78 | |
| 71 | 79 | $env['divclass'] = $float; |
| 72 | 80 | $env['lang'] = admin_lang(); |
@@ -75,8 +83,9 @@ discard block |
||
| 75 | 83 | $env['analyser'] = (!$env['debug'] AND !$GLOBALS['xhtml']) ? '' : admin_valider(); |
| 76 | 84 | $env['inclure'] = ((defined('_VAR_INCLURE') AND _VAR_INCLURE)?'inclure':''); |
| 77 | 85 | |
| 78 | - if (!$use_cache) |
|
| 79 | - $env['use_cache'] = ' *'; |
|
| 86 | + if (!$use_cache) { |
|
| 87 | + $env['use_cache'] = ' *'; |
|
| 88 | + } |
|
| 80 | 89 | |
| 81 | 90 | if (isset($debug['validation'])) { |
| 82 | 91 | $env['xhtml_error'] = $debug['validation']; |
@@ -123,8 +132,9 @@ discard block |
||
| 123 | 132 | AND $type != 'rubrique') { |
| 124 | 133 | unset($env['id_rubrique']); |
| 125 | 134 | unset($env['voir_rubrique']); |
| 126 | - if (admin_preview($type, $id, $desc)) |
|
| 127 | - $env['preview']=parametre_url(self(),'var_mode','preview','&'); |
|
| 135 | + if (admin_preview($type, $id, $desc)) { |
|
| 136 | + $env['preview']=parametre_url(self(),'var_mode','preview','&'); |
|
| 137 | + } |
|
| 128 | 138 | } |
| 129 | 139 | } |
| 130 | 140 | } |
@@ -136,22 +146,28 @@ discard block |
||
| 136 | 146 | // http://doc.spip.org/@admin_preview |
| 137 | 147 | function admin_preview($type, $id, $desc=null) |
| 138 | 148 | { |
| 139 | - if (defined('_VAR_PREVIEW') AND _VAR_PREVIEW) return ''; |
|
| 149 | + if (defined('_VAR_PREVIEW') AND _VAR_PREVIEW) { |
|
| 150 | + return ''; |
|
| 151 | + } |
|
| 140 | 152 | |
| 141 | 153 | if (!$desc) { |
| 142 | 154 | $trouver_table = charger_fonction('trouver_table','base'); |
| 143 | 155 | $desc = $trouver_table(table_objet_sql($type)); |
| 144 | 156 | } |
| 145 | - if (!$desc OR !isset($desc['field']['statut'])) |
|
| 146 | - return ''; |
|
| 157 | + if (!$desc OR !isset($desc['field']['statut'])) { |
|
| 158 | + return ''; |
|
| 159 | + } |
|
| 147 | 160 | |
| 148 | 161 | include_spip('inc/autoriser'); |
| 149 | - if (!autoriser('previsualiser')) return ''; |
|
| 162 | + if (!autoriser('previsualiser')) { |
|
| 163 | + return ''; |
|
| 164 | + } |
|
| 150 | 165 | |
| 151 | 166 | $notpub = sql_in("statut", array('prop', 'prive')); |
| 152 | 167 | |
| 153 | - if ($type == 'article' AND $GLOBALS['meta']['post_dates'] != 'oui') |
|
| 154 | - $notpub .= " OR (statut='publie' AND date>".sql_quote(date('Y-m-d H:i:s')).")"; |
|
| 168 | + if ($type == 'article' AND $GLOBALS['meta']['post_dates'] != 'oui') { |
|
| 169 | + $notpub .= " OR (statut='publie' AND date>".sql_quote(date('Y-m-d H:i:s')).")"; |
|
| 170 | + } |
|
| 155 | 171 | |
| 156 | 172 | return sql_fetsel('1', table_objet_sql($type), id_table_objet($type)."=".$id." AND ($notpub)"); |
| 157 | 173 | } |
@@ -164,11 +180,15 @@ discard block |
||
| 164 | 180 | function admin_lang() |
| 165 | 181 | { |
| 166 | 182 | $alang = sql_getfetsel('lang', 'spip_auteurs', "login=" . sql_quote(preg_replace(',^@,','',@$_COOKIE['spip_admin']))); |
| 167 | - if (!$alang) return ''; |
|
| 183 | + if (!$alang) { |
|
| 184 | + return ''; |
|
| 185 | + } |
|
| 168 | 186 | |
| 169 | 187 | $l = lang_select($alang); |
| 170 | 188 | $alang = $GLOBALS['spip_lang']; |
| 171 | - if ($l) lang_select(); |
|
| 189 | + if ($l) { |
|
| 190 | + lang_select(); |
|
| 191 | + } |
|
| 172 | 192 | return $alang; |
| 173 | 193 | } |
| 174 | 194 | |
@@ -25,7 +25,7 @@ discard block |
||
| 25 | 25 | */ |
| 26 | 26 | function balise_FORMULAIRE_INSCRIPTION ($p) { |
| 27 | 27 | |
| 28 | - return calculer_balise_dynamique($p, 'FORMULAIRE_INSCRIPTION', array()); |
|
| 28 | + return calculer_balise_dynamique($p, 'FORMULAIRE_INSCRIPTION', array()); |
|
| 29 | 29 | } |
| 30 | 30 | |
| 31 | 31 | /** |
@@ -40,10 +40,10 @@ discard block |
||
| 40 | 40 | * @return array|string |
| 41 | 41 | */ |
| 42 | 42 | function balise_FORMULAIRE_INSCRIPTION_stat($args, $context_compil) { |
| 43 | - list($mode, $id) = $args; |
|
| 44 | - include_spip('action/inscrire_auteur'); |
|
| 45 | - $mode = tester_statut_inscription($mode, $id); |
|
| 46 | - return $mode ? array($mode, $id) : ''; |
|
| 43 | + list($mode, $id) = $args; |
|
| 44 | + include_spip('action/inscrire_auteur'); |
|
| 45 | + $mode = tester_statut_inscription($mode, $id); |
|
| 46 | + return $mode ? array($mode, $id) : ''; |
|
| 47 | 47 | } |
| 48 | 48 | |
| 49 | 49 | ?> |
@@ -23,7 +23,7 @@ |
||
| 23 | 23 | * @param object $p |
| 24 | 24 | * @return mixed |
| 25 | 25 | */ |
| 26 | -function balise_FORMULAIRE_INSCRIPTION ($p) { |
|
| 26 | +function balise_FORMULAIRE_INSCRIPTION($p) { |
|
| 27 | 27 | |
| 28 | 28 | return calculer_balise_dynamique($p, 'FORMULAIRE_INSCRIPTION', array()); |
| 29 | 29 | } |
@@ -10,7 +10,9 @@ |
||
| 10 | 10 | * Pour plus de details voir le fichier COPYING.txt ou l'aide en ligne. * |
| 11 | 11 | \***************************************************************************/ |
| 12 | 12 | |
| 13 | -if (!defined('_ECRIRE_INC_VERSION')) return; |
|
| 13 | +if (!defined('_ECRIRE_INC_VERSION')) { |
|
| 14 | + return; |
|
| 15 | +} |
|
| 14 | 16 | |
| 15 | 17 | include_spip('base/abstract_sql'); |
| 16 | 18 | include_spip('inc/filtres'); |
@@ -15,7 +15,7 @@ discard block |
||
| 15 | 15 | |
| 16 | 16 | // http://doc.spip.org/@balise_LOGIN_PUBLIC |
| 17 | 17 | function balise_LOGIN_PUBLIC ($p, $nom='LOGIN_PUBLIC') { |
| 18 | - return calculer_balise_dynamique($p, $nom, array('url')); |
|
| 18 | + return calculer_balise_dynamique($p, $nom, array('url')); |
|
| 19 | 19 | } |
| 20 | 20 | |
| 21 | 21 | # retourner: |
@@ -26,17 +26,17 @@ discard block |
||
| 26 | 26 | |
| 27 | 27 | // http://doc.spip.org/@balise_LOGIN_PUBLIC_stat |
| 28 | 28 | function balise_LOGIN_PUBLIC_stat ($args, $context_compil) { |
| 29 | - return array(isset($args[1]) ? $args[1] : $args[0], (isset($args[2]) ? $args[2] : '')); |
|
| 29 | + return array(isset($args[1]) ? $args[1] : $args[0], (isset($args[2]) ? $args[2] : '')); |
|
| 30 | 30 | } |
| 31 | 31 | |
| 32 | 32 | // http://doc.spip.org/@balise_LOGIN_PUBLIC_dyn |
| 33 | 33 | function balise_LOGIN_PUBLIC_dyn($url, $login) { |
| 34 | - include_spip('balise/formulaire_'); |
|
| 35 | - if (!$url # pas d'url passee en filtre ou dans le contexte |
|
| 36 | - AND !$url = _request('url') # ni d'url passee par l'utilisateur |
|
| 37 | - ) |
|
| 38 | - $url = parametre_url(self(), '', '', '&'); |
|
| 39 | - return balise_FORMULAIRE__dyn('login',$url,$login,false); |
|
| 34 | + include_spip('balise/formulaire_'); |
|
| 35 | + if (!$url # pas d'url passee en filtre ou dans le contexte |
|
| 36 | + AND !$url = _request('url') # ni d'url passee par l'utilisateur |
|
| 37 | + ) |
|
| 38 | + $url = parametre_url(self(), '', '', '&'); |
|
| 39 | + return balise_FORMULAIRE__dyn('login',$url,$login,false); |
|
| 40 | 40 | } |
| 41 | 41 | |
| 42 | 42 | ?> |
@@ -10,11 +10,11 @@ discard block |
||
| 10 | 10 | * Pour plus de details voir le fichier COPYING.txt ou l'aide en ligne. * |
| 11 | 11 | \***************************************************************************/ |
| 12 | 12 | |
| 13 | -if (!defined("_ECRIRE_INC_VERSION")) return; #securite |
|
| 13 | +if (!defined("_ECRIRE_INC_VERSION")) return; #securite |
|
| 14 | 14 | |
| 15 | 15 | |
| 16 | 16 | // http://doc.spip.org/@balise_LOGIN_PUBLIC |
| 17 | -function balise_LOGIN_PUBLIC ($p, $nom='LOGIN_PUBLIC') { |
|
| 17 | +function balise_LOGIN_PUBLIC($p, $nom = 'LOGIN_PUBLIC') { |
|
| 18 | 18 | return calculer_balise_dynamique($p, $nom, array('url')); |
| 19 | 19 | } |
| 20 | 20 | |
@@ -25,7 +25,7 @@ discard block |
||
| 25 | 25 | # <boucle(AUTEURS)>[(#LOGIN_PUBLIC{#SELF, #LOGIN})] |
| 26 | 26 | |
| 27 | 27 | // http://doc.spip.org/@balise_LOGIN_PUBLIC_stat |
| 28 | -function balise_LOGIN_PUBLIC_stat ($args, $context_compil) { |
|
| 28 | +function balise_LOGIN_PUBLIC_stat($args, $context_compil) { |
|
| 29 | 29 | return array(isset($args[1]) ? $args[1] : $args[0], (isset($args[2]) ? $args[2] : '')); |
| 30 | 30 | } |
| 31 | 31 | |
@@ -36,7 +36,7 @@ discard block |
||
| 36 | 36 | AND !$url = _request('url') # ni d'url passee par l'utilisateur |
| 37 | 37 | ) |
| 38 | 38 | $url = parametre_url(self(), '', '', '&'); |
| 39 | - return balise_FORMULAIRE__dyn('login',$url,$login,false); |
|
| 39 | + return balise_FORMULAIRE__dyn('login', $url, $login, false); |
|
| 40 | 40 | } |
| 41 | 41 | |
| 42 | 42 | ?> |
@@ -10,7 +10,10 @@ discard block |
||
| 10 | 10 | * Pour plus de details voir le fichier COPYING.txt ou l'aide en ligne. * |
| 11 | 11 | \***************************************************************************/ |
| 12 | 12 | |
| 13 | -if (!defined("_ECRIRE_INC_VERSION")) return; #securite |
|
| 13 | +if (!defined("_ECRIRE_INC_VERSION")) { |
|
| 14 | + return; |
|
| 15 | +} |
|
| 16 | +#securite |
|
| 14 | 17 | |
| 15 | 18 | |
| 16 | 19 | // http://doc.spip.org/@balise_LOGIN_PUBLIC |
@@ -34,8 +37,9 @@ discard block |
||
| 34 | 37 | include_spip('balise/formulaire_'); |
| 35 | 38 | if (!$url # pas d'url passee en filtre ou dans le contexte |
| 36 | 39 | AND !$url = _request('url') # ni d'url passee par l'utilisateur |
| 37 | - ) |
|
| 38 | - $url = parametre_url(self(), '', '', '&'); |
|
| 40 | + ) { |
|
| 41 | + $url = parametre_url(self(), '', '', '&'); |
|
| 42 | + } |
|
| 39 | 43 | return balise_FORMULAIRE__dyn('login',$url,$login,false); |
| 40 | 44 | } |
| 41 | 45 | |
@@ -15,7 +15,7 @@ discard block |
||
| 15 | 15 | |
| 16 | 16 | // http://doc.spip.org/@balise_LOGIN_PRIVE |
| 17 | 17 | function balise_LOGIN_PRIVE ($p) { |
| 18 | - return calculer_balise_dynamique($p, 'LOGIN_PRIVE', array('url')); |
|
| 18 | + return calculer_balise_dynamique($p, 'LOGIN_PRIVE', array('url')); |
|
| 19 | 19 | } |
| 20 | 20 | |
| 21 | 21 | # retourner: |
@@ -26,16 +26,16 @@ discard block |
||
| 26 | 26 | |
| 27 | 27 | // http://doc.spip.org/@balise_LOGIN_PRIVE_stat |
| 28 | 28 | function balise_LOGIN_PRIVE_stat ($args, $context_compil) { |
| 29 | - return array(isset($args[1]) ? $args[1] : $args[0], (isset($args[2]) ? $args[2] : '')); |
|
| 29 | + return array(isset($args[1]) ? $args[1] : $args[0], (isset($args[2]) ? $args[2] : '')); |
|
| 30 | 30 | } |
| 31 | 31 | |
| 32 | 32 | // http://doc.spip.org/@balise_LOGIN_PRIVE_dyn |
| 33 | 33 | function balise_LOGIN_PRIVE_dyn($url, $login) { |
| 34 | - include_spip('balise/formulaire_'); |
|
| 35 | - if (!$url # pas d'url passee en filtre ou dans le contexte |
|
| 36 | - AND !$url = _request('url') # ni d'url passee par l'utilisateur |
|
| 37 | - ) |
|
| 38 | - $url = generer_url_ecrire('accueil','',true); |
|
| 39 | - return balise_FORMULAIRE__dyn('login',$url,$login,true); |
|
| 34 | + include_spip('balise/formulaire_'); |
|
| 35 | + if (!$url # pas d'url passee en filtre ou dans le contexte |
|
| 36 | + AND !$url = _request('url') # ni d'url passee par l'utilisateur |
|
| 37 | + ) |
|
| 38 | + $url = generer_url_ecrire('accueil','',true); |
|
| 39 | + return balise_FORMULAIRE__dyn('login',$url,$login,true); |
|
| 40 | 40 | } |
| 41 | 41 | ?> |
@@ -10,11 +10,11 @@ discard block |
||
| 10 | 10 | * Pour plus de details voir le fichier COPYING.txt ou l'aide en ligne. * |
| 11 | 11 | \***************************************************************************/ |
| 12 | 12 | |
| 13 | -if (!defined("_ECRIRE_INC_VERSION")) return; #securite |
|
| 13 | +if (!defined("_ECRIRE_INC_VERSION")) return; #securite |
|
| 14 | 14 | |
| 15 | 15 | |
| 16 | 16 | // http://doc.spip.org/@balise_LOGIN_PRIVE |
| 17 | -function balise_LOGIN_PRIVE ($p) { |
|
| 17 | +function balise_LOGIN_PRIVE($p) { |
|
| 18 | 18 | return calculer_balise_dynamique($p, 'LOGIN_PRIVE', array('url')); |
| 19 | 19 | } |
| 20 | 20 | |
@@ -25,7 +25,7 @@ discard block |
||
| 25 | 25 | # <boucle(AUTEURS)>[(#LOGIN_PRIVE{#URL_ECRIRE, #LOGIN})] |
| 26 | 26 | |
| 27 | 27 | // http://doc.spip.org/@balise_LOGIN_PRIVE_stat |
| 28 | -function balise_LOGIN_PRIVE_stat ($args, $context_compil) { |
|
| 28 | +function balise_LOGIN_PRIVE_stat($args, $context_compil) { |
|
| 29 | 29 | return array(isset($args[1]) ? $args[1] : $args[0], (isset($args[2]) ? $args[2] : '')); |
| 30 | 30 | } |
| 31 | 31 | |
@@ -35,7 +35,7 @@ discard block |
||
| 35 | 35 | if (!$url # pas d'url passee en filtre ou dans le contexte |
| 36 | 36 | AND !$url = _request('url') # ni d'url passee par l'utilisateur |
| 37 | 37 | ) |
| 38 | - $url = generer_url_ecrire('accueil','',true); |
|
| 39 | - return balise_FORMULAIRE__dyn('login',$url,$login,true); |
|
| 38 | + $url = generer_url_ecrire('accueil', '', true); |
|
| 39 | + return balise_FORMULAIRE__dyn('login', $url, $login, true); |
|
| 40 | 40 | } |
| 41 | 41 | ?> |
@@ -10,7 +10,10 @@ discard block |
||
| 10 | 10 | * Pour plus de details voir le fichier COPYING.txt ou l'aide en ligne. * |
| 11 | 11 | \***************************************************************************/ |
| 12 | 12 | |
| 13 | -if (!defined("_ECRIRE_INC_VERSION")) return; #securite |
|
| 13 | +if (!defined("_ECRIRE_INC_VERSION")) { |
|
| 14 | + return; |
|
| 15 | +} |
|
| 16 | +#securite |
|
| 14 | 17 | |
| 15 | 18 | |
| 16 | 19 | // http://doc.spip.org/@balise_LOGIN_PRIVE |
@@ -34,8 +37,9 @@ discard block |
||
| 34 | 37 | include_spip('balise/formulaire_'); |
| 35 | 38 | if (!$url # pas d'url passee en filtre ou dans le contexte |
| 36 | 39 | AND !$url = _request('url') # ni d'url passee par l'utilisateur |
| 37 | - ) |
|
| 38 | - $url = generer_url_ecrire('accueil','',true); |
|
| 40 | + ) { |
|
| 41 | + $url = generer_url_ecrire('accueil','',true); |
|
| 42 | + } |
|
| 39 | 43 | return balise_FORMULAIRE__dyn('login',$url,$login,true); |
| 40 | 44 | } |
| 41 | 45 | ?> |