Completed
Push — master ( 7d1d75...0ae8e3 )
by cam
01:06
created
ecrire/base/repair.php 1 patch
Indentation   +62 added lines, -62 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
 /**
@@ -36,20 +36,20 @@  discard block
 block discarded – undo
36 36
  **/
37 37
 function base_repair_dist($titre = '', $reprise = '') {
38 38
 
39
-	$res = admin_repair_tables();
40
-	if (!$res) {
41
-		$res = "<div class='error'>" . _T('avis_erreur_mysql') . ' ' . sql_errno() . ': ' . sql_error() . "</div>\n";
42
-	} else {
43
-		include_spip('inc/rubriques');
44
-		calculer_rubriques();
45
-		propager_les_secteurs();
46
-	}
47
-	include_spip('inc/minipres');
48
-	$res .= pipeline('base_admin_repair', $res);
49
-	echo minipres(
50
-		_T('texte_tentative_recuperation'),
51
-		$res . generer_form_ecrire('accueil', '', '', _T('public:accueil_site'))
52
-	);
39
+    $res = admin_repair_tables();
40
+    if (!$res) {
41
+        $res = "<div class='error'>" . _T('avis_erreur_mysql') . ' ' . sql_errno() . ': ' . sql_error() . "</div>\n";
42
+    } else {
43
+        include_spip('inc/rubriques');
44
+        calculer_rubriques();
45
+        propager_les_secteurs();
46
+    }
47
+    include_spip('inc/minipres');
48
+    $res .= pipeline('base_admin_repair', $res);
49
+    echo minipres(
50
+        _T('texte_tentative_recuperation'),
51
+        $res . generer_form_ecrire('accueil', '', '', _T('public:accueil_site'))
52
+    );
53 53
 }
54 54
 
55 55
 /**
@@ -63,59 +63,59 @@  discard block
 block discarded – undo
63 63
  **/
64 64
 function admin_repair_tables() {
65 65
 
66
-	$repair = sql_repair('repair', null, 'continue');
66
+    $repair = sql_repair('repair', null, 'continue');
67 67
 
68
-	// recreer les tables manquantes eventuelles
69
-	include_spip('base/create');
70
-	creer_base();
71
-	$tables = sql_alltable();
68
+    // recreer les tables manquantes eventuelles
69
+    include_spip('base/create');
70
+    creer_base();
71
+    $tables = sql_alltable();
72 72
 
73
-	$res = '';
74
-	foreach ($tables as $tab) {
75
-		$class = '';
76
-		$m = "<strong>$tab</strong> ";
77
-		spip_log("Repare $tab", _LOG_INFO_IMPORTANTE);
78
-		// supprimer la meta avant de lancer la reparation
79
-		// car le repair peut etre long ; on ne veut pas boucler
80
-		effacer_meta('admin_repair');
81
-		if ($repair) {
82
-			$result_repair = sql_repair($tab);
83
-			if (!$result_repair) {
84
-				return false;
85
-			}
86
-		}
73
+    $res = '';
74
+    foreach ($tables as $tab) {
75
+        $class = '';
76
+        $m = "<strong>$tab</strong> ";
77
+        spip_log("Repare $tab", _LOG_INFO_IMPORTANTE);
78
+        // supprimer la meta avant de lancer la reparation
79
+        // car le repair peut etre long ; on ne veut pas boucler
80
+        effacer_meta('admin_repair');
81
+        if ($repair) {
82
+            $result_repair = sql_repair($tab);
83
+            if (!$result_repair) {
84
+                return false;
85
+            }
86
+        }
87 87
 
88
-		// essayer de maj la table (creation de champs manquants)
89
-		maj_tables($tab);
88
+        // essayer de maj la table (creation de champs manquants)
89
+        maj_tables($tab);
90 90
 
91
-		$count = sql_countsel($tab);
91
+        $count = sql_countsel($tab);
92 92
 
93
-		if ($count > 1) {
94
-			$m .= '(' . _T('texte_compte_elements', ['count' => $count]) . ")\n";
95
-		} else {
96
-			if ($count == 1) {
97
-				$m .= '(' . _T('texte_compte_element', ['count' => $count]) . ")\n";
98
-			} else {
99
-				$m .= '(' . _T('texte_vide') . ")\n";
100
-			}
101
-		}
93
+        if ($count > 1) {
94
+            $m .= '(' . _T('texte_compte_elements', ['count' => $count]) . ")\n";
95
+        } else {
96
+            if ($count == 1) {
97
+                $m .= '(' . _T('texte_compte_element', ['count' => $count]) . ")\n";
98
+            } else {
99
+                $m .= '(' . _T('texte_vide') . ")\n";
100
+            }
101
+        }
102 102
 
103
-		if (
104
-			$result_repair
105
-			and $msg = join(
106
-				' ',
107
-				(is_resource($result_repair) or is_object($result_repair)) ? sql_fetch($result_repair) : $result_repair
108
-			) . ' '
109
-			and strpos($msg, ' OK ') === false
110
-		) {
111
-			$class = " class='notice'";
112
-			$m .= '<br /><tt>' . spip_htmlentities($msg) . "</tt>\n";
113
-		} else {
114
-			$m .= ' ' . _T('texte_table_ok');
115
-		}
103
+        if (
104
+            $result_repair
105
+            and $msg = join(
106
+                ' ',
107
+                (is_resource($result_repair) or is_object($result_repair)) ? sql_fetch($result_repair) : $result_repair
108
+            ) . ' '
109
+            and strpos($msg, ' OK ') === false
110
+        ) {
111
+            $class = " class='notice'";
112
+            $m .= '<br /><tt>' . spip_htmlentities($msg) . "</tt>\n";
113
+        } else {
114
+            $m .= ' ' . _T('texte_table_ok');
115
+        }
116 116
 
117
-		$res .= "<div$class>$m</div>";
118
-	}
117
+        $res .= "<div$class>$m</div>";
118
+    }
119 119
 
120
-	return $res;
120
+    return $res;
121 121
 }
Please login to merge, or discard this patch.
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/genie/maintenance.php 1 patch
Indentation   +47 added lines, -47 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
 /**
@@ -35,18 +35,18 @@  discard block
 block discarded – undo
35 35
  */
36 36
 function genie_maintenance_dist($t) {
37 37
 
38
-	// (re)mettre .htaccess avec deny from all
39
-	// dans les deux repertoires dits inaccessibles par http
40
-	include_spip('inc/acces');
41
-	verifier_htaccess(_DIR_ETC);
42
-	verifier_htaccess(_DIR_TMP);
38
+    // (re)mettre .htaccess avec deny from all
39
+    // dans les deux repertoires dits inaccessibles par http
40
+    include_spip('inc/acces');
41
+    verifier_htaccess(_DIR_ETC);
42
+    verifier_htaccess(_DIR_TMP);
43 43
 
44
-	// Verifier qu'aucune table n'est crashee
45
-	if (!_request('reinstall')) {
46
-		verifier_crash_tables();
47
-	}
44
+    // Verifier qu'aucune table n'est crashee
45
+    if (!_request('reinstall')) {
46
+        verifier_crash_tables();
47
+    }
48 48
 
49
-	return 1;
49
+    return 1;
50 50
 }
51 51
 
52 52
 
@@ -63,33 +63,33 @@  discard block
 block discarded – undo
63 63
  *     des tables qui ont crashé.
64 64
  */
65 65
 function verifier_crash_tables() {
66
-	if (spip_connect()) {
67
-		include_spip('base/serial');
68
-		include_spip('base/auxiliaires');
69
-		$crash = [];
70
-		foreach (['tables_principales', 'tables_auxiliaires'] as $com) {
71
-			foreach ($GLOBALS[$com] as $table => $desc) {
72
-				if (
73
-					!sql_select('*', $table, '', '', '', 1)
74
-					and !defined('spip_interdire_cache')
75
-				) { # cas "LOST CONNECTION"
76
-				$crash[] = $table;
77
-				}
78
-			}
79
-		}
80
-		#$crash[] = 'test';
81
-		if ($crash) {
82
-			ecrire_meta('message_crash_tables', serialize($crash));
83
-			spip_log('crash des tables', 'err');
84
-			spip_log($crash, 'err');
85
-		} else {
86
-			effacer_meta('message_crash_tables');
87
-		}
66
+    if (spip_connect()) {
67
+        include_spip('base/serial');
68
+        include_spip('base/auxiliaires');
69
+        $crash = [];
70
+        foreach (['tables_principales', 'tables_auxiliaires'] as $com) {
71
+            foreach ($GLOBALS[$com] as $table => $desc) {
72
+                if (
73
+                    !sql_select('*', $table, '', '', '', 1)
74
+                    and !defined('spip_interdire_cache')
75
+                ) { # cas "LOST CONNECTION"
76
+                $crash[] = $table;
77
+                }
78
+            }
79
+        }
80
+        #$crash[] = 'test';
81
+        if ($crash) {
82
+            ecrire_meta('message_crash_tables', serialize($crash));
83
+            spip_log('crash des tables', 'err');
84
+            spip_log($crash, 'err');
85
+        } else {
86
+            effacer_meta('message_crash_tables');
87
+        }
88 88
 
89
-		return $crash;
90
-	}
89
+        return $crash;
90
+    }
91 91
 
92
-	return false;
92
+    return false;
93 93
 }
94 94
 
95 95
 /**
@@ -105,15 +105,15 @@  discard block
 block discarded – undo
105 105
  * @return string
106 106
  */
107 107
 function message_crash_tables() {
108
-	if ($crash = verifier_crash_tables()) {
109
-		return
110
-			'<strong>' . _T('texte_recuperer_base') . '</strong><br />'
111
-			. ' <tt>' . join(', ', $crash) . '</tt><br />'
112
-			. generer_form_ecrire(
113
-				'base_repair',
114
-				_T('texte_crash_base'),
115
-				'',
116
-				_T('bouton_tenter_recuperation')
117
-			);
118
-	}
108
+    if ($crash = verifier_crash_tables()) {
109
+        return
110
+            '<strong>' . _T('texte_recuperer_base') . '</strong><br />'
111
+            . ' <tt>' . join(', ', $crash) . '</tt><br />'
112
+            . generer_form_ecrire(
113
+                'base_repair',
114
+                _T('texte_crash_base'),
115
+                '',
116
+                _T('bouton_tenter_recuperation')
117
+            );
118
+    }
119 119
 }
Please login to merge, or discard this patch.
ecrire/inc/drapeau_edition.php 1 patch
Indentation   +111 added lines, -111 removed lines patch added patch discarded remove patch
@@ -30,7 +30,7 @@  discard block
 block discarded – undo
30 30
  * @package SPIP\Core\Drapeaux\Edition
31 31
  **/
32 32
 if (!defined('_ECRIRE_INC_VERSION')) {
33
-	return;
33
+    return;
34 34
 }
35 35
 
36 36
 
@@ -45,46 +45,46 @@  discard block
 block discarded – undo
45 45
  *     `[ type d'objet ][id_objet][id_auteur][nom de l'auteur] = time()`
46 46
  **/
47 47
 function lire_tableau_edition() {
48
-	$edition = @unserialize($GLOBALS['meta']['drapeau_edition']);
49
-	if (!$edition) {
50
-		return [];
51
-	}
52
-	$changed = false;
48
+    $edition = @unserialize($GLOBALS['meta']['drapeau_edition']);
49
+    if (!$edition) {
50
+        return [];
51
+    }
52
+    $changed = false;
53 53
 
54
-	$bon_pour_le_service = time() - 3600;
55
-	// parcourir le tableau et virer les vieux
56
-	foreach ($edition as $objet => $data) {
57
-		if (!is_array($data)) {
58
-			unset($edition[$objet]);
59
-		} // vieille version
60
-		else {
61
-			foreach ($data as $id => $tab) {
62
-				if (!is_array($tab)) {
63
-					unset($edition[$objet][$tab]);
64
-				} // vieille version
65
-				else {
66
-					foreach ($tab as $n => $duo) {
67
-						if (current($duo) < $bon_pour_le_service) {
68
-							unset($edition[$objet][$id][$n]);
69
-							$changed = true;
70
-						}
71
-					}
72
-				}
73
-				if (!$edition[$objet][$id]) {
74
-					unset($edition[$objet][$id]);
75
-				}
76
-			}
77
-		}
78
-		if (!$edition[$objet]) {
79
-			unset($edition[$objet]);
80
-		}
81
-	}
54
+    $bon_pour_le_service = time() - 3600;
55
+    // parcourir le tableau et virer les vieux
56
+    foreach ($edition as $objet => $data) {
57
+        if (!is_array($data)) {
58
+            unset($edition[$objet]);
59
+        } // vieille version
60
+        else {
61
+            foreach ($data as $id => $tab) {
62
+                if (!is_array($tab)) {
63
+                    unset($edition[$objet][$tab]);
64
+                } // vieille version
65
+                else {
66
+                    foreach ($tab as $n => $duo) {
67
+                        if (current($duo) < $bon_pour_le_service) {
68
+                            unset($edition[$objet][$id][$n]);
69
+                            $changed = true;
70
+                        }
71
+                    }
72
+                }
73
+                if (!$edition[$objet][$id]) {
74
+                    unset($edition[$objet][$id]);
75
+                }
76
+            }
77
+        }
78
+        if (!$edition[$objet]) {
79
+            unset($edition[$objet]);
80
+        }
81
+    }
82 82
 
83
-	if ($changed) {
84
-		ecrire_tableau_edition($edition);
85
-	}
83
+    if ($changed) {
84
+        ecrire_tableau_edition($edition);
85
+    }
86 86
 
87
-	return $edition;
87
+    return $edition;
88 88
 }
89 89
 
90 90
 /**
@@ -97,7 +97,7 @@  discard block
 block discarded – undo
97 97
  *     `[ type d'objet ][id_objet][id_auteur][nom de l'auteur] = time()`
98 98
  **/
99 99
 function ecrire_tableau_edition($edition) {
100
-	ecrire_meta('drapeau_edition', serialize($edition));
100
+    ecrire_meta('drapeau_edition', serialize($edition));
101 101
 }
102 102
 
103 103
 /**
@@ -117,24 +117,24 @@  discard block
 block discarded – undo
117 117
  *     Type d'objet édité
118 118
  */
119 119
 function signale_edition($id, $auteur, $type = 'article') {
120
-	include_spip('base/objets');
121
-	include_spip('inc/filtres');
122
-	if (objet_info($type, 'editable') !== 'oui') {
123
-		return;
124
-	}
120
+    include_spip('base/objets');
121
+    include_spip('inc/filtres');
122
+    if (objet_info($type, 'editable') !== 'oui') {
123
+        return;
124
+    }
125 125
 
126
-	$edition = lire_tableau_edition();
127
-	if (isset($auteur['id_auteur']) and $id_a = $auteur['id_auteur']) {
128
-		$nom = $auteur['nom'];
129
-	} else {
130
-		$nom = $id_a = $GLOBALS['ip'];
131
-	}
126
+    $edition = lire_tableau_edition();
127
+    if (isset($auteur['id_auteur']) and $id_a = $auteur['id_auteur']) {
128
+        $nom = $auteur['nom'];
129
+    } else {
130
+        $nom = $id_a = $GLOBALS['ip'];
131
+    }
132 132
 
133
-	if (!isset($edition[$type][$id]) or !is_array($edition[$type][$id])) {
134
-		$edition[$type][$id] = [];
135
-	}
136
-	$edition[$type][$id][$id_a][$nom] = time();
137
-	ecrire_tableau_edition($edition);
133
+    if (!isset($edition[$type][$id]) or !is_array($edition[$type][$id])) {
134
+        $edition[$type][$id] = [];
135
+    }
136
+    $edition[$type][$id][$id_a][$nom] = time();
137
+    ecrire_tableau_edition($edition);
138 138
 }
139 139
 
140 140
 /**
@@ -151,9 +151,9 @@  discard block
 block discarded – undo
151 151
  */
152 152
 function qui_edite($id, $type = 'article') {
153 153
 
154
-	$edition = lire_tableau_edition();
154
+    $edition = lire_tableau_edition();
155 155
 
156
-	return empty($edition[$type][$id]) ? [] : $edition[$type][$id];
156
+    return empty($edition[$type][$id]) ? [] : $edition[$type][$id];
157 157
 }
158 158
 
159 159
 /**
@@ -167,22 +167,22 @@  discard block
 block discarded – undo
167 167
  *     Liste de tableaux `['nom_auteur_modif' => x|y|z, 'date_diff' => n]`
168 168
  */
169 169
 function mention_qui_edite($id, $type = 'article') {
170
-	$modif = qui_edite($id, $type);
171
-	unset($modif[$GLOBALS['visiteur_session']['id_auteur']]);
170
+    $modif = qui_edite($id, $type);
171
+    unset($modif[$GLOBALS['visiteur_session']['id_auteur']]);
172 172
 
173
-	if ($modif) {
174
-		$quand = 0;
175
-		foreach ($modif as $duo) {
176
-			$auteurs[] = typo(key($duo));
177
-			$quand = max($quand, current($duo));
178
-		}
173
+    if ($modif) {
174
+        $quand = 0;
175
+        foreach ($modif as $duo) {
176
+            $auteurs[] = typo(key($duo));
177
+            $quand = max($quand, current($duo));
178
+        }
179 179
 
180
-		// format lie a la chaine de langue 'avis_article_modifie'
181
-		return [
182
-			'nom_auteur_modif' => join(' | ', $auteurs),
183
-			'date_diff' => ceil((time() - $quand) / 60)
184
-		];
185
-	}
180
+        // format lie a la chaine de langue 'avis_article_modifie'
181
+        return [
182
+            'nom_auteur_modif' => join(' | ', $auteurs),
183
+            'date_diff' => ceil((time() - $quand) / 60)
184
+        ];
185
+    }
186 186
 }
187 187
 
188 188
 /**
@@ -196,25 +196,25 @@  discard block
 block discarded – undo
196 196
  *     Liste de tableaux `['objet' => x, 'id_objet' => n]`
197 197
  */
198 198
 function liste_drapeau_edition($id_auteur) {
199
-	$edition = lire_tableau_edition();
200
-	$objets_ouverts = [];
199
+    $edition = lire_tableau_edition();
200
+    $objets_ouverts = [];
201 201
 
202
-	foreach ($edition as $objet => $data) {
203
-		foreach ($data as $id => $auteurs) {
204
-			if (
205
-				isset($auteurs[$id_auteur])
206
-				and is_array($auteurs[$id_auteur]) // precaution
207
-				and (array_pop($auteurs[$id_auteur]) > time() - 3600)
208
-			) {
209
-				$objets_ouverts[] = [
210
-					'objet' => $objet,
211
-					'id_objet' => $id,
212
-				];
213
-			}
214
-		}
215
-	}
202
+    foreach ($edition as $objet => $data) {
203
+        foreach ($data as $id => $auteurs) {
204
+            if (
205
+                isset($auteurs[$id_auteur])
206
+                and is_array($auteurs[$id_auteur]) // precaution
207
+                and (array_pop($auteurs[$id_auteur]) > time() - 3600)
208
+            ) {
209
+                $objets_ouverts[] = [
210
+                    'objet' => $objet,
211
+                    'id_objet' => $id,
212
+                ];
213
+            }
214
+        }
215
+    }
216 216
 
217
-	return $objets_ouverts;
217
+    return $objets_ouverts;
218 218
 }
219 219
 
220 220
 /**
@@ -227,15 +227,15 @@  discard block
 block discarded – undo
227 227
  * @return void
228 228
  */
229 229
 function debloquer_tous($id_auteur) {
230
-	$edition = lire_tableau_edition();
231
-	foreach ($edition as $objet => $data) {
232
-		foreach ($data as $id => $auteurs) {
233
-			if (isset($auteurs[$id_auteur])) {
234
-				unset($edition[$objet][$id][$id_auteur]);
235
-				ecrire_tableau_edition($edition);
236
-			}
237
-		}
238
-	}
230
+    $edition = lire_tableau_edition();
231
+    foreach ($edition as $objet => $data) {
232
+        foreach ($data as $id => $auteurs) {
233
+            if (isset($auteurs[$id_auteur])) {
234
+                unset($edition[$objet][$id][$id_auteur]);
235
+                ecrire_tableau_edition($edition);
236
+            }
237
+        }
238
+    }
239 239
 }
240 240
 
241 241
 /**
@@ -253,19 +253,19 @@  discard block
 block discarded – undo
253 253
  * @return void
254 254
  */
255 255
 function debloquer_edition($id_auteur, $id_objet, $type = 'article') {
256
-	$edition = lire_tableau_edition();
256
+    $edition = lire_tableau_edition();
257 257
 
258
-	foreach ($edition as $objet => $data) {
259
-		if ($objet == $type) {
260
-			foreach ($data as $id => $auteurs) {
261
-				if (
262
-					$id == $id_objet
263
-					and isset($auteurs[$id_auteur])
264
-				) {
265
-					unset($edition[$objet][$id][$id_auteur]);
266
-					ecrire_tableau_edition($edition);
267
-				}
268
-			}
269
-		}
270
-	}
258
+    foreach ($edition as $objet => $data) {
259
+        if ($objet == $type) {
260
+            foreach ($data as $id => $auteurs) {
261
+                if (
262
+                    $id == $id_objet
263
+                    and isset($auteurs[$id_auteur])
264
+                ) {
265
+                    unset($edition[$objet][$id][$id_auteur]);
266
+                    ecrire_tableau_edition($edition);
267
+                }
268
+            }
269
+        }
270
+    }
271 271
 }
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.