Completed
Push — master ( 4aa2c5...a38486 )
by cam
01:23
created
ecrire/xml/interfaces.php 1 patch
Indentation   +18 added lines, -18 removed lines patch added patch discarded remove patch
@@ -11,12 +11,12 @@  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
 define(
18
-	'_REGEXP_DOCTYPE',
19
-	'/^((?:<\001?[?][^>]*>\s*)*(?:<!--.*?-->\s*)*)*<!DOCTYPE\s+(\w+)\s+(\w+)\s*([^>]*)>\s*/s'
18
+    '_REGEXP_DOCTYPE',
19
+    '/^((?:<\001?[?][^>]*>\s*)*(?:<!--.*?-->\s*)*)*<!DOCTYPE\s+(\w+)\s+(\w+)\s*([^>]*)>\s*/s'
20 20
 );
21 21
 
22 22
 define('_REGEXP_XML', '/^(\s*(?:<[?][^x>][^>]*>\s*)?(?:<[?]xml[^>]*>)?\s*(?:<!--.*?-->\s*)*)<(\w+)/s');
@@ -35,14 +35,14 @@  discard block
 block discarded – undo
35 35
 define('_REGEXP_ENTITY_DEF', '/^%(' . _SUB_REGEXP_SYMBOL . '+);/');
36 36
 define('_REGEXP_TYPE_XML', 'PUBLIC|SYSTEM|INCLUDE|IGNORE|CDATA');
37 37
 define('_REGEXP_ENTITY_DECL', '/^<!ENTITY\s+(%?)\s*(' .
38
-	_SUB_REGEXP_SYMBOL .
39
-	'+;?)\s+(' .
40
-	_REGEXP_TYPE_XML .
41
-	')?\s*(' .
42
-	"('([^']*)')" .
43
-	'|("([^"]*)")' .
44
-	'|\s*(%' . _SUB_REGEXP_SYMBOL . '+;)\s*' .
45
-	')\s*(--.*?--)?("([^"]*)")?\s*>\s*(.*)$/s');
38
+    _SUB_REGEXP_SYMBOL .
39
+    '+;?)\s+(' .
40
+    _REGEXP_TYPE_XML .
41
+    ')?\s*(' .
42
+    "('([^']*)')" .
43
+    '|("([^"]*)")' .
44
+    '|\s*(%' . _SUB_REGEXP_SYMBOL . '+;)\s*' .
45
+    ')\s*(--.*?--)?("([^"]*)")?\s*>\s*(.*)$/s');
46 46
 
47 47
 define('_REGEXP_INCLUDE_USE', '/^<!\[\s*%\s*([^;]*);\s*\[\s*(.*)$/s');
48 48
 
@@ -52,11 +52,11 @@  discard block
 block discarded – undo
52 52
  * Document Type Compilation
53 53
  **/
54 54
 class DTC {
55
-	public $macros = [];
56
-	public $elements = [];
57
-	public $peres = [];
58
-	public $attributs = [];
59
-	public $entites = [];
60
-	public $regles = [];
61
-	public $pcdata = [];
55
+    public $macros = [];
56
+    public $elements = [];
57
+    public $peres = [];
58
+    public $attributs = [];
59
+    public $entites = [];
60
+    public $regles = [];
61
+    public $pcdata = [];
62 62
 }
Please login to merge, or discard this patch.
ecrire/iterateur/php.php 1 patch
Indentation   +14 added lines, -14 removed lines patch added patch discarded remove patch
@@ -18,7 +18,7 @@  discard block
 block discarded – undo
18 18
 
19 19
 
20 20
 if (!defined('_ECRIRE_INC_VERSION')) {
21
-	return;
21
+    return;
22 22
 }
23 23
 
24 24
 
@@ -36,22 +36,22 @@  discard block
 block discarded – undo
36 36
  *     Description de la boucle complétée des champs
37 37
  */
38 38
 function iterateur_php_dist($b, $iteratorName) {
39
-	$b->iterateur = $iteratorName; # designe la classe d'iterateur
40
-	$b->show = [
41
-		'field' => [
42
-			'cle' => 'STRING',
43
-			'valeur' => 'STRING',
44
-		]
45
-	];
46
-	foreach (get_class_methods($iteratorName) as $method) {
47
-		$b->show['field'][strtolower($method)] = 'METHOD';
48
-	}
49
-
50
-	/*
39
+    $b->iterateur = $iteratorName; # designe la classe d'iterateur
40
+    $b->show = [
41
+        'field' => [
42
+            'cle' => 'STRING',
43
+            'valeur' => 'STRING',
44
+        ]
45
+    ];
46
+    foreach (get_class_methods($iteratorName) as $method) {
47
+        $b->show['field'][strtolower($method)] = 'METHOD';
48
+    }
49
+
50
+    /*
51 51
 	foreach (get_class_vars($iteratorName) as $property) {
52 52
 		$b->show['field'][ strtolower($property) ] = 'PROPERTY';
53 53
 	}
54 54
 	*/
55 55
 
56
-	return $b;
56
+    return $b;
57 57
 }
Please login to merge, or discard this patch.
ecrire/iterateur/pour.php 1 patch
Indentation   +9 added lines, -9 removed lines patch added patch discarded remove patch
@@ -17,7 +17,7 @@  discard block
 block discarded – undo
17 17
  **/
18 18
 
19 19
 if (!defined('_ECRIRE_INC_VERSION')) {
20
-	return;
20
+    return;
21 21
 }
22 22
 
23 23
 include_spip('iterateur/data');
@@ -39,13 +39,13 @@  discard block
 block discarded – undo
39 39
  *     Description de la boucle complétée des champs
40 40
  */
41 41
 function iterateur_POUR_dist($b) {
42
-	$b->iterateur = 'DATA'; # designe la classe d'iterateur
43
-	$b->show = [
44
-		'field' => [
45
-			'cle' => 'STRING',
46
-			'valeur' => 'STRING',
47
-		]
48
-	];
42
+    $b->iterateur = 'DATA'; # designe la classe d'iterateur
43
+    $b->show = [
44
+        'field' => [
45
+            'cle' => 'STRING',
46
+            'valeur' => 'STRING',
47
+        ]
48
+    ];
49 49
 
50
-	return $b;
50
+    return $b;
51 51
 }
Please login to merge, or discard this patch.
ecrire/iterateur/condition.php 1 patch
Indentation   +14 added lines, -14 removed lines patch added patch discarded remove patch
@@ -17,7 +17,7 @@  discard block
 block discarded – undo
17 17
  **/
18 18
 
19 19
 if (!defined('_ECRIRE_INC_VERSION')) {
20
-	return;
20
+    return;
21 21
 }
22 22
 
23 23
 include_spip('iterateur/data');
@@ -35,12 +35,12 @@  discard block
 block discarded – undo
35 35
  *     Description de la boucle complétée des champs
36 36
  */
37 37
 function iterateur_CONDITION_dist($b) {
38
-	$b->iterateur = 'CONDITION'; # designe la classe d'iterateur
39
-	$b->show = [
40
-		'field' => []
41
-	];
38
+    $b->iterateur = 'CONDITION'; # designe la classe d'iterateur
39
+    $b->show = [
40
+        'field' => []
41
+    ];
42 42
 
43
-	return $b;
43
+    return $b;
44 44
 }
45 45
 
46 46
 /**
@@ -49,12 +49,12 @@  discard block
 block discarded – undo
49 49
  * La boucle condition n'a toujours qu'un seul élément.
50 50
  */
51 51
 class IterateurCONDITION extends IterateurData {
52
-	/**
53
-	 * Obtenir les données de la boucle CONDITION
54
-	 *
55
-	 * @param array $command
56
-	 **/
57
-	protected function select($command) {
58
-		$this->tableau = [0 => 1];
59
-	}
52
+    /**
53
+     * Obtenir les données de la boucle CONDITION
54
+     *
55
+     * @param array $command
56
+     **/
57
+    protected function select($command) {
58
+        $this->tableau = [0 => 1];
59
+    }
60 60
 }
Please login to merge, or discard this patch.
ecrire/inc/definir_menus_favoris.php 1 patch
Indentation   +12 added lines, -12 removed lines patch added patch discarded remove patch
@@ -20,21 +20,21 @@
 block discarded – undo
20 20
  * Retourne la liste des menus favoris par défaut ainsi que leur rang
21 21
  */
22 22
 function inc_definir_menus_favoris_dist() {
23
-	$liste = [
23
+    $liste = [
24 24
 
25
-		// Menu Édition,
26
-		'auteurs' => 1,
27
-		'rubriques' => 2,
28
-		'articles' => 3,
25
+        // Menu Édition,
26
+        'auteurs' => 1,
27
+        'rubriques' => 2,
28
+        'articles' => 3,
29 29
 
30
-		// Menu Maintenance
31
-		'admin_vider' => 1,
30
+        // Menu Maintenance
31
+        'admin_vider' => 1,
32 32
 
33
-		// Menu Configurations
34
-		'configurer_identite' => 1,
35
-		'admin_plugin' => 2,
33
+        // Menu Configurations
34
+        'configurer_identite' => 1,
35
+        'admin_plugin' => 2,
36 36
 
37
-	];
37
+    ];
38 38
 
39
-	return $liste;
39
+    return $liste;
40 40
 }
Please login to merge, or discard this patch.
ecrire/inc/icone_renommer.php 1 patch
Indentation   +53 added lines, -53 removed lines patch added patch discarded remove patch
@@ -11,71 +11,71 @@
 block discarded – undo
11 11
 \***************************************************************************/
12 12
 
13 13
 if (!defined('_ECRIRE_INC_VERSION')) {
14
-	return;
14
+    return;
15 15
 }
16 16
 
17 17
 include_spip('inc/boutons');
18 18
 include_spip('base/objets');
19 19
 
20 20
 function inc_icone_renommer_dist($fond, $fonction) {
21
-	$size = 24;
22
-	if (
23
-		preg_match('/(?:-([0-9]{1,3}))?([.](gif|png|svg))?$/i', $fond, $match)
24
-		and ((isset($match[0]) and $match[0]) or (isset($match[1]) and $match[1]))
25
-	) {
26
-		if (isset($match[1]) and $match[1]) {
27
-			$size = $match[1];
28
-		}
29
-		$type = substr($fond, 0, -strlen($match[0]));
30
-		if (!isset($match[2]) or !$match[2]) {
31
-			$fond .= '.png';
32
-		}
33
-	} else {
34
-		$type = $fond;
35
-		$fond .= '.png';
36
-	}
21
+    $size = 24;
22
+    if (
23
+        preg_match('/(?:-([0-9]{1,3}))?([.](gif|png|svg))?$/i', $fond, $match)
24
+        and ((isset($match[0]) and $match[0]) or (isset($match[1]) and $match[1]))
25
+    ) {
26
+        if (isset($match[1]) and $match[1]) {
27
+            $size = $match[1];
28
+        }
29
+        $type = substr($fond, 0, -strlen($match[0]));
30
+        if (!isset($match[2]) or !$match[2]) {
31
+            $fond .= '.png';
32
+        }
33
+    } else {
34
+        $type = $fond;
35
+        $fond .= '.png';
36
+    }
37 37
 
38
-	$rtl = false;
39
-	if (preg_match(',[-_]rtl$,i', $type, $match)) {
40
-		$rtl = true;
41
-		$type = substr($type, 0, -strlen($match[0]));
42
-	}
38
+    $rtl = false;
39
+    if (preg_match(',[-_]rtl$,i', $type, $match)) {
40
+        $rtl = true;
41
+        $type = substr($type, 0, -strlen($match[0]));
42
+    }
43 43
 
44
-	// objet_type garde invariant tout ce qui ne commence par par id_, spip_
45
-	// et ne finit pas par un s, sauf si c'est une exception declaree
46
-	$type = objet_type($type, false);
44
+    // objet_type garde invariant tout ce qui ne commence par par id_, spip_
45
+    // et ne finit pas par un s, sauf si c'est une exception declaree
46
+    $type = objet_type($type, false);
47 47
 
48
-	$dir = 'images/';
49
-	$f = "$type-$size.png";
50
-	if ($icone = find_in_theme($dir . $f)) {
51
-		$dir = dirname($icone);
52
-		$fond = $icone;
48
+    $dir = 'images/';
49
+    $f = "$type-$size.png";
50
+    if ($icone = find_in_theme($dir . $f)) {
51
+        $dir = dirname($icone);
52
+        $fond = $icone;
53 53
 
54
-		if (
55
-			$rtl
56
-			and $fr = $dir . '/' . str_replace("$type-", "$type-rtl-", basename($icone))
57
-			and file_exists($fr)
58
-		) {
59
-			$fond = $fr;
60
-		}
54
+        if (
55
+            $rtl
56
+            and $fr = $dir . '/' . str_replace("$type-", "$type-rtl-", basename($icone))
57
+            and file_exists($fr)
58
+        ) {
59
+            $fond = $fr;
60
+        }
61 61
 
62
-		$action = $fonction;
63
-		if ($action == 'supprimer.gif') {
64
-			$action = 'del';
65
-		} elseif ($action == 'creer.gif') {
66
-			$action = 'new';
67
-		} elseif ($action == 'edit.gif') {
68
-			$action = 'edit';
69
-		}
62
+        $action = $fonction;
63
+        if ($action == 'supprimer.gif') {
64
+            $action = 'del';
65
+        } elseif ($action == 'creer.gif') {
66
+            $action = 'new';
67
+        } elseif ($action == 'edit.gif') {
68
+            $action = 'edit';
69
+        }
70 70
 
71
-		$fonction = '';
72
-		if (in_array($action, ['add','del', 'new', 'edit', 'config'])) {
73
-			$fonction = $action;
74
-		}
71
+        $fonction = '';
72
+        if (in_array($action, ['add','del', 'new', 'edit', 'config'])) {
73
+            $fonction = $action;
74
+        }
75 75
 
76
-		// c'est bon !
77
-		return [$fond, $fonction];
78
-	}
76
+        // c'est bon !
77
+        return [$fond, $fonction];
78
+    }
79 79
 
80
-	return [$fond, $fonction];
80
+    return [$fond, $fonction];
81 81
 }
Please login to merge, or discard this patch.
ecrire/inc/lister_objets.php 1 patch
Indentation   +21 added lines, -21 removed lines patch added patch discarded remove patch
@@ -17,7 +17,7 @@  discard block
 block discarded – undo
17 17
  **/
18 18
 
19 19
 if (!defined('_ECRIRE_INC_VERSION')) {
20
-	return;
20
+    return;
21 21
 }
22 22
 
23 23
 
@@ -40,29 +40,29 @@  discard block
 block discarded – undo
40 40
  *     Code HTML de la liste
41 41
  */
42 42
 function inc_lister_objets_dist($vue, $contexte = [], $force = false) {
43
-	$res = ''; // debug
44
-	if (!is_array($contexte)) {
45
-		return _L('$contexte doit etre un tableau dans inc/lister_objets');
46
-	}
43
+    $res = ''; // debug
44
+    if (!is_array($contexte)) {
45
+        return _L('$contexte doit etre un tableau dans inc/lister_objets');
46
+    }
47 47
 
48
-	$fond = "prive/objets/liste/$vue";
49
-	if (!find_in_path($fond . '.' . _EXTENSION_SQUELETTES)) {
50
-		// traiter les cas particuliers
51
-		include_spip('base/connect_sql');
52
-		$vue = table_objet($vue);
53
-		$fond = "prive/objets/liste/$vue";
54
-		if (!find_in_path($fond . '.' . _EXTENSION_SQUELETTES)) {
55
-			return _L("vue $vue introuvable pour lister les objets");
56
-		}
57
-	}
48
+    $fond = "prive/objets/liste/$vue";
49
+    if (!find_in_path($fond . '.' . _EXTENSION_SQUELETTES)) {
50
+        // traiter les cas particuliers
51
+        include_spip('base/connect_sql');
52
+        $vue = table_objet($vue);
53
+        $fond = "prive/objets/liste/$vue";
54
+        if (!find_in_path($fond . '.' . _EXTENSION_SQUELETTES)) {
55
+            return _L("vue $vue introuvable pour lister les objets");
56
+        }
57
+    }
58 58
 
59 59
 
60
-	$contexte['sinon'] = ($force ? $contexte['titre'] : '');
60
+    $contexte['sinon'] = ($force ? $contexte['titre'] : '');
61 61
 
62
-	$res = recuperer_fond($fond, $contexte, ['ajax' => true]);
63
-	if (_request('var_liste')) {
64
-		echo var_export($contexte, true);
65
-	}
62
+    $res = recuperer_fond($fond, $contexte, ['ajax' => true]);
63
+    if (_request('var_liste')) {
64
+        echo var_export($contexte, true);
65
+    }
66 66
 
67
-	return $res;
67
+    return $res;
68 68
 }
Please login to merge, or discard this patch.
ecrire/inc/journal.php 1 patch
Indentation   +8 added lines, -8 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
 
@@ -24,11 +24,11 @@  discard block
 block discarded – undo
24 24
  * @param array $opt
25 25
  */
26 26
 function inc_journal_dist($phrase, $opt = []) {
27
-	if (!strlen($phrase)) {
28
-		return;
29
-	}
30
-	if ($opt) {
31
-		$phrase .= ' :: ' . str_replace("\n", ' ', join(', ', $opt));
32
-	}
33
-	spip_log($phrase, 'journal');
27
+    if (!strlen($phrase)) {
28
+        return;
29
+    }
30
+    if ($opt) {
31
+        $phrase .= ' :: ' . str_replace("\n", ' ', join(', ', $opt));
32
+    }
33
+    spip_log($phrase, 'journal');
34 34
 }
Please login to merge, or discard this patch.
ecrire/inc/couleurs.php 1 patch
Indentation   +63 added lines, -63 removed lines patch added patch discarded remove patch
@@ -17,7 +17,7 @@  discard block
 block discarded – undo
17 17
  */
18 18
 
19 19
 if (!defined('_ECRIRE_INC_VERSION')) {
20
-	return;
20
+    return;
21 21
 }
22 22
 
23 23
 /**
@@ -38,70 +38,70 @@  discard block
 block discarded – undo
38 38
  * @return array|string
39 39
  */
40 40
 function inc_couleurs_dist($choix = null, $ajouter = false) {
41
-	static $couleurs_spip = [
42
-		// Violet soutenu
43
-		9 => ['couleur_theme' => '#9a6ef2'],
44
-		// Violet rosé
45
-		4 => ['couleur_theme' => '#c464cb'],
46
-		// Rose interface SPIP
47
-		2 => ['couleur_theme' =>  '#F02364'],
48
-		// Rouge
49
-		8 => ['couleur_theme' => '#ff4524'],
50
-		// Orange
51
-		3 => ['couleur_theme' => '#c97500'],
52
-		// Vert SPIP
53
-		1 => ['couleur_theme' => '#9dba00'],
54
-		// Vert Troglo
55
-		7 => ['couleur_theme' => '#419a2c'],
56
-		// Bleu-vert
57
-		12 => ['couleur_theme' => '#269681'],
58
-		//  Bleu pastel
59
-		5 => ['couleur_theme' => '#3190ae'],
60
-		//  Bleu Kermesse
61
-		11 => ['couleur_theme' => '#288bdd'],
62
-		//  Gris bleuté
63
-		6 => ['couleur_theme' => '#7d90a2'],
64
-		//  Gris
65
-		10 => ['couleur_theme' => '#909090'],
66
-	];
41
+    static $couleurs_spip = [
42
+        // Violet soutenu
43
+        9 => ['couleur_theme' => '#9a6ef2'],
44
+        // Violet rosé
45
+        4 => ['couleur_theme' => '#c464cb'],
46
+        // Rose interface SPIP
47
+        2 => ['couleur_theme' =>  '#F02364'],
48
+        // Rouge
49
+        8 => ['couleur_theme' => '#ff4524'],
50
+        // Orange
51
+        3 => ['couleur_theme' => '#c97500'],
52
+        // Vert SPIP
53
+        1 => ['couleur_theme' => '#9dba00'],
54
+        // Vert Troglo
55
+        7 => ['couleur_theme' => '#419a2c'],
56
+        // Bleu-vert
57
+        12 => ['couleur_theme' => '#269681'],
58
+        //  Bleu pastel
59
+        5 => ['couleur_theme' => '#3190ae'],
60
+        //  Bleu Kermesse
61
+        11 => ['couleur_theme' => '#288bdd'],
62
+        //  Gris bleuté
63
+        6 => ['couleur_theme' => '#7d90a2'],
64
+        //  Gris
65
+        10 => ['couleur_theme' => '#909090'],
66
+    ];
67 67
 
68
-	if (is_numeric($choix)) {
69
-		$c = $couleurs_spip[$choix];
70
-		// compat < SPIP 3.3
71
-		include_spip('inc/filtres_images_mini');
72
-		$c['couleur_foncee'] = $c['couleur_theme'];
73
-		$c['couleur_claire'] = '#' . couleur_eclaircir($c['couleur_theme'], .5);
68
+    if (is_numeric($choix)) {
69
+        $c = $couleurs_spip[$choix];
70
+        // compat < SPIP 3.3
71
+        include_spip('inc/filtres_images_mini');
72
+        $c['couleur_foncee'] = $c['couleur_theme'];
73
+        $c['couleur_claire'] = '#' . couleur_eclaircir($c['couleur_theme'], .5);
74 74
 
75
-		return
76
-			'couleur_theme=' . substr($c['couleur_theme'], 1)
77
-			// compat < SPIP 3.3
78
-			. '&couleur_claire=' . substr($c['couleur_claire'], 1)
79
-			. '&couleur_foncee=' . substr($c['couleur_foncee'], 1);
80
-	} else {
81
-		if (is_array($choix)) {
82
-			// compat < SPIP 3.3
83
-			$compat_spip_33 = function ($c) {
84
-				if (!isset($c['couleur_theme'])) {
85
-					$c['couleur_theme'] = $c['couleur_foncee'];
86
-					unset($c['couleur_foncee']);
87
-					unset($c['couleur_claire']);
88
-					unset($c['couleur_lien']);
89
-					unset($c['couleur_lien_off']);
90
-				}
91
-				return $c;
92
-			};
93
-			if ($ajouter) {
94
-				foreach ($choix as $c) {
95
-					$couleurs_spip[] = $compat_spip_33($c);
96
-				}
75
+        return
76
+            'couleur_theme=' . substr($c['couleur_theme'], 1)
77
+            // compat < SPIP 3.3
78
+            . '&couleur_claire=' . substr($c['couleur_claire'], 1)
79
+            . '&couleur_foncee=' . substr($c['couleur_foncee'], 1);
80
+    } else {
81
+        if (is_array($choix)) {
82
+            // compat < SPIP 3.3
83
+            $compat_spip_33 = function ($c) {
84
+                if (!isset($c['couleur_theme'])) {
85
+                    $c['couleur_theme'] = $c['couleur_foncee'];
86
+                    unset($c['couleur_foncee']);
87
+                    unset($c['couleur_claire']);
88
+                    unset($c['couleur_lien']);
89
+                    unset($c['couleur_lien_off']);
90
+                }
91
+                return $c;
92
+            };
93
+            if ($ajouter) {
94
+                foreach ($choix as $c) {
95
+                    $couleurs_spip[] = $compat_spip_33($c);
96
+                }
97 97
 
98
-				return $couleurs_spip;
99
-			} else {
100
-				$choix = array_map($compat_spip_33, $choix);
101
-				return $couleurs_spip = $choix;
102
-			}
103
-		}
104
-	}
98
+                return $couleurs_spip;
99
+            } else {
100
+                $choix = array_map($compat_spip_33, $choix);
101
+                return $couleurs_spip = $choix;
102
+            }
103
+        }
104
+    }
105 105
 
106
-	return $couleurs_spip;
106
+    return $couleurs_spip;
107 107
 }
Please login to merge, or discard this patch.