c839bad8c9c77a3c50f79a36b0b167b984cd568d
[lhc/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-2017 *
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')) {
14 return;
15 }
16
17
18 /**
19 * Extraire les infos de pipeline
20 *
21 * @param array $arbre
22 */
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 }
44
45 return $pipeline;
46 }