@@ -17,7 +17,7 @@ discard block |
||
| 17 | 17 | **/ |
| 18 | 18 | |
| 19 | 19 | if (!defined('_ECRIRE_INC_VERSION')) { |
| 20 | - return; |
|
| 20 | + return; |
|
| 21 | 21 | } |
| 22 | 22 | |
| 23 | 23 | /** |
@@ -37,7 +37,7 @@ discard block |
||
| 37 | 37 | * Pile complétée du code compilé |
| 38 | 38 | **/ |
| 39 | 39 | function balise_MENU_LANG_ECRIRE($p) { |
| 40 | - return calculer_balise_dynamique($p, 'MENU_LANG_ECRIRE', array('lang')); |
|
| 40 | + return calculer_balise_dynamique($p, 'MENU_LANG_ECRIRE', array('lang')); |
|
| 41 | 41 | } |
| 42 | 42 | |
| 43 | 43 | /** |
@@ -55,12 +55,12 @@ discard block |
||
| 55 | 55 | * Liste (lang) des arguments collectés et fournis. |
| 56 | 56 | */ |
| 57 | 57 | function balise_MENU_LANG_ECRIRE_stat($args, $context_compil) { |
| 58 | - include_spip('inc/lang'); |
|
| 59 | - if (strpos($GLOBALS['meta']['langues_proposees'], ',') === false) { |
|
| 60 | - return ''; |
|
| 61 | - } |
|
| 58 | + include_spip('inc/lang'); |
|
| 59 | + if (strpos($GLOBALS['meta']['langues_proposees'], ',') === false) { |
|
| 60 | + return ''; |
|
| 61 | + } |
|
| 62 | 62 | |
| 63 | - return $args; |
|
| 63 | + return $args; |
|
| 64 | 64 | } |
| 65 | 65 | |
| 66 | 66 | /** |
@@ -76,7 +76,7 @@ discard block |
||
| 76 | 76 | * Liste : Chemin du squelette, durée du cache, contexte |
| 77 | 77 | **/ |
| 78 | 78 | function balise_MENU_LANG_ECRIRE_dyn($opt) { |
| 79 | - return menu_lang_pour_tous('var_lang_ecrire', $opt); |
|
| 79 | + return menu_lang_pour_tous('var_lang_ecrire', $opt); |
|
| 80 | 80 | } |
| 81 | 81 | |
| 82 | 82 | /** |
@@ -96,30 +96,30 @@ discard block |
||
| 96 | 96 | * Liste : Chemin du squelette, durée du cache, contexte |
| 97 | 97 | **/ |
| 98 | 98 | function menu_lang_pour_tous($nom, $default) { |
| 99 | - include_spip('inc/lang'); |
|
| 99 | + include_spip('inc/lang'); |
|
| 100 | 100 | |
| 101 | - if ($GLOBALS['spip_lang'] <> $default) { |
|
| 102 | - $opt = lang_select($default); # et remplace |
|
| 103 | - if ($GLOBALS['spip_lang'] <> $default) { |
|
| 104 | - $default = ''; # annule tout choix par defaut |
|
| 105 | - if ($opt) { |
|
| 106 | - lang_select(); |
|
| 107 | - } |
|
| 108 | - } |
|
| 109 | - } |
|
| 101 | + if ($GLOBALS['spip_lang'] <> $default) { |
|
| 102 | + $opt = lang_select($default); # et remplace |
|
| 103 | + if ($GLOBALS['spip_lang'] <> $default) { |
|
| 104 | + $default = ''; # annule tout choix par defaut |
|
| 105 | + if ($opt) { |
|
| 106 | + lang_select(); |
|
| 107 | + } |
|
| 108 | + } |
|
| 109 | + } |
|
| 110 | 110 | |
| 111 | - # lien a partir de / |
|
| 112 | - $cible = parametre_url(self(), 'lang', '', '&'); |
|
| 113 | - $post = generer_url_action('converser', 'redirect=' . rawurlencode($cible), '&'); |
|
| 111 | + # lien a partir de / |
|
| 112 | + $cible = parametre_url(self(), 'lang', '', '&'); |
|
| 113 | + $post = generer_url_action('converser', 'redirect=' . rawurlencode($cible), '&'); |
|
| 114 | 114 | |
| 115 | - return array( |
|
| 116 | - 'formulaires/menu_lang', |
|
| 117 | - 3600, |
|
| 118 | - array( |
|
| 119 | - 'nom' => $nom, |
|
| 120 | - 'url' => $post, |
|
| 121 | - 'name' => $nom, |
|
| 122 | - 'default' => $default, |
|
| 123 | - ) |
|
| 124 | - ); |
|
| 115 | + return array( |
|
| 116 | + 'formulaires/menu_lang', |
|
| 117 | + 3600, |
|
| 118 | + array( |
|
| 119 | + 'nom' => $nom, |
|
| 120 | + 'url' => $post, |
|
| 121 | + 'name' => $nom, |
|
| 122 | + 'default' => $default, |
|
| 123 | + ) |
|
| 124 | + ); |
|
| 125 | 125 | } |
@@ -99,9 +99,9 @@ discard block |
||
| 99 | 99 | include_spip('inc/lang'); |
| 100 | 100 | |
| 101 | 101 | if ($GLOBALS['spip_lang'] <> $default) { |
| 102 | - $opt = lang_select($default); # et remplace |
|
| 102 | + $opt = lang_select($default); # et remplace |
|
| 103 | 103 | if ($GLOBALS['spip_lang'] <> $default) { |
| 104 | - $default = ''; # annule tout choix par defaut |
|
| 104 | + $default = ''; # annule tout choix par defaut |
|
| 105 | 105 | if ($opt) { |
| 106 | 106 | lang_select(); |
| 107 | 107 | } |
@@ -110,7 +110,7 @@ discard block |
||
| 110 | 110 | |
| 111 | 111 | # lien a partir de / |
| 112 | 112 | $cible = parametre_url(self(), 'lang', '', '&'); |
| 113 | - $post = generer_url_action('converser', 'redirect=' . rawurlencode($cible), '&'); |
|
| 113 | + $post = generer_url_action('converser', 'redirect='.rawurlencode($cible), '&'); |
|
| 114 | 114 | |
| 115 | 115 | return array( |
| 116 | 116 | 'formulaires/menu_lang', |
@@ -17,7 +17,7 @@ discard block |
||
| 17 | 17 | * @package SPIP\Core\Compilateur\Balises |
| 18 | 18 | **/ |
| 19 | 19 | if (!defined('_ECRIRE_INC_VERSION')) { |
| 20 | - return; |
|
| 20 | + return; |
|
| 21 | 21 | } |
| 22 | 22 | |
| 23 | 23 | |
@@ -60,7 +60,7 @@ discard block |
||
| 60 | 60 | * Pile complétée du code compilé |
| 61 | 61 | **/ |
| 62 | 62 | function balise_CONFIGURER_METAS_dist($p) { |
| 63 | - return calculer_balise_dynamique($p, $p->nom_champ, array()); |
|
| 63 | + return calculer_balise_dynamique($p, $p->nom_champ, array()); |
|
| 64 | 64 | } |
| 65 | 65 | |
| 66 | 66 | /** |
@@ -78,15 +78,15 @@ discard block |
||
| 78 | 78 | **/ |
| 79 | 79 | function balise_CONFIGURER_METAS_dyn($form) { |
| 80 | 80 | |
| 81 | - include_spip('balise/formulaire_'); |
|
| 82 | - if (!existe_formulaire($form)) { |
|
| 83 | - return ''; |
|
| 84 | - } |
|
| 85 | - $args = func_get_args(); |
|
| 86 | - $contexte = balise_FORMULAIRE__contexte('configurer_metas', $args); |
|
| 87 | - if (!is_array($contexte)) { |
|
| 88 | - return $contexte; |
|
| 89 | - } |
|
| 81 | + include_spip('balise/formulaire_'); |
|
| 82 | + if (!existe_formulaire($form)) { |
|
| 83 | + return ''; |
|
| 84 | + } |
|
| 85 | + $args = func_get_args(); |
|
| 86 | + $contexte = balise_FORMULAIRE__contexte('configurer_metas', $args); |
|
| 87 | + if (!is_array($contexte)) { |
|
| 88 | + return $contexte; |
|
| 89 | + } |
|
| 90 | 90 | |
| 91 | - return array('formulaires/' . $form, 3600, $contexte); |
|
| 91 | + return array('formulaires/' . $form, 3600, $contexte); |
|
| 92 | 92 | } |
@@ -88,5 +88,5 @@ |
||
| 88 | 88 | return $contexte; |
| 89 | 89 | } |
| 90 | 90 | |
| 91 | - return array('formulaires/' . $form, 3600, $contexte); |
|
| 91 | + return array('formulaires/'.$form, 3600, $contexte); |
|
| 92 | 92 | } |
@@ -17,7 +17,7 @@ discard block |
||
| 17 | 17 | **/ |
| 18 | 18 | |
| 19 | 19 | if (!defined('_ECRIRE_INC_VERSION')) { |
| 20 | - return; |
|
| 20 | + return; |
|
| 21 | 21 | } |
| 22 | 22 | |
| 23 | 23 | include_spip('base/abstract_sql'); |
@@ -41,7 +41,7 @@ discard block |
||
| 41 | 41 | * Pile complétée du code compilé |
| 42 | 42 | **/ |
| 43 | 43 | function balise_FORMULAIRE_ECRIRE_AUTEUR($p) { |
| 44 | - return calculer_balise_dynamique($p, 'FORMULAIRE_ECRIRE_AUTEUR', array('id_auteur', 'id_article', 'email')); |
|
| 44 | + return calculer_balise_dynamique($p, 'FORMULAIRE_ECRIRE_AUTEUR', array('id_auteur', 'id_article', 'email')); |
|
| 45 | 45 | } |
| 46 | 46 | |
| 47 | 47 | /** |
@@ -59,42 +59,42 @@ discard block |
||
| 59 | 59 | * - chaîne vide sinon (erreur ou non affichage). |
| 60 | 60 | */ |
| 61 | 61 | function balise_FORMULAIRE_ECRIRE_AUTEUR_stat($args, $context_compil) { |
| 62 | - include_spip('inc/filtres'); |
|
| 63 | - // Pas d'id_auteur ni d'id_article ? Erreur de contexte |
|
| 64 | - $id = intval($args[1]); |
|
| 65 | - if (!$args[0] and !$id) { |
|
| 66 | - $msg = array( |
|
| 67 | - 'zbug_champ_hors_motif', |
|
| 68 | - array( |
|
| 69 | - 'champ' => 'FORMULAIRE_ECRIRE_AUTEUR', |
|
| 70 | - 'motif' => 'AUTEURS/ARTICLES' |
|
| 71 | - ) |
|
| 72 | - ); |
|
| 62 | + include_spip('inc/filtres'); |
|
| 63 | + // Pas d'id_auteur ni d'id_article ? Erreur de contexte |
|
| 64 | + $id = intval($args[1]); |
|
| 65 | + if (!$args[0] and !$id) { |
|
| 66 | + $msg = array( |
|
| 67 | + 'zbug_champ_hors_motif', |
|
| 68 | + array( |
|
| 69 | + 'champ' => 'FORMULAIRE_ECRIRE_AUTEUR', |
|
| 70 | + 'motif' => 'AUTEURS/ARTICLES' |
|
| 71 | + ) |
|
| 72 | + ); |
|
| 73 | 73 | |
| 74 | - erreur_squelette($msg, $context_compil); |
|
| 74 | + erreur_squelette($msg, $context_compil); |
|
| 75 | 75 | |
| 76 | - return ''; |
|
| 77 | - } |
|
| 78 | - // Si on est dans un contexte article, |
|
| 79 | - // sortir tous les mails des auteurs de l'article |
|
| 80 | - if (!$args[0] and $id) { |
|
| 81 | - $r = ''; |
|
| 82 | - $s = sql_allfetsel('email', |
|
| 83 | - 'spip_auteurs AS A LEFT JOIN spip_auteurs_liens AS L ON (A.id_auteur=L.id_auteur AND L.objet=\'article\')', |
|
| 84 | - "A.email != '' AND L.id_objet=$id"); |
|
| 85 | - foreach ($s as $row) { |
|
| 86 | - if (email_valide($row['email'])) { |
|
| 87 | - $r .= ', ' . $row['email']; |
|
| 88 | - } |
|
| 89 | - } |
|
| 90 | - $args[2] = substr($r, 2); |
|
| 91 | - } |
|
| 76 | + return ''; |
|
| 77 | + } |
|
| 78 | + // Si on est dans un contexte article, |
|
| 79 | + // sortir tous les mails des auteurs de l'article |
|
| 80 | + if (!$args[0] and $id) { |
|
| 81 | + $r = ''; |
|
| 82 | + $s = sql_allfetsel('email', |
|
| 83 | + 'spip_auteurs AS A LEFT JOIN spip_auteurs_liens AS L ON (A.id_auteur=L.id_auteur AND L.objet=\'article\')', |
|
| 84 | + "A.email != '' AND L.id_objet=$id"); |
|
| 85 | + foreach ($s as $row) { |
|
| 86 | + if (email_valide($row['email'])) { |
|
| 87 | + $r .= ', ' . $row['email']; |
|
| 88 | + } |
|
| 89 | + } |
|
| 90 | + $args[2] = substr($r, 2); |
|
| 91 | + } |
|
| 92 | 92 | |
| 93 | - // On ne peut pas ecrire a un auteur dont le mail n'est pas valide |
|
| 94 | - if (!$args[2] or !email_valide($args[2])) { |
|
| 95 | - return ''; |
|
| 96 | - } |
|
| 93 | + // On ne peut pas ecrire a un auteur dont le mail n'est pas valide |
|
| 94 | + if (!$args[2] or !email_valide($args[2])) { |
|
| 95 | + return ''; |
|
| 96 | + } |
|
| 97 | 97 | |
| 98 | - // OK |
|
| 99 | - return $args; |
|
| 98 | + // OK |
|
| 99 | + return $args; |
|
| 100 | 100 | } |
@@ -84,7 +84,7 @@ |
||
| 84 | 84 | "A.email != '' AND L.id_objet=$id"); |
| 85 | 85 | foreach ($s as $row) { |
| 86 | 86 | if (email_valide($row['email'])) { |
| 87 | - $r .= ', ' . $row['email']; |
|
| 87 | + $r .= ', '.$row['email']; |
|
| 88 | 88 | } |
| 89 | 89 | } |
| 90 | 90 | $args[2] = substr($r, 2); |
@@ -17,7 +17,7 @@ discard block |
||
| 17 | 17 | **/ |
| 18 | 18 | |
| 19 | 19 | if (!defined('_ECRIRE_INC_VERSION')) { |
| 20 | - return; |
|
| 20 | + return; |
|
| 21 | 21 | } |
| 22 | 22 | |
| 23 | 23 | include_spip('base/abstract_sql'); |
@@ -43,7 +43,7 @@ discard block |
||
| 43 | 43 | * Pile complétée du code compilé |
| 44 | 44 | **/ |
| 45 | 45 | function balise_FORMULAIRE_INSCRIPTION($p) { |
| 46 | - return calculer_balise_dynamique($p, 'FORMULAIRE_INSCRIPTION', array()); |
|
| 46 | + return calculer_balise_dynamique($p, 'FORMULAIRE_INSCRIPTION', array()); |
|
| 47 | 47 | } |
| 48 | 48 | |
| 49 | 49 | /** |
@@ -72,9 +72,9 @@ discard block |
||
| 72 | 72 | * - chaîne vide sinon. |
| 73 | 73 | */ |
| 74 | 74 | function balise_FORMULAIRE_INSCRIPTION_stat($args, $context_compil) { |
| 75 | - list($mode, $id, $retour) = array_pad($args, 3, null); |
|
| 76 | - include_spip('action/inscrire_auteur'); |
|
| 77 | - $mode = tester_statut_inscription($mode, $id); |
|
| 75 | + list($mode, $id, $retour) = array_pad($args, 3, null); |
|
| 76 | + include_spip('action/inscrire_auteur'); |
|
| 77 | + $mode = tester_statut_inscription($mode, $id); |
|
| 78 | 78 | |
| 79 | - return $mode ? array($mode, $id, $retour) : ''; |
|
| 79 | + return $mode ? array($mode, $id, $retour) : ''; |
|
| 80 | 80 | } |
@@ -17,7 +17,7 @@ discard block |
||
| 17 | 17 | **/ |
| 18 | 18 | |
| 19 | 19 | if (!defined("_ECRIRE_INC_VERSION")) { |
| 20 | - return; |
|
| 20 | + return; |
|
| 21 | 21 | } #securite |
| 22 | 22 | |
| 23 | 23 | |
@@ -36,7 +36,7 @@ discard block |
||
| 36 | 36 | * Pile complétée du code compilé |
| 37 | 37 | **/ |
| 38 | 38 | function balise_LOGIN_PUBLIC($p, $nom = 'LOGIN_PUBLIC') { |
| 39 | - return calculer_balise_dynamique($p, $nom, array('url')); |
|
| 39 | + return calculer_balise_dynamique($p, $nom, array('url')); |
|
| 40 | 40 | } |
| 41 | 41 | |
| 42 | 42 | /** |
@@ -57,7 +57,7 @@ discard block |
||
| 57 | 57 | * Liste (url, login) des arguments collectés. |
| 58 | 58 | */ |
| 59 | 59 | function balise_LOGIN_PUBLIC_stat($args, $context_compil) { |
| 60 | - return array(isset($args[1]) ? $args[1] : $args[0], (isset($args[2]) ? $args[2] : '')); |
|
| 60 | + return array(isset($args[1]) ? $args[1] : $args[0], (isset($args[2]) ? $args[2] : '')); |
|
| 61 | 61 | } |
| 62 | 62 | |
| 63 | 63 | /** |
@@ -74,12 +74,12 @@ discard block |
||
| 74 | 74 | * Liste : Chemin du squelette, durée du cache, contexte |
| 75 | 75 | **/ |
| 76 | 76 | function balise_LOGIN_PUBLIC_dyn($url, $login) { |
| 77 | - include_spip('balise/formulaire_'); |
|
| 78 | - if (!$url # pas d'url passee en filtre ou dans le contexte |
|
| 79 | - and !$url = _request('url') # ni d'url passee par l'utilisateur |
|
| 80 | - ) { |
|
| 81 | - $url = parametre_url(self(), '', '', '&'); |
|
| 82 | - } |
|
| 77 | + include_spip('balise/formulaire_'); |
|
| 78 | + if (!$url # pas d'url passee en filtre ou dans le contexte |
|
| 79 | + and !$url = _request('url') # ni d'url passee par l'utilisateur |
|
| 80 | + ) { |
|
| 81 | + $url = parametre_url(self(), '', '', '&'); |
|
| 82 | + } |
|
| 83 | 83 | |
| 84 | - return balise_FORMULAIRE__dyn('login', $url, $login, false); |
|
| 84 | + return balise_FORMULAIRE__dyn('login', $url, $login, false); |
|
| 85 | 85 | } |
@@ -17,7 +17,7 @@ discard block |
||
| 17 | 17 | **/ |
| 18 | 18 | |
| 19 | 19 | if (!defined('_ECRIRE_INC_VERSION')) { |
| 20 | - return; |
|
| 20 | + return; |
|
| 21 | 21 | } |
| 22 | 22 | |
| 23 | 23 | /** |
@@ -37,7 +37,7 @@ discard block |
||
| 37 | 37 | * Pile complétée du code compilé |
| 38 | 38 | **/ |
| 39 | 39 | function balise_MENU_LANG($p) { |
| 40 | - return calculer_balise_dynamique($p, 'MENU_LANG', array('lang')); |
|
| 40 | + return calculer_balise_dynamique($p, 'MENU_LANG', array('lang')); |
|
| 41 | 41 | } |
| 42 | 42 | |
| 43 | 43 | /** |
@@ -55,11 +55,11 @@ discard block |
||
| 55 | 55 | * Liste (lang) des arguments collectés et fournis. |
| 56 | 56 | */ |
| 57 | 57 | function balise_MENU_LANG_stat($args, $context_compil) { |
| 58 | - if (strpos($GLOBALS['meta']['langues_multilingue'], ',') === false) { |
|
| 59 | - return ''; |
|
| 60 | - } |
|
| 58 | + if (strpos($GLOBALS['meta']['langues_multilingue'], ',') === false) { |
|
| 59 | + return ''; |
|
| 60 | + } |
|
| 61 | 61 | |
| 62 | - return $args; |
|
| 62 | + return $args; |
|
| 63 | 63 | } |
| 64 | 64 | |
| 65 | 65 | /** |
@@ -75,7 +75,7 @@ discard block |
||
| 75 | 75 | * Liste : Chemin du squelette, durée du cache, contexte |
| 76 | 76 | **/ |
| 77 | 77 | function balise_MENU_LANG_dyn($opt) { |
| 78 | - include_spip('balise/menu_lang_ecrire'); |
|
| 78 | + include_spip('balise/menu_lang_ecrire'); |
|
| 79 | 79 | |
| 80 | - return menu_lang_pour_tous('var_lang', $opt); |
|
| 80 | + return menu_lang_pour_tous('var_lang', $opt); |
|
| 81 | 81 | } |
@@ -38,7 +38,7 @@ discard block |
||
| 38 | 38 | |
| 39 | 39 | // numerotons les occurences d'un meme prefix |
| 40 | 40 | $versions[$info['prefix']] = isset($versions[$info['prefix']]) ? $versions[$info['prefix']] + 1 : ''; |
| 41 | - $id = $info['prefix'] . $versions[$info['prefix']]; |
|
| 41 | + $id = $info['prefix'].$versions[$info['prefix']]; |
|
| 42 | 42 | |
| 43 | 43 | $class = $class_li; |
| 44 | 44 | $class .= $actif ? " actif" : ""; |
@@ -55,15 +55,15 @@ discard block |
||
| 55 | 55 | $prefix = $info['prefix']; |
| 56 | 56 | $dir = "$dir_plugins$plug_file/lang/$prefix"; |
| 57 | 57 | $desc = plugin_propre($info['description'], $dir); |
| 58 | - $url_stat = parametre_url($url_page, "plugin", $dir_plugins . $plug_file); |
|
| 58 | + $url_stat = parametre_url($url_page, "plugin", $dir_plugins.$plug_file); |
|
| 59 | 59 | |
| 60 | - $s .= "<strong class='nom'>" . typo($info['nom']) . "</strong>"; |
|
| 61 | - $s .= " <span class='version'>" . $info['version'] . "</span>"; |
|
| 62 | - $s .= " <span class='etat'> - " . plugin_etat_en_clair($info['etat']) . "</span>"; |
|
| 60 | + $s .= "<strong class='nom'>".typo($info['nom'])."</strong>"; |
|
| 61 | + $s .= " <span class='version'>".$info['version']."</span>"; |
|
| 62 | + $s .= " <span class='etat'> - ".plugin_etat_en_clair($info['etat'])."</span>"; |
|
| 63 | 63 | $s .= "</div>"; |
| 64 | 64 | |
| 65 | 65 | if ($erreur) { |
| 66 | - $s .= "<div class='erreur'>" . join('<br >', $info['erreur']) . "</div>"; |
|
| 66 | + $s .= "<div class='erreur'>".join('<br >', $info['erreur'])."</div>"; |
|
| 67 | 67 | } |
| 68 | 68 | |
| 69 | 69 | $s .= "</li>"; |
@@ -11,7 +11,7 @@ discard block |
||
| 11 | 11 | \***************************************************************************/ |
| 12 | 12 | |
| 13 | 13 | if (!defined('_ECRIRE_INC_VERSION')) { |
| 14 | - return; |
|
| 14 | + return; |
|
| 15 | 15 | } |
| 16 | 16 | include_spip('inc/charsets'); |
| 17 | 17 | include_spip('inc/texte'); |
@@ -19,54 +19,54 @@ discard block |
||
| 19 | 19 | |
| 20 | 20 | // https://code.spip.net/@ligne_plug |
| 21 | 21 | function plugins_afficher_nom_plugin_dist( |
| 22 | - $url_page, |
|
| 23 | - $plug_file, |
|
| 24 | - $checked, |
|
| 25 | - $actif, |
|
| 26 | - $expose = false, |
|
| 27 | - $class_li = "item", |
|
| 28 | - $dir_plugins = _DIR_PLUGINS |
|
| 22 | + $url_page, |
|
| 23 | + $plug_file, |
|
| 24 | + $checked, |
|
| 25 | + $actif, |
|
| 26 | + $expose = false, |
|
| 27 | + $class_li = "item", |
|
| 28 | + $dir_plugins = _DIR_PLUGINS |
|
| 29 | 29 | ) { |
| 30 | - static $id_input = 0; |
|
| 31 | - static $versions = array(); |
|
| 30 | + static $id_input = 0; |
|
| 31 | + static $versions = array(); |
|
| 32 | 32 | |
| 33 | - $erreur = false; |
|
| 34 | - $s = ""; |
|
| 33 | + $erreur = false; |
|
| 34 | + $s = ""; |
|
| 35 | 35 | |
| 36 | - $get_infos = charger_fonction('get_infos', 'plugins'); |
|
| 37 | - $info = $get_infos($plug_file, false, $dir_plugins); |
|
| 36 | + $get_infos = charger_fonction('get_infos', 'plugins'); |
|
| 37 | + $info = $get_infos($plug_file, false, $dir_plugins); |
|
| 38 | 38 | |
| 39 | - // numerotons les occurences d'un meme prefix |
|
| 40 | - $versions[$info['prefix']] = isset($versions[$info['prefix']]) ? $versions[$info['prefix']] + 1 : ''; |
|
| 41 | - $id = $info['prefix'] . $versions[$info['prefix']]; |
|
| 39 | + // numerotons les occurences d'un meme prefix |
|
| 40 | + $versions[$info['prefix']] = isset($versions[$info['prefix']]) ? $versions[$info['prefix']] + 1 : ''; |
|
| 41 | + $id = $info['prefix'] . $versions[$info['prefix']]; |
|
| 42 | 42 | |
| 43 | - $class = $class_li; |
|
| 44 | - $class .= $actif ? " actif" : ""; |
|
| 45 | - $class .= $expose ? " on" : ""; |
|
| 46 | - $erreur = isset($info['erreur']); |
|
| 47 | - if ($erreur) { |
|
| 48 | - $class .= " error"; |
|
| 49 | - } |
|
| 50 | - $s .= "<li id='$id' class='$class'>"; |
|
| 43 | + $class = $class_li; |
|
| 44 | + $class .= $actif ? " actif" : ""; |
|
| 45 | + $class .= $expose ? " on" : ""; |
|
| 46 | + $erreur = isset($info['erreur']); |
|
| 47 | + if ($erreur) { |
|
| 48 | + $class .= " error"; |
|
| 49 | + } |
|
| 50 | + $s .= "<li id='$id' class='$class'>"; |
|
| 51 | 51 | |
| 52 | - // Cartouche Resume |
|
| 53 | - $s .= "<div class='resume'>"; |
|
| 52 | + // Cartouche Resume |
|
| 53 | + $s .= "<div class='resume'>"; |
|
| 54 | 54 | |
| 55 | - $prefix = $info['prefix']; |
|
| 56 | - $dir = "$dir_plugins$plug_file/lang/$prefix"; |
|
| 57 | - $desc = plugin_propre($info['description'], $dir); |
|
| 58 | - $url_stat = parametre_url($url_page, "plugin", $dir_plugins . $plug_file); |
|
| 55 | + $prefix = $info['prefix']; |
|
| 56 | + $dir = "$dir_plugins$plug_file/lang/$prefix"; |
|
| 57 | + $desc = plugin_propre($info['description'], $dir); |
|
| 58 | + $url_stat = parametre_url($url_page, "plugin", $dir_plugins . $plug_file); |
|
| 59 | 59 | |
| 60 | - $s .= "<strong class='nom'>" . typo($info['nom']) . "</strong>"; |
|
| 61 | - $s .= " <span class='version'>" . $info['version'] . "</span>"; |
|
| 62 | - $s .= " <span class='etat'> - " . plugin_etat_en_clair($info['etat']) . "</span>"; |
|
| 63 | - $s .= "</div>"; |
|
| 60 | + $s .= "<strong class='nom'>" . typo($info['nom']) . "</strong>"; |
|
| 61 | + $s .= " <span class='version'>" . $info['version'] . "</span>"; |
|
| 62 | + $s .= " <span class='etat'> - " . plugin_etat_en_clair($info['etat']) . "</span>"; |
|
| 63 | + $s .= "</div>"; |
|
| 64 | 64 | |
| 65 | - if ($erreur) { |
|
| 66 | - $s .= "<div class='erreur'>" . join('<br >', $info['erreur']) . "</div>"; |
|
| 67 | - } |
|
| 65 | + if ($erreur) { |
|
| 66 | + $s .= "<div class='erreur'>" . join('<br >', $info['erreur']) . "</div>"; |
|
| 67 | + } |
|
| 68 | 68 | |
| 69 | - $s .= "</li>"; |
|
| 69 | + $s .= "</li>"; |
|
| 70 | 70 | |
| 71 | - return $s; |
|
| 71 | + return $s; |
|
| 72 | 72 | } |
@@ -17,116 +17,116 @@ discard block |
||
| 17 | 17 | **/ |
| 18 | 18 | |
| 19 | 19 | if (!defined('_ECRIRE_INC_VERSION')) { |
| 20 | - return; |
|
| 20 | + return; |
|
| 21 | 21 | } |
| 22 | 22 | |
| 23 | 23 | // lecture d'un texte ecrit en pseudo-xml issu d'un fichier plugin.xml |
| 24 | 24 | // et conversion approximative en tableau PHP. |
| 25 | 25 | function plugins_infos_plugin($desc, $plug = '', $dir_plugins = _DIR_PLUGINS) { |
| 26 | - include_spip('inc/xml'); |
|
| 27 | - $arbre = spip_xml_parse($desc); |
|
| 28 | - |
|
| 29 | - $verifie_conformite = charger_fonction('verifie_conformite', 'plugins'); |
|
| 30 | - $verifie_conformite($plug, $arbre, $dir_plugins); |
|
| 31 | - |
|
| 32 | - include_spip('inc/charsets'); |
|
| 33 | - |
|
| 34 | - // On renvoie la DTD utilisee |
|
| 35 | - $ret['dtd'] = "plugin"; |
|
| 36 | - |
|
| 37 | - if (isset($arbre['categorie'])) { |
|
| 38 | - $ret['categorie'] = trim(spip_xml_aplatit($arbre['categorie'])); |
|
| 39 | - } |
|
| 40 | - if (isset($arbre['nom'])) { |
|
| 41 | - $ret['nom'] = charset2unicode(spip_xml_aplatit($arbre['nom'])); |
|
| 42 | - } |
|
| 43 | - if (isset($arbre['icon'])) { |
|
| 44 | - $ret['logo'] = trim(spip_xml_aplatit($arbre['icon'])); |
|
| 45 | - } |
|
| 46 | - if (isset($arbre['auteur'])) { |
|
| 47 | - $ret['auteur'][] = trim(spip_xml_aplatit($arbre['auteur'])); |
|
| 48 | - } // garder le 1er niveau en tableau mais traiter le multi possible |
|
| 49 | - if (isset($arbre['licence'])) { |
|
| 50 | - $ret['licence'][] = trim(spip_xml_aplatit($arbre['licence'])); |
|
| 51 | - } |
|
| 52 | - if (isset($arbre['version'])) { |
|
| 53 | - $ret['version'] = trim(spip_xml_aplatit($arbre['version'])); |
|
| 54 | - } |
|
| 55 | - if (isset($arbre['version_base'])) { |
|
| 56 | - $ret['schema'] = trim(spip_xml_aplatit($arbre['version_base'])); |
|
| 57 | - } |
|
| 58 | - if (isset($arbre['etat'])) { |
|
| 59 | - $ret['etat'] = trim(spip_xml_aplatit($arbre['etat'])); |
|
| 60 | - } |
|
| 61 | - |
|
| 62 | - $ret['description'] = $ret['slogan'] = ""; |
|
| 63 | - if (isset($arbre['slogan'])) { |
|
| 64 | - $ret['slogan'] = trim(spip_xml_aplatit($arbre['slogan'])); |
|
| 65 | - } |
|
| 66 | - if (isset($arbre['description'])) { |
|
| 67 | - $ret['description'] = trim(spip_xml_aplatit($arbre['description'])); |
|
| 68 | - } |
|
| 69 | - |
|
| 70 | - if (isset($arbre['lien'])) { |
|
| 71 | - $ret['documentation'] = trim(join(' ', $arbre['lien'])); |
|
| 72 | - if ($ret['documentation']) { |
|
| 73 | - // le lien de doc doit etre une url et c'est tout |
|
| 74 | - if (!tester_url_absolue($ret['documentation'])) { |
|
| 75 | - $ret['documentation'] = ""; |
|
| 76 | - } |
|
| 77 | - } |
|
| 78 | - } |
|
| 79 | - |
|
| 80 | - if (isset($arbre['options'])) { |
|
| 81 | - $ret['options'] = $arbre['options']; |
|
| 82 | - } |
|
| 83 | - if (isset($arbre['fonctions'])) { |
|
| 84 | - $ret['fonctions'] = $arbre['fonctions']; |
|
| 85 | - } |
|
| 86 | - if (isset($arbre['prefix'][0])) { |
|
| 87 | - $ret['prefix'] = trim(array_pop($arbre['prefix'])); |
|
| 88 | - } |
|
| 89 | - if (isset($arbre['install'])) { |
|
| 90 | - $ret['install'] = $arbre['install']; |
|
| 91 | - } |
|
| 92 | - if (isset($arbre['meta'])) { |
|
| 93 | - $ret['meta'] = trim(spip_xml_aplatit($arbre['meta'])); |
|
| 94 | - } |
|
| 95 | - |
|
| 96 | - $necessite = info_plugin_normalise_necessite(isset($arbre['necessite']) ? $arbre['necessite'] : ''); |
|
| 97 | - $ret['compatibilite'] = isset($necessite['compatible']) ? $necessite['compatible'] : ''; |
|
| 98 | - $ret['necessite'] = $necessite['necessite']; |
|
| 99 | - $ret['lib'] = $necessite['lib']; |
|
| 100 | - $ret['utilise'] = info_plugin_normalise_utilise(isset($arbre['utilise']) ? $arbre['utilise'] : ''); |
|
| 101 | - $ret['procure'] = info_plugin_normalise_procure(isset($arbre['procure']) ? $arbre['procure'] : ''); |
|
| 102 | - $ret['chemin'] = info_plugin_normalise_chemin(isset($arbre['path']) ? $arbre['path'] : ''); |
|
| 103 | - |
|
| 104 | - if (isset($arbre['pipeline'])) { |
|
| 105 | - $ret['pipeline'] = $arbre['pipeline']; |
|
| 106 | - } |
|
| 107 | - |
|
| 108 | - $extraire_boutons = charger_fonction('extraire_boutons', 'plugins'); |
|
| 109 | - $les_boutons = $extraire_boutons($arbre); |
|
| 110 | - $ret['menu'] = $les_boutons['bouton']; |
|
| 111 | - $ret['onglet'] = $les_boutons['onglet']; |
|
| 112 | - |
|
| 113 | - $ret['traduire'] = isset($arbre['traduire']) ? $arbre['traduire'] : ''; |
|
| 114 | - |
|
| 115 | - if (isset($arbre['config'])) { |
|
| 116 | - $ret['config'] = spip_xml_aplatit($arbre['config']); |
|
| 117 | - } |
|
| 118 | - if (isset($arbre['noisette'])) { |
|
| 119 | - $ret['noisette'] = $arbre['noisette']; |
|
| 120 | - } |
|
| 121 | - |
|
| 122 | - if (isset($arbre['erreur'])) { |
|
| 123 | - $ret['erreur'] = $arbre['erreur']; |
|
| 124 | - if ($plug) { |
|
| 125 | - spip_log("infos_plugin $plug " . @join(' ', $arbre['erreur'])); |
|
| 126 | - } |
|
| 127 | - } |
|
| 128 | - |
|
| 129 | - return $ret; |
|
| 26 | + include_spip('inc/xml'); |
|
| 27 | + $arbre = spip_xml_parse($desc); |
|
| 28 | + |
|
| 29 | + $verifie_conformite = charger_fonction('verifie_conformite', 'plugins'); |
|
| 30 | + $verifie_conformite($plug, $arbre, $dir_plugins); |
|
| 31 | + |
|
| 32 | + include_spip('inc/charsets'); |
|
| 33 | + |
|
| 34 | + // On renvoie la DTD utilisee |
|
| 35 | + $ret['dtd'] = "plugin"; |
|
| 36 | + |
|
| 37 | + if (isset($arbre['categorie'])) { |
|
| 38 | + $ret['categorie'] = trim(spip_xml_aplatit($arbre['categorie'])); |
|
| 39 | + } |
|
| 40 | + if (isset($arbre['nom'])) { |
|
| 41 | + $ret['nom'] = charset2unicode(spip_xml_aplatit($arbre['nom'])); |
|
| 42 | + } |
|
| 43 | + if (isset($arbre['icon'])) { |
|
| 44 | + $ret['logo'] = trim(spip_xml_aplatit($arbre['icon'])); |
|
| 45 | + } |
|
| 46 | + if (isset($arbre['auteur'])) { |
|
| 47 | + $ret['auteur'][] = trim(spip_xml_aplatit($arbre['auteur'])); |
|
| 48 | + } // garder le 1er niveau en tableau mais traiter le multi possible |
|
| 49 | + if (isset($arbre['licence'])) { |
|
| 50 | + $ret['licence'][] = trim(spip_xml_aplatit($arbre['licence'])); |
|
| 51 | + } |
|
| 52 | + if (isset($arbre['version'])) { |
|
| 53 | + $ret['version'] = trim(spip_xml_aplatit($arbre['version'])); |
|
| 54 | + } |
|
| 55 | + if (isset($arbre['version_base'])) { |
|
| 56 | + $ret['schema'] = trim(spip_xml_aplatit($arbre['version_base'])); |
|
| 57 | + } |
|
| 58 | + if (isset($arbre['etat'])) { |
|
| 59 | + $ret['etat'] = trim(spip_xml_aplatit($arbre['etat'])); |
|
| 60 | + } |
|
| 61 | + |
|
| 62 | + $ret['description'] = $ret['slogan'] = ""; |
|
| 63 | + if (isset($arbre['slogan'])) { |
|
| 64 | + $ret['slogan'] = trim(spip_xml_aplatit($arbre['slogan'])); |
|
| 65 | + } |
|
| 66 | + if (isset($arbre['description'])) { |
|
| 67 | + $ret['description'] = trim(spip_xml_aplatit($arbre['description'])); |
|
| 68 | + } |
|
| 69 | + |
|
| 70 | + if (isset($arbre['lien'])) { |
|
| 71 | + $ret['documentation'] = trim(join(' ', $arbre['lien'])); |
|
| 72 | + if ($ret['documentation']) { |
|
| 73 | + // le lien de doc doit etre une url et c'est tout |
|
| 74 | + if (!tester_url_absolue($ret['documentation'])) { |
|
| 75 | + $ret['documentation'] = ""; |
|
| 76 | + } |
|
| 77 | + } |
|
| 78 | + } |
|
| 79 | + |
|
| 80 | + if (isset($arbre['options'])) { |
|
| 81 | + $ret['options'] = $arbre['options']; |
|
| 82 | + } |
|
| 83 | + if (isset($arbre['fonctions'])) { |
|
| 84 | + $ret['fonctions'] = $arbre['fonctions']; |
|
| 85 | + } |
|
| 86 | + if (isset($arbre['prefix'][0])) { |
|
| 87 | + $ret['prefix'] = trim(array_pop($arbre['prefix'])); |
|
| 88 | + } |
|
| 89 | + if (isset($arbre['install'])) { |
|
| 90 | + $ret['install'] = $arbre['install']; |
|
| 91 | + } |
|
| 92 | + if (isset($arbre['meta'])) { |
|
| 93 | + $ret['meta'] = trim(spip_xml_aplatit($arbre['meta'])); |
|
| 94 | + } |
|
| 95 | + |
|
| 96 | + $necessite = info_plugin_normalise_necessite(isset($arbre['necessite']) ? $arbre['necessite'] : ''); |
|
| 97 | + $ret['compatibilite'] = isset($necessite['compatible']) ? $necessite['compatible'] : ''; |
|
| 98 | + $ret['necessite'] = $necessite['necessite']; |
|
| 99 | + $ret['lib'] = $necessite['lib']; |
|
| 100 | + $ret['utilise'] = info_plugin_normalise_utilise(isset($arbre['utilise']) ? $arbre['utilise'] : ''); |
|
| 101 | + $ret['procure'] = info_plugin_normalise_procure(isset($arbre['procure']) ? $arbre['procure'] : ''); |
|
| 102 | + $ret['chemin'] = info_plugin_normalise_chemin(isset($arbre['path']) ? $arbre['path'] : ''); |
|
| 103 | + |
|
| 104 | + if (isset($arbre['pipeline'])) { |
|
| 105 | + $ret['pipeline'] = $arbre['pipeline']; |
|
| 106 | + } |
|
| 107 | + |
|
| 108 | + $extraire_boutons = charger_fonction('extraire_boutons', 'plugins'); |
|
| 109 | + $les_boutons = $extraire_boutons($arbre); |
|
| 110 | + $ret['menu'] = $les_boutons['bouton']; |
|
| 111 | + $ret['onglet'] = $les_boutons['onglet']; |
|
| 112 | + |
|
| 113 | + $ret['traduire'] = isset($arbre['traduire']) ? $arbre['traduire'] : ''; |
|
| 114 | + |
|
| 115 | + if (isset($arbre['config'])) { |
|
| 116 | + $ret['config'] = spip_xml_aplatit($arbre['config']); |
|
| 117 | + } |
|
| 118 | + if (isset($arbre['noisette'])) { |
|
| 119 | + $ret['noisette'] = $arbre['noisette']; |
|
| 120 | + } |
|
| 121 | + |
|
| 122 | + if (isset($arbre['erreur'])) { |
|
| 123 | + $ret['erreur'] = $arbre['erreur']; |
|
| 124 | + if ($plug) { |
|
| 125 | + spip_log("infos_plugin $plug " . @join(' ', $arbre['erreur'])); |
|
| 126 | + } |
|
| 127 | + } |
|
| 128 | + |
|
| 129 | + return $ret; |
|
| 130 | 130 | } |
| 131 | 131 | |
| 132 | 132 | |
@@ -153,27 +153,27 @@ discard block |
||
| 153 | 153 | * Liste des necessite modifiés. |
| 154 | 154 | */ |
| 155 | 155 | function info_plugin_normalise_necessite($necessite) { |
| 156 | - $res = array('necessite' => array(), 'lib' => array()); |
|
| 157 | - |
|
| 158 | - if (is_array($necessite)) { |
|
| 159 | - foreach ($necessite as $need) { |
|
| 160 | - $id = $need['id']; |
|
| 161 | - $v = isset($need['version']) ? $need['version'] : ''; |
|
| 162 | - |
|
| 163 | - // Necessite SPIP version x ? |
|
| 164 | - if (strtoupper($id) == 'SPIP') { |
|
| 165 | - $res['compatible'] = $v; |
|
| 166 | - } else { |
|
| 167 | - if (preg_match(',^lib:\s*([^\s]*),i', $id, $r)) { |
|
| 168 | - $res['lib'][] = array('nom' => $r[1], 'id' => $r[1], 'lien' => $need['src']); |
|
| 169 | - } else { |
|
| 170 | - $res['necessite'][] = array('id' => $id, 'nom' => $id, 'version' => $v, 'compatibilite' => $v); |
|
| 171 | - } |
|
| 172 | - } |
|
| 173 | - } |
|
| 174 | - } |
|
| 175 | - |
|
| 176 | - return $res; |
|
| 156 | + $res = array('necessite' => array(), 'lib' => array()); |
|
| 157 | + |
|
| 158 | + if (is_array($necessite)) { |
|
| 159 | + foreach ($necessite as $need) { |
|
| 160 | + $id = $need['id']; |
|
| 161 | + $v = isset($need['version']) ? $need['version'] : ''; |
|
| 162 | + |
|
| 163 | + // Necessite SPIP version x ? |
|
| 164 | + if (strtoupper($id) == 'SPIP') { |
|
| 165 | + $res['compatible'] = $v; |
|
| 166 | + } else { |
|
| 167 | + if (preg_match(',^lib:\s*([^\s]*),i', $id, $r)) { |
|
| 168 | + $res['lib'][] = array('nom' => $r[1], 'id' => $r[1], 'lien' => $need['src']); |
|
| 169 | + } else { |
|
| 170 | + $res['necessite'][] = array('id' => $id, 'nom' => $id, 'version' => $v, 'compatibilite' => $v); |
|
| 171 | + } |
|
| 172 | + } |
|
| 173 | + } |
|
| 174 | + } |
|
| 175 | + |
|
| 176 | + return $res; |
|
| 177 | 177 | } |
| 178 | 178 | |
| 179 | 179 | /** |
@@ -189,17 +189,17 @@ discard block |
||
| 189 | 189 | * Liste des utilise modifiés. |
| 190 | 190 | */ |
| 191 | 191 | function info_plugin_normalise_utilise($utilise) { |
| 192 | - $res = array(); |
|
| 192 | + $res = array(); |
|
| 193 | 193 | |
| 194 | - if (is_array($utilise)) { |
|
| 195 | - foreach ($utilise as $need) { |
|
| 196 | - $id = $need['id']; |
|
| 197 | - $v = isset($need['version']) ? $need['version'] : ''; |
|
| 198 | - $res[] = array('nom' => $id, 'id' => $id, 'version' => $v, 'compatibilite' => $v); |
|
| 199 | - } |
|
| 200 | - } |
|
| 194 | + if (is_array($utilise)) { |
|
| 195 | + foreach ($utilise as $need) { |
|
| 196 | + $id = $need['id']; |
|
| 197 | + $v = isset($need['version']) ? $need['version'] : ''; |
|
| 198 | + $res[] = array('nom' => $id, 'id' => $id, 'version' => $v, 'compatibilite' => $v); |
|
| 199 | + } |
|
| 200 | + } |
|
| 201 | 201 | |
| 202 | - return $res; |
|
| 202 | + return $res; |
|
| 203 | 203 | } |
| 204 | 204 | |
| 205 | 205 | /** |
@@ -213,17 +213,17 @@ discard block |
||
| 213 | 213 | * Liste des procure modifiés. |
| 214 | 214 | */ |
| 215 | 215 | function info_plugin_normalise_procure($procure) { |
| 216 | - $res = array(); |
|
| 216 | + $res = array(); |
|
| 217 | 217 | |
| 218 | - if (is_array($procure)) { |
|
| 219 | - foreach ($procure as $need) { |
|
| 220 | - $id = $need['id']; |
|
| 221 | - $v = $need['version']; |
|
| 222 | - $res[] = array('nom' => $id, 'id' => $id, 'version' => $v); |
|
| 223 | - } |
|
| 224 | - } |
|
| 218 | + if (is_array($procure)) { |
|
| 219 | + foreach ($procure as $need) { |
|
| 220 | + $id = $need['id']; |
|
| 221 | + $v = $need['version']; |
|
| 222 | + $res[] = array('nom' => $id, 'id' => $id, 'version' => $v); |
|
| 223 | + } |
|
| 224 | + } |
|
| 225 | 225 | |
| 226 | - return $res; |
|
| 226 | + return $res; |
|
| 227 | 227 | } |
| 228 | 228 | |
| 229 | 229 | /** |
@@ -237,14 +237,14 @@ discard block |
||
| 237 | 237 | * Liste des chemins modifiés. |
| 238 | 238 | */ |
| 239 | 239 | function info_plugin_normalise_chemin($chemins) { |
| 240 | - $res = array(); |
|
| 240 | + $res = array(); |
|
| 241 | 241 | |
| 242 | - if (is_array($chemins)) { |
|
| 243 | - foreach ($chemins as $c) { |
|
| 244 | - $c['path'] = $c['dir']; |
|
| 245 | - $res[] = $c; |
|
| 246 | - } |
|
| 247 | - } |
|
| 242 | + if (is_array($chemins)) { |
|
| 243 | + foreach ($chemins as $c) { |
|
| 244 | + $c['path'] = $c['dir']; |
|
| 245 | + $res[] = $c; |
|
| 246 | + } |
|
| 247 | + } |
|
| 248 | 248 | |
| 249 | - return $res; |
|
| 249 | + return $res; |
|
| 250 | 250 | } |
@@ -122,7 +122,7 @@ |
||
| 122 | 122 | if (isset($arbre['erreur'])) { |
| 123 | 123 | $ret['erreur'] = $arbre['erreur']; |
| 124 | 124 | if ($plug) { |
| 125 | - spip_log("infos_plugin $plug " . @join(' ', $arbre['erreur'])); |
|
| 125 | + spip_log("infos_plugin $plug ".@join(' ', $arbre['erreur'])); |
|
| 126 | 126 | } |
| 127 | 127 | } |
| 128 | 128 | |
@@ -11,7 +11,7 @@ discard block |
||
| 11 | 11 | \***************************************************************************/ |
| 12 | 12 | |
| 13 | 13 | if (!defined('_ECRIRE_INC_VERSION')) { |
| 14 | - return; |
|
| 14 | + return; |
|
| 15 | 15 | } |
| 16 | 16 | |
| 17 | 17 | |
@@ -21,26 +21,26 @@ discard block |
||
| 21 | 21 | * @param array $arbre |
| 22 | 22 | */ |
| 23 | 23 | function plugins_extraire_pipelines_dist(&$arbre) { |
| 24 | - $pipeline = array(); |
|
| 25 | - if (spip_xml_match_nodes(',^pipeline,', $arbre, $pipes)) { |
|
| 26 | - foreach ($pipes as $tag => $p) { |
|
| 27 | - if (!is_array($p[0])) { |
|
| 28 | - list($tag, $att) = spip_xml_decompose_tag($tag); |
|
| 29 | - $pipeline[] = $att; |
|
| 30 | - } else { |
|
| 31 | - foreach ($p as $pipe) { |
|
| 32 | - $att = array(); |
|
| 33 | - if (is_array($pipe)) { |
|
| 34 | - foreach ($pipe as $k => $t) { |
|
| 35 | - $att[$k] = trim(end($t)); |
|
| 36 | - } |
|
| 37 | - } |
|
| 38 | - $pipeline[] = $att; |
|
| 39 | - } |
|
| 40 | - } |
|
| 41 | - } |
|
| 42 | - unset($arbre[$tag]); |
|
| 43 | - } |
|
| 24 | + $pipeline = array(); |
|
| 25 | + if (spip_xml_match_nodes(',^pipeline,', $arbre, $pipes)) { |
|
| 26 | + foreach ($pipes as $tag => $p) { |
|
| 27 | + if (!is_array($p[0])) { |
|
| 28 | + list($tag, $att) = spip_xml_decompose_tag($tag); |
|
| 29 | + $pipeline[] = $att; |
|
| 30 | + } else { |
|
| 31 | + foreach ($p as $pipe) { |
|
| 32 | + $att = array(); |
|
| 33 | + if (is_array($pipe)) { |
|
| 34 | + foreach ($pipe as $k => $t) { |
|
| 35 | + $att[$k] = trim(end($t)); |
|
| 36 | + } |
|
| 37 | + } |
|
| 38 | + $pipeline[] = $att; |
|
| 39 | + } |
|
| 40 | + } |
|
| 41 | + } |
|
| 42 | + unset($arbre[$tag]); |
|
| 43 | + } |
|
| 44 | 44 | |
| 45 | - return $pipeline; |
|
| 45 | + return $pipeline; |
|
| 46 | 46 | } |