[SPIP] +2.1.12
[velocampus/web/www.git] / www / ecrire / plugins / extraire_pipelines.php
1 <?php
2
3 /***************************************************************************\
4 * SPIP, Systeme de publication pour l'internet *
5 * *
6 * Copyright (c) 2001-2011 *
7 * Arnaud Martin, Antoine Pitrou, Philippe Riviere, Emmanuel Saint-James *
8 * *
9 * Ce programme est un logiciel libre distribue sous licence GNU/GPL. *
10 * Pour plus de details voir le fichier COPYING.txt ou l'aide en ligne. *
11 \***************************************************************************/
12
13 if (!defined('_ECRIRE_INC_VERSION')) return;
14
15
16 /**
17 * Extraire les infos de pipeline
18 *
19 * @param array $arbre
20 */
21 function plugins_extraire_pipelines_dist(&$arbre){
22 $pipeline = array();
23 if (spip_xml_match_nodes(',^pipeline,',$arbre,$pipes)){
24 foreach($pipes as $tag=>$p){
25 if (!is_array($p[0])){
26 list($tag,$att) = spip_xml_decompose_tag($tag);
27 $pipeline[] = $att;
28 }
29 else foreach($p as $pipe){
30 $att = array();
31 if (is_array($pipe))
32 foreach($pipe as $k=>$t)
33 $att[$k] = trim(end($t));
34 $pipeline[] = $att;
35 }
36 }
37 unset($arbre[$tag]);
38 }
39
40 return $pipeline;
41 }
42
43
44 ?>