Completed
Push — master ( 3bf1a5...bdbd8d )
by cam
01:05
created
ecrire/plugins/extraire_boutons.php 1 patch
Indentation   +27 added lines, -27 removed lines patch added patch discarded remove patch
@@ -11,7 +11,7 @@  discard block
 block discarded – undo
11 11
 \***************************************************************************/
12 12
 
13 13
 if (!defined('_ECRIRE_INC_VERSION')) {
14
-	return;
14
+    return;
15 15
 }
16 16
 
17 17
 /**
@@ -21,31 +21,31 @@  discard block
 block discarded – undo
21 21
  * @return array
22 22
  */
23 23
 function plugins_extraire_boutons_dist($arbre) {
24
-	$les_boutons = null;
25
-	$ret = ['bouton' => [], 'onglet' => []];
26
-	// recuperer les boutons et onglets si necessaire
27
-	spip_xml_match_nodes(',^(bouton|onglet)\s,', $arbre, $les_boutons);
28
-	if (is_array($les_boutons) && count($les_boutons)) {
29
-		$ret['bouton'] = [];
30
-		$ret['onglet'] = [];
31
-		foreach ($les_boutons as $bouton => $val) {
32
-			$bouton = spip_xml_decompose_tag($bouton);
33
-			$type = reset($bouton);
34
-			$bouton = end($bouton);
35
-			if (isset($bouton['id'])) {
36
-				$id = $bouton['id'];
37
-				$val = reset($val);
38
-				if (is_array($val)) {
39
-					$ret[$type][$id]['parent'] = $bouton['parent'] ?? '';
40
-					$ret[$type][$id]['position'] = $bouton['position'] ?? '';
41
-					$ret[$type][$id]['titre'] = isset($val['titre']) ? trim(spip_xml_aplatit($val['titre'])) : '';
42
-					$ret[$type][$id]['icone'] = isset($val['icone']) ? trim(end($val['icone'])) : '';
43
-					$ret[$type][$id]['action'] = isset($val['url']) ? trim(end($val['url'])) : '';
44
-					$ret[$type][$id]['parametres'] = isset($val['args']) ? trim(end($val['args'])) : '';
45
-				}
46
-			}
47
-		}
48
-	}
24
+    $les_boutons = null;
25
+    $ret = ['bouton' => [], 'onglet' => []];
26
+    // recuperer les boutons et onglets si necessaire
27
+    spip_xml_match_nodes(',^(bouton|onglet)\s,', $arbre, $les_boutons);
28
+    if (is_array($les_boutons) && count($les_boutons)) {
29
+        $ret['bouton'] = [];
30
+        $ret['onglet'] = [];
31
+        foreach ($les_boutons as $bouton => $val) {
32
+            $bouton = spip_xml_decompose_tag($bouton);
33
+            $type = reset($bouton);
34
+            $bouton = end($bouton);
35
+            if (isset($bouton['id'])) {
36
+                $id = $bouton['id'];
37
+                $val = reset($val);
38
+                if (is_array($val)) {
39
+                    $ret[$type][$id]['parent'] = $bouton['parent'] ?? '';
40
+                    $ret[$type][$id]['position'] = $bouton['position'] ?? '';
41
+                    $ret[$type][$id]['titre'] = isset($val['titre']) ? trim(spip_xml_aplatit($val['titre'])) : '';
42
+                    $ret[$type][$id]['icone'] = isset($val['icone']) ? trim(end($val['icone'])) : '';
43
+                    $ret[$type][$id]['action'] = isset($val['url']) ? trim(end($val['url'])) : '';
44
+                    $ret[$type][$id]['parametres'] = isset($val['args']) ? trim(end($val['args'])) : '';
45
+                }
46
+            }
47
+        }
48
+    }
49 49
 
50
-	return $ret;
50
+    return $ret;
51 51
 }
Please login to merge, or discard this patch.