Completed
Push — master ( e5e2d7...4eb2ca )
by cam
05:17
created
prive/formulaires/configurer_preferences.php 1 patch
Indentation   +40 added lines, -40 removed lines patch added patch discarded remove patch
@@ -21,7 +21,7 @@  discard block
 block discarded – undo
21 21
  **/
22 22
 
23 23
 if (!defined('_ECRIRE_INC_VERSION')) {
24
-	return;
24
+    return;
25 25
 }
26 26
 
27 27
 /**
@@ -31,28 +31,28 @@  discard block
 block discarded – undo
31 31
  *     Environnement du formulaire
32 32
  **/
33 33
 function formulaires_configurer_preferences_charger_dist() {
34
-	// travailler sur des meta fraiches
35
-	include_spip('inc/meta');
36
-	lire_metas();
34
+    // travailler sur des meta fraiches
35
+    include_spip('inc/meta');
36
+    lire_metas();
37 37
 
38
-	$valeurs = array();
39
-	$valeurs['display_navigation'] = isset($GLOBALS['visiteur_session']['prefs']['display_navigation']) ? $GLOBALS['visiteur_session']['prefs']['display_navigation'] : 'navigation_avec_icones';
40
-	$valeurs['display_outils'] = isset($GLOBALS['visiteur_session']['prefs']['display_outils']) ? $GLOBALS['visiteur_session']['prefs']['display_outils'] : 'oui';
41
-	$valeurs['display'] = (isset($GLOBALS['visiteur_session']['prefs']['display']) and $GLOBALS['visiteur_session']['prefs']['display'] > 0) ? $GLOBALS['visiteur_session']['prefs']['display'] : 2;
42
-	$valeurs['couleur'] = (isset($GLOBALS['visiteur_session']['prefs']['couleur']) and $GLOBALS['visiteur_session']['prefs']['couleur'] > 0) ? $GLOBALS['visiteur_session']['prefs']['couleur'] : 1;
38
+    $valeurs = array();
39
+    $valeurs['display_navigation'] = isset($GLOBALS['visiteur_session']['prefs']['display_navigation']) ? $GLOBALS['visiteur_session']['prefs']['display_navigation'] : 'navigation_avec_icones';
40
+    $valeurs['display_outils'] = isset($GLOBALS['visiteur_session']['prefs']['display_outils']) ? $GLOBALS['visiteur_session']['prefs']['display_outils'] : 'oui';
41
+    $valeurs['display'] = (isset($GLOBALS['visiteur_session']['prefs']['display']) and $GLOBALS['visiteur_session']['prefs']['display'] > 0) ? $GLOBALS['visiteur_session']['prefs']['display'] : 2;
42
+    $valeurs['couleur'] = (isset($GLOBALS['visiteur_session']['prefs']['couleur']) and $GLOBALS['visiteur_session']['prefs']['couleur'] > 0) ? $GLOBALS['visiteur_session']['prefs']['couleur'] : 1;
43 43
 
44
-	$couleurs = charger_fonction('couleurs', 'inc');
45
-	$les_couleurs = $couleurs(array(), true);
46
-	foreach ($les_couleurs as $k => $c) {
47
-		$valeurs['_couleurs_url'][$k] = generer_url_public('style_prive.css', 'ltr='
48
-			. $GLOBALS['spip_lang_left'] . '&'
49
-			. $couleurs($k));
50
-		$valeurs['couleurs'][$k] = $c;
51
-	}
44
+    $couleurs = charger_fonction('couleurs', 'inc');
45
+    $les_couleurs = $couleurs(array(), true);
46
+    foreach ($les_couleurs as $k => $c) {
47
+        $valeurs['_couleurs_url'][$k] = generer_url_public('style_prive.css', 'ltr='
48
+            . $GLOBALS['spip_lang_left'] . '&'
49
+            . $couleurs($k));
50
+        $valeurs['couleurs'][$k] = $c;
51
+    }
52 52
 
53
-	$valeurs['imessage'] = $GLOBALS['visiteur_session']['imessage'];
53
+    $valeurs['imessage'] = $GLOBALS['visiteur_session']['imessage'];
54 54
 
55
-	return $valeurs;
55
+    return $valeurs;
56 56
 }
57 57
 
58 58
 /**
@@ -63,29 +63,29 @@  discard block
 block discarded – undo
63 63
  **/
64 64
 function formulaires_configurer_preferences_traiter_dist() {
65 65
 
66
-	if ($couleur = _request('couleur')) {
67
-		$GLOBALS['visiteur_session']['prefs']['couleur'] = $couleur;
68
-	}
69
-	if ($display = _request('display')) {
70
-		$GLOBALS['visiteur_session']['prefs']['display'] = $display;
71
-	}
72
-	if ($display_navigation = _request('display_navigation')) {
73
-		$GLOBALS['visiteur_session']['prefs']['display_navigation'] = $display_navigation;
74
-	}
75
-	if (!is_null($display_outils = _request('display_outils'))) {
76
-		$GLOBALS['visiteur_session']['prefs']['display_outils'] = $display_outils;
77
-	}
66
+    if ($couleur = _request('couleur')) {
67
+        $GLOBALS['visiteur_session']['prefs']['couleur'] = $couleur;
68
+    }
69
+    if ($display = _request('display')) {
70
+        $GLOBALS['visiteur_session']['prefs']['display'] = $display;
71
+    }
72
+    if ($display_navigation = _request('display_navigation')) {
73
+        $GLOBALS['visiteur_session']['prefs']['display_navigation'] = $display_navigation;
74
+    }
75
+    if (!is_null($display_outils = _request('display_outils'))) {
76
+        $GLOBALS['visiteur_session']['prefs']['display_outils'] = $display_outils;
77
+    }
78 78
 
79
-	if (intval($GLOBALS['visiteur_session']['id_auteur'])) {
80
-		include_spip('action/editer_auteur');
81
-		$c = array('prefs' => serialize($GLOBALS['visiteur_session']['prefs']));
79
+    if (intval($GLOBALS['visiteur_session']['id_auteur'])) {
80
+        include_spip('action/editer_auteur');
81
+        $c = array('prefs' => serialize($GLOBALS['visiteur_session']['prefs']));
82 82
 
83
-		if (_request('imessage')) {
84
-			$c['imessage'] = _request('imessage');
85
-		}
83
+        if (_request('imessage')) {
84
+            $c['imessage'] = _request('imessage');
85
+        }
86 86
 
87
-		auteur_modifier($GLOBALS['visiteur_session']['id_auteur'], $c);
88
-	}
87
+        auteur_modifier($GLOBALS['visiteur_session']['id_auteur'], $c);
88
+    }
89 89
 
90
-	return array('message_ok' => _T('config_info_enregistree'), 'editable' => true);
90
+    return array('message_ok' => _T('config_info_enregistree'), 'editable' => true);
91 91
 }
Please login to merge, or discard this patch.
ecrire/inc/presentation_mini.php 1 patch
Indentation   +117 added lines, -117 removed lines patch added patch discarded remove patch
@@ -16,7 +16,7 @@  discard block
 block discarded – undo
16 16
  * @package SPIP\Core\Affichage
17 17
  **/
18 18
 if (!defined('_ECRIRE_INC_VERSION')) {
19
-	return;
19
+    return;
20 20
 }
21 21
 
22 22
 /**
@@ -45,7 +45,7 @@  discard block
 block discarded – undo
45 45
  * @return string Code HTML
46 46
  */
47 47
 function debut_gauche() {
48
-	return "<div id = 'conteneur' class = ''>\n<div id = 'navigation' class = 'lat' role = 'contentinfo'>\n";
48
+    return "<div id = 'conteneur' class = ''>\n<div id = 'navigation' class = 'lat' role = 'contentinfo'>\n";
49 49
 }
50 50
 
51 51
 /**
@@ -61,13 +61,13 @@  discard block
 block discarded – undo
61 61
  * @return string Code HTML
62 62
  */
63 63
 function creer_colonne_droite() {
64
-	static $deja_colonne_droite;
65
-	if ($deja_colonne_droite) {
66
-		return '';
67
-	}
68
-	$deja_colonne_droite = true;
64
+    static $deja_colonne_droite;
65
+    if ($deja_colonne_droite) {
66
+        return '';
67
+    }
68
+    $deja_colonne_droite = true;
69 69
 
70
-	return "\n</div><div id='extra' class='lat' role='complementary'>";
70
+    return "\n</div><div id='extra' class='lat' role='complementary'>";
71 71
 }
72 72
 
73 73
 /**
@@ -76,10 +76,10 @@  discard block
 block discarded – undo
76 76
  * @return string Code HTML
77 77
  */
78 78
 function debut_droite() {
79
-	return liste_objets_bloques(_request('exec'))
80
-	. creer_colonne_droite()
81
-	. "</div>"
82
-	. "\n<div id='contenu'>";
79
+    return liste_objets_bloques(_request('exec'))
80
+    . creer_colonne_droite()
81
+    . "</div>"
82
+    . "\n<div id='contenu'>";
83 83
 }
84 84
 
85 85
 /**
@@ -101,30 +101,30 @@  discard block
 block discarded – undo
101 101
  *     Code HTML
102 102
  **/
103 103
 function liste_objets_bloques($exec, $contexte = array(), $auteur = null) {
104
-	$res = '';
105
-	if ($GLOBALS['meta']["articles_modif"] != "non") {
106
-		include_spip('inc/drapeau_edition');
107
-		if (is_null($auteur)) {
108
-			$auteur = $GLOBALS['visiteur_session'];
109
-		}
110
-		if ($en_cours = trouver_objet_exec($exec)
111
-			and $en_cours['edition']
112
-			and $type = $en_cours['type']
113
-			and ((isset($contexte[$en_cours['id_table_objet']]) and $id = $contexte[$en_cours['id_table_objet']])
114
-				or $id = _request($en_cours['id_table_objet']))
115
-		) {
116
-			// marquer le fait que l'objet est ouvert en edition par toto
117
-			// a telle date ; une alerte sera donnee aux autres redacteurs
118
-			signale_edition($id, $auteur, $type);
119
-		}
120
-
121
-		$objets_ouverts = liste_drapeau_edition($auteur['id_auteur']);
122
-		if (count($objets_ouverts)) {
123
-			$res .= recuperer_fond('prive/objets/liste/objets-en-edition', array(), array('ajax' => true));
124
-		}
125
-	}
126
-
127
-	return $res;
104
+    $res = '';
105
+    if ($GLOBALS['meta']["articles_modif"] != "non") {
106
+        include_spip('inc/drapeau_edition');
107
+        if (is_null($auteur)) {
108
+            $auteur = $GLOBALS['visiteur_session'];
109
+        }
110
+        if ($en_cours = trouver_objet_exec($exec)
111
+            and $en_cours['edition']
112
+            and $type = $en_cours['type']
113
+            and ((isset($contexte[$en_cours['id_table_objet']]) and $id = $contexte[$en_cours['id_table_objet']])
114
+                or $id = _request($en_cours['id_table_objet']))
115
+        ) {
116
+            // marquer le fait que l'objet est ouvert en edition par toto
117
+            // a telle date ; une alerte sera donnee aux autres redacteurs
118
+            signale_edition($id, $auteur, $type);
119
+        }
120
+
121
+        $objets_ouverts = liste_drapeau_edition($auteur['id_auteur']);
122
+        if (count($objets_ouverts)) {
123
+            $res .= recuperer_fond('prive/objets/liste/objets-en-edition', array(), array('ajax' => true));
124
+        }
125
+    }
126
+
127
+    return $res;
128 128
 }
129 129
 
130 130
 
@@ -138,20 +138,20 @@  discard block
 block discarded – undo
138 138
  * @return string Code HTML
139 139
  **/
140 140
 function fin_page() {
141
-	include_spip('inc/pipelines');
142
-	// avec &var_profile=1 on a le tableau de mesures SQL
143
-	$debug = ((_request('exec') !== 'valider_xml')
144
-		and ((_request('var_mode') == 'debug')
145
-			or (isset($GLOBALS['tableau_des_temps']) and $GLOBALS['tableau_des_temps'])
146
-			and isset($_COOKIE['spip_admin'])));
147
-	$t = '</div><div id="pied"><div class="largeur">'
148
-		. recuperer_fond('prive/squelettes/inclure/pied')
149
-		. "</div>"
150
-		. "</div></div>" // cf. div#page et div.largeur ouvertes dans conmmencer_page()
151
-		. ($debug ? erreur_squelette() : '')
152
-		. "</body></html>\n";
153
-
154
-	return f_queue($t);
141
+    include_spip('inc/pipelines');
142
+    // avec &var_profile=1 on a le tableau de mesures SQL
143
+    $debug = ((_request('exec') !== 'valider_xml')
144
+        and ((_request('var_mode') == 'debug')
145
+            or (isset($GLOBALS['tableau_des_temps']) and $GLOBALS['tableau_des_temps'])
146
+            and isset($_COOKIE['spip_admin'])));
147
+    $t = '</div><div id="pied"><div class="largeur">'
148
+        . recuperer_fond('prive/squelettes/inclure/pied')
149
+        . "</div>"
150
+        . "</div></div>" // cf. div#page et div.largeur ouvertes dans conmmencer_page()
151
+        . ($debug ? erreur_squelette() : '')
152
+        . "</body></html>\n";
153
+
154
+    return f_queue($t);
155 155
 }
156 156
 
157 157
 /**
@@ -166,20 +166,20 @@  discard block
 block discarded – undo
166 166
  * @return string Code HTML
167 167
  **/
168 168
 function html_tests_js() {
169
-	if (_SPIP_AJAX and !defined('_TESTER_NOSCRIPT')) {
170
-		// pour le pied de page (deja defini si on est validation XML)
171
-		define('_TESTER_NOSCRIPT',
172
-			"<noscript>\n<div style='display:none;'><img src='"
173
-			. generer_url_ecrire('test_ajax', 'js=-1')
174
-			. "' width='1' height='1' alt='' /></div></noscript>\n");
175
-	}
176
-
177
-	$rejouer = '';
178
-	if (defined('_SESSION_REJOUER')) {
179
-		$rejouer = (_SESSION_REJOUER === true) ? rejouer_session() : _SESSION_REJOUER;
180
-	}
181
-
182
-	return $rejouer . (defined('_TESTER_NOSCRIPT') ? _TESTER_NOSCRIPT : '');
169
+    if (_SPIP_AJAX and !defined('_TESTER_NOSCRIPT')) {
170
+        // pour le pied de page (deja defini si on est validation XML)
171
+        define('_TESTER_NOSCRIPT',
172
+            "<noscript>\n<div style='display:none;'><img src='"
173
+            . generer_url_ecrire('test_ajax', 'js=-1')
174
+            . "' width='1' height='1' alt='' /></div></noscript>\n");
175
+    }
176
+
177
+    $rejouer = '';
178
+    if (defined('_SESSION_REJOUER')) {
179
+        $rejouer = (_SESSION_REJOUER === true) ? rejouer_session() : _SESSION_REJOUER;
180
+    }
181
+
182
+    return $rejouer . (defined('_TESTER_NOSCRIPT') ? _TESTER_NOSCRIPT : '');
183 183
 }
184 184
 
185 185
 /**
@@ -189,25 +189,25 @@  discard block
 block discarded – undo
189 189
  **/
190 190
 function info_maj_spip() {
191 191
 
192
-	$maj = isset($GLOBALS['meta']['info_maj_spip']) ? $GLOBALS['meta']['info_maj_spip'] : null;
193
-	if (!$maj) {
194
-		return "";
195
-	}
192
+    $maj = isset($GLOBALS['meta']['info_maj_spip']) ? $GLOBALS['meta']['info_maj_spip'] : null;
193
+    if (!$maj) {
194
+        return "";
195
+    }
196 196
 
197
-	$maj = explode('|', $maj);
198
-	// c'est une ancienne notif, on a fait la maj depuis !
199
-	if ($GLOBALS['spip_version_branche'] !== reset($maj)) {
200
-		return "";
201
-	}
197
+    $maj = explode('|', $maj);
198
+    // c'est une ancienne notif, on a fait la maj depuis !
199
+    if ($GLOBALS['spip_version_branche'] !== reset($maj)) {
200
+        return "";
201
+    }
202 202
 
203
-	if (!autoriser('webmestre')) {
204
-		return "";
205
-	}
203
+    if (!autoriser('webmestre')) {
204
+        return "";
205
+    }
206 206
 
207
-	array_shift($maj);
208
-	$maj = implode('|', $maj);
207
+    array_shift($maj);
208
+    $maj = implode('|', $maj);
209 209
 
210
-	return "$maj<br />";
210
+    return "$maj<br />";
211 211
 }
212 212
 
213 213
 /**
@@ -218,31 +218,31 @@  discard block
 block discarded – undo
218 218
  **/
219 219
 function info_copyright() {
220 220
 
221
-	$version = $GLOBALS['spip_version_affichee'];
222
-
223
-	//
224
-	// Mention, le cas echeant, de la revision SVN courante
225
-	//
226
-	if ($svn_revision = version_svn_courante(_DIR_RACINE)) {
227
-		$version .= ' ' . (($svn_revision < 0) ? 'SVN ' : '')
228
-			. "[<a href='http://core.spip.net/projects/spip/repository/revisions/"
229
-			. abs($svn_revision) . "' target=\"_blank\" rel=\"noopener noreferrer\">"
230
-			. abs($svn_revision) . "</a>]";
231
-	}
232
-
233
-	// et la version de l'ecran de securite
234
-	$secu = defined('_ECRAN_SECURITE')
235
-		? "<br />" . _T('ecran_securite', array('version' => _ECRAN_SECURITE))
236
-		: '';
237
-
238
-	return _T('info_copyright',
239
-		array(
240
-			'spip' => "<b>SPIP $version</b> ",
241
-			'lien_gpl' =>
242
-				"<a href='" . generer_url_ecrire("aide",
243
-					"aide=licence&var_lang=" . $GLOBALS['spip_lang']) . "' class=\"aide popin\">" . _T('info_copyright_gpl') . "</a>"
244
-		))
245
-	. $secu;
221
+    $version = $GLOBALS['spip_version_affichee'];
222
+
223
+    //
224
+    // Mention, le cas echeant, de la revision SVN courante
225
+    //
226
+    if ($svn_revision = version_svn_courante(_DIR_RACINE)) {
227
+        $version .= ' ' . (($svn_revision < 0) ? 'SVN ' : '')
228
+            . "[<a href='http://core.spip.net/projects/spip/repository/revisions/"
229
+            . abs($svn_revision) . "' target=\"_blank\" rel=\"noopener noreferrer\">"
230
+            . abs($svn_revision) . "</a>]";
231
+    }
232
+
233
+    // et la version de l'ecran de securite
234
+    $secu = defined('_ECRAN_SECURITE')
235
+        ? "<br />" . _T('ecran_securite', array('version' => _ECRAN_SECURITE))
236
+        : '';
237
+
238
+    return _T('info_copyright',
239
+        array(
240
+            'spip' => "<b>SPIP $version</b> ",
241
+            'lien_gpl' =>
242
+                "<a href='" . generer_url_ecrire("aide",
243
+                    "aide=licence&var_lang=" . $GLOBALS['spip_lang']) . "' class=\"aide popin\">" . _T('info_copyright_gpl') . "</a>"
244
+        ))
245
+    . $secu;
246 246
 
247 247
 }
248 248
 
@@ -258,17 +258,17 @@  discard block
 block discarded – undo
258 258
  * @return string             Code HTML
259 259
  **/
260 260
 function formulaire_recherche($page, $complement = "") {
261
-	$recherche = _request('recherche');
262
-	$recherche_aff = entites_html($recherche);
263
-	if (!strlen($recherche)) {
264
-		$recherche_aff = _T('info_rechercher');
265
-		$onfocus = " onfocus=\"this.value='';\"";
266
-	} else {
267
-		$onfocus = '';
268
-	}
269
-
270
-	$form = '<input type="text" size="10" value="' . $recherche_aff . '" name="recherche" class="recherche" accesskey="r"' . $onfocus . ' />';
271
-	$form .= "<input type='image' src='" . chemin_image('rechercher-20.png') . "' name='submit' class='submit' alt='" . _T('info_rechercher') . "' />";
272
-
273
-	return "<div class='spip_recherche'>" . generer_form_ecrire($page, $form . $complement, " method='get'") . "</div>";
261
+    $recherche = _request('recherche');
262
+    $recherche_aff = entites_html($recherche);
263
+    if (!strlen($recherche)) {
264
+        $recherche_aff = _T('info_rechercher');
265
+        $onfocus = " onfocus=\"this.value='';\"";
266
+    } else {
267
+        $onfocus = '';
268
+    }
269
+
270
+    $form = '<input type="text" size="10" value="' . $recherche_aff . '" name="recherche" class="recherche" accesskey="r"' . $onfocus . ' />';
271
+    $form .= "<input type='image' src='" . chemin_image('rechercher-20.png') . "' name='submit' class='submit' alt='" . _T('info_rechercher') . "' />";
272
+
273
+    return "<div class='spip_recherche'>" . generer_form_ecrire($page, $form . $complement, " method='get'") . "</div>";
274 274
 }
Please login to merge, or discard this patch.