[SPIP][PLUGINS] v3.0-->v3.2
[lhc/web/www.git] / www / ecrire / plugins / extraire_pipelines.php
index a3da5ef..c839bad 100644 (file)
@@ -3,14 +3,16 @@
 /***************************************************************************\
  *  SPIP, Systeme de publication pour l'internet                           *
  *                                                                         *
- *  Copyright (c) 2001-2016                                                *
+ *  Copyright (c) 2001-2017                                                *
  *  Arnaud Martin, Antoine Pitrou, Philippe Riviere, Emmanuel Saint-James  *
  *                                                                         *
  *  Ce programme est un logiciel libre distribue sous licence GNU/GPL.     *
  *  Pour plus de details voir le fichier COPYING.txt ou l'aide en ligne.   *
 \***************************************************************************/
 
-if (!defined('_ECRIRE_INC_VERSION')) return;
+if (!defined('_ECRIRE_INC_VERSION')) {
+       return;
+}
 
 
 /**
@@ -18,20 +20,23 @@ if (!defined('_ECRIRE_INC_VERSION')) return;
  *
  * @param array $arbre
  */
-function plugins_extraire_pipelines_dist(&$arbre){
+function plugins_extraire_pipelines_dist(&$arbre) {
        $pipeline = array();
-       if (spip_xml_match_nodes(',^pipeline,',$arbre,$pipes)){
-               foreach($pipes as $tag=>$p){
-                       if (!is_array($p[0])){
-                               list($tag,$att) = spip_xml_decompose_tag($tag);
-                               $pipeline[] = $att;
-                       }
-                       else foreach($p as $pipe){
-                               $att = array();
-                               if (is_array($pipe))
-                                       foreach($pipe as $k=>$t)
-                                               $att[$k] = trim(end($t));
+       if (spip_xml_match_nodes(',^pipeline,', $arbre, $pipes)) {
+               foreach ($pipes as $tag => $p) {
+                       if (!is_array($p[0])) {
+                               list($tag, $att) = spip_xml_decompose_tag($tag);
                                $pipeline[] = $att;
+                       } else {
+                               foreach ($p as $pipe) {
+                                       $att = array();
+                                       if (is_array($pipe)) {
+                                               foreach ($pipe as $k => $t) {
+                                                       $att[$k] = trim(end($t));
+                                               }
+                                       }
+                                       $pipeline[] = $att;
+                               }
                        }
                }
                unset($arbre[$tag]);
@@ -39,6 +44,3 @@ function plugins_extraire_pipelines_dist(&$arbre){
 
        return $pipeline;
 }
-
-
-?>