Completed
Push — master ( ffd49b...ff6ae5 )
by cam
01:22
created
ecrire/inc/presentation_mini.php 1 patch
Indentation   +136 added lines, -136 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
 /**
@@ -25,7 +25,7 @@  discard block
 block discarded – undo
25 25
  * @return string Code HTML
26 26
  */
27 27
 function debut_grand_cadre() {
28
- return "\n<div class = 'table_page'>\n";
28
+    return "\n<div class = 'table_page'>\n";
29 29
 }
30 30
 
31 31
 /**
@@ -34,7 +34,7 @@  discard block
 block discarded – undo
34 34
  * @return string Code HTML
35 35
  */
36 36
 function fin_grand_cadre() {
37
- return "\n</div>";
37
+    return "\n</div>";
38 38
 }
39 39
 
40 40
 // Debut de la colonne de gauche
@@ -49,7 +49,7 @@  discard block
 block discarded – undo
49 49
  * @return string Code HTML
50 50
  */
51 51
 function debut_gauche() {
52
-	return "<div id = 'conteneur' class = ''>\n<div id = 'navigation' class = 'lat' role = 'contentinfo'>\n";
52
+    return "<div id = 'conteneur' class = ''>\n<div id = 'navigation' class = 'lat' role = 'contentinfo'>\n";
53 53
 }
54 54
 
55 55
 /**
@@ -58,7 +58,7 @@  discard block
 block discarded – undo
58 58
  * @return string Code HTML
59 59
  */
60 60
 function fin_gauche() {
61
- return "</div></div><br class = 'nettoyeur' />";
61
+    return "</div></div><br class = 'nettoyeur' />";
62 62
 }
63 63
 
64 64
 /**
@@ -67,13 +67,13 @@  discard block
 block discarded – undo
67 67
  * @return string Code HTML
68 68
  */
69 69
 function creer_colonne_droite() {
70
-	static $deja_colonne_droite;
71
-	if ($deja_colonne_droite) {
72
-		return '';
73
-	}
74
-	$deja_colonne_droite = true;
70
+    static $deja_colonne_droite;
71
+    if ($deja_colonne_droite) {
72
+        return '';
73
+    }
74
+    $deja_colonne_droite = true;
75 75
 
76
-	return "\n</div><div id='extra' class='lat' role='complementary'>";
76
+    return "\n</div><div id='extra' class='lat' role='complementary'>";
77 77
 }
78 78
 
79 79
 /**
@@ -82,10 +82,10 @@  discard block
 block discarded – undo
82 82
  * @return string Code HTML
83 83
  */
84 84
 function debut_droite() {
85
-	return liste_objets_bloques(_request('exec'))
86
-	. creer_colonne_droite()
87
-	. '</div>'
88
-	. "\n<div id='contenu'>";
85
+    return liste_objets_bloques(_request('exec'))
86
+    . creer_colonne_droite()
87
+    . '</div>'
88
+    . "\n<div id='contenu'>";
89 89
 }
90 90
 
91 91
 /**
@@ -107,32 +107,32 @@  discard block
 block discarded – undo
107 107
  *     Code HTML
108 108
  **/
109 109
 function liste_objets_bloques($exec, $contexte = [], $auteur = null): string {
110
-	$res = '';
111
-	include_spip('inc/config');
112
-	if (lire_config('articles_modif', 'non') !== 'non') {
113
-		include_spip('inc/drapeau_edition');
114
-		if (is_null($auteur)) {
115
-			$auteur = $GLOBALS['visiteur_session'];
116
-		}
117
-		if (
118
-			$en_cours = trouver_objet_exec($exec)
119
-			and $en_cours['edition']
120
-			and $type = $en_cours['type']
121
-			and ((isset($contexte[$en_cours['id_table_objet']]) and $id = $contexte[$en_cours['id_table_objet']])
122
-				or $id = _request($en_cours['id_table_objet']))
123
-		) {
124
-			// marquer le fait que l'objet est ouvert en edition par toto
125
-			// a telle date ; une alerte sera donnee aux autres redacteurs
126
-			signale_edition($id, $auteur, $type);
127
-		}
128
-
129
-		$objets_ouverts = liste_drapeau_edition($auteur['id_auteur']);
130
-		if (count($objets_ouverts)) {
131
-			$res .= recuperer_fond('prive/objets/liste/objets-en-edition', [], ['ajax' => true]);
132
-		}
133
-	}
134
-
135
-	return $res;
110
+    $res = '';
111
+    include_spip('inc/config');
112
+    if (lire_config('articles_modif', 'non') !== 'non') {
113
+        include_spip('inc/drapeau_edition');
114
+        if (is_null($auteur)) {
115
+            $auteur = $GLOBALS['visiteur_session'];
116
+        }
117
+        if (
118
+            $en_cours = trouver_objet_exec($exec)
119
+            and $en_cours['edition']
120
+            and $type = $en_cours['type']
121
+            and ((isset($contexte[$en_cours['id_table_objet']]) and $id = $contexte[$en_cours['id_table_objet']])
122
+                or $id = _request($en_cours['id_table_objet']))
123
+        ) {
124
+            // marquer le fait que l'objet est ouvert en edition par toto
125
+            // a telle date ; une alerte sera donnee aux autres redacteurs
126
+            signale_edition($id, $auteur, $type);
127
+        }
128
+
129
+        $objets_ouverts = liste_drapeau_edition($auteur['id_auteur']);
130
+        if (count($objets_ouverts)) {
131
+            $res .= recuperer_fond('prive/objets/liste/objets-en-edition', [], ['ajax' => true]);
132
+        }
133
+    }
134
+
135
+    return $res;
136 136
 }
137 137
 
138 138
 
@@ -146,20 +146,20 @@  discard block
 block discarded – undo
146 146
  * @return string Code HTML
147 147
  **/
148 148
 function fin_page() {
149
-	include_spip('inc/pipelines');
150
-	// avec &var_profile=1 on a le tableau de mesures SQL
151
-	$debug = ((_request('exec') !== 'valider_xml')
152
-		and ((_request('var_mode') == 'debug')
153
-			or (isset($GLOBALS['tableau_des_temps']) and $GLOBALS['tableau_des_temps'])
154
-			and isset($_COOKIE['spip_admin'])));
155
-	$t = '</div><div id="pied"><div class="largeur">'
156
-		. recuperer_fond('prive/squelettes/inclure/pied')
157
-		. '</div>'
158
-		. '</div></div>' // cf. div#page et div.largeur ouvertes dans conmmencer_page()
159
-		. ($debug ? erreur_squelette() : '')
160
-		. "</body></html>\n";
161
-
162
-	return f_queue($t);
149
+    include_spip('inc/pipelines');
150
+    // avec &var_profile=1 on a le tableau de mesures SQL
151
+    $debug = ((_request('exec') !== 'valider_xml')
152
+        and ((_request('var_mode') == 'debug')
153
+            or (isset($GLOBALS['tableau_des_temps']) and $GLOBALS['tableau_des_temps'])
154
+            and isset($_COOKIE['spip_admin'])));
155
+    $t = '</div><div id="pied"><div class="largeur">'
156
+        . recuperer_fond('prive/squelettes/inclure/pied')
157
+        . '</div>'
158
+        . '</div></div>' // cf. div#page et div.largeur ouvertes dans conmmencer_page()
159
+        . ($debug ? erreur_squelette() : '')
160
+        . "</body></html>\n";
161
+
162
+    return f_queue($t);
163 163
 }
164 164
 
165 165
 /**
@@ -174,22 +174,22 @@  discard block
 block discarded – undo
174 174
  * @return string Code HTML
175 175
  **/
176 176
 function html_tests_js() {
177
-	if (_SPIP_AJAX and !defined('_TESTER_NOSCRIPT')) {
178
-		// pour le pied de page (deja defini si on est validation XML)
179
-		define(
180
-			'_TESTER_NOSCRIPT',
181
-			"<noscript>\n<div style='display:none;'><img src='"
182
-			. generer_url_ecrire('test_ajax', 'js=-1')
183
-			. "' width='1' height='1' alt='' /></div></noscript>\n"
184
-		);
185
-	}
186
-
187
-	$rejouer = '';
188
-	if (defined('_SESSION_REJOUER')) {
189
-		$rejouer = (_SESSION_REJOUER === true) ? rejouer_session() : _SESSION_REJOUER;
190
-	}
191
-
192
-	return $rejouer . (defined('_TESTER_NOSCRIPT') ? _TESTER_NOSCRIPT : '');
177
+    if (_SPIP_AJAX and !defined('_TESTER_NOSCRIPT')) {
178
+        // pour le pied de page (deja defini si on est validation XML)
179
+        define(
180
+            '_TESTER_NOSCRIPT',
181
+            "<noscript>\n<div style='display:none;'><img src='"
182
+            . generer_url_ecrire('test_ajax', 'js=-1')
183
+            . "' width='1' height='1' alt='' /></div></noscript>\n"
184
+        );
185
+    }
186
+
187
+    $rejouer = '';
188
+    if (defined('_SESSION_REJOUER')) {
189
+        $rejouer = (_SESSION_REJOUER === true) ? rejouer_session() : _SESSION_REJOUER;
190
+    }
191
+
192
+    return $rejouer . (defined('_TESTER_NOSCRIPT') ? _TESTER_NOSCRIPT : '');
193 193
 }
194 194
 
195 195
 /**
@@ -199,25 +199,25 @@  discard block
 block discarded – undo
199 199
  **/
200 200
 function info_maj_spip() {
201 201
 
202
-	$maj = $GLOBALS['meta']['info_maj_spip'] ?? null;
203
-	if (!$maj) {
204
-		return '';
205
-	}
202
+    $maj = $GLOBALS['meta']['info_maj_spip'] ?? null;
203
+    if (!$maj) {
204
+        return '';
205
+    }
206 206
 
207
-	$maj = explode('|', $maj);
208
-	// c'est une ancienne notif, on a fait la maj depuis !
209
-	if ($GLOBALS['spip_version_branche'] !== reset($maj)) {
210
-		return '';
211
-	}
207
+    $maj = explode('|', $maj);
208
+    // c'est une ancienne notif, on a fait la maj depuis !
209
+    if ($GLOBALS['spip_version_branche'] !== reset($maj)) {
210
+        return '';
211
+    }
212 212
 
213
-	if (!autoriser('webmestre')) {
214
-		return '';
215
-	}
213
+    if (!autoriser('webmestre')) {
214
+        return '';
215
+    }
216 216
 
217
-	array_shift($maj);
218
-	$maj = implode('|', $maj);
217
+    array_shift($maj);
218
+    $maj = implode('|', $maj);
219 219
 
220
-	return "$maj<br />";
220
+    return "$maj<br />";
221 221
 }
222 222
 
223 223
 /**
@@ -228,43 +228,43 @@  discard block
 block discarded – undo
228 228
  **/
229 229
 function info_copyright() {
230 230
 
231
-	$version = $GLOBALS['spip_version_affichee'];
232
-
233
-	//
234
-	// Mention, le cas echeant, de la revision SVN courante
235
-	//
236
-	if ($vcs = version_vcs_courante(_DIR_RACINE, true)) {
237
-		if ($vcs['vcs'] === 'GIT') {
238
-			$url = 'https://git.spip.net/spip/spip/commit/' . $vcs['commit'];
239
-		} elseif ($vcs['vcs'] === 'SVN') {
240
-			$url = 'https://core.spip.net/projects/spip/repository/revisions/' . $vcs['commit'];
241
-		} else {
242
-			$url = '';
243
-		}
244
-		// affichage "GIT [master: abcdef]"
245
-		$commit = $vcs['commit_short'] ?? $vcs['commit'];
246
-		if ($url) {
247
-			$commit = "<a href=\"$url\" target=\"_blank\" rel=\"noopener noreferrer\">$commit</a>";
248
-		}
249
-		if ($vcs['branch']) {
250
-			$commit = $vcs['branch'] . ': ' . $commit;
251
-		}
252
-		$version .= " {$vcs['vcs']} [$commit]";
253
-	}
254
-
255
-	// et la version de l'ecran de securite
256
-	$secu = defined('_ECRAN_SECURITE')
257
-		? '<br />' . _T('ecran_securite', ['version' => _ECRAN_SECURITE])
258
-		: '';
259
-
260
-	return _T(
261
-		'info_copyright',
262
-		[
263
-			'spip' => "<b>SPIP $version</b> ",
264
-			'lien_gpl' => '<a href="https://www.gnu.org/licenses/gpl-3.0.html" class="aide popin">' . _T('info_copyright_gpl') . '</a>'
265
-		]
266
-	)
267
-	. $secu;
231
+    $version = $GLOBALS['spip_version_affichee'];
232
+
233
+    //
234
+    // Mention, le cas echeant, de la revision SVN courante
235
+    //
236
+    if ($vcs = version_vcs_courante(_DIR_RACINE, true)) {
237
+        if ($vcs['vcs'] === 'GIT') {
238
+            $url = 'https://git.spip.net/spip/spip/commit/' . $vcs['commit'];
239
+        } elseif ($vcs['vcs'] === 'SVN') {
240
+            $url = 'https://core.spip.net/projects/spip/repository/revisions/' . $vcs['commit'];
241
+        } else {
242
+            $url = '';
243
+        }
244
+        // affichage "GIT [master: abcdef]"
245
+        $commit = $vcs['commit_short'] ?? $vcs['commit'];
246
+        if ($url) {
247
+            $commit = "<a href=\"$url\" target=\"_blank\" rel=\"noopener noreferrer\">$commit</a>";
248
+        }
249
+        if ($vcs['branch']) {
250
+            $commit = $vcs['branch'] . ': ' . $commit;
251
+        }
252
+        $version .= " {$vcs['vcs']} [$commit]";
253
+    }
254
+
255
+    // et la version de l'ecran de securite
256
+    $secu = defined('_ECRAN_SECURITE')
257
+        ? '<br />' . _T('ecran_securite', ['version' => _ECRAN_SECURITE])
258
+        : '';
259
+
260
+    return _T(
261
+        'info_copyright',
262
+        [
263
+            'spip' => "<b>SPIP $version</b> ",
264
+            'lien_gpl' => '<a href="https://www.gnu.org/licenses/gpl-3.0.html" class="aide popin">' . _T('info_copyright_gpl') . '</a>'
265
+        ]
266
+    )
267
+    . $secu;
268 268
 }
269 269
 
270 270
 /**
@@ -279,17 +279,17 @@  discard block
 block discarded – undo
279 279
  * @return string             Code HTML
280 280
  **/
281 281
 function formulaire_recherche($page, $complement = '') {
282
-	$recherche = _request('recherche');
283
-	$recherche_aff = entites_html($recherche);
284
-	if (!strlen($recherche)) {
285
-		$recherche_aff = _T('info_rechercher');
286
-		$onfocus = " onfocus=\"this.value='';\"";
287
-	} else {
288
-		$onfocus = '';
289
-	}
290
-
291
-	$form = '<input type="text" size="10" value="' . $recherche_aff . '" name="recherche" class="recherche" accesskey="r"' . $onfocus . ' />';
292
-	$form .= "<input type='image' src='" . chemin_image('rechercher-20.png') . "' name='submit' class='submit' alt='" . _T('info_rechercher') . "' />";
293
-
294
-	return "<div class='spip_recherche'>" . generer_form_ecrire($page, $form . $complement, " method='get'") . '</div>';
282
+    $recherche = _request('recherche');
283
+    $recherche_aff = entites_html($recherche);
284
+    if (!strlen($recherche)) {
285
+        $recherche_aff = _T('info_rechercher');
286
+        $onfocus = " onfocus=\"this.value='';\"";
287
+    } else {
288
+        $onfocus = '';
289
+    }
290
+
291
+    $form = '<input type="text" size="10" value="' . $recherche_aff . '" name="recherche" class="recherche" accesskey="r"' . $onfocus . ' />';
292
+    $form .= "<input type='image' src='" . chemin_image('rechercher-20.png') . "' name='submit' class='submit' alt='" . _T('info_rechercher') . "' />";
293
+
294
+    return "<div class='spip_recherche'>" . generer_form_ecrire($page, $form . $complement, " method='get'") . '</div>';
295 295
 }
Please login to merge, or discard this patch.