Completed
Push — master ( fa948f...93df9d )
by cam
06:55 queued 02:09
created
prive/formulaires/configurer_reducteur.php 1 patch
Indentation   +86 added lines, -86 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
 /**
@@ -28,22 +28,22 @@  discard block
 block discarded – undo
28 28
  *     Environnement du formulaire
29 29
  **/
30 30
 function formulaires_configurer_reducteur_charger_dist() {
31
-	$valeurs = array();
32
-	foreach (array(
33
-		'image_process',
34
-		'formats_graphiques',
35
-		'creer_preview',
36
-		'taille_preview',
37
-	) as $m) {
38
-		$valeurs[$m] = isset($GLOBALS['meta'][$m]) ? $GLOBALS['meta'][$m] : null;
39
-	}
31
+    $valeurs = array();
32
+    foreach (array(
33
+        'image_process',
34
+        'formats_graphiques',
35
+        'creer_preview',
36
+        'taille_preview',
37
+    ) as $m) {
38
+        $valeurs[$m] = isset($GLOBALS['meta'][$m]) ? $GLOBALS['meta'][$m] : null;
39
+    }
40 40
 
41
-	$valeurs['taille_preview'] = intval($valeurs['taille_preview']);
42
-	if ($valeurs['taille_preview'] < 10) {
43
-		$valeurs['taille_preview'] = 120;
44
-	}
41
+    $valeurs['taille_preview'] = intval($valeurs['taille_preview']);
42
+    if ($valeurs['taille_preview'] < 10) {
43
+        $valeurs['taille_preview'] = 120;
44
+    }
45 45
 
46
-	return $valeurs;
46
+    return $valeurs;
47 47
 }
48 48
 
49 49
 
@@ -54,51 +54,51 @@  discard block
 block discarded – undo
54 54
  *     Retours des traitements
55 55
  **/
56 56
 function formulaires_configurer_reducteur_traiter_dist() {
57
-	$res = array('editable' => true);
57
+    $res = array('editable' => true);
58 58
 
59
-	if (is_array($image_process = _request('image_process_'))) {
60
-		$image_process = array_keys($image_process);
61
-		$image_process = reset($image_process);
59
+    if (is_array($image_process = _request('image_process_'))) {
60
+        $image_process = array_keys($image_process);
61
+        $image_process = reset($image_process);
62 62
 
63
-		// application du choix de vignette
64
-		if ($image_process) {
65
-			// mettre a jour les formats graphiques lisibles
66
-			switch ($image_process) {
67
-				case 'gd1':
68
-				case 'gd2':
69
-					$formats_graphiques = $GLOBALS['meta']['gd_formats_read'];
70
-					break;
71
-				case 'netpbm':
72
-					$formats_graphiques = $GLOBALS['meta']['netpbm_formats'];
73
-					break;
74
-				case 'convert':
75
-				case 'imagick':
76
-					$formats_graphiques = 'gif,jpg,png,webp';
77
-					break;
78
-				default: #debug
79
-					$formats_graphiques = '';
80
-					$image_process = 'non';
81
-					break;
82
-			}
83
-			ecrire_meta('formats_graphiques', $formats_graphiques, 'non');
84
-			ecrire_meta('image_process', $image_process, 'non');
85
-		}
86
-	}
63
+        // application du choix de vignette
64
+        if ($image_process) {
65
+            // mettre a jour les formats graphiques lisibles
66
+            switch ($image_process) {
67
+                case 'gd1':
68
+                case 'gd2':
69
+                    $formats_graphiques = $GLOBALS['meta']['gd_formats_read'];
70
+                    break;
71
+                case 'netpbm':
72
+                    $formats_graphiques = $GLOBALS['meta']['netpbm_formats'];
73
+                    break;
74
+                case 'convert':
75
+                case 'imagick':
76
+                    $formats_graphiques = 'gif,jpg,png,webp';
77
+                    break;
78
+                default: #debug
79
+                    $formats_graphiques = '';
80
+                    $image_process = 'non';
81
+                    break;
82
+            }
83
+            ecrire_meta('formats_graphiques', $formats_graphiques, 'non');
84
+            ecrire_meta('image_process', $image_process, 'non');
85
+        }
86
+    }
87 87
 
88
-	foreach (array(
89
-		'creer_preview'
90
-	) as $m) {
91
-		if (!is_null($v = _request($m))) {
92
-			ecrire_meta($m, $v == 'oui' ? 'oui' : 'non');
93
-		}
94
-	}
95
-	if (!is_null($v = _request('taille_preview'))) {
96
-		ecrire_meta('taille_preview', intval($v));
97
-	}
88
+    foreach (array(
89
+        'creer_preview'
90
+    ) as $m) {
91
+        if (!is_null($v = _request($m))) {
92
+            ecrire_meta($m, $v == 'oui' ? 'oui' : 'non');
93
+        }
94
+    }
95
+    if (!is_null($v = _request('taille_preview'))) {
96
+        ecrire_meta('taille_preview', intval($v));
97
+    }
98 98
 
99
-	$res['message_ok'] = _T('config_info_enregistree');
99
+    $res['message_ok'] = _T('config_info_enregistree');
100 100
 
101
-	return $res;
101
+    return $res;
102 102
 }
103 103
 
104 104
 /**
@@ -111,36 +111,36 @@  discard block
 block discarded – undo
111 111
  *     URL d'action pour tester la librairie graphique en créant une vignette
112 112
  **/
113 113
 function url_vignette_choix($process) {
114
-	switch ($process) {
115
-		case 'gd2':
116
-			if (!function_exists('ImageCreateTrueColor')) {
117
-				return '';
118
-			}
119
-			break;
120
-		case 'gd1':
121
-			if (!function_exists('ImageGif')
122
-				and !function_exists('ImageJpeg')
123
-				and !function_exists('ImagePng')
124
-			) {
125
-				return '';
126
-			}
127
-			break;
128
-		case 'netpbm':
129
-			if (defined('_PNMSCALE_COMMAND') and _PNMSCALE_COMMAND == '') {
130
-				return '';
131
-			}
132
-			break;
133
-		case 'imagick':
134
-			if (!method_exists('Imagick', 'readImage')) {
135
-				return '';
136
-			}
137
-			break;
138
-		case 'convert':
139
-			if (defined('_CONVERT_COMMAND') and _CONVERT_COMMAND == '') {
140
-				return '';
141
-			}
142
-			break;
143
-	}
114
+    switch ($process) {
115
+        case 'gd2':
116
+            if (!function_exists('ImageCreateTrueColor')) {
117
+                return '';
118
+            }
119
+            break;
120
+        case 'gd1':
121
+            if (!function_exists('ImageGif')
122
+                and !function_exists('ImageJpeg')
123
+                and !function_exists('ImagePng')
124
+            ) {
125
+                return '';
126
+            }
127
+            break;
128
+        case 'netpbm':
129
+            if (defined('_PNMSCALE_COMMAND') and _PNMSCALE_COMMAND == '') {
130
+                return '';
131
+            }
132
+            break;
133
+        case 'imagick':
134
+            if (!method_exists('Imagick', 'readImage')) {
135
+                return '';
136
+            }
137
+            break;
138
+        case 'convert':
139
+            if (defined('_CONVERT_COMMAND') and _CONVERT_COMMAND == '') {
140
+                return '';
141
+            }
142
+            break;
143
+    }
144 144
 
145
-	return generer_url_action('tester', "arg=$process&time=" . time());
145
+    return generer_url_action('tester', "arg=$process&time=" . time());
146 146
 }
Please login to merge, or discard this patch.
ecrire/inc/flock.php 1 patch
Indentation   +394 added lines, -394 removed lines patch added patch discarded remove patch
@@ -17,12 +17,12 @@  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
 if (!defined('_TEST_FILE_EXISTS')) {
24
-	/** Permettre d'éviter des tests file_exists sur certains hébergeurs */
25
-	define('_TEST_FILE_EXISTS', preg_match(',(online|free)[.]fr$,', isset($_ENV["HTTP_HOST"]) ? $_ENV["HTTP_HOST"] : ""));
24
+    /** Permettre d'éviter des tests file_exists sur certains hébergeurs */
25
+    define('_TEST_FILE_EXISTS', preg_match(',(online|free)[.]fr$,', isset($_ENV["HTTP_HOST"]) ? $_ENV["HTTP_HOST"] : ""));
26 26
 }
27 27
 
28 28
 #define('_SPIP_LOCK_MODE',0); // ne pas utiliser de lock (deconseille)
@@ -30,7 +30,7 @@  discard block
 block discarded – undo
30 30
 #define('_SPIP_LOCK_MODE',2); // utiliser le nfslock de spip
31 31
 
32 32
 if (_SPIP_LOCK_MODE == 2) {
33
-	include_spip('inc/nfslock');
33
+    include_spip('inc/nfslock');
34 34
 }
35 35
 
36 36
 $GLOBALS['liste_verrous'] = array();
@@ -53,24 +53,24 @@  discard block
 block discarded – undo
53 53
  *     Ressource sur le fichier ouvert, sinon false.
54 54
  **/
55 55
 function spip_fopen_lock($fichier, $mode, $verrou) {
56
-	if (_SPIP_LOCK_MODE == 1) {
57
-		if ($fl = @fopen($fichier, $mode)) {
58
-			// verrou
59
-			@flock($fl, $verrou);
60
-		}
61
-
62
-		return $fl;
63
-	} elseif (_SPIP_LOCK_MODE == 2) {
64
-		if (($verrou = spip_nfslock($fichier)) && ($fl = @fopen($fichier, $mode))) {
65
-			$GLOBALS['liste_verrous'][$fl] = array($fichier, $verrou);
66
-
67
-			return $fl;
68
-		} else {
69
-			return false;
70
-		}
71
-	}
72
-
73
-	return @fopen($fichier, $mode);
56
+    if (_SPIP_LOCK_MODE == 1) {
57
+        if ($fl = @fopen($fichier, $mode)) {
58
+            // verrou
59
+            @flock($fl, $verrou);
60
+        }
61
+
62
+        return $fl;
63
+    } elseif (_SPIP_LOCK_MODE == 2) {
64
+        if (($verrou = spip_nfslock($fichier)) && ($fl = @fopen($fichier, $mode))) {
65
+            $GLOBALS['liste_verrous'][$fl] = array($fichier, $verrou);
66
+
67
+            return $fl;
68
+        } else {
69
+            return false;
70
+        }
71
+    }
72
+
73
+    return @fopen($fichier, $mode);
74 74
 }
75 75
 
76 76
 /**
@@ -85,14 +85,14 @@  discard block
 block discarded – undo
85 85
  *     true si succès, false sinon.
86 86
  **/
87 87
 function spip_fclose_unlock($handle) {
88
-	if (_SPIP_LOCK_MODE == 1) {
89
-		@flock($handle, LOCK_UN);
90
-	} elseif (_SPIP_LOCK_MODE == 2) {
91
-		spip_nfsunlock(reset($GLOBALS['liste_verrous'][$handle]), end($GLOBALS['liste_verrous'][$handle]));
92
-		unset($GLOBALS['liste_verrous'][$handle]);
93
-	}
94
-
95
-	return @fclose($handle);
88
+    if (_SPIP_LOCK_MODE == 1) {
89
+        @flock($handle, LOCK_UN);
90
+    } elseif (_SPIP_LOCK_MODE == 2) {
91
+        spip_nfsunlock(reset($GLOBALS['liste_verrous'][$handle]), end($GLOBALS['liste_verrous'][$handle]));
92
+        unset($GLOBALS['liste_verrous'][$handle]);
93
+    }
94
+
95
+    return @fclose($handle);
96 96
 }
97 97
 
98 98
 
@@ -106,23 +106,23 @@  discard block
 block discarded – undo
106 106
  *     Contenu du fichier
107 107
  **/
108 108
 function spip_file_get_contents($fichier) {
109
-	if (substr($fichier, -3) != '.gz') {
110
-		if (function_exists('file_get_contents')) {
111
-			// quand on est sous windows on ne sait pas si file_get_contents marche
112
-			// on essaye : si ca retourne du contenu alors c'est bon
113
-			// sinon on fait un file() pour avoir le coeur net
114
-			$contenu = @file_get_contents($fichier);
115
-			if (!$contenu and _OS_SERVEUR == 'windows') {
116
-				$contenu = @file($fichier);
117
-			}
118
-		} else {
119
-			$contenu = @file($fichier);
120
-		}
121
-	} else {
122
-		$contenu = @gzfile($fichier);
123
-	}
124
-
125
-	return is_array($contenu) ? join('', $contenu) : (string)$contenu;
109
+    if (substr($fichier, -3) != '.gz') {
110
+        if (function_exists('file_get_contents')) {
111
+            // quand on est sous windows on ne sait pas si file_get_contents marche
112
+            // on essaye : si ca retourne du contenu alors c'est bon
113
+            // sinon on fait un file() pour avoir le coeur net
114
+            $contenu = @file_get_contents($fichier);
115
+            if (!$contenu and _OS_SERVEUR == 'windows') {
116
+                $contenu = @file($fichier);
117
+            }
118
+        } else {
119
+            $contenu = @file($fichier);
120
+        }
121
+    } else {
122
+        $contenu = @gzfile($fichier);
123
+    }
124
+
125
+    return is_array($contenu) ? join('', $contenu) : (string)$contenu;
126 126
 }
127 127
 
128 128
 
@@ -147,48 +147,48 @@  discard block
 block discarded – undo
147 147
  *     true si l'opération a réussie, false sinon.
148 148
  **/
149 149
 function lire_fichier($fichier, &$contenu, $options = array()) {
150
-	$contenu = '';
151
-	// inutile car si le fichier n'existe pas, le lock va renvoyer false juste apres
152
-	// economisons donc les acces disque, sauf chez free qui rale pour un rien
153
-	if (_TEST_FILE_EXISTS and !@file_exists($fichier)) {
154
-		return false;
155
-	}
156
-
157
-	#spip_timer('lire_fichier');
158
-
159
-	// pas de @ sur spip_fopen_lock qui est silencieux de toute facon
160
-	if ($fl = spip_fopen_lock($fichier, 'r', LOCK_SH)) {
161
-		// lire le fichier avant tout
162
-		$contenu = spip_file_get_contents($fichier);
163
-
164
-		// le fichier a-t-il ete supprime par le locker ?
165
-		// on ne verifie que si la tentative de lecture a echoue
166
-		// pour discriminer un contenu vide d'un fichier absent
167
-		// et eviter un acces disque
168
-		if (!$contenu and !@file_exists($fichier)) {
169
-			spip_fclose_unlock($fl);
170
-
171
-			return false;
172
-		}
173
-
174
-		// liberer le verrou
175
-		spip_fclose_unlock($fl);
176
-
177
-		// Verifications
178
-		$ok = true;
179
-		if (isset($options['phpcheck']) and $options['phpcheck'] == 'oui') {
180
-			$ok &= (preg_match(",[?]>\n?$,", $contenu));
181
-		}
182
-
183
-		#spip_log("$fread $fichier ".spip_timer('lire_fichier'));
184
-		if (!$ok) {
185
-			spip_log("echec lecture $fichier");
186
-		}
187
-
188
-		return $ok;
189
-	}
190
-
191
-	return false;
150
+    $contenu = '';
151
+    // inutile car si le fichier n'existe pas, le lock va renvoyer false juste apres
152
+    // economisons donc les acces disque, sauf chez free qui rale pour un rien
153
+    if (_TEST_FILE_EXISTS and !@file_exists($fichier)) {
154
+        return false;
155
+    }
156
+
157
+    #spip_timer('lire_fichier');
158
+
159
+    // pas de @ sur spip_fopen_lock qui est silencieux de toute facon
160
+    if ($fl = spip_fopen_lock($fichier, 'r', LOCK_SH)) {
161
+        // lire le fichier avant tout
162
+        $contenu = spip_file_get_contents($fichier);
163
+
164
+        // le fichier a-t-il ete supprime par le locker ?
165
+        // on ne verifie que si la tentative de lecture a echoue
166
+        // pour discriminer un contenu vide d'un fichier absent
167
+        // et eviter un acces disque
168
+        if (!$contenu and !@file_exists($fichier)) {
169
+            spip_fclose_unlock($fl);
170
+
171
+            return false;
172
+        }
173
+
174
+        // liberer le verrou
175
+        spip_fclose_unlock($fl);
176
+
177
+        // Verifications
178
+        $ok = true;
179
+        if (isset($options['phpcheck']) and $options['phpcheck'] == 'oui') {
180
+            $ok &= (preg_match(",[?]>\n?$,", $contenu));
181
+        }
182
+
183
+        #spip_log("$fread $fichier ".spip_timer('lire_fichier'));
184
+        if (!$ok) {
185
+            spip_log("echec lecture $fichier");
186
+        }
187
+
188
+        return $ok;
189
+    }
190
+
191
+    return false;
192 192
 }
193 193
 
194 194
 
@@ -216,85 +216,85 @@  discard block
 block discarded – undo
216 216
  **/
217 217
 function ecrire_fichier($fichier, $contenu, $ignorer_echec = false, $truncate = true) {
218 218
 
219
-	#spip_timer('ecrire_fichier');
220
-
221
-	// verrouiller le fichier destination
222
-	if ($fp = spip_fopen_lock($fichier, 'a', LOCK_EX)) {
223
-		// ecrire les donnees, compressees le cas echeant
224
-		// (on ouvre un nouveau pointeur sur le fichier, ce qui a l'avantage
225
-		// de le recreer si le locker qui nous precede l'avait supprime...)
226
-		if (substr($fichier, -3) == '.gz') {
227
-			$contenu = gzencode($contenu);
228
-		}
229
-		// si c'est une ecriture avec troncation , on fait plutot une ecriture complete a cote suivie unlink+rename
230
-		// pour etre sur d'avoir une operation atomique
231
-		// y compris en NFS : http://www.ietf.org/rfc/rfc1094.txt
232
-		// sauf sous wintruc ou ca ne marche pas
233
-		$ok = false;
234
-		if ($truncate and _OS_SERVEUR != 'windows') {
235
-			if (!function_exists('creer_uniqid')) {
236
-				include_spip('inc/acces');
237
-			}
238
-			$id = creer_uniqid();
239
-			// on ouvre un pointeur sur un fichier temporaire en ecriture +raz
240
-			if ($fp2 = spip_fopen_lock("$fichier.$id", 'w', LOCK_EX)) {
241
-				$s = @fputs($fp2, $contenu, $a = strlen($contenu));
242
-				$ok = ($s == $a);
243
-				spip_fclose_unlock($fp2);
244
-				spip_fclose_unlock($fp);
245
-				// unlink direct et pas spip_unlink car on avait deja le verrou
246
-				// a priori pas besoin car rename ecrase la cible
247
-				// @unlink($fichier);
248
-				// le rename aussitot, atomique quand on est pas sous windows
249
-				// au pire on arrive en second en cas de concourance, et le rename echoue
250
-				// --> on a la version de l'autre process qui doit etre identique
251
-				@rename("$fichier.$id", $fichier);
252
-				// precaution en cas d'echec du rename
253
-				if (!_TEST_FILE_EXISTS or @file_exists("$fichier.$id")) {
254
-					@unlink("$fichier.$id");
255
-				}
256
-				if ($ok) {
257
-					$ok = file_exists($fichier);
258
-				}
259
-			} else // echec mais penser a fermer ..
260
-			{
261
-				spip_fclose_unlock($fp);
262
-			}
263
-		}
264
-		// sinon ou si methode precedente a echoueee
265
-		// on se rabat sur la methode ancienne
266
-		if (!$ok) {
267
-			// ici on est en ajout ou sous windows, cas desespere
268
-			if ($truncate) {
269
-				@ftruncate($fp, 0);
270
-			}
271
-			$s = @fputs($fp, $contenu, $a = strlen($contenu));
272
-
273
-			$ok = ($s == $a);
274
-			spip_fclose_unlock($fp);
275
-		}
276
-
277
-		// liberer le verrou et fermer le fichier
278
-		@chmod($fichier, _SPIP_CHMOD & 0666);
279
-		if ($ok) {
280
-			if (strpos($fichier, ".php") !== false) {
281
-				spip_clear_opcode_cache(realpath($fichier));
282
-			}
283
-
284
-			return $ok;
285
-		}
286
-	}
287
-
288
-	if (!$ignorer_echec) {
289
-		include_spip('inc/autoriser');
290
-		if (autoriser('chargerftp')) {
291
-			raler_fichier($fichier);
292
-		}
293
-		spip_unlink($fichier);
294
-	}
295
-	spip_log("Ecriture fichier $fichier impossible", _LOG_INFO_IMPORTANTE);
296
-
297
-	return false;
219
+    #spip_timer('ecrire_fichier');
220
+
221
+    // verrouiller le fichier destination
222
+    if ($fp = spip_fopen_lock($fichier, 'a', LOCK_EX)) {
223
+        // ecrire les donnees, compressees le cas echeant
224
+        // (on ouvre un nouveau pointeur sur le fichier, ce qui a l'avantage
225
+        // de le recreer si le locker qui nous precede l'avait supprime...)
226
+        if (substr($fichier, -3) == '.gz') {
227
+            $contenu = gzencode($contenu);
228
+        }
229
+        // si c'est une ecriture avec troncation , on fait plutot une ecriture complete a cote suivie unlink+rename
230
+        // pour etre sur d'avoir une operation atomique
231
+        // y compris en NFS : http://www.ietf.org/rfc/rfc1094.txt
232
+        // sauf sous wintruc ou ca ne marche pas
233
+        $ok = false;
234
+        if ($truncate and _OS_SERVEUR != 'windows') {
235
+            if (!function_exists('creer_uniqid')) {
236
+                include_spip('inc/acces');
237
+            }
238
+            $id = creer_uniqid();
239
+            // on ouvre un pointeur sur un fichier temporaire en ecriture +raz
240
+            if ($fp2 = spip_fopen_lock("$fichier.$id", 'w', LOCK_EX)) {
241
+                $s = @fputs($fp2, $contenu, $a = strlen($contenu));
242
+                $ok = ($s == $a);
243
+                spip_fclose_unlock($fp2);
244
+                spip_fclose_unlock($fp);
245
+                // unlink direct et pas spip_unlink car on avait deja le verrou
246
+                // a priori pas besoin car rename ecrase la cible
247
+                // @unlink($fichier);
248
+                // le rename aussitot, atomique quand on est pas sous windows
249
+                // au pire on arrive en second en cas de concourance, et le rename echoue
250
+                // --> on a la version de l'autre process qui doit etre identique
251
+                @rename("$fichier.$id", $fichier);
252
+                // precaution en cas d'echec du rename
253
+                if (!_TEST_FILE_EXISTS or @file_exists("$fichier.$id")) {
254
+                    @unlink("$fichier.$id");
255
+                }
256
+                if ($ok) {
257
+                    $ok = file_exists($fichier);
258
+                }
259
+            } else // echec mais penser a fermer ..
260
+            {
261
+                spip_fclose_unlock($fp);
262
+            }
263
+        }
264
+        // sinon ou si methode precedente a echoueee
265
+        // on se rabat sur la methode ancienne
266
+        if (!$ok) {
267
+            // ici on est en ajout ou sous windows, cas desespere
268
+            if ($truncate) {
269
+                @ftruncate($fp, 0);
270
+            }
271
+            $s = @fputs($fp, $contenu, $a = strlen($contenu));
272
+
273
+            $ok = ($s == $a);
274
+            spip_fclose_unlock($fp);
275
+        }
276
+
277
+        // liberer le verrou et fermer le fichier
278
+        @chmod($fichier, _SPIP_CHMOD & 0666);
279
+        if ($ok) {
280
+            if (strpos($fichier, ".php") !== false) {
281
+                spip_clear_opcode_cache(realpath($fichier));
282
+            }
283
+
284
+            return $ok;
285
+        }
286
+    }
287
+
288
+    if (!$ignorer_echec) {
289
+        include_spip('inc/autoriser');
290
+        if (autoriser('chargerftp')) {
291
+            raler_fichier($fichier);
292
+        }
293
+        spip_unlink($fichier);
294
+    }
295
+    spip_log("Ecriture fichier $fichier impossible", _LOG_INFO_IMPORTANTE);
296
+
297
+    return false;
298 298
 }
299 299
 
300 300
 /**
@@ -314,12 +314,12 @@  discard block
 block discarded – undo
314 314
  *     Écriture avec troncation ?
315 315
  */
316 316
 function ecrire_fichier_securise($fichier, $contenu, $ecrire_quand_meme = false, $truncate = true) {
317
-	if (substr($fichier, -4) !== '.php') {
318
-		spip_log('Erreur de programmation: ' . $fichier . ' doit finir par .php');
319
-	}
320
-	$contenu = "<" . "?php die ('Acces interdit'); ?" . ">\n" . $contenu;
317
+    if (substr($fichier, -4) !== '.php') {
318
+        spip_log('Erreur de programmation: ' . $fichier . ' doit finir par .php');
319
+    }
320
+    $contenu = "<" . "?php die ('Acces interdit'); ?" . ">\n" . $contenu;
321 321
 
322
-	return ecrire_fichier($fichier, $contenu, $ecrire_quand_meme, $truncate);
322
+    return ecrire_fichier($fichier, $contenu, $ecrire_quand_meme, $truncate);
323 323
 }
324 324
 
325 325
 
@@ -330,23 +330,23 @@  discard block
 block discarded – undo
330 330
  * @return bool
331 331
  */
332 332
 function ecrire_fichier_calcule_si_modifie($fichier, $contenu, $force=false, $use_copy=false) {
333
-	$fichier_tmp = $fichier . '.last';
334
-	if (!ecrire_fichier($fichier_tmp, $contenu, true)){
335
-		return false;
336
-	}
337
-	if ($force
338
-	  or !file_exists($fichier)
339
-		or md5_file($fichier) != md5_file($fichier_tmp)) {
340
-		if ($use_copy) {
341
-			@copy($fichier_tmp, $fichier);
342
-		}
343
-		else {
344
-			@rename($fichier_tmp, $fichier);
345
-		}
346
-		// eviter que PHP ne reserve le vieux timestamp
347
-		clearstatcache(true, $fichier);
348
-	}
349
-	return true;
333
+    $fichier_tmp = $fichier . '.last';
334
+    if (!ecrire_fichier($fichier_tmp, $contenu, true)){
335
+        return false;
336
+    }
337
+    if ($force
338
+      or !file_exists($fichier)
339
+        or md5_file($fichier) != md5_file($fichier_tmp)) {
340
+        if ($use_copy) {
341
+            @copy($fichier_tmp, $fichier);
342
+        }
343
+        else {
344
+            @rename($fichier_tmp, $fichier);
345
+        }
346
+        // eviter que PHP ne reserve le vieux timestamp
347
+        clearstatcache(true, $fichier);
348
+    }
349
+    return true;
350 350
 }
351 351
 
352 352
 
@@ -367,11 +367,11 @@  discard block
 block discarded – undo
367 367
  *     true si l'opération a réussie, false sinon.
368 368
  */
369 369
 function lire_fichier_securise($fichier, &$contenu, $options = array()) {
370
-	if ($res = lire_fichier($fichier, $contenu, $options)) {
371
-		$contenu = substr($contenu, strlen("<" . "?php die ('Acces interdit'); ?" . ">\n"));
372
-	}
370
+    if ($res = lire_fichier($fichier, $contenu, $options)) {
371
+        $contenu = substr($contenu, strlen("<" . "?php die ('Acces interdit'); ?" . ">\n"));
372
+    }
373 373
 
374
-	return $res;
374
+    return $res;
375 375
 }
376 376
 
377 377
 /**
@@ -386,20 +386,20 @@  discard block
 block discarded – undo
386 386
  *     Chemin du fichier
387 387
  **/
388 388
 function raler_fichier($fichier) {
389
-	include_spip('inc/minipres');
390
-	$dir = dirname($fichier);
391
-	http_status(401);
392
-	echo minipres(_T('texte_inc_meta_2'), "<h4 style='color: red'>"
393
-		. _T('texte_inc_meta_1', array('fichier' => $fichier))
394
-		. " <a href='"
395
-		. generer_url_ecrire('install', "etape=chmod&test_dir=$dir")
396
-		. "'>"
397
-		. _T('texte_inc_meta_2')
398
-		. "</a> "
399
-		. _T('texte_inc_meta_3',
400
-			array('repertoire' => joli_repertoire($dir)))
401
-		. "</h4>\n");
402
-	exit;
389
+    include_spip('inc/minipres');
390
+    $dir = dirname($fichier);
391
+    http_status(401);
392
+    echo minipres(_T('texte_inc_meta_2'), "<h4 style='color: red'>"
393
+        . _T('texte_inc_meta_1', array('fichier' => $fichier))
394
+        . " <a href='"
395
+        . generer_url_ecrire('install', "etape=chmod&test_dir=$dir")
396
+        . "'>"
397
+        . _T('texte_inc_meta_2')
398
+        . "</a> "
399
+        . _T('texte_inc_meta_3',
400
+            array('repertoire' => joli_repertoire($dir)))
401
+        . "</h4>\n");
402
+    exit;
403 403
 }
404 404
 
405 405
 
@@ -414,14 +414,14 @@  discard block
 block discarded – undo
414 414
  *     - true si récent, false sinon
415 415
  */
416 416
 function jeune_fichier($fichier, $n) {
417
-	if (!file_exists($fichier)) {
418
-		return false;
419
-	}
420
-	if (!$c = @filemtime($fichier)) {
421
-		return false;
422
-	}
423
-
424
-	return (time() - $n <= $c);
417
+    if (!file_exists($fichier)) {
418
+        return false;
419
+    }
420
+    if (!$c = @filemtime($fichier)) {
421
+        return false;
422
+    }
423
+
424
+    return (time() - $n <= $c);
425 425
 }
426 426
 
427 427
 /**
@@ -436,22 +436,22 @@  discard block
 block discarded – undo
436 436
  *     - false si on n'arrive pas poser le verrou ou si la suppression échoue
437 437
  */
438 438
 function supprimer_fichier($fichier, $lock = true) {
439
-	if (!@file_exists($fichier)) {
440
-		return true;
441
-	}
442
-
443
-	if ($lock) {
444
-		// verrouiller le fichier destination
445
-		if (!$fp = spip_fopen_lock($fichier, 'a', LOCK_EX)) {
446
-			return false;
447
-		}
448
-
449
-		// liberer le verrou
450
-		spip_fclose_unlock($fp);
451
-	}
452
-
453
-	// supprimer
454
-	return @unlink($fichier);
439
+    if (!@file_exists($fichier)) {
440
+        return true;
441
+    }
442
+
443
+    if ($lock) {
444
+        // verrouiller le fichier destination
445
+        if (!$fp = spip_fopen_lock($fichier, 'a', LOCK_EX)) {
446
+            return false;
447
+        }
448
+
449
+        // liberer le verrou
450
+        spip_fclose_unlock($fp);
451
+    }
452
+
453
+    // supprimer
454
+    return @unlink($fichier);
455 455
 }
456 456
 
457 457
 /**
@@ -461,12 +461,12 @@  discard block
 block discarded – undo
461 461
  *     Chemin du fichier
462 462
  */
463 463
 function spip_unlink($f) {
464
-	if (!is_dir($f)) {
465
-		supprimer_fichier($f, false);
466
-	} else {
467
-		@unlink("$f/.ok");
468
-		@rmdir($f);
469
-	}
464
+    if (!is_dir($f)) {
465
+        supprimer_fichier($f, false);
466
+    } else {
467
+        @unlink("$f/.ok");
468
+        @rmdir($f);
469
+    }
470 470
 }
471 471
 
472 472
 /**
@@ -480,26 +480,26 @@  discard block
 block discarded – undo
480 480
  *   The absolute path of the PHP file to invalidate.
481 481
  */
482 482
 function spip_clear_opcode_cache($filepath) {
483
-	clearstatcache(true, $filepath);
484
-
485
-	// Zend OPcache
486
-	if (function_exists('opcache_invalidate')) {
487
-		$invalidate = @opcache_invalidate($filepath, true);
488
-		// si l'invalidation a echoue lever un flag
489
-		if (!$invalidate and !defined('_spip_attend_invalidation_opcode_cache')) {
490
-			define('_spip_attend_invalidation_opcode_cache',true);
491
-		}
492
-	} elseif (!defined('_spip_attend_invalidation_opcode_cache')) {
493
-		// n'agira que si opcache est effectivement actif (il semble qu'on a pas toujours la fonction opcache_invalidate)
494
-		define('_spip_attend_invalidation_opcode_cache',true);
495
-	}
496
-	// APC.
497
-	if (function_exists('apc_delete_file')) {
498
-		// apc_delete_file() throws a PHP warning in case the specified file was
499
-		// not compiled yet.
500
-		// @see http://php.net/apc-delete-file
501
-		@apc_delete_file($filepath);
502
-	}
483
+    clearstatcache(true, $filepath);
484
+
485
+    // Zend OPcache
486
+    if (function_exists('opcache_invalidate')) {
487
+        $invalidate = @opcache_invalidate($filepath, true);
488
+        // si l'invalidation a echoue lever un flag
489
+        if (!$invalidate and !defined('_spip_attend_invalidation_opcode_cache')) {
490
+            define('_spip_attend_invalidation_opcode_cache',true);
491
+        }
492
+    } elseif (!defined('_spip_attend_invalidation_opcode_cache')) {
493
+        // n'agira que si opcache est effectivement actif (il semble qu'on a pas toujours la fonction opcache_invalidate)
494
+        define('_spip_attend_invalidation_opcode_cache',true);
495
+    }
496
+    // APC.
497
+    if (function_exists('apc_delete_file')) {
498
+        // apc_delete_file() throws a PHP warning in case the specified file was
499
+        // not compiled yet.
500
+        // @see http://php.net/apc-delete-file
501
+        @apc_delete_file($filepath);
502
+    }
503 503
 }
504 504
 
505 505
 /**
@@ -522,24 +522,24 @@  discard block
 block discarded – undo
522 522
  *
523 523
  */
524 524
 function spip_attend_invalidation_opcode_cache($timestamp = null) {
525
-	if (function_exists('opcache_get_configuration')
526
-		and @ini_get('opcache.enable')
527
-		and @ini_get('opcache.validate_timestamps')
528
-		and ($duree = intval(@ini_get('opcache.revalidate_freq')) or $duree = 2)
529
-		and defined('_spip_attend_invalidation_opcode_cache') // des invalidations ont echouees
530
-	) {
531
-		$wait = $duree + 1;
532
-		if ($timestamp) {
533
-			$wait -= (time() - $timestamp);
534
-			if ($wait<0) {
535
-				$wait = 0;
536
-			}
537
-		}
538
-		spip_log('Probleme de configuration opcache.revalidate_freq '. $duree .'s : on attend '.$wait.'s', _LOG_INFO_IMPORTANTE);
539
-		if ($wait) {
540
-			sleep($duree + 1);
541
-		}
542
-	}
525
+    if (function_exists('opcache_get_configuration')
526
+        and @ini_get('opcache.enable')
527
+        and @ini_get('opcache.validate_timestamps')
528
+        and ($duree = intval(@ini_get('opcache.revalidate_freq')) or $duree = 2)
529
+        and defined('_spip_attend_invalidation_opcode_cache') // des invalidations ont echouees
530
+    ) {
531
+        $wait = $duree + 1;
532
+        if ($timestamp) {
533
+            $wait -= (time() - $timestamp);
534
+            if ($wait<0) {
535
+                $wait = 0;
536
+            }
537
+        }
538
+        spip_log('Probleme de configuration opcache.revalidate_freq '. $duree .'s : on attend '.$wait.'s', _LOG_INFO_IMPORTANTE);
539
+        if ($wait) {
540
+            sleep($duree + 1);
541
+        }
542
+    }
543 543
 }
544 544
 
545 545
 
@@ -552,26 +552,26 @@  discard block
 block discarded – undo
552 552
  * @return bool Suppression reussie.
553 553
  */
554 554
 function supprimer_repertoire($dir) {
555
-	if (!file_exists($dir)) {
556
-		return true;
557
-	}
558
-	if (!is_dir($dir) || is_link($dir)) {
559
-		return @unlink($dir);
560
-	}
561
-
562
-	foreach (scandir($dir) as $item) {
563
-		if ($item == '.' || $item == '..') {
564
-			continue;
565
-		}
566
-		if (!supprimer_repertoire($dir . "/" . $item)) {
567
-			@chmod($dir . "/" . $item, 0777);
568
-			if (!supprimer_repertoire($dir . "/" . $item)) {
569
-				return false;
570
-			}
571
-		};
572
-	}
573
-
574
-	return @rmdir($dir);
555
+    if (!file_exists($dir)) {
556
+        return true;
557
+    }
558
+    if (!is_dir($dir) || is_link($dir)) {
559
+        return @unlink($dir);
560
+    }
561
+
562
+    foreach (scandir($dir) as $item) {
563
+        if ($item == '.' || $item == '..') {
564
+            continue;
565
+        }
566
+        if (!supprimer_repertoire($dir . "/" . $item)) {
567
+            @chmod($dir . "/" . $item, 0777);
568
+            if (!supprimer_repertoire($dir . "/" . $item)) {
569
+                return false;
570
+            }
571
+        };
572
+    }
573
+
574
+    return @rmdir($dir);
575 575
 }
576 576
 
577 577
 
@@ -600,57 +600,57 @@  discard block
 block discarded – undo
600 600
  *     Chemin du répertoire créé.
601 601
  **/
602 602
 function sous_repertoire($base, $subdir = '', $nobase = false, $tantpis = false) {
603
-	static $dirs = array();
604
-
605
-	$base = str_replace("//", "/", $base);
606
-
607
-	# suppr le dernier caractere si c'est un /
608
-	$base = rtrim($base, '/');
609
-
610
-	if (!strlen($subdir)) {
611
-		$n = strrpos($base, "/");
612
-		if ($n === false) {
613
-			return $nobase ? '' : ($base . '/');
614
-		}
615
-		$subdir = substr($base, $n + 1);
616
-		$base = substr($base, 0, $n + 1);
617
-	} else {
618
-		$base .= '/';
619
-		$subdir = str_replace("/", "", $subdir);
620
-	}
621
-
622
-	$baseaff = $nobase ? '' : $base;
623
-	if (isset($dirs[$base . $subdir])) {
624
-		return $baseaff . $dirs[$base . $subdir];
625
-	}
626
-
627
-	$path = $base . $subdir; # $path = 'IMG/distant/pdf' ou 'IMG/distant_pdf'
628
-
629
-	if (file_exists("$path/.ok")) {
630
-		return $baseaff . ($dirs[$base . $subdir] = "$subdir/");
631
-	}
632
-
633
-	@mkdir($path, _SPIP_CHMOD);
634
-	@chmod($path, _SPIP_CHMOD);
635
-
636
-	if (is_dir($path) && is_writable($path)) {
637
-		@touch("$path/.ok");
638
-		spip_log("creation $base$subdir/");
639
-
640
-		return $baseaff . ($dirs[$base . $subdir] = "$subdir/");
641
-	}
642
-
643
-	// en cas d'echec c'est peut etre tout simplement que le disque est plein :
644
-	// l'inode du fichier dir_test existe, mais impossible d'y mettre du contenu
645
-	spip_log("echec creation $base${subdir}");
646
-	if ($tantpis) {
647
-		return '';
648
-	}
649
-	if (!_DIR_RESTREINT) {
650
-		$base = preg_replace(',^' . _DIR_RACINE . ',', '', $base);
651
-	}
652
-	$base .= $subdir;
653
-	raler_fichier($base . '/.ok');
603
+    static $dirs = array();
604
+
605
+    $base = str_replace("//", "/", $base);
606
+
607
+    # suppr le dernier caractere si c'est un /
608
+    $base = rtrim($base, '/');
609
+
610
+    if (!strlen($subdir)) {
611
+        $n = strrpos($base, "/");
612
+        if ($n === false) {
613
+            return $nobase ? '' : ($base . '/');
614
+        }
615
+        $subdir = substr($base, $n + 1);
616
+        $base = substr($base, 0, $n + 1);
617
+    } else {
618
+        $base .= '/';
619
+        $subdir = str_replace("/", "", $subdir);
620
+    }
621
+
622
+    $baseaff = $nobase ? '' : $base;
623
+    if (isset($dirs[$base . $subdir])) {
624
+        return $baseaff . $dirs[$base . $subdir];
625
+    }
626
+
627
+    $path = $base . $subdir; # $path = 'IMG/distant/pdf' ou 'IMG/distant_pdf'
628
+
629
+    if (file_exists("$path/.ok")) {
630
+        return $baseaff . ($dirs[$base . $subdir] = "$subdir/");
631
+    }
632
+
633
+    @mkdir($path, _SPIP_CHMOD);
634
+    @chmod($path, _SPIP_CHMOD);
635
+
636
+    if (is_dir($path) && is_writable($path)) {
637
+        @touch("$path/.ok");
638
+        spip_log("creation $base$subdir/");
639
+
640
+        return $baseaff . ($dirs[$base . $subdir] = "$subdir/");
641
+    }
642
+
643
+    // en cas d'echec c'est peut etre tout simplement que le disque est plein :
644
+    // l'inode du fichier dir_test existe, mais impossible d'y mettre du contenu
645
+    spip_log("echec creation $base${subdir}");
646
+    if ($tantpis) {
647
+        return '';
648
+    }
649
+    if (!_DIR_RESTREINT) {
650
+        $base = preg_replace(',^' . _DIR_RACINE . ',', '', $base);
651
+    }
652
+    $base .= $subdir;
653
+    raler_fichier($base . '/.ok');
654 654
 }
655 655
 
656 656
 
@@ -683,51 +683,51 @@  discard block
 block discarded – undo
683 683
  *     Chemins des fichiers trouvés.
684 684
  **/
685 685
 function preg_files($dir, $pattern = -1 /* AUTO */, $maxfiles = 10000, $recurs = array()) {
686
-	$nbfiles = 0;
687
-	if ($pattern == -1) {
688
-		$pattern = "^$dir";
689
-	}
690
-	$fichiers = array();
691
-	// revenir au repertoire racine si on a recu dossier/truc
692
-	// pour regarder dossier/truc/ ne pas oublier le / final
693
-	$dir = preg_replace(',/[^/]*$,', '', $dir);
694
-	if ($dir == '') {
695
-		$dir = '.';
696
-	}
697
-
698
-	if (@is_dir($dir) and is_readable($dir) and $d = opendir($dir)) {
699
-		while (($f = readdir($d)) !== false && ($nbfiles < $maxfiles)) {
700
-			if ($f[0] != '.' # ignorer . .. .svn etc
701
-				and $f != 'CVS'
702
-				and $f != 'remove.txt'
703
-				and is_readable($f = "$dir/$f")
704
-			) {
705
-				if (is_file($f)) {
706
-					if (preg_match(";$pattern;iS", $f)) {
707
-						$fichiers[] = $f;
708
-						$nbfiles++;
709
-					}
710
-				} else {
711
-					if (is_dir($f) and is_array($recurs)) {
712
-						$rp = @realpath($f);
713
-						if (!is_string($rp) or !strlen($rp)) {
714
-							$rp = $f;
715
-						} # realpath n'est peut etre pas autorise
716
-						if (!isset($recurs[$rp])) {
717
-							$recurs[$rp] = true;
718
-							$beginning = $fichiers;
719
-							$end = preg_files("$f/", $pattern,
720
-								$maxfiles - $nbfiles, $recurs);
721
-							$fichiers = array_merge((array)$beginning, (array)$end);
722
-							$nbfiles = count($fichiers);
723
-						}
724
-					}
725
-				}
726
-			}
727
-		}
728
-		closedir($d);
729
-	}
730
-	sort($fichiers);
731
-
732
-	return $fichiers;
686
+    $nbfiles = 0;
687
+    if ($pattern == -1) {
688
+        $pattern = "^$dir";
689
+    }
690
+    $fichiers = array();
691
+    // revenir au repertoire racine si on a recu dossier/truc
692
+    // pour regarder dossier/truc/ ne pas oublier le / final
693
+    $dir = preg_replace(',/[^/]*$,', '', $dir);
694
+    if ($dir == '') {
695
+        $dir = '.';
696
+    }
697
+
698
+    if (@is_dir($dir) and is_readable($dir) and $d = opendir($dir)) {
699
+        while (($f = readdir($d)) !== false && ($nbfiles < $maxfiles)) {
700
+            if ($f[0] != '.' # ignorer . .. .svn etc
701
+                and $f != 'CVS'
702
+                and $f != 'remove.txt'
703
+                and is_readable($f = "$dir/$f")
704
+            ) {
705
+                if (is_file($f)) {
706
+                    if (preg_match(";$pattern;iS", $f)) {
707
+                        $fichiers[] = $f;
708
+                        $nbfiles++;
709
+                    }
710
+                } else {
711
+                    if (is_dir($f) and is_array($recurs)) {
712
+                        $rp = @realpath($f);
713
+                        if (!is_string($rp) or !strlen($rp)) {
714
+                            $rp = $f;
715
+                        } # realpath n'est peut etre pas autorise
716
+                        if (!isset($recurs[$rp])) {
717
+                            $recurs[$rp] = true;
718
+                            $beginning = $fichiers;
719
+                            $end = preg_files("$f/", $pattern,
720
+                                $maxfiles - $nbfiles, $recurs);
721
+                            $fichiers = array_merge((array)$beginning, (array)$end);
722
+                            $nbfiles = count($fichiers);
723
+                        }
724
+                    }
725
+                }
726
+            }
727
+        }
728
+        closedir($d);
729
+    }
730
+    sort($fichiers);
731
+
732
+    return $fichiers;
733 733
 }
Please login to merge, or discard this patch.
ecrire/public/debusquer.php 1 patch
Indentation   +681 added lines, -681 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
 include_spip('public/decompiler');
@@ -66,135 +66,135 @@  discard block
 block discarded – undo
66 66
  *     - string si $message à false.
67 67
  **/
68 68
 function public_debusquer_dist($message = '', $lieu = '', $opt = array()) {
69
-	static $tableau_des_erreurs = array();
70
-
71
-	// Pour des tests unitaires, pouvoir récupérer les erreurs générées
72
-	if (isset($opt['erreurs'])) {
73
-		if ($opt['erreurs'] == 'get') {
74
-			return $tableau_des_erreurs;
75
-		}
76
-		if ($opt['erreurs'] == 'reset') {
77
-			$tableau_des_erreurs = array();
78
-
79
-			return true;
80
-		}
81
-	}
82
-
83
-	// Erreur ou appel final ?
84
-	if ($message) {
85
-		$message = debusquer_compose_message($message);
86
-		$tableau_des_erreurs[] = array($message, $lieu);
87
-		set_request('var_mode', 'debug');
88
-		$GLOBALS['bouton_admin_debug'] = true;
89
-		// Permettre a la compil de continuer
90
-		if (is_object($lieu) and (!isset($lieu->code) or !$lieu->code)) {
91
-			$lieu->code = "''";
92
-		}
93
-		// forcer l'appel au debusqueur en cas de boucles infernales
94
-		$urgence = (_DEBUG_MAX_SQUELETTE_ERREURS and count($tableau_des_erreurs) > _DEBUG_MAX_SQUELETTE_ERREURS);
95
-		if (!$urgence) {
96
-			return;
97
-		}
98
-	}
99
-	if (empty($GLOBALS['debug_objets']['principal'])) {
100
-		// espace public ?
101
-		if (isset($GLOBALS['fond'])) {
102
-			$GLOBALS['debug_objets']['principal'] = $GLOBALS['fond'];
103
-		}
104
-	}
105
-
106
-	include_spip('inc/autoriser');
107
-	if (!autoriser('debug')) {
108
-		return;
109
-	}
110
-	include_spip('inc/headers');
111
-	include_spip('inc/filtres');
112
-
113
-	// en cas de squelette inclus,  virer le code de l'incluant:
114
-	// - il contient souvent une Div restreignant la largeur a 3 fois rien
115
-	// - ca fait 2 headers !
116
-	// sauf si l'on se trouve deja dans un flux compresse (plugin compresseur
117
-	// actif par exemple)
118
-	if (ob_get_length()
119
-		and
120
-		!in_array('ob_gzhandler', ob_get_status())
121
-	) {
122
-		ob_end_clean();
123
-	}
124
-
125
-	lang_select($GLOBALS['visiteur_session']['lang']);
126
-	$fonc = _request('var_mode_objet');
127
-	$mode = _request('var_mode_affiche');
128
-	$self = str_replace("\\'", '&#39;', self());
129
-	$self = parametre_url($self, 'var_mode', 'debug');
130
-
131
-	$res = debusquer_bandeau($tableau_des_erreurs)
132
-		. '<br />'
133
-		. debusquer_squelette($fonc, $mode, $self);
134
-
135
-	if (!_DIR_RESTREINT or headers_sent()) {
136
-		return $res;
137
-	}
138
-	if ($tableau_des_erreurs) {
139
-		http_status(503);
140
-	}
141
-
142
-	http_no_cache();
143
-	if (isset($_GET['var_profile'])) {
144
-		$titre = parametre_url($GLOBALS['REQUEST_URI'], 'var_profile', '');
145
-		$titre = parametre_url($titre, 'var_mode', '');
146
-	} else {
147
-		if (!$fonc) {
148
-			$fonc = $GLOBALS['debug_objets']['principal'];
149
-		}
150
-		$titre = !$mode ? $fonc : ($mode . (isset($GLOBALS['debug_objets']['sourcefile'][$fonc]) ? " " . $GLOBALS['debug_objets']['sourcefile'][$fonc] : ""));
151
-	}
152
-	if ($message === false) {
153
-		lang_select();
154
-
155
-		return debusquer_entete($titre, $res);
156
-	} else {
157
-		echo debusquer_entete($titre, $res);
158
-	}
159
-	exit;
69
+    static $tableau_des_erreurs = array();
70
+
71
+    // Pour des tests unitaires, pouvoir récupérer les erreurs générées
72
+    if (isset($opt['erreurs'])) {
73
+        if ($opt['erreurs'] == 'get') {
74
+            return $tableau_des_erreurs;
75
+        }
76
+        if ($opt['erreurs'] == 'reset') {
77
+            $tableau_des_erreurs = array();
78
+
79
+            return true;
80
+        }
81
+    }
82
+
83
+    // Erreur ou appel final ?
84
+    if ($message) {
85
+        $message = debusquer_compose_message($message);
86
+        $tableau_des_erreurs[] = array($message, $lieu);
87
+        set_request('var_mode', 'debug');
88
+        $GLOBALS['bouton_admin_debug'] = true;
89
+        // Permettre a la compil de continuer
90
+        if (is_object($lieu) and (!isset($lieu->code) or !$lieu->code)) {
91
+            $lieu->code = "''";
92
+        }
93
+        // forcer l'appel au debusqueur en cas de boucles infernales
94
+        $urgence = (_DEBUG_MAX_SQUELETTE_ERREURS and count($tableau_des_erreurs) > _DEBUG_MAX_SQUELETTE_ERREURS);
95
+        if (!$urgence) {
96
+            return;
97
+        }
98
+    }
99
+    if (empty($GLOBALS['debug_objets']['principal'])) {
100
+        // espace public ?
101
+        if (isset($GLOBALS['fond'])) {
102
+            $GLOBALS['debug_objets']['principal'] = $GLOBALS['fond'];
103
+        }
104
+    }
105
+
106
+    include_spip('inc/autoriser');
107
+    if (!autoriser('debug')) {
108
+        return;
109
+    }
110
+    include_spip('inc/headers');
111
+    include_spip('inc/filtres');
112
+
113
+    // en cas de squelette inclus,  virer le code de l'incluant:
114
+    // - il contient souvent une Div restreignant la largeur a 3 fois rien
115
+    // - ca fait 2 headers !
116
+    // sauf si l'on se trouve deja dans un flux compresse (plugin compresseur
117
+    // actif par exemple)
118
+    if (ob_get_length()
119
+        and
120
+        !in_array('ob_gzhandler', ob_get_status())
121
+    ) {
122
+        ob_end_clean();
123
+    }
124
+
125
+    lang_select($GLOBALS['visiteur_session']['lang']);
126
+    $fonc = _request('var_mode_objet');
127
+    $mode = _request('var_mode_affiche');
128
+    $self = str_replace("\\'", '&#39;', self());
129
+    $self = parametre_url($self, 'var_mode', 'debug');
130
+
131
+    $res = debusquer_bandeau($tableau_des_erreurs)
132
+        . '<br />'
133
+        . debusquer_squelette($fonc, $mode, $self);
134
+
135
+    if (!_DIR_RESTREINT or headers_sent()) {
136
+        return $res;
137
+    }
138
+    if ($tableau_des_erreurs) {
139
+        http_status(503);
140
+    }
141
+
142
+    http_no_cache();
143
+    if (isset($_GET['var_profile'])) {
144
+        $titre = parametre_url($GLOBALS['REQUEST_URI'], 'var_profile', '');
145
+        $titre = parametre_url($titre, 'var_mode', '');
146
+    } else {
147
+        if (!$fonc) {
148
+            $fonc = $GLOBALS['debug_objets']['principal'];
149
+        }
150
+        $titre = !$mode ? $fonc : ($mode . (isset($GLOBALS['debug_objets']['sourcefile'][$fonc]) ? " " . $GLOBALS['debug_objets']['sourcefile'][$fonc] : ""));
151
+    }
152
+    if ($message === false) {
153
+        lang_select();
154
+
155
+        return debusquer_entete($titre, $res);
156
+    } else {
157
+        echo debusquer_entete($titre, $res);
158
+    }
159
+    exit;
160 160
 }
161 161
 
162 162
 function debusquer_compose_message($msg) {
163
-	if (is_array($msg)) {
164
-		// si c'est un texte, c'est une traduction a faire, mais
165
-		// sqlite renvoit aussi des erreurs alpha num (mais avec 3 arguments)
166
-		if (!is_numeric($msg[0]) and count($msg) == 2) {
167
-			// message avec argument: instancier
168
-			$msg = _T($msg[0], $msg[1], 'spip-debug-arg');
169
-		} else {
170
-			// message SQL: interpreter
171
-			$msg = debusquer_requete($msg);
172
-		}
173
-	}
174
-	// FIXME: le fond n'est pas la si on n'est pas dans un squelette
175
-	// cela dit, ca serait bien d'indiquer tout de meme d'ou vient l'erreur
176
-	$fond = isset($GLOBALS['fond']) ? $GLOBALS['fond'] : "";
177
-	// une erreur critique sort $message en array
178
-	$debug = is_array($msg) ? $msg[1] : $msg;
179
-	spip_log("Debug: " . $debug . " (" . $fond . ")");
180
-
181
-	return $msg;
163
+    if (is_array($msg)) {
164
+        // si c'est un texte, c'est une traduction a faire, mais
165
+        // sqlite renvoit aussi des erreurs alpha num (mais avec 3 arguments)
166
+        if (!is_numeric($msg[0]) and count($msg) == 2) {
167
+            // message avec argument: instancier
168
+            $msg = _T($msg[0], $msg[1], 'spip-debug-arg');
169
+        } else {
170
+            // message SQL: interpreter
171
+            $msg = debusquer_requete($msg);
172
+        }
173
+    }
174
+    // FIXME: le fond n'est pas la si on n'est pas dans un squelette
175
+    // cela dit, ca serait bien d'indiquer tout de meme d'ou vient l'erreur
176
+    $fond = isset($GLOBALS['fond']) ? $GLOBALS['fond'] : "";
177
+    // une erreur critique sort $message en array
178
+    $debug = is_array($msg) ? $msg[1] : $msg;
179
+    spip_log("Debug: " . $debug . " (" . $fond . ")");
180
+
181
+    return $msg;
182 182
 }
183 183
 
184 184
 function debusquer_bandeau($erreurs) {
185 185
 
186
-	if (!empty($erreurs)) {
187
-		$n = array(count($erreurs) . ' ' . _T('zbug_erreur_squelette'));
186
+    if (!empty($erreurs)) {
187
+        $n = array(count($erreurs) . ' ' . _T('zbug_erreur_squelette'));
188 188
 
189
-		return debusquer_navigation($erreurs, $n);
190
-	} elseif (!empty($GLOBALS['tableau_des_temps'])) {
191
-		include_spip('public/tracer');
192
-		list($temps, $nav) = chrono_requete($GLOBALS['tableau_des_temps']);
189
+        return debusquer_navigation($erreurs, $n);
190
+    } elseif (!empty($GLOBALS['tableau_des_temps'])) {
191
+        include_spip('public/tracer');
192
+        list($temps, $nav) = chrono_requete($GLOBALS['tableau_des_temps']);
193 193
 
194
-		return debusquer_navigation($temps, $nav, 'debug-profile');
195
-	} else {
196
-		return '';
197
-	}
194
+        return debusquer_navigation($temps, $nav, 'debug-profile');
195
+    } else {
196
+        return '';
197
+    }
198 198
 }
199 199
 
200 200
 /**
@@ -204,42 +204,42 @@  discard block
 block discarded – undo
204 204
  * @return string Code HTML
205 205
  **/
206 206
 function debusquer_contexte($env) {
207
-	if (is_string($env) and is_array($env_tab = @unserialize($env))) {
208
-		$env = $env_tab;
209
-	}
210
-
211
-	if (!$env) {
212
-		return '';
213
-	}
214
-	$res = "";
215
-	foreach ($env as $nom => $valeur) {
216
-		if (is_array($valeur)) {
217
-			$valeur_simple = array();
218
-			foreach ($valeur as $v) {
219
-				if (is_array($v)) {
220
-					$valeur_simple[] = 'array:' . count($v);
221
-				} elseif (is_object($v)) {
222
-					$valeur_simple[] = get_class($v);
223
-				} elseif (is_string($v)) {
224
-					$valeur_simple[] = "'" . $v . "'";
225
-				} else {
226
-					$valeur_simple[] = $v;
227
-				}
228
-			}
229
-			$n = count($valeur);
230
-			$valeur = (($n > 3) ? 'array:' . $n . ' ' : '');
231
-			$valeur .= '[' . join(', ', $valeur_simple) . ']';
232
-		} elseif (is_object($valeur)) {
233
-			$valeur = get_class($valeur);
234
-		} elseif (is_string($valeur)) {
235
-			$valeur = "'" . $valeur . "'";
236
-		}
237
-		$res .= "\n<tr><td><strong>" . nl2br(entites_html($nom))
238
-			. "</strong></td><td>:&nbsp;" . nl2br(entites_html($valeur))
239
-			. "</td></tr>\n";
240
-	}
241
-
242
-	return "<div class='spip-env'><fieldset><legend onclick=\"this.parentElement.classList.toggle('expanded');\">#ENV</legend>\n<div><table>$res</table></div></fieldset></div>\n";
207
+    if (is_string($env) and is_array($env_tab = @unserialize($env))) {
208
+        $env = $env_tab;
209
+    }
210
+
211
+    if (!$env) {
212
+        return '';
213
+    }
214
+    $res = "";
215
+    foreach ($env as $nom => $valeur) {
216
+        if (is_array($valeur)) {
217
+            $valeur_simple = array();
218
+            foreach ($valeur as $v) {
219
+                if (is_array($v)) {
220
+                    $valeur_simple[] = 'array:' . count($v);
221
+                } elseif (is_object($v)) {
222
+                    $valeur_simple[] = get_class($v);
223
+                } elseif (is_string($v)) {
224
+                    $valeur_simple[] = "'" . $v . "'";
225
+                } else {
226
+                    $valeur_simple[] = $v;
227
+                }
228
+            }
229
+            $n = count($valeur);
230
+            $valeur = (($n > 3) ? 'array:' . $n . ' ' : '');
231
+            $valeur .= '[' . join(', ', $valeur_simple) . ']';
232
+        } elseif (is_object($valeur)) {
233
+            $valeur = get_class($valeur);
234
+        } elseif (is_string($valeur)) {
235
+            $valeur = "'" . $valeur . "'";
236
+        }
237
+        $res .= "\n<tr><td><strong>" . nl2br(entites_html($nom))
238
+            . "</strong></td><td>:&nbsp;" . nl2br(entites_html($valeur))
239
+            . "</td></tr>\n";
240
+    }
241
+
242
+    return "<div class='spip-env'><fieldset><legend onclick=\"this.parentElement.classList.toggle('expanded');\">#ENV</legend>\n<div><table>$res</table></div></fieldset></div>\n";
243 243
 }
244 244
 
245 245
 // Affichage du tableau des erreurs ou des temps de calcul
@@ -247,67 +247,67 @@  discard block
 block discarded – undo
247 247
 
248 248
 function debusquer_navigation($tableau, $caption = array(), $id = 'debug-nav') {
249 249
 
250
-	if (_request('exec') == 'valider_xml') {
251
-		return '';
252
-	}
253
-	$GLOBALS['bouton_admin_debug'] = true;
254
-	$res = '';
255
-	$href = quote_amp(parametre_url($GLOBALS['REQUEST_URI'], 'var_mode', 'debug'));
256
-	foreach ($tableau as $i => $err) {
257
-		$boucle = $ligne = $skel = '';
258
-		list($msg, $lieu) = $err;
259
-		if (is_object($lieu)) {
260
-			$ligne = $lieu->ligne;
261
-			$boucle = $lieu->id_boucle ? $lieu->id_boucle : '';
262
-			if (isset($lieu->descr['nom'])) {
263
-				$nom_code = $lieu->descr['nom'];
264
-				$skel = $lieu->descr['sourcefile'];
265
-				$h2 = parametre_url($href, 'var_mode_objet', $nom_code);
266
-				$h3 = parametre_url($h2, 'var_mode_affiche', 'squelette') . '#L' . $ligne;
267
-				$skel = "<a href='$h3'><b>$skel</b></a>";
268
-				if ($boucle) {
269
-					$h3 = parametre_url($h2 . $boucle, 'var_mode_affiche', 'boucle');
270
-					$boucle = "<a href='$h3'><b>$boucle</b></a>";
271
-				}
272
-			}
273
-		}
274
-
275
-		$j = ($i + 1);
276
-		$res .= "<tr id='req$j'><td style='text-align: right'>"
277
-			. $j
278
-			. "&nbsp;</td><td style='text-align: left'>"
279
-			. (is_array($msg) ? implode('', $msg) : $msg)
280
-			. "</td><td style='text-align: left'>"
281
-			. ($skel ? $skel : "&nbsp;&nbsp;&nbsp;/&nbsp;&nbsp;")
282
-			. "</td><td class='spip-debug-arg' style='text-align: left'>"
283
-			. ($boucle ? $boucle : "&nbsp;&nbsp;&nbsp;/&nbsp;&nbsp;")
284
-			. "</td><td style='text-align: right'>"
285
-			. $ligne
286
-			. "</td></tr>\n";
287
-
288
-	}
289
-
290
-	return "\n<table id='$id'>"
291
-	. "<caption onclick=\"x = document.getElementById('$id'); (x.style.display == '' ? x.style.display = 'none' : x.style.display = '');\">"
292
-	. $caption[0]
250
+    if (_request('exec') == 'valider_xml') {
251
+        return '';
252
+    }
253
+    $GLOBALS['bouton_admin_debug'] = true;
254
+    $res = '';
255
+    $href = quote_amp(parametre_url($GLOBALS['REQUEST_URI'], 'var_mode', 'debug'));
256
+    foreach ($tableau as $i => $err) {
257
+        $boucle = $ligne = $skel = '';
258
+        list($msg, $lieu) = $err;
259
+        if (is_object($lieu)) {
260
+            $ligne = $lieu->ligne;
261
+            $boucle = $lieu->id_boucle ? $lieu->id_boucle : '';
262
+            if (isset($lieu->descr['nom'])) {
263
+                $nom_code = $lieu->descr['nom'];
264
+                $skel = $lieu->descr['sourcefile'];
265
+                $h2 = parametre_url($href, 'var_mode_objet', $nom_code);
266
+                $h3 = parametre_url($h2, 'var_mode_affiche', 'squelette') . '#L' . $ligne;
267
+                $skel = "<a href='$h3'><b>$skel</b></a>";
268
+                if ($boucle) {
269
+                    $h3 = parametre_url($h2 . $boucle, 'var_mode_affiche', 'boucle');
270
+                    $boucle = "<a href='$h3'><b>$boucle</b></a>";
271
+                }
272
+            }
273
+        }
274
+
275
+        $j = ($i + 1);
276
+        $res .= "<tr id='req$j'><td style='text-align: right'>"
277
+            . $j
278
+            . "&nbsp;</td><td style='text-align: left'>"
279
+            . (is_array($msg) ? implode('', $msg) : $msg)
280
+            . "</td><td style='text-align: left'>"
281
+            . ($skel ? $skel : "&nbsp;&nbsp;&nbsp;/&nbsp;&nbsp;")
282
+            . "</td><td class='spip-debug-arg' style='text-align: left'>"
283
+            . ($boucle ? $boucle : "&nbsp;&nbsp;&nbsp;/&nbsp;&nbsp;")
284
+            . "</td><td style='text-align: right'>"
285
+            . $ligne
286
+            . "</td></tr>\n";
287
+
288
+    }
289
+
290
+    return "\n<table id='$id'>"
291
+    . "<caption onclick=\"x = document.getElementById('$id'); (x.style.display == '' ? x.style.display = 'none' : x.style.display = '');\">"
292
+    . $caption[0]
293 293
 ## aide locale courte a ecrire, avec lien vers une grosse page de documentation
294 294
 #		aider('erreur_compilation'),
295
-	. "</caption>"
296
-	//  fausse caption du chrono (mais vraie nav)
297
-	. (!empty($caption[1]) ? $caption[1] : '')
298
-	. "<tr><th>"
299
-	. _T('numero')
300
-	. "</th><th>"
301
-	. _T('public:message')
302
-	. "</th><th>"
303
-	. _T('squelette')
304
-	. "</th><th>"
305
-	. _T('zbug_boucle')
306
-	. "</th><th>"
307
-	. _T('ligne')
308
-	. "</th></tr>"
309
-	. $res
310
-	. "</table>";
295
+    . "</caption>"
296
+    //  fausse caption du chrono (mais vraie nav)
297
+    . (!empty($caption[1]) ? $caption[1] : '')
298
+    . "<tr><th>"
299
+    . _T('numero')
300
+    . "</th><th>"
301
+    . _T('public:message')
302
+    . "</th><th>"
303
+    . _T('squelette')
304
+    . "</th><th>"
305
+    . _T('zbug_boucle')
306
+    . "</th><th>"
307
+    . _T('ligne')
308
+    . "</th></tr>"
309
+    . $res
310
+    . "</table>";
311 311
 }
312 312
 
313 313
 
@@ -327,125 +327,125 @@  discard block
 block discarded – undo
327 327
  *    ou un tableau si l'erreur est critique
328 328
  **/
329 329
 function debusquer_requete($message) {
330
-	list($errno, $msg, $query) = $message;
331
-
332
-	// FIXME: ces écritures mélangent divers syntaxe des moteurs SQL
333
-	// il serait plus prudent certainement d'avoir une fonction d'analyse par moteur
334
-	if (preg_match(',err(no|code):?[[:space:]]*([0-9]+),i', $msg, $regs)) {
335
-		$errno = $regs[2];
336
-	} elseif (is_numeric($errno) and ($errno == 1030 or $errno <= 1026)
337
-		and preg_match(',[^[:alnum:]]([0-9]+)[^[:alnum:]],', $msg, $regs)
338
-	) {
339
-		$errno = $regs[1];
340
-	}
341
-
342
-	// Erreur systeme
343
-	if (is_numeric($errno) and $errno > 0 and $errno < 200) {
344
-		$retour = "<tt><br /><br /><blink>"
345
-			. _T('info_erreur_systeme', array('errsys' => $errno))
346
-			. "</blink><br />\n<b>"
347
-			. _T('info_erreur_systeme2',
348
-				array('script' => generer_url_ecrire('base_repair')))
349
-			. '</b><br />';
350
-		spip_log("Erreur systeme $errno");
351
-
352
-		return array($retour, '');
353
-	}
354
-
355
-	// Requete erronee
356
-	$err = "<b>" . _T('avis_erreur_mysql') . " $errno</b><br /><tt>\n"
357
-		. spip_htmlspecialchars($msg)
358
-		. "\n<br /><span style='color: red'><b>"
359
-		. spip_htmlspecialchars($query)
360
-		. "</b></span></tt><br />";
361
-
362
-	//. aider('erreur_mysql');
363
-
364
-	return $err;
330
+    list($errno, $msg, $query) = $message;
331
+
332
+    // FIXME: ces écritures mélangent divers syntaxe des moteurs SQL
333
+    // il serait plus prudent certainement d'avoir une fonction d'analyse par moteur
334
+    if (preg_match(',err(no|code):?[[:space:]]*([0-9]+),i', $msg, $regs)) {
335
+        $errno = $regs[2];
336
+    } elseif (is_numeric($errno) and ($errno == 1030 or $errno <= 1026)
337
+        and preg_match(',[^[:alnum:]]([0-9]+)[^[:alnum:]],', $msg, $regs)
338
+    ) {
339
+        $errno = $regs[1];
340
+    }
341
+
342
+    // Erreur systeme
343
+    if (is_numeric($errno) and $errno > 0 and $errno < 200) {
344
+        $retour = "<tt><br /><br /><blink>"
345
+            . _T('info_erreur_systeme', array('errsys' => $errno))
346
+            . "</blink><br />\n<b>"
347
+            . _T('info_erreur_systeme2',
348
+                array('script' => generer_url_ecrire('base_repair')))
349
+            . '</b><br />';
350
+        spip_log("Erreur systeme $errno");
351
+
352
+        return array($retour, '');
353
+    }
354
+
355
+    // Requete erronee
356
+    $err = "<b>" . _T('avis_erreur_mysql') . " $errno</b><br /><tt>\n"
357
+        . spip_htmlspecialchars($msg)
358
+        . "\n<br /><span style='color: red'><b>"
359
+        . spip_htmlspecialchars($query)
360
+        . "</b></span></tt><br />";
361
+
362
+    //. aider('erreur_mysql');
363
+
364
+    return $err;
365 365
 }
366 366
 
367 367
 
368 368
 // https://code.spip.net/@trouve_boucle_debug
369 369
 function trouve_boucle_debug($n, $nom, $debut = 0, $boucle = "") {
370 370
 
371
-	$id = $nom . $boucle;
372
-	if (is_array($GLOBALS['debug_objets']['sequence'][$id])) {
373
-		foreach ($GLOBALS['debug_objets']['sequence'][$id] as $v) {
374
-
375
-			if (!preg_match('/^(.*)(<\?.*\?>)(.*)$/s', $v[0], $r)) {
376
-				$y = substr_count($v[0], "\n");
377
-			} else {
378
-				if ($v[1][0] == '#') // balise dynamique
379
-				{
380
-					$incl = $GLOBALS['debug_objets']['resultat'][$v[2]];
381
-				} else // inclusion
382
-				{
383
-					$incl = $GLOBALS['debug_objets']['squelette'][trouve_squelette_inclus($v[0])];
384
-				}
385
-				$y = substr_count($incl, "\n")
386
-					+ substr_count($r[1], "\n")
387
-					+ substr_count($r[3], "\n");
388
-			}
389
-			if ($n <= ($y + $debut)) {
390
-				if ($v[1][0] == '?') {
391
-					return trouve_boucle_debug($n, $nom, $debut, substr($v[1], 1));
392
-				} elseif ($v[1][0] == '!') {
393
-					if ($incl = trouve_squelette_inclus($v[1])) {
394
-						return trouve_boucle_debug($n, $incl, $debut);
395
-					}
396
-				}
397
-
398
-				return array($nom, $boucle, $v[2] - 1 + $n - $debut);
399
-			}
400
-			$debut += $y;
401
-		}
402
-	}
403
-
404
-	return array($nom, $boucle, $n - $debut);
371
+    $id = $nom . $boucle;
372
+    if (is_array($GLOBALS['debug_objets']['sequence'][$id])) {
373
+        foreach ($GLOBALS['debug_objets']['sequence'][$id] as $v) {
374
+
375
+            if (!preg_match('/^(.*)(<\?.*\?>)(.*)$/s', $v[0], $r)) {
376
+                $y = substr_count($v[0], "\n");
377
+            } else {
378
+                if ($v[1][0] == '#') // balise dynamique
379
+                {
380
+                    $incl = $GLOBALS['debug_objets']['resultat'][$v[2]];
381
+                } else // inclusion
382
+                {
383
+                    $incl = $GLOBALS['debug_objets']['squelette'][trouve_squelette_inclus($v[0])];
384
+                }
385
+                $y = substr_count($incl, "\n")
386
+                    + substr_count($r[1], "\n")
387
+                    + substr_count($r[3], "\n");
388
+            }
389
+            if ($n <= ($y + $debut)) {
390
+                if ($v[1][0] == '?') {
391
+                    return trouve_boucle_debug($n, $nom, $debut, substr($v[1], 1));
392
+                } elseif ($v[1][0] == '!') {
393
+                    if ($incl = trouve_squelette_inclus($v[1])) {
394
+                        return trouve_boucle_debug($n, $incl, $debut);
395
+                    }
396
+                }
397
+
398
+                return array($nom, $boucle, $v[2] - 1 + $n - $debut);
399
+            }
400
+            $debut += $y;
401
+        }
402
+    }
403
+
404
+    return array($nom, $boucle, $n - $debut);
405 405
 }
406 406
 
407 407
 // https://code.spip.net/@trouve_squelette_inclus
408 408
 function trouve_squelette_inclus($script) {
409 409
 
410
-	preg_match('/include\(.(.*).php3?.\);/', $script, $reg);
411
-	// si le script X.php n'est pas ecrire/public.php
412
-	// on suppose qu'il prend le squelette X.html (pas sur, mais y a pas mieux)
413
-	if ($reg[1] == 'ecrire/public') // si c'est bien ecrire/public on cherche le param 'fond'
414
-	{
415
-		if (!preg_match("/'fond' => '([^']*)'/", $script, $reg)) // a defaut on cherche le param 'page'
416
-		{
417
-			if (!preg_match("/'param' => '([^']*)'/", $script, $reg)) {
418
-				$reg[1] = "inconnu";
419
-			}
420
-		}
421
-	}
422
-	$incl = ',' . $reg[1] . '[.]\w$,';
423
-
424
-	foreach ($GLOBALS['debug_objets']['sourcefile'] as $k => $v) {
425
-		if (preg_match($incl, $v)) {
426
-			return $k;
427
-		}
428
-	}
429
-
430
-	return "";
410
+    preg_match('/include\(.(.*).php3?.\);/', $script, $reg);
411
+    // si le script X.php n'est pas ecrire/public.php
412
+    // on suppose qu'il prend le squelette X.html (pas sur, mais y a pas mieux)
413
+    if ($reg[1] == 'ecrire/public') // si c'est bien ecrire/public on cherche le param 'fond'
414
+    {
415
+        if (!preg_match("/'fond' => '([^']*)'/", $script, $reg)) // a defaut on cherche le param 'page'
416
+        {
417
+            if (!preg_match("/'param' => '([^']*)'/", $script, $reg)) {
418
+                $reg[1] = "inconnu";
419
+            }
420
+        }
421
+    }
422
+    $incl = ',' . $reg[1] . '[.]\w$,';
423
+
424
+    foreach ($GLOBALS['debug_objets']['sourcefile'] as $k => $v) {
425
+        if (preg_match($incl, $v)) {
426
+            return $k;
427
+        }
428
+    }
429
+
430
+    return "";
431 431
 }
432 432
 
433 433
 // https://code.spip.net/@reference_boucle_debug
434 434
 function reference_boucle_debug($n, $nom, $self) {
435
-	list($skel, $boucle, $ligne) = trouve_boucle_debug($n, $nom);
436
-
437
-	if (!$boucle) {
438
-		return !$ligne ? "" :
439
-			(" (" .
440
-				(($nom != $skel) ? _T('squelette_inclus_ligne') :
441
-					_T('squelette_ligne')) .
442
-				" <a href='$self&amp;var_mode_objet=$skel&amp;var_mode_affiche=squelette&amp;var_mode_ligne=$ligne#L$ligne'>$ligne</a>)");
443
-	} else {
444
-		$self .= "&amp;var_mode_objet=$skel$boucle&amp;var_mode_affiche=boucle";
445
-
446
-		return !$ligne ? " (boucle\n<a href='$self#$skel$boucle'>$boucle</a>)" :
447
-			" (boucle $boucle ligne\n<a href='$self&amp;var_mode_ligne=$ligne#L$ligne'>$ligne</a>)";
448
-	}
435
+    list($skel, $boucle, $ligne) = trouve_boucle_debug($n, $nom);
436
+
437
+    if (!$boucle) {
438
+        return !$ligne ? "" :
439
+            (" (" .
440
+                (($nom != $skel) ? _T('squelette_inclus_ligne') :
441
+                    _T('squelette_ligne')) .
442
+                " <a href='$self&amp;var_mode_objet=$skel&amp;var_mode_affiche=squelette&amp;var_mode_ligne=$ligne#L$ligne'>$ligne</a>)");
443
+    } else {
444
+        $self .= "&amp;var_mode_objet=$skel$boucle&amp;var_mode_affiche=boucle";
445
+
446
+        return !$ligne ? " (boucle\n<a href='$self#$skel$boucle'>$boucle</a>)" :
447
+            " (boucle $boucle ligne\n<a href='$self&amp;var_mode_ligne=$ligne#L$ligne'>$ligne</a>)";
448
+    }
449 449
 }
450 450
 
451 451
 // affiche un texte avec numero de ligne et ancre.
@@ -453,395 +453,395 @@  discard block
 block discarded – undo
453 453
 // https://code.spip.net/@ancre_texte
454 454
 function ancre_texte($texte, $fautifs = array(), $nocpt = false) {
455 455
 
456
-	$var_mode_ligne = _request('var_mode_ligne');
457
-	if ($var_mode_ligne) {
458
-		$fautifs[] = array($var_mode_ligne);
459
-	}
460
-	$res = '';
461
-
462
-	$s = highlight_string($texte, true);
463
-	if (substr($s, 0, 6) == '<code>') {
464
-		$s = substr($s, 6);
465
-		$res = '<code>';
466
-	}
467
-
468
-	$s = preg_replace(',<(\w[^<>]*)>([^<]*)<br />([^<]*)</\1>,',
469
-		'<\1>\2</\1><br />' . "\n" . '<\1>\3</\1>',
470
-		$s);
471
-
472
-
473
-	$tableau = explode("<br />", $s);
474
-
475
-	$format = "<span style='float:left;display:block;width:50px;height:1px'><a id='L%d' style='background-color: white; visibility: " . ($nocpt ? 'hidden' : 'visible') . ";%s' href='#T%s' title=\"%s\">%0" . strval(@strlen(count($tableau))) . "d</a></span> %s<br />\n";
476
-
477
-	$format10 = str_replace('white', 'lightgrey', $format);
478
-	$formaterr = "color: red;";
479
-	$i = 1;
480
-	$flignes = array();
481
-	$loc = array(0, 0);
482
-	foreach ($fautifs as $lc) {
483
-		if (is_array($lc)) {
484
-			$l = array_shift($lc);
485
-			$flignes[$l] = $lc;
486
-		} else {
487
-			$flignes[$lc] = $loc;
488
-		}
489
-	}
490
-
491
-	$ancre = md5($texte);
492
-	foreach ($tableau as $ligne) {
493
-		if (isset($flignes[$i])) {
494
-			$ligne = str_replace('&nbsp;', ' ', $ligne);
495
-			$indexmesg = $flignes[$i][1];
496
-			$err = textebrut($flignes[$i][2]);
497
-			// tentative de pointer sur la colonne fautive;
498
-			// marche pas car highlight_string rajoute des entites. A revoir.
499
-			// $m = $flignes[$i][0];
500
-			// $ligne = substr($ligne, 0, $m-1) .
501
-			// sprintf($formaterr, substr($ligne,$m));
502
-			$bg = $formaterr;
503
-		} else {
504
-			$indexmesg = $ancre;
505
-			$err = $bg = '';
506
-		}
507
-		$res .= sprintf((($i % 10) ? $format : $format10), $i, $bg, $indexmesg, $err, $i, $ligne);
508
-		$i++;
509
-	}
510
-
511
-	return "<div id='T$ancre'>"
512
-	. '<div onclick="'
513
-	. "jQuery(this).parent().find('a').toggle();"
514
-	. '" title="'
515
-	. _T('masquer_colonne')
516
-	. '" style="cursor: pointer;">'
517
-	. ($nocpt ? '' : _T('info_numero_abbreviation'))
518
-	. "</div>
456
+    $var_mode_ligne = _request('var_mode_ligne');
457
+    if ($var_mode_ligne) {
458
+        $fautifs[] = array($var_mode_ligne);
459
+    }
460
+    $res = '';
461
+
462
+    $s = highlight_string($texte, true);
463
+    if (substr($s, 0, 6) == '<code>') {
464
+        $s = substr($s, 6);
465
+        $res = '<code>';
466
+    }
467
+
468
+    $s = preg_replace(',<(\w[^<>]*)>([^<]*)<br />([^<]*)</\1>,',
469
+        '<\1>\2</\1><br />' . "\n" . '<\1>\3</\1>',
470
+        $s);
471
+
472
+
473
+    $tableau = explode("<br />", $s);
474
+
475
+    $format = "<span style='float:left;display:block;width:50px;height:1px'><a id='L%d' style='background-color: white; visibility: " . ($nocpt ? 'hidden' : 'visible') . ";%s' href='#T%s' title=\"%s\">%0" . strval(@strlen(count($tableau))) . "d</a></span> %s<br />\n";
476
+
477
+    $format10 = str_replace('white', 'lightgrey', $format);
478
+    $formaterr = "color: red;";
479
+    $i = 1;
480
+    $flignes = array();
481
+    $loc = array(0, 0);
482
+    foreach ($fautifs as $lc) {
483
+        if (is_array($lc)) {
484
+            $l = array_shift($lc);
485
+            $flignes[$l] = $lc;
486
+        } else {
487
+            $flignes[$lc] = $loc;
488
+        }
489
+    }
490
+
491
+    $ancre = md5($texte);
492
+    foreach ($tableau as $ligne) {
493
+        if (isset($flignes[$i])) {
494
+            $ligne = str_replace('&nbsp;', ' ', $ligne);
495
+            $indexmesg = $flignes[$i][1];
496
+            $err = textebrut($flignes[$i][2]);
497
+            // tentative de pointer sur la colonne fautive;
498
+            // marche pas car highlight_string rajoute des entites. A revoir.
499
+            // $m = $flignes[$i][0];
500
+            // $ligne = substr($ligne, 0, $m-1) .
501
+            // sprintf($formaterr, substr($ligne,$m));
502
+            $bg = $formaterr;
503
+        } else {
504
+            $indexmesg = $ancre;
505
+            $err = $bg = '';
506
+        }
507
+        $res .= sprintf((($i % 10) ? $format : $format10), $i, $bg, $indexmesg, $err, $i, $ligne);
508
+        $i++;
509
+    }
510
+
511
+    return "<div id='T$ancre'>"
512
+    . '<div onclick="'
513
+    . "jQuery(this).parent().find('a').toggle();"
514
+    . '" title="'
515
+    . _T('masquer_colonne')
516
+    . '" style="cursor: pointer;">'
517
+    . ($nocpt ? '' : _T('info_numero_abbreviation'))
518
+    . "</div>
519 519
 	" . $res . "</div>\n";
520 520
 }
521 521
 
522 522
 // l'environnement graphique du debuggueur 
523 523
 
524 524
 function debusquer_squelette($fonc, $mode, $self) {
525
-	$texte = '';
526
-
527
-	if ($mode !== 'validation') {
528
-		if (isset($GLOBALS['debug_objets']['sourcefile']) and $GLOBALS['debug_objets']['sourcefile']) {
529
-			$res = "<div id='spip-boucles'>\n"
530
-				. debusquer_navigation_squelettes($self)
531
-				. "</div>";
532
-		} else {
533
-			$res = '';
534
-		}
535
-		if ($fonc) {
536
-			$id = " id='$fonc'";
537
-			if (!empty($GLOBALS['debug_objets'][$mode][$fonc])) {
538
-				list($legend, $texte, $res2) = debusquer_source($fonc, $mode);
539
-				$texte .= $res2;
540
-			} elseif (!empty($GLOBALS['debug_objets'][$mode][$fonc . 'tout'])) {
541
-				$legend = _T('zbug_' . $mode);
542
-				$texte = $GLOBALS['debug_objets'][$mode][$fonc . 'tout'];
543
-				$texte = ancre_texte($texte, array('', ''));
544
-			}
545
-		} else {
546
-			if (strlen(trim($res))) {
547
-				return "<img src='" . chemin_image('debug-xx.svg') . "' alt='afficher-masquer le debug' id='spip-debug-toggle' onclick=\"var x = document.getElementById('spip-debug'); (x.style.display == '' ? x.style.display = 'none' : x.style.display = '');\" /><div id='spip-debug'>$res</div>";
548
-			} else {
549
-				// cas de l'appel sur erreur: montre la page
550
-				return isset($GLOBALS['debug_objets']['resultat']['tout'])
551
-					? $GLOBALS['debug_objets']['resultat']['tout']
552
-					: '';
553
-			}
554
-		}
555
-	} else {
556
-		$valider = charger_fonction('valider', 'xml');
557
-		$val = $valider($GLOBALS['debug_objets']['validation'][$fonc . 'tout']);
558
-		// Si erreur, signaler leur nombre dans le formulaire admin
559
-		$GLOBALS['debug_objets']['validation'] = $val->err ? count($val->err) : '';
560
-		list($texte, $err) = emboite_texte($val, $fonc, $self);
561
-		if ($err === false) {
562
-			$err = _T('impossible');
563
-		} elseif ($err === true) {
564
-			$err = _T('correcte');
565
-		} else {
566
-			$err = ": $err";
567
-		}
568
-		$legend = _T('validation') . ' ' . $err;
569
-		$res = $id = '';
570
-	}
571
-
572
-	return !trim($texte) ? '' : (
573
-		"<img src='" . chemin_image('debug-xx.svg') . "' alt='afficher-masquer le debug' id='spip-debug-toggle' onclick=\"var x = document.getElementById('spip-debug'); (x.style.display == '' ? x.style.display = 'none' : x.style.display = '');\" /><div id='spip-debug'>$res"
574
-		. "<div id='debug_boucle'><fieldset$id><legend>"
575
-		. "<a href='" . $self . "#f_" . substr($fonc, 0, 37) . "'> &#8593; "
576
-		. ($legend ? $legend : $mode)
577
-		. "</a></legend>"
578
-		. $texte
579
-		. "</fieldset></div>"
580
-		. "</div>");
525
+    $texte = '';
526
+
527
+    if ($mode !== 'validation') {
528
+        if (isset($GLOBALS['debug_objets']['sourcefile']) and $GLOBALS['debug_objets']['sourcefile']) {
529
+            $res = "<div id='spip-boucles'>\n"
530
+                . debusquer_navigation_squelettes($self)
531
+                . "</div>";
532
+        } else {
533
+            $res = '';
534
+        }
535
+        if ($fonc) {
536
+            $id = " id='$fonc'";
537
+            if (!empty($GLOBALS['debug_objets'][$mode][$fonc])) {
538
+                list($legend, $texte, $res2) = debusquer_source($fonc, $mode);
539
+                $texte .= $res2;
540
+            } elseif (!empty($GLOBALS['debug_objets'][$mode][$fonc . 'tout'])) {
541
+                $legend = _T('zbug_' . $mode);
542
+                $texte = $GLOBALS['debug_objets'][$mode][$fonc . 'tout'];
543
+                $texte = ancre_texte($texte, array('', ''));
544
+            }
545
+        } else {
546
+            if (strlen(trim($res))) {
547
+                return "<img src='" . chemin_image('debug-xx.svg') . "' alt='afficher-masquer le debug' id='spip-debug-toggle' onclick=\"var x = document.getElementById('spip-debug'); (x.style.display == '' ? x.style.display = 'none' : x.style.display = '');\" /><div id='spip-debug'>$res</div>";
548
+            } else {
549
+                // cas de l'appel sur erreur: montre la page
550
+                return isset($GLOBALS['debug_objets']['resultat']['tout'])
551
+                    ? $GLOBALS['debug_objets']['resultat']['tout']
552
+                    : '';
553
+            }
554
+        }
555
+    } else {
556
+        $valider = charger_fonction('valider', 'xml');
557
+        $val = $valider($GLOBALS['debug_objets']['validation'][$fonc . 'tout']);
558
+        // Si erreur, signaler leur nombre dans le formulaire admin
559
+        $GLOBALS['debug_objets']['validation'] = $val->err ? count($val->err) : '';
560
+        list($texte, $err) = emboite_texte($val, $fonc, $self);
561
+        if ($err === false) {
562
+            $err = _T('impossible');
563
+        } elseif ($err === true) {
564
+            $err = _T('correcte');
565
+        } else {
566
+            $err = ": $err";
567
+        }
568
+        $legend = _T('validation') . ' ' . $err;
569
+        $res = $id = '';
570
+    }
571
+
572
+    return !trim($texte) ? '' : (
573
+        "<img src='" . chemin_image('debug-xx.svg') . "' alt='afficher-masquer le debug' id='spip-debug-toggle' onclick=\"var x = document.getElementById('spip-debug'); (x.style.display == '' ? x.style.display = 'none' : x.style.display = '');\" /><div id='spip-debug'>$res"
574
+        . "<div id='debug_boucle'><fieldset$id><legend>"
575
+        . "<a href='" . $self . "#f_" . substr($fonc, 0, 37) . "'> &#8593; "
576
+        . ($legend ? $legend : $mode)
577
+        . "</a></legend>"
578
+        . $texte
579
+        . "</fieldset></div>"
580
+        . "</div>");
581 581
 }
582 582
 
583 583
 
584 584
 // https://code.spip.net/@emboite_texte
585 585
 function emboite_texte($res, $fonc = '', $self = '') {
586
-	$errs = $res->err;
587
-	$texte = $res->entete . ($errs ? '' : $res->page);
588
-
589
-	if (!$texte and !$errs) {
590
-		return array(ancre_texte('', array('', '')), false);
591
-	}
592
-	if (!$errs) {
593
-		return array(ancre_texte($texte, array('', '')), true);
594
-	}
595
-
596
-	if (!isset($GLOBALS['debug_objets'])) {
597
-
598
-		$colors = array('#e0e0f0', '#f8f8ff');
599
-		$encore = count_occ($errs);
600
-		$encore2 = array();
601
-		$fautifs = array();
602
-
603
-		$err = '<tr><th>'
604
-			. _T('numero')
605
-			. "</th><th>"
606
-			. _T('occurence')
607
-			. "</th><th>"
608
-			. _T('ligne')
609
-			. "</th><th>"
610
-			. _T('colonne')
611
-			. "</th><th>"
612
-			. _T('erreur')
613
-			. "</th></tr>";
614
-
615
-		$i = 0;
616
-		$style = "style='text-align: right; padding-right: 5px'";
617
-		foreach ($errs as $r) {
618
-			$i++;
619
-			list($msg, $ligne, $col) = $r;
620
-			#spip_log("$r = list($msg, $ligne, $col");
621
-			if (isset($encore2[$msg])) {
622
-				$ref = ++$encore2[$msg];
623
-			} else {
624
-				$encore2[$msg] = $ref = 1;
625
-			}
626
-			$err .= "<tr  style='background-color: "
627
-				. $colors[$i % 2]
628
-				. "'><td $style><a href='#debut_err'>"
629
-				. $i
630
-				. "</a></td><td $style>"
631
-				. "$ref/$encore[$msg]</td>"
632
-				. "<td $style><a href='#L"
633
-				. $ligne
634
-				. "' id='T$i'>"
635
-				. $ligne
636
-				. "</a></td><td $style>"
637
-				. $col
638
-				. "</td><td>$msg</td></tr>\n";
639
-			$fautifs[] = array($ligne, $col, $i, $msg);
640
-		}
641
-		$err = "<h2 style='text-align: center'>"
642
-			. $i
643
-			. "<a href='#fin_err'>"
644
-			. " " . _T('erreur_texte')
645
-			. "</a></h2><table id='debut_err' style='width: 100%'>"
646
-			. $err
647
-			. " </table><a id='fin_err'></a>";
648
-
649
-		return array(ancre_texte($texte, $fautifs), $err);
650
-	} else {
651
-		list($msg, $fermant, $ouvrant) = $errs[0];
652
-		$rf = reference_boucle_debug($fermant, $fonc, $self);
653
-		$ro = reference_boucle_debug($ouvrant, $fonc, $self);
654
-		$err = $msg .
655
-			"<a href='#L" . $fermant . "'>$fermant</a>$rf<br />" .
656
-			"<a href='#L" . $ouvrant . "'>$ouvrant</a>$ro";
657
-
658
-		return array(ancre_texte($texte, array(array($ouvrant), array($fermant))), $err);
659
-	}
586
+    $errs = $res->err;
587
+    $texte = $res->entete . ($errs ? '' : $res->page);
588
+
589
+    if (!$texte and !$errs) {
590
+        return array(ancre_texte('', array('', '')), false);
591
+    }
592
+    if (!$errs) {
593
+        return array(ancre_texte($texte, array('', '')), true);
594
+    }
595
+
596
+    if (!isset($GLOBALS['debug_objets'])) {
597
+
598
+        $colors = array('#e0e0f0', '#f8f8ff');
599
+        $encore = count_occ($errs);
600
+        $encore2 = array();
601
+        $fautifs = array();
602
+
603
+        $err = '<tr><th>'
604
+            . _T('numero')
605
+            . "</th><th>"
606
+            . _T('occurence')
607
+            . "</th><th>"
608
+            . _T('ligne')
609
+            . "</th><th>"
610
+            . _T('colonne')
611
+            . "</th><th>"
612
+            . _T('erreur')
613
+            . "</th></tr>";
614
+
615
+        $i = 0;
616
+        $style = "style='text-align: right; padding-right: 5px'";
617
+        foreach ($errs as $r) {
618
+            $i++;
619
+            list($msg, $ligne, $col) = $r;
620
+            #spip_log("$r = list($msg, $ligne, $col");
621
+            if (isset($encore2[$msg])) {
622
+                $ref = ++$encore2[$msg];
623
+            } else {
624
+                $encore2[$msg] = $ref = 1;
625
+            }
626
+            $err .= "<tr  style='background-color: "
627
+                . $colors[$i % 2]
628
+                . "'><td $style><a href='#debut_err'>"
629
+                . $i
630
+                . "</a></td><td $style>"
631
+                . "$ref/$encore[$msg]</td>"
632
+                . "<td $style><a href='#L"
633
+                . $ligne
634
+                . "' id='T$i'>"
635
+                . $ligne
636
+                . "</a></td><td $style>"
637
+                . $col
638
+                . "</td><td>$msg</td></tr>\n";
639
+            $fautifs[] = array($ligne, $col, $i, $msg);
640
+        }
641
+        $err = "<h2 style='text-align: center'>"
642
+            . $i
643
+            . "<a href='#fin_err'>"
644
+            . " " . _T('erreur_texte')
645
+            . "</a></h2><table id='debut_err' style='width: 100%'>"
646
+            . $err
647
+            . " </table><a id='fin_err'></a>";
648
+
649
+        return array(ancre_texte($texte, $fautifs), $err);
650
+    } else {
651
+        list($msg, $fermant, $ouvrant) = $errs[0];
652
+        $rf = reference_boucle_debug($fermant, $fonc, $self);
653
+        $ro = reference_boucle_debug($ouvrant, $fonc, $self);
654
+        $err = $msg .
655
+            "<a href='#L" . $fermant . "'>$fermant</a>$rf<br />" .
656
+            "<a href='#L" . $ouvrant . "'>$ouvrant</a>$ro";
657
+
658
+        return array(ancre_texte($texte, array(array($ouvrant), array($fermant))), $err);
659
+    }
660 660
 }
661 661
 
662 662
 // https://code.spip.net/@count_occ
663 663
 function count_occ($regs) {
664
-	$encore = array();
665
-	foreach ($regs as $r) {
666
-		if (isset($encore[$r[0]])) {
667
-			$encore[$r[0]]++;
668
-		} else {
669
-			$encore[$r[0]] = 1;
670
-		}
671
-	}
672
-
673
-	return $encore;
664
+    $encore = array();
665
+    foreach ($regs as $r) {
666
+        if (isset($encore[$r[0]])) {
667
+            $encore[$r[0]]++;
668
+        } else {
669
+            $encore[$r[0]] = 1;
670
+        }
671
+    }
672
+
673
+    return $encore;
674 674
 }
675 675
 
676 676
 function debusquer_navigation_squelettes($self) {
677 677
 
678
-	$res = '';
679
-	$boucles = !empty($GLOBALS['debug_objets']['boucle']) ? $GLOBALS['debug_objets']['boucle'] : '';
680
-	$contexte = $GLOBALS['debug_objets']['contexte'];
681
-	$t_skel = _T('squelette');
682
-	foreach ($GLOBALS['debug_objets']['sourcefile'] as $nom => $sourcefile) {
683
-		$self2 = parametre_url($self, 'var_mode_objet', $nom);
684
-		$nav = !$boucles ? '' : debusquer_navigation_boucles($boucles, $nom, $self, $sourcefile);
685
-		$temps = !isset($GLOBALS['debug_objets']['profile'][$sourcefile]) ? '' : _T('zbug_profile',
686
-			array('time' => $GLOBALS['debug_objets']['profile'][$sourcefile]));
687
-
688
-		$res .= "<fieldset id='f_" . $nom . "'><legend>"
689
-			. $t_skel
690
-			. ' '
691
-			. $sourcefile
692
-			. "&nbsp;:\n<a href='$self2&amp;var_mode_affiche=squelette#f_$nom'>"
693
-			. $t_skel
694
-			. "</a>\n<a href='$self2&amp;var_mode_affiche=resultat#f_$nom'>"
695
-			. _T('zbug_resultat')
696
-			. "</a>\n<a href='$self2&amp;var_mode_affiche=code#f_$nom'>"
697
-			. _T('zbug_code')
698
-			. "</a>\n<a href='"
699
-			. str_replace('var_mode=debug', 'var_profile=1&amp;var_mode=recalcul', $self)
700
-			. "'>"
701
-			. _T('zbug_calcul')
702
-			. "</a></legend>"
703
-			. (!$temps ? '' : ("\n<span style='display:block;float:" . $GLOBALS['spip_lang_right'] . "'>$temps</span><br />"))
704
-			. debusquer_contexte($contexte[$sourcefile])
705
-		. (!$nav ? '' : ("<table width='100%'>\n$nav</table>\n"))
706
-		. "</fieldset>\n";
707
-	}
708
-
709
-	return $res;
678
+    $res = '';
679
+    $boucles = !empty($GLOBALS['debug_objets']['boucle']) ? $GLOBALS['debug_objets']['boucle'] : '';
680
+    $contexte = $GLOBALS['debug_objets']['contexte'];
681
+    $t_skel = _T('squelette');
682
+    foreach ($GLOBALS['debug_objets']['sourcefile'] as $nom => $sourcefile) {
683
+        $self2 = parametre_url($self, 'var_mode_objet', $nom);
684
+        $nav = !$boucles ? '' : debusquer_navigation_boucles($boucles, $nom, $self, $sourcefile);
685
+        $temps = !isset($GLOBALS['debug_objets']['profile'][$sourcefile]) ? '' : _T('zbug_profile',
686
+            array('time' => $GLOBALS['debug_objets']['profile'][$sourcefile]));
687
+
688
+        $res .= "<fieldset id='f_" . $nom . "'><legend>"
689
+            . $t_skel
690
+            . ' '
691
+            . $sourcefile
692
+            . "&nbsp;:\n<a href='$self2&amp;var_mode_affiche=squelette#f_$nom'>"
693
+            . $t_skel
694
+            . "</a>\n<a href='$self2&amp;var_mode_affiche=resultat#f_$nom'>"
695
+            . _T('zbug_resultat')
696
+            . "</a>\n<a href='$self2&amp;var_mode_affiche=code#f_$nom'>"
697
+            . _T('zbug_code')
698
+            . "</a>\n<a href='"
699
+            . str_replace('var_mode=debug', 'var_profile=1&amp;var_mode=recalcul', $self)
700
+            . "'>"
701
+            . _T('zbug_calcul')
702
+            . "</a></legend>"
703
+            . (!$temps ? '' : ("\n<span style='display:block;float:" . $GLOBALS['spip_lang_right'] . "'>$temps</span><br />"))
704
+            . debusquer_contexte($contexte[$sourcefile])
705
+        . (!$nav ? '' : ("<table width='100%'>\n$nav</table>\n"))
706
+        . "</fieldset>\n";
707
+    }
708
+
709
+    return $res;
710 710
 }
711 711
 
712 712
 function debusquer_navigation_boucles($boucles, $nom_skel, $self, $nom_source) {
713
-	$i = 0;
714
-	$res = '';
715
-	$var_mode_objet = _request('var_mode_objet');
716
-	$gram = preg_match('/[.](\w+)$/', $nom_source, $r) ? $r[1] : '';
717
-
718
-	foreach ($boucles as $objet => $boucle) {
719
-		if (substr($objet, 0, strlen($nom_skel)) == $nom_skel) {
720
-			$i++;
721
-			$nom = $boucle->id_boucle;
722
-			$req = $boucle->type_requete;
723
-			$crit = public_decompiler($boucle, $gram, 0, 'criteres');
724
-			$self2 = $self . "&amp;var_mode_objet=" . $objet;
725
-
726
-			$res .= "\n<tr style='background-color: " .
727
-				($i % 2 ? '#e0e0f0' : '#f8f8ff') .
728
-				"'><td  align='right'>$i</td><td>\n" .
729
-				"<a  class='debug_link_boucle' href='" .
730
-				$self2 .
731
-				"&amp;var_mode_affiche=boucle#f_$nom_skel'>" .
732
-				_T('zbug_boucle') .
733
-				"</a></td><td>\n<a class='debug_link_boucle' href='" .
734
-				$self2 .
735
-				"&amp;var_mode_affiche=resultat#f_$nom_skel'>" .
736
-				_T('zbug_resultat') .
737
-				"</a></td><td>\n<a class='debug_link_resultat' href='" .
738
-				$self2 .
739
-				"&amp;var_mode_affiche=code#f_$nom_skel'>" .
740
-				_T('zbug_code') .
741
-				"</a></td><td>\n<a class='debug_link_resultat' href='" .
742
-				str_replace('var_mode=', 'var_profile=', $self2) .
743
-				"'>" .
744
-				_T('zbug_calcul') .
745
-				"</a></td><td>\n" .
746
-				(($var_mode_objet == $objet) ? "<b>$nom</b>" : $nom) .
747
-				"</td><td>\n" .
748
-				$req .
749
-				"</td><td>\n" .
750
-				spip_htmlspecialchars($crit) .
751
-				"</td></tr>";
752
-		}
753
-	}
754
-
755
-	return $res;
713
+    $i = 0;
714
+    $res = '';
715
+    $var_mode_objet = _request('var_mode_objet');
716
+    $gram = preg_match('/[.](\w+)$/', $nom_source, $r) ? $r[1] : '';
717
+
718
+    foreach ($boucles as $objet => $boucle) {
719
+        if (substr($objet, 0, strlen($nom_skel)) == $nom_skel) {
720
+            $i++;
721
+            $nom = $boucle->id_boucle;
722
+            $req = $boucle->type_requete;
723
+            $crit = public_decompiler($boucle, $gram, 0, 'criteres');
724
+            $self2 = $self . "&amp;var_mode_objet=" . $objet;
725
+
726
+            $res .= "\n<tr style='background-color: " .
727
+                ($i % 2 ? '#e0e0f0' : '#f8f8ff') .
728
+                "'><td  align='right'>$i</td><td>\n" .
729
+                "<a  class='debug_link_boucle' href='" .
730
+                $self2 .
731
+                "&amp;var_mode_affiche=boucle#f_$nom_skel'>" .
732
+                _T('zbug_boucle') .
733
+                "</a></td><td>\n<a class='debug_link_boucle' href='" .
734
+                $self2 .
735
+                "&amp;var_mode_affiche=resultat#f_$nom_skel'>" .
736
+                _T('zbug_resultat') .
737
+                "</a></td><td>\n<a class='debug_link_resultat' href='" .
738
+                $self2 .
739
+                "&amp;var_mode_affiche=code#f_$nom_skel'>" .
740
+                _T('zbug_code') .
741
+                "</a></td><td>\n<a class='debug_link_resultat' href='" .
742
+                str_replace('var_mode=', 'var_profile=', $self2) .
743
+                "'>" .
744
+                _T('zbug_calcul') .
745
+                "</a></td><td>\n" .
746
+                (($var_mode_objet == $objet) ? "<b>$nom</b>" : $nom) .
747
+                "</td><td>\n" .
748
+                $req .
749
+                "</td><td>\n" .
750
+                spip_htmlspecialchars($crit) .
751
+                "</td></tr>";
752
+        }
753
+    }
754
+
755
+    return $res;
756 756
 }
757 757
 
758 758
 function debusquer_source($objet, $affiche) {
759
-	$quoi = $GLOBALS['debug_objets'][$affiche][$objet];
760
-	if (!empty($GLOBALS['debug_objets']['boucle'][$objet]->id_boucle)) {
761
-		$nom = $GLOBALS['debug_objets']['boucle'][$objet]->id_boucle;
762
-	} else {
763
-		$nom = $GLOBALS['debug_objets']['sourcefile'][$objet];
764
-	}
765
-	$res2 = "";
766
-
767
-	if ($affiche == 'resultat') {
768
-		$legend = $nom;
769
-		$req = $GLOBALS['debug_objets']['requete'][$objet];
770
-		if (function_exists('_mysql_traite_query')) {
771
-			$c = strtolower(_request('connect'));
772
-			$c = $GLOBALS['connexions'][$c ? $c : 0]['prefixe'];
773
-			$req = _mysql_traite_query($req, '', $c);
774
-		}
775
-		//  permettre le copier/coller facile
776
-		// $res = ancre_texte($req, array(), true);
777
-		$res = "<div id='T" . md5($req) . "'>\n<pre>\n" . $req . "</pre>\n</div>\n";
778
-		//  formatage et affichage des resultats bruts de la requete
779
-		$ress_req = spip_query($req);
780
-		$brut_sql = '';
781
-		$num = 1;
782
-		//  eviter l'affichage de milliers de lignes
783
-		//  personnalisation possible dans mes_options
784
-		$max_aff = defined('_MAX_DEBUG_AFF') ? _MAX_DEBUG_AFF : 50;
785
-		while ($retours_sql = sql_fetch($ress_req)) {
786
-			if ($num <= $max_aff) {
787
-				$brut_sql .= "<h3>" . ($num == 1 ? $num . " sur " . sql_count($ress_req) : $num) . "</h3>";
788
-				$brut_sql .= "<p>";
789
-				foreach ($retours_sql as $key => $val) {
790
-					$brut_sql .= "<strong>" . $key . "</strong> => " . spip_htmlspecialchars(couper($val, 150)) . "<br />\n";
791
-				}
792
-				$brut_sql .= "</p>";
793
-			}
794
-			$num++;
795
-		}
796
-		$res2 = interdire_scripts($brut_sql);
797
-		foreach ($quoi as $view) {
798
-			//  ne pas afficher les $contexte_inclus
799
-			$view = preg_replace(",<\?php.+\?[>],Uims", "", $view);
800
-			if ($view) {
801
-				$res2 .= "\n<br /><fieldset>" . interdire_scripts($view) . "</fieldset>";
802
-			}
803
-		}
804
-
805
-	} elseif ($affiche == 'code') {
806
-		$legend = $nom;
807
-		$res = ancre_texte("<" . "?php\n" . $quoi . "\n?" . ">");
808
-	} elseif ($affiche == 'boucle') {
809
-		$legend = _T('zbug_boucle') . ' ' . $nom;
810
-		// Le compilateur prefixe le nom des boucles par l'extension du fichier source.
811
-		$gram = preg_match('/^([^_]+)_/', $objet, $r) ? $r[1] : '';
812
-		$res = ancre_texte(public_decompiler($quoi, $gram, 0, 'boucle'));
813
-	} elseif ($affiche == 'squelette') {
814
-		$legend = $GLOBALS['debug_objets']['sourcefile'][$objet];
815
-		$res = ancre_texte($GLOBALS['debug_objets']['squelette'][$objet]);
816
-	}
817
-
818
-	return array($legend, $res, $res2);
759
+    $quoi = $GLOBALS['debug_objets'][$affiche][$objet];
760
+    if (!empty($GLOBALS['debug_objets']['boucle'][$objet]->id_boucle)) {
761
+        $nom = $GLOBALS['debug_objets']['boucle'][$objet]->id_boucle;
762
+    } else {
763
+        $nom = $GLOBALS['debug_objets']['sourcefile'][$objet];
764
+    }
765
+    $res2 = "";
766
+
767
+    if ($affiche == 'resultat') {
768
+        $legend = $nom;
769
+        $req = $GLOBALS['debug_objets']['requete'][$objet];
770
+        if (function_exists('_mysql_traite_query')) {
771
+            $c = strtolower(_request('connect'));
772
+            $c = $GLOBALS['connexions'][$c ? $c : 0]['prefixe'];
773
+            $req = _mysql_traite_query($req, '', $c);
774
+        }
775
+        //  permettre le copier/coller facile
776
+        // $res = ancre_texte($req, array(), true);
777
+        $res = "<div id='T" . md5($req) . "'>\n<pre>\n" . $req . "</pre>\n</div>\n";
778
+        //  formatage et affichage des resultats bruts de la requete
779
+        $ress_req = spip_query($req);
780
+        $brut_sql = '';
781
+        $num = 1;
782
+        //  eviter l'affichage de milliers de lignes
783
+        //  personnalisation possible dans mes_options
784
+        $max_aff = defined('_MAX_DEBUG_AFF') ? _MAX_DEBUG_AFF : 50;
785
+        while ($retours_sql = sql_fetch($ress_req)) {
786
+            if ($num <= $max_aff) {
787
+                $brut_sql .= "<h3>" . ($num == 1 ? $num . " sur " . sql_count($ress_req) : $num) . "</h3>";
788
+                $brut_sql .= "<p>";
789
+                foreach ($retours_sql as $key => $val) {
790
+                    $brut_sql .= "<strong>" . $key . "</strong> => " . spip_htmlspecialchars(couper($val, 150)) . "<br />\n";
791
+                }
792
+                $brut_sql .= "</p>";
793
+            }
794
+            $num++;
795
+        }
796
+        $res2 = interdire_scripts($brut_sql);
797
+        foreach ($quoi as $view) {
798
+            //  ne pas afficher les $contexte_inclus
799
+            $view = preg_replace(",<\?php.+\?[>],Uims", "", $view);
800
+            if ($view) {
801
+                $res2 .= "\n<br /><fieldset>" . interdire_scripts($view) . "</fieldset>";
802
+            }
803
+        }
804
+
805
+    } elseif ($affiche == 'code') {
806
+        $legend = $nom;
807
+        $res = ancre_texte("<" . "?php\n" . $quoi . "\n?" . ">");
808
+    } elseif ($affiche == 'boucle') {
809
+        $legend = _T('zbug_boucle') . ' ' . $nom;
810
+        // Le compilateur prefixe le nom des boucles par l'extension du fichier source.
811
+        $gram = preg_match('/^([^_]+)_/', $objet, $r) ? $r[1] : '';
812
+        $res = ancre_texte(public_decompiler($quoi, $gram, 0, 'boucle'));
813
+    } elseif ($affiche == 'squelette') {
814
+        $legend = $GLOBALS['debug_objets']['sourcefile'][$objet];
815
+        $res = ancre_texte($GLOBALS['debug_objets']['squelette'][$objet]);
816
+    }
817
+
818
+    return array($legend, $res, $res2);
819 819
 }
820 820
 
821 821
 // https://code.spip.net/@debusquer_entete
822 822
 function debusquer_entete($titre, $corps) {
823 823
 
824
-	include_spip('balise/formulaire_admin');
825
-	include_spip('public/assembler'); // pour inclure_balise_dynamique
826
-	include_spip('inc/texte'); // pour corriger_typo
827
-
828
-	return _DOCTYPE_ECRIRE .
829
-	html_lang_attributes() .
830
-	"<head>\n<title>" .
831
-	('SPIP ' . $GLOBALS['spip_version_affichee'] . ' ' .
832
-		_T('admin_debug') . ' ' . $titre . ' (' .
833
-		supprimer_tags(corriger_typo($GLOBALS['meta']['nom_site']))) .
834
-	")</title>\n" .
835
-	"<meta http-equiv='Content-Type' content='text/html" .
836
-	(($c = $GLOBALS['meta']['charset']) ? "; charset=$c" : '') .
837
-	"' />\n" .
838
-	http_script('', 'jquery.js')
839
-	. "<link rel='stylesheet' href='" . url_absolue(find_in_path('spip_admin.css'))
840
-	. "' type='text/css' />" .
841
-	"</head>\n" .
842
-	"<body style='margin:0 10px;'>\n" .
843
-	"<div id='spip-debug-header'>" .
844
-	$corps .
845
-	inclure_balise_dynamique(balise_FORMULAIRE_ADMIN_dyn('spip-admin-float', $GLOBALS['debug_objets']), false) .
846
-	'</div></body></html>';
824
+    include_spip('balise/formulaire_admin');
825
+    include_spip('public/assembler'); // pour inclure_balise_dynamique
826
+    include_spip('inc/texte'); // pour corriger_typo
827
+
828
+    return _DOCTYPE_ECRIRE .
829
+    html_lang_attributes() .
830
+    "<head>\n<title>" .
831
+    ('SPIP ' . $GLOBALS['spip_version_affichee'] . ' ' .
832
+        _T('admin_debug') . ' ' . $titre . ' (' .
833
+        supprimer_tags(corriger_typo($GLOBALS['meta']['nom_site']))) .
834
+    ")</title>\n" .
835
+    "<meta http-equiv='Content-Type' content='text/html" .
836
+    (($c = $GLOBALS['meta']['charset']) ? "; charset=$c" : '') .
837
+    "' />\n" .
838
+    http_script('', 'jquery.js')
839
+    . "<link rel='stylesheet' href='" . url_absolue(find_in_path('spip_admin.css'))
840
+    . "' type='text/css' />" .
841
+    "</head>\n" .
842
+    "<body style='margin:0 10px;'>\n" .
843
+    "<div id='spip-debug-header'>" .
844
+    $corps .
845
+    inclure_balise_dynamique(balise_FORMULAIRE_ADMIN_dyn('spip-admin-float', $GLOBALS['debug_objets']), false) .
846
+    '</div></body></html>';
847 847
 }
Please login to merge, or discard this patch.
ecrire/action/relancer_inscription.php 1 patch
Indentation   +18 added lines, -18 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
 /**
@@ -26,22 +26,22 @@  discard block
 block discarded – undo
26 26
  * @return void
27 27
  */
28 28
 function action_relancer_inscription_dist() {
29
-	$securiser_action = charger_fonction('securiser_action', 'inc');
30
-	$id_auteur = $securiser_action();
29
+    $securiser_action = charger_fonction('securiser_action', 'inc');
30
+    $id_auteur = $securiser_action();
31 31
 
32
-	if (intval($id_auteur) and autoriser('relancer', 'inscription')) {
33
-		$auteur = sql_fetsel('prefs, email, nom, statut', 'spip_auteurs', "id_auteur=$id_auteur");
34
-		if ($auteur['statut'] == 'nouveau') {
35
-			include_spip('action/inscrire_auteur');
36
-			action_inscrire_auteur_dist($auteur['prefs'], $auteur['email'], $auteur['nom'], array('force_nouveau' => true));
37
-		}
38
-	} elseif ($id_auteur === '*' and autoriser('relancer', 'inscription')) {
39
-		$auteurs = sql_allfetsel('prefs, email, nom', 'spip_auteurs', "statut='nouveau'");
40
-		if (is_array($auteurs)) {
41
-			include_spip('action/inscrire_auteur');
42
-			while ($row = array_pop($auteurs)) {
43
-				action_inscrire_auteur_dist($row['prefs'], $row['email'], $row['nom'], array('force_nouveau' => true));
44
-			}
45
-		}
46
-	}
32
+    if (intval($id_auteur) and autoriser('relancer', 'inscription')) {
33
+        $auteur = sql_fetsel('prefs, email, nom, statut', 'spip_auteurs', "id_auteur=$id_auteur");
34
+        if ($auteur['statut'] == 'nouveau') {
35
+            include_spip('action/inscrire_auteur');
36
+            action_inscrire_auteur_dist($auteur['prefs'], $auteur['email'], $auteur['nom'], array('force_nouveau' => true));
37
+        }
38
+    } elseif ($id_auteur === '*' and autoriser('relancer', 'inscription')) {
39
+        $auteurs = sql_allfetsel('prefs, email, nom', 'spip_auteurs', "statut='nouveau'");
40
+        if (is_array($auteurs)) {
41
+            include_spip('action/inscrire_auteur');
42
+            while ($row = array_pop($auteurs)) {
43
+                action_inscrire_auteur_dist($row['prefs'], $row['email'], $row['nom'], array('force_nouveau' => true));
44
+            }
45
+        }
46
+    }
47 47
 }
Please login to merge, or discard this patch.
ecrire/lang/ecrire_it_fem.php 1 patch
Indentation   +683 added lines, -683 removed lines patch added patch discarded remove patch
@@ -4,364 +4,364 @@  discard block
 block discarded – undo
4 4
 // ** ne pas modifier le fichier **
5 5
 
6 6
 if (!defined('_ECRIRE_INC_VERSION')) {
7
-	return;
7
+    return;
8 8
 }
9 9
 
10 10
 $GLOBALS[$GLOBALS['idx_lang']] = array(
11 11
 
12
-	// A
13
-	'activer_plugin' => 'Attiva il plugin',
14
-	'affichage' => 'Visualizzazione',
15
-	'aide_non_disponible' => 'Questa parte della guida in linea non è ancora disponibile in italiano.',
16
-	'annuler_recherche' => 'Annullare la ricerca',
17
-	'auteur' => 'Autrice:',
18
-	'avis_acces_interdit' => 'Accesso vietato.',
19
-	'avis_article_modifie' => 'Attenzione, @nom_auteur_modif@ ha lavorato su quest’articolo @date_diff@ minuti fa',
20
-	'avis_aucun_resultat' => 'Nessun risultato.',
21
-	'avis_base_inaccessible' => 'Impossibile connettersi al database @base@.',
22
-	'avis_chemin_invalide_1' => 'il percorso che hai scelto',
23
-	'avis_chemin_invalide_2' => 'non sembra valido. Torna alla pagina precedente e verifica le informazioni fornite.',
24
-	'avis_connexion_echec_1' => 'il collegamento alla base di dati è fallito.',
25
-	'avis_connexion_echec_2' => 'torna alla pagina precedente e verifica le informazioni fornite.',
26
-	'avis_connexion_echec_3' => '<b>N.B.</b> Spesso sul server si deve <b>chiedere</b> l’attivazione dell’accesso alla base di dati prima di poterlo utilizzare. Se è impossibile collegarsi, verificare la configurazione per la connessione con l’amministratrice del sistema.',
27
-	'avis_connexion_erreur_nom_base' => 'Il nome del database può contenere solo lettere, cifre e tratti',
28
-	'avis_connexion_ldap_echec_1' => 'La connessione al server LDAP è fallita.',
29
-	'avis_connexion_ldap_echec_2' => 'Torna alla pagina precedente e verifica le informazioni fornite. ',
30
-	'avis_connexion_ldap_echec_3' => 'In alternativa, non utilizzare il supporto LDAP per importare utenti.',
31
-	'avis_deplacement_rubrique' => 'Attenzione! Questa rubrica contiene @contient_breves@ breve/i: se vuoi spostarla, spunta questa casella per confermare.',
32
-	'avis_erreur_connexion_mysql' => 'Errore di connessione SQL',
33
-	'avis_espace_interdit' => '<b>Area vietata</b> <div>SPIP è già installato.</div>',
34
-	'avis_lecture_noms_bases_1' => 'Il programma di installazione non ha potuto leggere i nomi dei database installati nel server.',
35
-	'avis_lecture_noms_bases_2' => 'Nessun database è disponibile, o la funzione che permette di accedere alla lista database è
12
+    // A
13
+    'activer_plugin' => 'Attiva il plugin',
14
+    'affichage' => 'Visualizzazione',
15
+    'aide_non_disponible' => 'Questa parte della guida in linea non è ancora disponibile in italiano.',
16
+    'annuler_recherche' => 'Annullare la ricerca',
17
+    'auteur' => 'Autrice:',
18
+    'avis_acces_interdit' => 'Accesso vietato.',
19
+    'avis_article_modifie' => 'Attenzione, @nom_auteur_modif@ ha lavorato su quest’articolo @date_diff@ minuti fa',
20
+    'avis_aucun_resultat' => 'Nessun risultato.',
21
+    'avis_base_inaccessible' => 'Impossibile connettersi al database @base@.',
22
+    'avis_chemin_invalide_1' => 'il percorso che hai scelto',
23
+    'avis_chemin_invalide_2' => 'non sembra valido. Torna alla pagina precedente e verifica le informazioni fornite.',
24
+    'avis_connexion_echec_1' => 'il collegamento alla base di dati è fallito.',
25
+    'avis_connexion_echec_2' => 'torna alla pagina precedente e verifica le informazioni fornite.',
26
+    'avis_connexion_echec_3' => '<b>N.B.</b> Spesso sul server si deve <b>chiedere</b> l’attivazione dell’accesso alla base di dati prima di poterlo utilizzare. Se è impossibile collegarsi, verificare la configurazione per la connessione con l’amministratrice del sistema.',
27
+    'avis_connexion_erreur_nom_base' => 'Il nome del database può contenere solo lettere, cifre e tratti',
28
+    'avis_connexion_ldap_echec_1' => 'La connessione al server LDAP è fallita.',
29
+    'avis_connexion_ldap_echec_2' => 'Torna alla pagina precedente e verifica le informazioni fornite. ',
30
+    'avis_connexion_ldap_echec_3' => 'In alternativa, non utilizzare il supporto LDAP per importare utenti.',
31
+    'avis_deplacement_rubrique' => 'Attenzione! Questa rubrica contiene @contient_breves@ breve/i: se vuoi spostarla, spunta questa casella per confermare.',
32
+    'avis_erreur_connexion_mysql' => 'Errore di connessione SQL',
33
+    'avis_espace_interdit' => '<b>Area vietata</b> <div>SPIP è già installato.</div>',
34
+    'avis_lecture_noms_bases_1' => 'Il programma di installazione non ha potuto leggere i nomi dei database installati nel server.',
35
+    'avis_lecture_noms_bases_2' => 'Nessun database è disponibile, o la funzione che permette di accedere alla lista database è
36 36
 disattivata per motivi sicurezza (verifica con l’amministratrice di sistema).',
37
-	'avis_lecture_noms_bases_3' => 'Nel secondo caso, è probabile che un database con il tuo nome di login sia utilizzabile:',
38
-	'avis_non_acces_page' => 'Non hai accesso a questa pagina.',
39
-	'avis_operation_echec' => 'L’operazione è fallita.',
40
-	'avis_operation_impossible' => 'Operazione impossibile',
41
-	'avis_suppression_base' => 'ATTENZIONE, la cancellazione dei dati è irreversibile',
37
+    'avis_lecture_noms_bases_3' => 'Nel secondo caso, è probabile che un database con il tuo nome di login sia utilizzabile:',
38
+    'avis_non_acces_page' => 'Non hai accesso a questa pagina.',
39
+    'avis_operation_echec' => 'L’operazione è fallita.',
40
+    'avis_operation_impossible' => 'Operazione impossibile',
41
+    'avis_suppression_base' => 'ATTENZIONE, la cancellazione dei dati è irreversibile',
42 42
 
43
-	// B
44
-	'bouton_acces_ldap' => 'Aggiungi l’accesso a LDAP',
45
-	'bouton_ajouter' => 'Aggiungi',
46
-	'bouton_annuler' => 'Annulla',
47
-	'bouton_cache_activer' => 'Riattivare la cache',
48
-	'bouton_cache_desactiver' => 'Disattivare temporaneamente la cache',
49
-	'bouton_demande_publication' => 'Chiedi la pubblicazione di questo articolo',
50
-	'bouton_desactive_tout' => 'Disattiva tutto',
51
-	'bouton_desinstaller' => 'Disinstalla',
52
-	'bouton_effacer_tout' => 'Cancella TUTTO',
53
-	'bouton_envoyer_message' => 'Messaggio definitivo: Invia',
54
-	'bouton_fermer' => 'Chiudere',
55
-	'bouton_mettre_a_jour_base' => 'Aggiornare il database',
56
-	'bouton_modifier' => 'Modifica',
57
-	'bouton_radio_afficher' => 'Visualizza',
58
-	'bouton_radio_apparaitre_liste_redacteurs_connectes' => 'Comparire nell’elenco delle redattrici collegate',
59
-	'bouton_radio_envoi_annonces_adresse' => 'Invia gli annunci all’indirizzo:',
60
-	'bouton_radio_envoi_liste_nouveautes' => 'Invia l’elenco delle novità',
61
-	'bouton_radio_non_apparaitre_liste_redacteurs_connectes' => 'Non comparire nell’elenco delle redattrici collegate ',
62
-	'bouton_radio_non_envoi_annonces_editoriales' => 'Non inviare annunci editoriali ',
63
-	'bouton_redirection' => 'REINDIRIZZAMENTO',
64
-	'bouton_relancer_installation' => 'Rilanciare l’installazione',
65
-	'bouton_suivant' => 'Avanti',
66
-	'bouton_tenter_recuperation' => 'Tentare un ripristino',
67
-	'bouton_test_proxy' => 'Testare il proxy',
68
-	'bouton_vider_cache' => 'Svuota la cache',
43
+    // B
44
+    'bouton_acces_ldap' => 'Aggiungi l’accesso a LDAP',
45
+    'bouton_ajouter' => 'Aggiungi',
46
+    'bouton_annuler' => 'Annulla',
47
+    'bouton_cache_activer' => 'Riattivare la cache',
48
+    'bouton_cache_desactiver' => 'Disattivare temporaneamente la cache',
49
+    'bouton_demande_publication' => 'Chiedi la pubblicazione di questo articolo',
50
+    'bouton_desactive_tout' => 'Disattiva tutto',
51
+    'bouton_desinstaller' => 'Disinstalla',
52
+    'bouton_effacer_tout' => 'Cancella TUTTO',
53
+    'bouton_envoyer_message' => 'Messaggio definitivo: Invia',
54
+    'bouton_fermer' => 'Chiudere',
55
+    'bouton_mettre_a_jour_base' => 'Aggiornare il database',
56
+    'bouton_modifier' => 'Modifica',
57
+    'bouton_radio_afficher' => 'Visualizza',
58
+    'bouton_radio_apparaitre_liste_redacteurs_connectes' => 'Comparire nell’elenco delle redattrici collegate',
59
+    'bouton_radio_envoi_annonces_adresse' => 'Invia gli annunci all’indirizzo:',
60
+    'bouton_radio_envoi_liste_nouveautes' => 'Invia l’elenco delle novità',
61
+    'bouton_radio_non_apparaitre_liste_redacteurs_connectes' => 'Non comparire nell’elenco delle redattrici collegate ',
62
+    'bouton_radio_non_envoi_annonces_editoriales' => 'Non inviare annunci editoriali ',
63
+    'bouton_redirection' => 'REINDIRIZZAMENTO',
64
+    'bouton_relancer_installation' => 'Rilanciare l’installazione',
65
+    'bouton_suivant' => 'Avanti',
66
+    'bouton_tenter_recuperation' => 'Tentare un ripristino',
67
+    'bouton_test_proxy' => 'Testare il proxy',
68
+    'bouton_vider_cache' => 'Svuota la cache',
69 69
 
70
-	// C
71
-	'cache_modifiable_webmestre' => 'Questo parametro può essere modificato dalla webmistress del sito.',
72
-	'calendrier_synchro' => 'Se si utilizza un programma di agenda compatibile con <b>iCal</b>, è possibile sincronizzare i dati con le informazioni di questo sito',
73
-	'config_activer_champs' => 'Attiva i campi seguenti',
74
-	'config_choix_base_sup' => 'indicare un database su questo server',
75
-	'config_erreur_base_sup' => 'SPIP non ha accesso all’elenco dei database accessibili ',
76
-	'config_info_base_sup' => 'Se si hanno altri database da interrogare attraverso SPIP, con il proprio server SQL o altro, il form sottostante permette di dichiararli. Se si lasciano alcuni campi vuoti verranno utilizzati i dati della connessione al database principale.',
77
-	'config_info_base_sup_disponibles' => 'Database supplementari già dichiarati:',
78
-	'config_info_enregistree' => 'La nuova configurazione è stata registrata',
79
-	'config_info_logos' => 'Ogni elemento del sito può avere un logo, come pure un « logo per il roll-over »',
80
-	'config_info_logos_utiliser' => 'Utilizza i logo',
81
-	'config_info_logos_utiliser_non' => 'Non utilizzare i logo',
82
-	'config_info_logos_utiliser_survol' => 'Utilizzare i logo di roll-over',
83
-	'config_info_logos_utiliser_survol_non' => 'Non utilizzare i logo di roll-over',
84
-	'config_info_redirection' => 'Attivando questa opzione è possibile creare degli articoli virtuali, semplici riferimenti di articoli pubblicati su altri siti o al di fuori di SPIP.',
85
-	'config_redirection' => 'Articoli virtuali',
86
-	'config_titre_base_sup' => 'Dichiarazione di un database supplementare',
87
-	'config_titre_base_sup_choix' => 'Scegliere un database supplementare',
88
-	'connexion_ldap' => 'Connessione:',
89
-	'creer_et_associer_un_auteur' => 'Creare ed associare un’autrice',
70
+    // C
71
+    'cache_modifiable_webmestre' => 'Questo parametro può essere modificato dalla webmistress del sito.',
72
+    'calendrier_synchro' => 'Se si utilizza un programma di agenda compatibile con <b>iCal</b>, è possibile sincronizzare i dati con le informazioni di questo sito',
73
+    'config_activer_champs' => 'Attiva i campi seguenti',
74
+    'config_choix_base_sup' => 'indicare un database su questo server',
75
+    'config_erreur_base_sup' => 'SPIP non ha accesso all’elenco dei database accessibili ',
76
+    'config_info_base_sup' => 'Se si hanno altri database da interrogare attraverso SPIP, con il proprio server SQL o altro, il form sottostante permette di dichiararli. Se si lasciano alcuni campi vuoti verranno utilizzati i dati della connessione al database principale.',
77
+    'config_info_base_sup_disponibles' => 'Database supplementari già dichiarati:',
78
+    'config_info_enregistree' => 'La nuova configurazione è stata registrata',
79
+    'config_info_logos' => 'Ogni elemento del sito può avere un logo, come pure un « logo per il roll-over »',
80
+    'config_info_logos_utiliser' => 'Utilizza i logo',
81
+    'config_info_logos_utiliser_non' => 'Non utilizzare i logo',
82
+    'config_info_logos_utiliser_survol' => 'Utilizzare i logo di roll-over',
83
+    'config_info_logos_utiliser_survol_non' => 'Non utilizzare i logo di roll-over',
84
+    'config_info_redirection' => 'Attivando questa opzione è possibile creare degli articoli virtuali, semplici riferimenti di articoli pubblicati su altri siti o al di fuori di SPIP.',
85
+    'config_redirection' => 'Articoli virtuali',
86
+    'config_titre_base_sup' => 'Dichiarazione di un database supplementare',
87
+    'config_titre_base_sup_choix' => 'Scegliere un database supplementare',
88
+    'connexion_ldap' => 'Connessione:',
89
+    'creer_et_associer_un_auteur' => 'Creare ed associare un’autrice',
90 90
 
91
-	// D
92
-	'date_mot_heures' => 'ore',
91
+    // D
92
+    'date_mot_heures' => 'ore',
93 93
 
94
-	// E
95
-	'ecran_securite' => ' + schermo di sicurezza @version@', # RELIRE
96
-	'email' => 'email',
97
-	'email_2' => 'email:',
98
-	'en_savoir_plus' => 'Ulteriori informazioni', # RELIRE
99
-	'entree_adresse_annuaire' => 'Indirizzo della rubrica',
100
-	'entree_adresse_email' => 'Il tuo indirizzo email',
101
-	'entree_adresse_email_2' => 'Indirizzo email',
102
-	'entree_base_donnee_1' => 'Indirizzo del database',
103
-	'entree_base_donnee_2' => '(Spesso questo indirizzo coincide con quello dell’intero sito, qualche volta corrisponde a "localhost", altre volte invece non è necessario specificarlo.)',
104
-	'entree_biographie' => 'La tua biografia in breve.',
105
-	'entree_chemin_acces' => '<b>Inserire</b> il percorso d’accesso:',
106
-	'entree_cle_pgp' => 'Chiave PGP',
107
-	'entree_cle_pgp_2' => 'Autenticazione', # RELIRE
108
-	'entree_contenu_rubrique' => '(Contenuto della rubrica in qualche parola)',
109
-	'entree_identifiants_connexion' => 'Identificativo di connessione...',
110
-	'entree_identifiants_connexion_2' => 'Identificativo', # RELIRE
111
-	'entree_informations_connexion_ldap' => 'Inserisci in questo form gli estremi per la connessione alla tua rubrica LDAP.
94
+    // E
95
+    'ecran_securite' => ' + schermo di sicurezza @version@', # RELIRE
96
+    'email' => 'email',
97
+    'email_2' => 'email:',
98
+    'en_savoir_plus' => 'Ulteriori informazioni', # RELIRE
99
+    'entree_adresse_annuaire' => 'Indirizzo della rubrica',
100
+    'entree_adresse_email' => 'Il tuo indirizzo email',
101
+    'entree_adresse_email_2' => 'Indirizzo email',
102
+    'entree_base_donnee_1' => 'Indirizzo del database',
103
+    'entree_base_donnee_2' => '(Spesso questo indirizzo coincide con quello dell’intero sito, qualche volta corrisponde a "localhost", altre volte invece non è necessario specificarlo.)',
104
+    'entree_biographie' => 'La tua biografia in breve.',
105
+    'entree_chemin_acces' => '<b>Inserire</b> il percorso d’accesso:',
106
+    'entree_cle_pgp' => 'Chiave PGP',
107
+    'entree_cle_pgp_2' => 'Autenticazione', # RELIRE
108
+    'entree_contenu_rubrique' => '(Contenuto della rubrica in qualche parola)',
109
+    'entree_identifiants_connexion' => 'Identificativo di connessione...',
110
+    'entree_identifiants_connexion_2' => 'Identificativo', # RELIRE
111
+    'entree_informations_connexion_ldap' => 'Inserisci in questo form gli estremi per la connessione alla tua rubrica LDAP.
112 112
 Se non conosci queste informazioni, richiedile all’amministratrice del sistema o della rete.',
113
-	'entree_infos_perso' => 'Chi sei?',
114
-	'entree_infos_perso_2' => 'Chi è l’autrice ?',
115
-	'entree_interieur_rubrique' => 'All’interno della rubrica:',
116
-	'entree_liens_sites' => '<b>Link ipertestuale</b> (riferimento, sito da visitare...)',
117
-	'entree_login' => 'Login',
118
-	'entree_login_connexion_1' => 'Il login di connessione',
119
-	'entree_login_connexion_2' => '(Corrisponde a volte al login d’accesso via FTP; in alcuni casi non occorre specificare nulla)',
120
-	'entree_mot_passe' => 'Password',
121
-	'entree_mot_passe_1' => 'La password di connessione',
122
-	'entree_mot_passe_2' => '(Corrisponde a volte alla password d’accesso via FTP; in alcuni casi non occorre specificare nulla)',
123
-	'entree_nom_fichier' => 'Inserire il nome del file @texte_compresse@:',
124
-	'entree_nom_pseudo' => 'Nome o pseudonimo',
125
-	'entree_nom_pseudo_1' => '(Nome o pseudonimo)',
126
-	'entree_nom_pseudo_2' => 'Nome o pseudonimo',
127
-	'entree_nom_site' => 'Nome del tuo sito',
128
-	'entree_nom_site_2' => 'Nome del sito dell’autrice', # RELIRE
129
-	'entree_nouveau_passe' => 'Nuova password',
130
-	'entree_passe_ldap' => 'Password',
131
-	'entree_port_annuaire' => 'Il numero di porta della rubrica',
132
-	'entree_signature' => 'Firma',
133
-	'entree_titre_obligatoire' => '<b>Titolo</b> [Obbligatorio]<br />',
134
-	'entree_url' => 'Indirizzo (URL) del sito',
135
-	'entree_url_2' => 'Indirizzo (URL) del sito',
136
-	'erreur_connect_deja_existant' => 'Esiste già un server con questo nome', # RELIRE
137
-	'erreur_email_deja_existant' => 'Questo indirizzo email è già registrato',
138
-	'erreur_nom_connect_incorrect' => 'Questo nome non è autorizzato', # RELIRE
139
-	'erreur_plugin_desinstalation_echouee' => 'La disinstallazione del plug in è fallita. E’ comunque possibile disattivarlo.', # RELIRE
140
-	'erreur_plugin_fichier_absent' => 'File non presente',
141
-	'erreur_plugin_fichier_def_absent' => 'File di definizioni non presente',
142
-	'erreur_plugin_nom_fonction_interdit' => 'Nome di funzione non possibile',
143
-	'erreur_plugin_nom_manquant' => 'Nome del plugin mancante',
144
-	'erreur_plugin_prefix_manquant' => 'Spazio per il nome del plugin non definito',
145
-	'erreur_plugin_tag_plugin_absent' => '&lt;plugin&gt; mancante nel file di definizione',
146
-	'erreur_plugin_version_manquant' => 'Versione del plugin mancante',
113
+    'entree_infos_perso' => 'Chi sei?',
114
+    'entree_infos_perso_2' => 'Chi è l’autrice ?',
115
+    'entree_interieur_rubrique' => 'All’interno della rubrica:',
116
+    'entree_liens_sites' => '<b>Link ipertestuale</b> (riferimento, sito da visitare...)',
117
+    'entree_login' => 'Login',
118
+    'entree_login_connexion_1' => 'Il login di connessione',
119
+    'entree_login_connexion_2' => '(Corrisponde a volte al login d’accesso via FTP; in alcuni casi non occorre specificare nulla)',
120
+    'entree_mot_passe' => 'Password',
121
+    'entree_mot_passe_1' => 'La password di connessione',
122
+    'entree_mot_passe_2' => '(Corrisponde a volte alla password d’accesso via FTP; in alcuni casi non occorre specificare nulla)',
123
+    'entree_nom_fichier' => 'Inserire il nome del file @texte_compresse@:',
124
+    'entree_nom_pseudo' => 'Nome o pseudonimo',
125
+    'entree_nom_pseudo_1' => '(Nome o pseudonimo)',
126
+    'entree_nom_pseudo_2' => 'Nome o pseudonimo',
127
+    'entree_nom_site' => 'Nome del tuo sito',
128
+    'entree_nom_site_2' => 'Nome del sito dell’autrice', # RELIRE
129
+    'entree_nouveau_passe' => 'Nuova password',
130
+    'entree_passe_ldap' => 'Password',
131
+    'entree_port_annuaire' => 'Il numero di porta della rubrica',
132
+    'entree_signature' => 'Firma',
133
+    'entree_titre_obligatoire' => '<b>Titolo</b> [Obbligatorio]<br />',
134
+    'entree_url' => 'Indirizzo (URL) del sito',
135
+    'entree_url_2' => 'Indirizzo (URL) del sito',
136
+    'erreur_connect_deja_existant' => 'Esiste già un server con questo nome', # RELIRE
137
+    'erreur_email_deja_existant' => 'Questo indirizzo email è già registrato',
138
+    'erreur_nom_connect_incorrect' => 'Questo nome non è autorizzato', # RELIRE
139
+    'erreur_plugin_desinstalation_echouee' => 'La disinstallazione del plug in è fallita. E’ comunque possibile disattivarlo.', # RELIRE
140
+    'erreur_plugin_fichier_absent' => 'File non presente',
141
+    'erreur_plugin_fichier_def_absent' => 'File di definizioni non presente',
142
+    'erreur_plugin_nom_fonction_interdit' => 'Nome di funzione non possibile',
143
+    'erreur_plugin_nom_manquant' => 'Nome del plugin mancante',
144
+    'erreur_plugin_prefix_manquant' => 'Spazio per il nome del plugin non definito',
145
+    'erreur_plugin_tag_plugin_absent' => '&lt;plugin&gt; mancante nel file di definizione',
146
+    'erreur_plugin_version_manquant' => 'Versione del plugin mancante',
147 147
 
148
-	// H
149
-	'htaccess_a_simuler' => 'Attenzione: la configurazione del vostro server HTTP non tiene conto dei file @htaccess@. Per poter mettere in sicurezza bisognerà modificare la configurazione di questo punto, oppure sarà necessario che i parametri fissi @constantes@ (definiti nel file le_mie_opzioni.php) abbiano i valore dei registri diversi da @document_root@.', # RELIRE
148
+    // H
149
+    'htaccess_a_simuler' => 'Attenzione: la configurazione del vostro server HTTP non tiene conto dei file @htaccess@. Per poter mettere in sicurezza bisognerà modificare la configurazione di questo punto, oppure sarà necessario che i parametri fissi @constantes@ (definiti nel file le_mie_opzioni.php) abbiano i valore dei registri diversi da @document_root@.', # RELIRE
150 150
 
151
-	// I
152
-	'ical_info1' => 'Questa pagina elenca diversi metodi per rimanere in contatto con le varie attività del sito.',
153
-	'ical_info2' => 'Per ulteriori informazioni su tutte queste tecniche, non esitate a consultare <a href="@spipnet@">la documentazione di SPIP</a>.',
154
-	'ical_info_calendrier' => 'Sono disponibili due calendari. Il primo è una mappa del sito che annuncia tutti gli articoli pubblicati. Il secondo contiene gli annunci editoriali e gli ultimi messaggi privati: è un’area riservata, mediante identificativo personale, che è possibile modificare in qualsiasi momento rinnovando la password personale.',
155
-	'ical_methode_http' => 'Download',
156
-	'ical_methode_webcal' => 'Sincronizzazione (webcal://)',
157
-	'ical_texte_js' => 'Una linea in javascript permette di visualizzare, con molta semplicità e su qualsiasi tipo di sito, gli articoli recenti pubblicati su questo sito.',
158
-	'ical_texte_prive' => 'Questo calendario, ad uso strettamente privato, dà informazioni sull’attività redazionale privata di questo sito (impegni e appuntamenti personali, articoli e brevi proposti...).',
159
-	'ical_texte_public' => 'Questo calendario permette di monitorare l’attività pubblica del sito (articoli e brevi pubblicati).',
160
-	'ical_texte_rss' => 'È possibile mettere in syndication le novità di questo sito con qualsiasi lettore di file in formato XML/RSS (Rich Site Summary). Questo è il medesimo formato che permette a SPIP di leggere le novità pubblicate su altri siti che utilizzano un formato di scambio compatibile.',
161
-	'ical_titre_js' => 'Javascript',
162
-	'ical_titre_mailing' => 'Mailing-list',
163
-	'ical_titre_rss' => 'File di syndication',
164
-	'icone_activer_cookie' => 'Attiva il cookie di corrispondenza',
165
-	'icone_activite' => 'Attività',
166
-	'icone_admin_plugin' => 'Gestione dei plugin',
167
-	'icone_afficher_auteurs' => 'Pubblica le autrici',
168
-	'icone_afficher_visiteurs' => 'Pubblica i visitatori',
169
-	'icone_arret_discussion' => 'Non partecipare più a questa discussione',
170
-	'icone_calendrier' => 'Calendario',
171
-	'icone_creer_auteur' => 'Crea una nuova autrice ed associala a questo articolo',
172
-	'icone_creer_mot_cle' => 'Crea una nuova parola chiave e collegala a questo articolo',
173
-	'icone_creer_rubrique_2' => 'Crea una nuova rubrica',
174
-	'icone_ma_langue' => 'La mia lingua',
175
-	'icone_mes_infos' => 'Le mie informazioni',
176
-	'icone_modifier_article' => 'Modifica l’articolo',
177
-	'icone_modifier_rubrique' => 'Modifica la rubrica',
178
-	'icone_relancer_signataire' => 'Rilanciare il firmatario',
179
-	'icone_retour' => 'Indietro',
180
-	'icone_retour_article' => 'Torna all’articolo',
181
-	'icone_supprimer_cookie' => 'Elimina il cookie di corrispondenza',
182
-	'icone_supprimer_rubrique' => 'Elimina la rubrica',
183
-	'icone_supprimer_signature' => 'Cancella l’adesione',
184
-	'icone_valider_signature' => 'Conferma l’adesione',
185
-	'image_administrer_rubrique' => 'Puoi amministrare questa rubrica',
186
-	'impossible_modifier_login_auteur' => 'Impossible de modifier le login.', # MODIF
187
-	'impossible_modifier_pass_auteur' => 'Impossible de modifier le mot de passe.', # MODIF
188
-	'info_1_article' => '1 articolo',
189
-	'info_activer_cookie' => 'Se vuoi puoi attivare un <b>cookie di corrispondenza</b>, che ti permetterà
151
+    // I
152
+    'ical_info1' => 'Questa pagina elenca diversi metodi per rimanere in contatto con le varie attività del sito.',
153
+    'ical_info2' => 'Per ulteriori informazioni su tutte queste tecniche, non esitate a consultare <a href="@spipnet@">la documentazione di SPIP</a>.',
154
+    'ical_info_calendrier' => 'Sono disponibili due calendari. Il primo è una mappa del sito che annuncia tutti gli articoli pubblicati. Il secondo contiene gli annunci editoriali e gli ultimi messaggi privati: è un’area riservata, mediante identificativo personale, che è possibile modificare in qualsiasi momento rinnovando la password personale.',
155
+    'ical_methode_http' => 'Download',
156
+    'ical_methode_webcal' => 'Sincronizzazione (webcal://)',
157
+    'ical_texte_js' => 'Una linea in javascript permette di visualizzare, con molta semplicità e su qualsiasi tipo di sito, gli articoli recenti pubblicati su questo sito.',
158
+    'ical_texte_prive' => 'Questo calendario, ad uso strettamente privato, dà informazioni sull’attività redazionale privata di questo sito (impegni e appuntamenti personali, articoli e brevi proposti...).',
159
+    'ical_texte_public' => 'Questo calendario permette di monitorare l’attività pubblica del sito (articoli e brevi pubblicati).',
160
+    'ical_texte_rss' => 'È possibile mettere in syndication le novità di questo sito con qualsiasi lettore di file in formato XML/RSS (Rich Site Summary). Questo è il medesimo formato che permette a SPIP di leggere le novità pubblicate su altri siti che utilizzano un formato di scambio compatibile.',
161
+    'ical_titre_js' => 'Javascript',
162
+    'ical_titre_mailing' => 'Mailing-list',
163
+    'ical_titre_rss' => 'File di syndication',
164
+    'icone_activer_cookie' => 'Attiva il cookie di corrispondenza',
165
+    'icone_activite' => 'Attività',
166
+    'icone_admin_plugin' => 'Gestione dei plugin',
167
+    'icone_afficher_auteurs' => 'Pubblica le autrici',
168
+    'icone_afficher_visiteurs' => 'Pubblica i visitatori',
169
+    'icone_arret_discussion' => 'Non partecipare più a questa discussione',
170
+    'icone_calendrier' => 'Calendario',
171
+    'icone_creer_auteur' => 'Crea una nuova autrice ed associala a questo articolo',
172
+    'icone_creer_mot_cle' => 'Crea una nuova parola chiave e collegala a questo articolo',
173
+    'icone_creer_rubrique_2' => 'Crea una nuova rubrica',
174
+    'icone_ma_langue' => 'La mia lingua',
175
+    'icone_mes_infos' => 'Le mie informazioni',
176
+    'icone_modifier_article' => 'Modifica l’articolo',
177
+    'icone_modifier_rubrique' => 'Modifica la rubrica',
178
+    'icone_relancer_signataire' => 'Rilanciare il firmatario',
179
+    'icone_retour' => 'Indietro',
180
+    'icone_retour_article' => 'Torna all’articolo',
181
+    'icone_supprimer_cookie' => 'Elimina il cookie di corrispondenza',
182
+    'icone_supprimer_rubrique' => 'Elimina la rubrica',
183
+    'icone_supprimer_signature' => 'Cancella l’adesione',
184
+    'icone_valider_signature' => 'Conferma l’adesione',
185
+    'image_administrer_rubrique' => 'Puoi amministrare questa rubrica',
186
+    'impossible_modifier_login_auteur' => 'Impossible de modifier le login.', # MODIF
187
+    'impossible_modifier_pass_auteur' => 'Impossible de modifier le mot de passe.', # MODIF
188
+    'info_1_article' => '1 articolo',
189
+    'info_activer_cookie' => 'Se vuoi puoi attivare un <b>cookie di corrispondenza</b>, che ti permetterà
190 190
 di passare facilmente dal sito pubblico all’interfaccia privata.',
191
-	'info_administrateur' => 'Amministratrice',
192
-	'info_administrateur_1' => 'Amministratrice',
193
-	'info_administrateur_2' => 'del sito (<i>da utilizzare con prudenza</i>)',
194
-	'info_administrateur_site_01' => 'Se sei amministratrice del sito,',
195
-	'info_administrateur_site_02' => 'clicca qui',
196
-	'info_administrateurs' => 'Amministratrici',
197
-	'info_administrer_rubrique' => 'Puoi amministrare questa rubrica',
198
-	'info_adresse' => 'all’indirizzo:',
199
-	'info_adresse_url' => 'Indirizzo (URL) del sito pubblico',
200
-	'info_aide_en_ligne' => 'Guida in linea SPIP',
201
-	'info_ajout_image' => 'Quando aggiungi delle immagini come documenti allegati ad un articolo,
191
+    'info_administrateur' => 'Amministratrice',
192
+    'info_administrateur_1' => 'Amministratrice',
193
+    'info_administrateur_2' => 'del sito (<i>da utilizzare con prudenza</i>)',
194
+    'info_administrateur_site_01' => 'Se sei amministratrice del sito,',
195
+    'info_administrateur_site_02' => 'clicca qui',
196
+    'info_administrateurs' => 'Amministratrici',
197
+    'info_administrer_rubrique' => 'Puoi amministrare questa rubrica',
198
+    'info_adresse' => 'all’indirizzo:',
199
+    'info_adresse_url' => 'Indirizzo (URL) del sito pubblico',
200
+    'info_aide_en_ligne' => 'Guida in linea SPIP',
201
+    'info_ajout_image' => 'Quando aggiungi delle immagini come documenti allegati ad un articolo,
202 202
 SPIP può creare  delle thumbnail (miniature) delle
203 203
 immagini inserite. Ciò permette ad esempio di creare in automatico una galleria di immagini o un portfolio.',
204
-	'info_ajouter_rubrique' => 'Aggiungi un’altra rubrica da amministrare:',
205
-	'info_annonce_nouveautes' => 'Annuncio delle novità',
206
-	'info_article' => 'articolo',
207
-	'info_article_2' => 'articoli',
208
-	'info_article_a_paraitre' => 'Gli articoli postdatati da pubblicare',
209
-	'info_articles_02' => 'articoli',
210
-	'info_articles_2' => 'Articoli',
211
-	'info_articles_auteur' => 'Articoli di questo autore',
212
-	'info_articles_trouves' => 'Articoli trovati',
213
-	'info_attente_validation' => 'I tuoi articoli in attesa di convalida',
214
-	'info_aujourdhui' => 'oggi: ',
215
-	'info_auteurs' => 'Le autrici',
216
-	'info_auteurs_par_tri' => 'Autrici@partri@',
217
-	'info_auteurs_trouves' => 'Autrici trovate',
218
-	'info_authentification_externe' => 'Autenticazione esterna',
219
-	'info_avertissement' => 'Avvertimento',
220
-	'info_barre_outils' => 'con la barra degli strumenti?',
221
-	'info_base_installee' => 'La struttura del vostro database è installata.',
222
-	'info_chapeau' => 'Introduzione',
223
-	'info_chapeau_2' => 'Introduzione:',
224
-	'info_chemin_acces_1' => 'Opzioni: <b>Percorso d’accesso ai dati nell’elenco</b>',
225
-	'info_chemin_acces_2' => 'È necessario specificare il percorso per accedere ai dati nell’elenco. Questa informazione è indispensabile al fine di leggere i profili utente in esso contenuti.',
226
-	'info_chemin_acces_annuaire' => 'Opzioni: <b>Percorso d’accesso ai dati nell’elenco',
227
-	'info_choix_base' => 'Terza fase: ',
228
-	'info_classement_1' => '<sup>o</sup> su @liste@',
229
-	'info_classement_2' => '<sup>o</sup> su @liste@',
230
-	'info_code_acces' => 'Non dimenticare i tuoi codici d’accesso!',
231
-	'info_config_suivi' => 'Se questo indirizzo corrisponde a una mailing-list, è possibile indicare qui sotto l’indirizzo al quale i partecipanti del sito possono iscriversi. Questo indirizzo può essere una URL (per esempio la pagina di iscrizione via Web alla lista), oppure un indirizzo email che contiene un Oggetto specifico (per esempio: <tt>@adresse_suivi@?subject=subscribe</tt>):',
232
-	'info_config_suivi_explication' => 'È possibile abbonarsi alla mailing-list di questo sito. Verranno spedite per email le notifiche degli articoli e delle brevi proposte per la pubblicazione.',
233
-	'info_confirmer_passe' => 'Conferma la nuova password:',
234
-	'info_conflit_edition_avis_non_sauvegarde' => 'Attenzione, i campi seguenti sono già stati modificati. Quindi le vostre modifiche su questi campi non sono state registrate.',
235
-	'info_conflit_edition_differences' => 'Differenze:',
236
-	'info_conflit_edition_version_enregistree' => 'La versione registrata:',
237
-	'info_conflit_edition_votre_version' => 'La tua versione:',
238
-	'info_connexion_base' => 'Prova di connessione al database',
239
-	'info_connexion_base_donnee' => 'Connessione al proprio database',
240
-	'info_connexion_ldap_ok' => 'La connessione LDAP è riuscita.</b><p> È possibile passare alla fase successiva.</p>',
241
-	'info_connexion_mysql' => 'La connessione a SQL',
242
-	'info_connexion_ok' => 'La connessione è riuscita.',
243
-	'info_contact' => 'Contatti',
244
-	'info_contenu_articles' => 'Contentuto degli articoli',
245
-	'info_creation_paragraphe' => 'Per creare dei paragrafi indipendenti, lasciare delle righe vuote.', # RELIRE
246
-	'info_creation_rubrique' => 'Prima di poter scrivere degli articoli, <br />devi creare almeno una rubrica.<br />',
247
-	'info_creation_tables' => 'Creazione delle tabelle nel database',
248
-	'info_creer_base' => '<b>Creare</b> un nuovo database:',
249
-	'info_dans_rubrique' => 'Nella rubrica:',
250
-	'info_date_publication_anterieure' => 'Data di redazione anteriore:',
251
-	'info_date_referencement' => 'DATA DI INSERIMENTO IN REPERTORIO DI QUESTO SITO:',
252
-	'info_derniere_etape' => 'Finito!',
253
-	'info_descriptif' => 'Descrizione:',
254
-	'info_desinstaller_plugin' => 'elimina i dati e disattiva il plug-in',
255
-	'info_discussion_cours' => 'Discussioni in corso',
256
-	'info_ecrire_article' => 'Prima di poter scrivere degli articoli, devi creare almeno una rubrica.',
257
-	'info_email_envoi' => 'Indirizzo email del mittente (opzionale)',
258
-	'info_email_envoi_txt' => 'Indicare qui l’indirizzo da utilizzare per l’invio degli email (come impostazione predefinita l’indirizzo del destinatario sarà utilizzato come indirizzo del mittente):',
259
-	'info_email_webmestre' => 'Indirizzo email della webmistress', # RELIRE
260
-	'info_envoi_email_automatique' => 'Invio di email automatico',
261
-	'info_envoyer_maintenant' => 'Invia adesso',
262
-	'info_etape_suivante' => 'Passare alla fase successiva',
263
-	'info_etape_suivante_1' => 'Puoi passare alla fase successiva.',
264
-	'info_etape_suivante_2' => 'Puoi passare alla fase successiva.',
265
-	'info_exportation_base' => 'esportazione del database verso @archive@',
266
-	'info_facilite_suivi_activite' => 'Al fine di facilitare il monitoraggio
204
+    'info_ajouter_rubrique' => 'Aggiungi un’altra rubrica da amministrare:',
205
+    'info_annonce_nouveautes' => 'Annuncio delle novità',
206
+    'info_article' => 'articolo',
207
+    'info_article_2' => 'articoli',
208
+    'info_article_a_paraitre' => 'Gli articoli postdatati da pubblicare',
209
+    'info_articles_02' => 'articoli',
210
+    'info_articles_2' => 'Articoli',
211
+    'info_articles_auteur' => 'Articoli di questo autore',
212
+    'info_articles_trouves' => 'Articoli trovati',
213
+    'info_attente_validation' => 'I tuoi articoli in attesa di convalida',
214
+    'info_aujourdhui' => 'oggi: ',
215
+    'info_auteurs' => 'Le autrici',
216
+    'info_auteurs_par_tri' => 'Autrici@partri@',
217
+    'info_auteurs_trouves' => 'Autrici trovate',
218
+    'info_authentification_externe' => 'Autenticazione esterna',
219
+    'info_avertissement' => 'Avvertimento',
220
+    'info_barre_outils' => 'con la barra degli strumenti?',
221
+    'info_base_installee' => 'La struttura del vostro database è installata.',
222
+    'info_chapeau' => 'Introduzione',
223
+    'info_chapeau_2' => 'Introduzione:',
224
+    'info_chemin_acces_1' => 'Opzioni: <b>Percorso d’accesso ai dati nell’elenco</b>',
225
+    'info_chemin_acces_2' => 'È necessario specificare il percorso per accedere ai dati nell’elenco. Questa informazione è indispensabile al fine di leggere i profili utente in esso contenuti.',
226
+    'info_chemin_acces_annuaire' => 'Opzioni: <b>Percorso d’accesso ai dati nell’elenco',
227
+    'info_choix_base' => 'Terza fase: ',
228
+    'info_classement_1' => '<sup>o</sup> su @liste@',
229
+    'info_classement_2' => '<sup>o</sup> su @liste@',
230
+    'info_code_acces' => 'Non dimenticare i tuoi codici d’accesso!',
231
+    'info_config_suivi' => 'Se questo indirizzo corrisponde a una mailing-list, è possibile indicare qui sotto l’indirizzo al quale i partecipanti del sito possono iscriversi. Questo indirizzo può essere una URL (per esempio la pagina di iscrizione via Web alla lista), oppure un indirizzo email che contiene un Oggetto specifico (per esempio: <tt>@adresse_suivi@?subject=subscribe</tt>):',
232
+    'info_config_suivi_explication' => 'È possibile abbonarsi alla mailing-list di questo sito. Verranno spedite per email le notifiche degli articoli e delle brevi proposte per la pubblicazione.',
233
+    'info_confirmer_passe' => 'Conferma la nuova password:',
234
+    'info_conflit_edition_avis_non_sauvegarde' => 'Attenzione, i campi seguenti sono già stati modificati. Quindi le vostre modifiche su questi campi non sono state registrate.',
235
+    'info_conflit_edition_differences' => 'Differenze:',
236
+    'info_conflit_edition_version_enregistree' => 'La versione registrata:',
237
+    'info_conflit_edition_votre_version' => 'La tua versione:',
238
+    'info_connexion_base' => 'Prova di connessione al database',
239
+    'info_connexion_base_donnee' => 'Connessione al proprio database',
240
+    'info_connexion_ldap_ok' => 'La connessione LDAP è riuscita.</b><p> È possibile passare alla fase successiva.</p>',
241
+    'info_connexion_mysql' => 'La connessione a SQL',
242
+    'info_connexion_ok' => 'La connessione è riuscita.',
243
+    'info_contact' => 'Contatti',
244
+    'info_contenu_articles' => 'Contentuto degli articoli',
245
+    'info_creation_paragraphe' => 'Per creare dei paragrafi indipendenti, lasciare delle righe vuote.', # RELIRE
246
+    'info_creation_rubrique' => 'Prima di poter scrivere degli articoli, <br />devi creare almeno una rubrica.<br />',
247
+    'info_creation_tables' => 'Creazione delle tabelle nel database',
248
+    'info_creer_base' => '<b>Creare</b> un nuovo database:',
249
+    'info_dans_rubrique' => 'Nella rubrica:',
250
+    'info_date_publication_anterieure' => 'Data di redazione anteriore:',
251
+    'info_date_referencement' => 'DATA DI INSERIMENTO IN REPERTORIO DI QUESTO SITO:',
252
+    'info_derniere_etape' => 'Finito!',
253
+    'info_descriptif' => 'Descrizione:',
254
+    'info_desinstaller_plugin' => 'elimina i dati e disattiva il plug-in',
255
+    'info_discussion_cours' => 'Discussioni in corso',
256
+    'info_ecrire_article' => 'Prima di poter scrivere degli articoli, devi creare almeno una rubrica.',
257
+    'info_email_envoi' => 'Indirizzo email del mittente (opzionale)',
258
+    'info_email_envoi_txt' => 'Indicare qui l’indirizzo da utilizzare per l’invio degli email (come impostazione predefinita l’indirizzo del destinatario sarà utilizzato come indirizzo del mittente):',
259
+    'info_email_webmestre' => 'Indirizzo email della webmistress', # RELIRE
260
+    'info_envoi_email_automatique' => 'Invio di email automatico',
261
+    'info_envoyer_maintenant' => 'Invia adesso',
262
+    'info_etape_suivante' => 'Passare alla fase successiva',
263
+    'info_etape_suivante_1' => 'Puoi passare alla fase successiva.',
264
+    'info_etape_suivante_2' => 'Puoi passare alla fase successiva.',
265
+    'info_exportation_base' => 'esportazione del database verso @archive@',
266
+    'info_facilite_suivi_activite' => 'Al fine di facilitare il monitoraggio
267 267
 dell’attività editoriale del sito, SPIP può far pervenire via email,
268 268
 per esempio ad una mailing-list delle redattrici, l’annuncio delle domande di
269 269
 pubblicazione e di convalida degli articoli.',
270
-	'info_fichiers_authent' => 'File d’autenticazione ".htpasswd"',
271
-	'info_forums_abo_invites' => 'Il sito comprende dei forum accessibili solo a utenti registrate. Nel sito pubblico è quindi presente una pagina d’iscrizione.',
272
-	'info_gauche_admin_tech' => '<b>Questa pagina è accessibile solo alle responsabili del sito.</b><p> Permette l’accesso alle diverse funzioni di manutenzione tecnica. Alcune di esse richiedono una procedura di identificazione specifica, tramite accesso FTP.</p>', # RELIRE
273
-	'info_gauche_admin_vider' => '<b>Questa pagina è accessibile solo alle responsabili del sito.</b><p> Permette l’accesso alle diverse funzioni di manutenzione tecnica. Alcune di esse richiedono una procedura di identificazione specifica, tramite accesso FTP.</p>', # RELIRE
274
-	'info_gauche_auteurs' => 'Elenco di tutte le autrici del sito.
270
+    'info_fichiers_authent' => 'File d’autenticazione ".htpasswd"',
271
+    'info_forums_abo_invites' => 'Il sito comprende dei forum accessibili solo a utenti registrate. Nel sito pubblico è quindi presente una pagina d’iscrizione.',
272
+    'info_gauche_admin_tech' => '<b>Questa pagina è accessibile solo alle responsabili del sito.</b><p> Permette l’accesso alle diverse funzioni di manutenzione tecnica. Alcune di esse richiedono una procedura di identificazione specifica, tramite accesso FTP.</p>', # RELIRE
273
+    'info_gauche_admin_vider' => '<b>Questa pagina è accessibile solo alle responsabili del sito.</b><p> Permette l’accesso alle diverse funzioni di manutenzione tecnica. Alcune di esse richiedono una procedura di identificazione specifica, tramite accesso FTP.</p>', # RELIRE
274
+    'info_gauche_auteurs' => 'Elenco di tutte le autrici del sito.
275 275
 Il loro status è indicato dal colore dell’icona (redattrice = giallo; amministratrice = verde).',
276
-	'info_gauche_auteurs_exterieurs' => 'Le autrici esterne, senza accesso al sito, sono indicate da un’icona blu;
276
+    'info_gauche_auteurs_exterieurs' => 'Le autrici esterne, senza accesso al sito, sono indicate da un’icona blu;
277 277
                 le autrici eliminate sono indicate da un’icona grigia.', # RELIRE
278
-	'info_gauche_messagerie' => 'Il sistema di messaggistica permette di scambiare dei messaggi tra redattrici, di conservare dei memo (promemoria ad uso personale) o di pubblicare degli annunci nel pannello di controllo dell’area riservata (se sei amministratrice).',
279
-	'info_gauche_statistiques_referers' => 'Questa pagina presenta un elenco dei siti che contengono link verso il tuo (<i>referrer</i>). Questo elenco è valido però solo per oggi essendo azzerato ogni 24 ore.',
280
-	'info_gauche_visiteurs_enregistres' => 'Trovi qui i visitatori registrati allo spazio
278
+    'info_gauche_messagerie' => 'Il sistema di messaggistica permette di scambiare dei messaggi tra redattrici, di conservare dei memo (promemoria ad uso personale) o di pubblicare degli annunci nel pannello di controllo dell’area riservata (se sei amministratrice).',
279
+    'info_gauche_statistiques_referers' => 'Questa pagina presenta un elenco dei siti che contengono link verso il tuo (<i>referrer</i>). Questo elenco è valido però solo per oggi essendo azzerato ogni 24 ore.',
280
+    'info_gauche_visiteurs_enregistres' => 'Trovi qui i visitatori registrati allo spazio
281 281
 pubblico del sito (forum su abbonamento).',
282
-	'info_generation_miniatures_images' => 'Generazione di thumbnail di immagini',
283
-	'info_hebergeur_desactiver_envoi_email' => 'Alcuni hoster disattivano l’invio automatico di email
282
+    'info_generation_miniatures_images' => 'Generazione di thumbnail di immagini',
283
+    'info_hebergeur_desactiver_envoi_email' => 'Alcuni hoster disattivano l’invio automatico di email
284 284
 dai loro server. In questo caso, le funzionalità di SPIP di seguito riportate non funzioneranno.',
285
-	'info_hier' => 'ieri:',
286
-	'info_identification_publique' => 'La tua identità pubblica...',
287
-	'info_image_process' => 'Seleziona il metodo migliore per la creazione delle anteprime cliccando sull’immagine corrispondente.',
288
-	'info_image_process2' => 'Se non appare alcuna immagine, ciò significa che la configurazione del server non permette l’uso di tali funzioni. Se si desidera utilizzarle, contattate la responsabile tecnica chiedendo delle estensioni "GD" o "Imagick".', # RELIRE
289
-	'info_images_auto' => 'Immagini elaborate automaticamente',
290
-	'info_informations_personnelles' => 'Informazioni personali',
291
-	'info_inscription_automatique' => 'Iscrizione automatica di nuove redattrici',
292
-	'info_jeu_caractere' => 'Set di caratteri del sito',
293
-	'info_jours' => 'giorni',
294
-	'info_laisser_champs_vides' => 'lasciare questi campi vuoti)',
295
-	'info_langues' => 'Lingua del sito',
296
-	'info_ldap_ok' => 'L’autenticazione LDAP è installata.',
297
-	'info_lien_hypertexte' => 'Link ipertestuale:',
298
-	'info_liste_redacteurs_connectes' => 'Elenco delle redattrici collegate',
299
-	'info_login_existant' => 'Questo login esiste già.',
300
-	'info_login_trop_court' => 'Login troppo corto.',
301
-	'info_logos' => 'I logo',
302
-	'info_maximum' => 'massimo:',
303
-	'info_meme_rubrique' => 'Nella stessa rubrica',
304
-	'info_message_en_redaction' => 'I tuoi messaggi in corso di redazione',
305
-	'info_message_technique' => 'Messaggio tecnico:',
306
-	'info_messagerie_interne' => 'Sistema di messaggistica interna',
307
-	'info_mise_a_niveau_base' => 'aggiornamento del database SQL',
308
-	'info_mise_a_niveau_base_2' => '{{Attenzione!}} È stata installata una versione
285
+    'info_hier' => 'ieri:',
286
+    'info_identification_publique' => 'La tua identità pubblica...',
287
+    'info_image_process' => 'Seleziona il metodo migliore per la creazione delle anteprime cliccando sull’immagine corrispondente.',
288
+    'info_image_process2' => 'Se non appare alcuna immagine, ciò significa che la configurazione del server non permette l’uso di tali funzioni. Se si desidera utilizzarle, contattate la responsabile tecnica chiedendo delle estensioni "GD" o "Imagick".', # RELIRE
289
+    'info_images_auto' => 'Immagini elaborate automaticamente',
290
+    'info_informations_personnelles' => 'Informazioni personali',
291
+    'info_inscription_automatique' => 'Iscrizione automatica di nuove redattrici',
292
+    'info_jeu_caractere' => 'Set di caratteri del sito',
293
+    'info_jours' => 'giorni',
294
+    'info_laisser_champs_vides' => 'lasciare questi campi vuoti)',
295
+    'info_langues' => 'Lingua del sito',
296
+    'info_ldap_ok' => 'L’autenticazione LDAP è installata.',
297
+    'info_lien_hypertexte' => 'Link ipertestuale:',
298
+    'info_liste_redacteurs_connectes' => 'Elenco delle redattrici collegate',
299
+    'info_login_existant' => 'Questo login esiste già.',
300
+    'info_login_trop_court' => 'Login troppo corto.',
301
+    'info_logos' => 'I logo',
302
+    'info_maximum' => 'massimo:',
303
+    'info_meme_rubrique' => 'Nella stessa rubrica',
304
+    'info_message_en_redaction' => 'I tuoi messaggi in corso di redazione',
305
+    'info_message_technique' => 'Messaggio tecnico:',
306
+    'info_messagerie_interne' => 'Sistema di messaggistica interna',
307
+    'info_mise_a_niveau_base' => 'aggiornamento del database SQL',
308
+    'info_mise_a_niveau_base_2' => '{{Attenzione!}} È stata installata una versione
309 309
 dei file di SPIP {precedente} rispetto a quella che era in uso per questo sito:
310 310
 le informazioni contenute nel database sono probabilmente andate perse.<br />{{Reinstallare i file di SPIP.}}',
311
-	'info_modifier_auteur' => 'Modifica l’autrice:',
312
-	'info_modifier_rubrique' => 'Modifica la rubrica:',
313
-	'info_modifier_titre' => 'Modifica: @titre@',
314
-	'info_mon_site_spip' => 'Il mio sito SPIP',
315
-	'info_moyenne' => 'media: ',
316
-	'info_multi_cet_article' => 'Lingua di questo articolo:',
317
-	'info_multi_langues_choisies' => 'Selezionare di seguito le lingue disponibili per le redattrici del sito.
311
+    'info_modifier_auteur' => 'Modifica l’autrice:',
312
+    'info_modifier_rubrique' => 'Modifica la rubrica:',
313
+    'info_modifier_titre' => 'Modifica: @titre@',
314
+    'info_mon_site_spip' => 'Il mio sito SPIP',
315
+    'info_moyenne' => 'media: ',
316
+    'info_multi_cet_article' => 'Lingua di questo articolo:',
317
+    'info_multi_langues_choisies' => 'Selezionare di seguito le lingue disponibili per le redattrici del sito.
318 318
   Le lingue già utilizzate nel sito (visualizzate per prime) non possono essere disattivate.',
319
-	'info_multi_secteurs' => '... solo per le rubriche collocate nella {root} del sito?',
320
-	'info_nom' => 'Nome',
321
-	'info_nom_destinataire' => 'Nome del destinatario',
322
-	'info_nom_site' => 'Nome del tuo sito',
323
-	'info_nombre_articles' => '@nb_articles@ articoli,',
324
-	'info_nombre_rubriques' => '@nb_rubriques@ rubriche,',
325
-	'info_nombre_sites' => '@nb_sites@ siti, ',
326
-	'info_non_deplacer' => 'Non spostare...',
327
-	'info_non_envoi_annonce_dernieres_nouveautes' => 'SPIP può inviare regolarmente annunci sulle ultime novità del sito
319
+    'info_multi_secteurs' => '... solo per le rubriche collocate nella {root} del sito?',
320
+    'info_nom' => 'Nome',
321
+    'info_nom_destinataire' => 'Nome del destinatario',
322
+    'info_nom_site' => 'Nome del tuo sito',
323
+    'info_nombre_articles' => '@nb_articles@ articoli,',
324
+    'info_nombre_rubriques' => '@nb_rubriques@ rubriche,',
325
+    'info_nombre_sites' => '@nb_sites@ siti, ',
326
+    'info_non_deplacer' => 'Non spostare...',
327
+    'info_non_envoi_annonce_dernieres_nouveautes' => 'SPIP può inviare regolarmente annunci sulle ultime novità del sito
328 328
 (articoli e brevi recentemente pubblicati).',
329
-	'info_non_envoi_liste_nouveautes' => 'Non inviare l’elenco delle novità',
330
-	'info_non_modifiable' => 'non può essere modificato',
331
-	'info_non_suppression_mot_cle' => 'non voglio cancellare questa parola chiave.',
332
-	'info_notes' => 'Note',
333
-	'info_nouvel_article' => 'Nuovo articolo',
334
-	'info_nouvelle_traduction' => 'Nuova traduzione:',
335
-	'info_numero_article' => 'ARTICOLO NUMERO:',
336
-	'info_obligatoire_02' => '(obbligatorio)', # MODIF
337
-	'info_option_accepter_visiteurs' => 'Accetta l’iscrizione di utenti del sito pubblico',
338
-	'info_option_ne_pas_accepter_visiteurs' => 'Rifiuta l’iscrizione di utenti',
339
-	'info_options_avancees' => 'OPZIONE AVANZATA',
340
-	'info_ou' => 'o... ',
341
-	'info_page_interdite' => 'Pagina riservata',
342
-	'info_par_nom' => 'per nome',
343
-	'info_par_nombre_article' => 'per numero di articoli',
344
-	'info_par_statut' => 'per status',
345
-	'info_par_tri' => '’(per @tri@)’',
346
-	'info_passe_trop_court' => 'Password troppo corta.',
347
-	'info_passes_identiques' => 'Le due password non sono uguali.',
348
-	'info_plus_cinq_car' => 'più di 5 caratteri',
349
-	'info_plus_cinq_car_2' => '(Più di 5 caratteri)',
350
-	'info_plus_trois_car' => '(Più di 3 caratteri)',
351
-	'info_popularite' => 'popolarità: @popularite@; visite: @visites@',
352
-	'info_post_scriptum' => 'Post Scriptum',
353
-	'info_post_scriptum_2' => 'Post Scriptum:',
354
-	'info_pour' => 'per',
355
-	'info_preview_texte' => 'È possibile visualizzare un’anteprima del sito comprendente anche gli articoli e le brevi "proposti" per la pubblicazione. Questa funzionalità può essere disattivata, consentita solo alle amministratrici o a tutte le redattrici.', # MODIF
356
-	'info_procedez_par_etape' => 'procedere passo dopo passo',
357
-	'info_procedure_maj_version' => 'è necessario avviare la procedura di aggiornamento per adattare
329
+    'info_non_envoi_liste_nouveautes' => 'Non inviare l’elenco delle novità',
330
+    'info_non_modifiable' => 'non può essere modificato',
331
+    'info_non_suppression_mot_cle' => 'non voglio cancellare questa parola chiave.',
332
+    'info_notes' => 'Note',
333
+    'info_nouvel_article' => 'Nuovo articolo',
334
+    'info_nouvelle_traduction' => 'Nuova traduzione:',
335
+    'info_numero_article' => 'ARTICOLO NUMERO:',
336
+    'info_obligatoire_02' => '(obbligatorio)', # MODIF
337
+    'info_option_accepter_visiteurs' => 'Accetta l’iscrizione di utenti del sito pubblico',
338
+    'info_option_ne_pas_accepter_visiteurs' => 'Rifiuta l’iscrizione di utenti',
339
+    'info_options_avancees' => 'OPZIONE AVANZATA',
340
+    'info_ou' => 'o... ',
341
+    'info_page_interdite' => 'Pagina riservata',
342
+    'info_par_nom' => 'per nome',
343
+    'info_par_nombre_article' => 'per numero di articoli',
344
+    'info_par_statut' => 'per status',
345
+    'info_par_tri' => '’(per @tri@)’',
346
+    'info_passe_trop_court' => 'Password troppo corta.',
347
+    'info_passes_identiques' => 'Le due password non sono uguali.',
348
+    'info_plus_cinq_car' => 'più di 5 caratteri',
349
+    'info_plus_cinq_car_2' => '(Più di 5 caratteri)',
350
+    'info_plus_trois_car' => '(Più di 3 caratteri)',
351
+    'info_popularite' => 'popolarità: @popularite@; visite: @visites@',
352
+    'info_post_scriptum' => 'Post Scriptum',
353
+    'info_post_scriptum_2' => 'Post Scriptum:',
354
+    'info_pour' => 'per',
355
+    'info_preview_texte' => 'È possibile visualizzare un’anteprima del sito comprendente anche gli articoli e le brevi "proposti" per la pubblicazione. Questa funzionalità può essere disattivata, consentita solo alle amministratrici o a tutte le redattrici.', # MODIF
356
+    'info_procedez_par_etape' => 'procedere passo dopo passo',
357
+    'info_procedure_maj_version' => 'è necessario avviare la procedura di aggiornamento per adattare
358 358
 il database alla nuova versione di SPIP.',
359
-	'info_proxy_ok' => 'Test del proxy riuscito.',
360
-	'info_ps' => 'P.S.',
361
-	'info_publier' => 'pubblicare',
362
-	'info_publies' => 'I tuoi articoli pubblicati',
363
-	'info_question_accepter_visiteurs' => 'I modelli di pagina del sito prevedono la registrazione di utenti senza accesso all’area riservata. Attivare la seguente funzionalità:',
364
-	'info_question_inscription_nouveaux_redacteurs' => 'Accettate le iscrizioni di nuove redattrici
359
+    'info_proxy_ok' => 'Test del proxy riuscito.',
360
+    'info_ps' => 'P.S.',
361
+    'info_publier' => 'pubblicare',
362
+    'info_publies' => 'I tuoi articoli pubblicati',
363
+    'info_question_accepter_visiteurs' => 'I modelli di pagina del sito prevedono la registrazione di utenti senza accesso all’area riservata. Attivare la seguente funzionalità:',
364
+    'info_question_inscription_nouveaux_redacteurs' => 'Accettate le iscrizioni di nuove redattrici
365 365
 direttamente dal sito pubblico? In questo caso, chi visita il sito potrà iscriversi
366 366
 grazie ad un modulo automatizzato e potrà accedere all’area riservata per proporre i propri articoli.
367 367
 <div class="notice">Durante la fase d’iscrizione,
@@ -370,317 +370,317 @@  discard block
 block discarded – undo
370 370
 host disattivano l’invio di email dai
371 371
 propri server: in questo caso, l’iscrizione automatica è
372 372
 impossibile.', # RELIRE
373
-	'info_qui_edite' => '@nom_auteur_modif@ ha lavorato su questo contenuto @date_diff@ minuti fa',
374
-	'info_racine_site' => 'Root del sito',
375
-	'info_recharger_page' => 'Aggiorna questa pagina fra qualche istante.',
376
-	'info_recherche_auteur_zero' => 'Nessun risultato per "@cherche_auteur@".',
377
-	'info_recommencer' => 'Ricomincia.',
378
-	'info_redacteur_1' => 'Redattori',
379
-	'info_redacteur_2' => 'avendo accesso allo spazio privato (<i>raccommandato</i>)',
380
-	'info_redacteurs' => 'Redattrici',
381
-	'info_redaction_en_cours' => 'IN CORSO DI REDAZIONE',
382
-	'info_redirection' => 'Reindirizzamento',
383
-	'info_refuses' => 'I tuoi articoli rifiutati',
384
-	'info_reglage_ldap' => 'Opzioni: <b>Parametri per l’importazione LDAP</b>',
385
-	'info_renvoi_article' => '<b>Reindirizzamento.</b> Quest’articolo rimanda alla pagina:',
386
-	'info_reserve_admin' => 'Solo le amministratrici possono modificare quest’indirizzo.',
387
-	'info_restreindre_rubrique' => 'Limita la facoltà di gestione alla rubrica:',
388
-	'info_resultat_recherche' => 'Risultati della ricerca:',
389
-	'info_rubriques' => 'Rubriche',
390
-	'info_rubriques_02' => 'rubriche',
391
-	'info_rubriques_trouvees' => 'Rubriche trovate',
392
-	'info_sans_titre' => 'Senza titolo',
393
-	'info_selection_chemin_acces' => '<b>Seleziona</b> qui sotto il percorso d’accesso nell’elenco:',
394
-	'info_signatures' => 'firme',
395
-	'info_site' => 'Sito',
396
-	'info_site_2' => 'sito: ',
397
-	'info_site_min' => 'sito',
398
-	'info_site_reference_2' => 'Sito repertoriato',
399
-	'info_site_web' => 'Sito Web :',
400
-	'info_sites' => 'siti',
401
-	'info_sites_lies_mot' => 'I siti in repertorio legati a questa parola chiave',
402
-	'info_sites_proxy' => 'Utilizza un proxy',
403
-	'info_sites_trouves' => 'Siti trovati',
404
-	'info_sous_titre' => 'Sottotitolo:',
405
-	'info_statut_administrateur' => 'Amministratrice',
406
-	'info_statut_auteur' => 'Status di questa autrice:',
407
-	'info_statut_auteur_a_confirmer' => 'Iscrizione da confermare',
408
-	'info_statut_auteur_autre' => 'Altro stato:',
409
-	'info_statut_redacteur' => 'Redattrice',
410
-	'info_statut_utilisateurs_1' => 'Status predefinito delle utenti importate',
411
-	'info_statut_utilisateurs_2' => 'Scegli lo status da attribuire alle personne presenti nell’elenco LDAP quando si collegano per la prima volta. Potrai poi modificare questa impostazione per ogni singola autrice.',
412
-	'info_suivi_activite' => 'Monitoraggio dell’attività editoriale',
413
-	'info_surtitre' => 'Occhiello:',
414
-	'info_syndication_integrale_1' => 'Il tuo sito propone dei file di  syndication (vedi « <a href="@url@">@titre@</a> »).',
415
-	'info_syndication_integrale_2' => 'Si desidera trasmettere gli articoli in versione integrale oppure in versione riassunta di un centinaio di caratteri?',
416
-	'info_table_prefix' => 'È possibile modificare il prefisso del nome delle tabelle del database (cosa indispensabile se si desidera installare più siti usando il medesimo database). Questo prefisso si deve scrivere usando esclusivamente lettere minuscole, prive di accenti e senza alcuno spazio.',
417
-	'info_taille_maximale_images' => 'SPIP testerà la dimensione massima delle immagini che può manipolare (in milioni di pixel).<br /> Le immagini di dimensione maggiore non saranno ridotte.',
418
-	'info_taille_maximale_vignette' => 'Dimensione massima delle immagini create dal sistema:',
419
-	'info_terminer_installation' => 'Puoi ora terminare la procedura d’installazione standard.',
420
-	'info_texte' => 'Testo',
421
-	'info_texte_explicatif' => 'Testo esplicativo',
422
-	'info_texte_long' => '(il testo è lungo: è quindi visualizzato in più sezioni che verranno riunificate dopo la convalida)',
423
-	'info_texte_message' => 'Testo del messaggio',
424
-	'info_texte_message_02' => 'Testo del messaggio',
425
-	'info_titre' => 'Titolo:',
426
-	'info_total' => 'totale: ',
427
-	'info_tous_articles_en_redaction' => 'Tutti gli articoli in corso di redazione',
428
-	'info_tous_articles_presents' => 'Tutti gli articoli pubblicati in questa rubrica',
429
-	'info_tous_les' => 'tutti i:',
430
-	'info_tout_site' => 'Tutto il sito',
431
-	'info_tout_site2' => 'L’articolo non è stato tradotto in questa lingua.',
432
-	'info_tout_site3' => 'L’articolo è stato tradotto in questa lingua, ma sono state effettuate alcune modifiche all’articolo di riferimento. La traduzione deve quindi essere aggiornata.',
433
-	'info_tout_site4' => 'L’articolo è stato tradotto in questa lingua e la traduzione è aggiornata.',
434
-	'info_tout_site5' => 'Articolo originale.',
435
-	'info_tout_site6' => '<b>Attenzione:</b> solo gli articoli originali vengono visualizzati.
373
+    'info_qui_edite' => '@nom_auteur_modif@ ha lavorato su questo contenuto @date_diff@ minuti fa',
374
+    'info_racine_site' => 'Root del sito',
375
+    'info_recharger_page' => 'Aggiorna questa pagina fra qualche istante.',
376
+    'info_recherche_auteur_zero' => 'Nessun risultato per "@cherche_auteur@".',
377
+    'info_recommencer' => 'Ricomincia.',
378
+    'info_redacteur_1' => 'Redattori',
379
+    'info_redacteur_2' => 'avendo accesso allo spazio privato (<i>raccommandato</i>)',
380
+    'info_redacteurs' => 'Redattrici',
381
+    'info_redaction_en_cours' => 'IN CORSO DI REDAZIONE',
382
+    'info_redirection' => 'Reindirizzamento',
383
+    'info_refuses' => 'I tuoi articoli rifiutati',
384
+    'info_reglage_ldap' => 'Opzioni: <b>Parametri per l’importazione LDAP</b>',
385
+    'info_renvoi_article' => '<b>Reindirizzamento.</b> Quest’articolo rimanda alla pagina:',
386
+    'info_reserve_admin' => 'Solo le amministratrici possono modificare quest’indirizzo.',
387
+    'info_restreindre_rubrique' => 'Limita la facoltà di gestione alla rubrica:',
388
+    'info_resultat_recherche' => 'Risultati della ricerca:',
389
+    'info_rubriques' => 'Rubriche',
390
+    'info_rubriques_02' => 'rubriche',
391
+    'info_rubriques_trouvees' => 'Rubriche trovate',
392
+    'info_sans_titre' => 'Senza titolo',
393
+    'info_selection_chemin_acces' => '<b>Seleziona</b> qui sotto il percorso d’accesso nell’elenco:',
394
+    'info_signatures' => 'firme',
395
+    'info_site' => 'Sito',
396
+    'info_site_2' => 'sito: ',
397
+    'info_site_min' => 'sito',
398
+    'info_site_reference_2' => 'Sito repertoriato',
399
+    'info_site_web' => 'Sito Web :',
400
+    'info_sites' => 'siti',
401
+    'info_sites_lies_mot' => 'I siti in repertorio legati a questa parola chiave',
402
+    'info_sites_proxy' => 'Utilizza un proxy',
403
+    'info_sites_trouves' => 'Siti trovati',
404
+    'info_sous_titre' => 'Sottotitolo:',
405
+    'info_statut_administrateur' => 'Amministratrice',
406
+    'info_statut_auteur' => 'Status di questa autrice:',
407
+    'info_statut_auteur_a_confirmer' => 'Iscrizione da confermare',
408
+    'info_statut_auteur_autre' => 'Altro stato:',
409
+    'info_statut_redacteur' => 'Redattrice',
410
+    'info_statut_utilisateurs_1' => 'Status predefinito delle utenti importate',
411
+    'info_statut_utilisateurs_2' => 'Scegli lo status da attribuire alle personne presenti nell’elenco LDAP quando si collegano per la prima volta. Potrai poi modificare questa impostazione per ogni singola autrice.',
412
+    'info_suivi_activite' => 'Monitoraggio dell’attività editoriale',
413
+    'info_surtitre' => 'Occhiello:',
414
+    'info_syndication_integrale_1' => 'Il tuo sito propone dei file di  syndication (vedi « <a href="@url@">@titre@</a> »).',
415
+    'info_syndication_integrale_2' => 'Si desidera trasmettere gli articoli in versione integrale oppure in versione riassunta di un centinaio di caratteri?',
416
+    'info_table_prefix' => 'È possibile modificare il prefisso del nome delle tabelle del database (cosa indispensabile se si desidera installare più siti usando il medesimo database). Questo prefisso si deve scrivere usando esclusivamente lettere minuscole, prive di accenti e senza alcuno spazio.',
417
+    'info_taille_maximale_images' => 'SPIP testerà la dimensione massima delle immagini che può manipolare (in milioni di pixel).<br /> Le immagini di dimensione maggiore non saranno ridotte.',
418
+    'info_taille_maximale_vignette' => 'Dimensione massima delle immagini create dal sistema:',
419
+    'info_terminer_installation' => 'Puoi ora terminare la procedura d’installazione standard.',
420
+    'info_texte' => 'Testo',
421
+    'info_texte_explicatif' => 'Testo esplicativo',
422
+    'info_texte_long' => '(il testo è lungo: è quindi visualizzato in più sezioni che verranno riunificate dopo la convalida)',
423
+    'info_texte_message' => 'Testo del messaggio',
424
+    'info_texte_message_02' => 'Testo del messaggio',
425
+    'info_titre' => 'Titolo:',
426
+    'info_total' => 'totale: ',
427
+    'info_tous_articles_en_redaction' => 'Tutti gli articoli in corso di redazione',
428
+    'info_tous_articles_presents' => 'Tutti gli articoli pubblicati in questa rubrica',
429
+    'info_tous_les' => 'tutti i:',
430
+    'info_tout_site' => 'Tutto il sito',
431
+    'info_tout_site2' => 'L’articolo non è stato tradotto in questa lingua.',
432
+    'info_tout_site3' => 'L’articolo è stato tradotto in questa lingua, ma sono state effettuate alcune modifiche all’articolo di riferimento. La traduzione deve quindi essere aggiornata.',
433
+    'info_tout_site4' => 'L’articolo è stato tradotto in questa lingua e la traduzione è aggiornata.',
434
+    'info_tout_site5' => 'Articolo originale.',
435
+    'info_tout_site6' => '<b>Attenzione:</b> solo gli articoli originali vengono visualizzati.
436 436
 Le traduzioni sono associate all’originale,
437 437
  in un colore che indica il loro stato:',
438
-	'info_travail_colaboratif' => 'Lavoro di collaborazione sugli articoli',
439
-	'info_un_article' => 'un articolo, ',
440
-	'info_un_site' => 'un sito, ',
441
-	'info_une_rubrique' => 'una rubrica, ',
442
-	'info_une_rubrique_02' => '1 rubrica',
443
-	'info_url' => 'URL:',
444
-	'info_urlref' => 'Link ipertestuale:',
445
-	'info_utilisation_spip' => 'Puoi ora cominciare ad utilizzare il sistema di pubblicazione assistita...',
446
-	'info_visites_par_mois' => 'Visualizzazione per mese:',
447
-	'info_visiteur_1' => 'Visitatori',
448
-	'info_visiteur_2' => 'del sito pubblico',
449
-	'info_visiteurs' => 'Visitatori',
450
-	'info_visiteurs_02' => 'Visitatori del sito pubblico',
451
-	'install_adresse_base_hebergeur' => 'Indirizzo del database attribuito dal provider',
452
-	'install_echec_annonce' => 'L’installazione potrebbe fallire oppure causare problemi di funzionalità al sito...',
453
-	'install_extension_mbstring' => 'SPIP non funziona con:',
454
-	'install_extension_php_obligatoire' => 'SPIP esige l’estensione php:',
455
-	'install_login_base_hebergeur' => 'Login di connessione attribuito dal provider',
456
-	'install_nom_base_hebergeur' => 'Nome del database attribuito dal provider:',
457
-	'install_pas_table' => 'Database attualmente senza tabelle',
458
-	'install_pass_base_hebergeur' => 'Password di connessione attribuito dal provider',
459
-	'install_php_version' => 'PHP versione @version@ insufficiente (minimo = @minimum@)',
460
-	'install_select_langue' => 'Seleziona una lingua e poi clicca sul bottone « Avanti » per lanciare la procedura di installazione.',
461
-	'install_select_type_db' => 'Indicare il tipo di database:',
462
-	'install_select_type_mysql' => 'MySQL',
463
-	'install_select_type_sqlite2' => 'SQLite 2',
464
-	'install_select_type_sqlite3' => 'SQLite 3',
465
-	'install_serveur_hebergeur' => 'Server del database attribuito dall’hoster',
466
-	'install_table_prefix_hebergeur' => 'Prefisso della tabella attribuito dal provider:',
467
-	'install_tables_base' => 'Tabelle del database',
468
-	'install_types_db_connus' => 'SPIP può utilizzare <b>MySQL</b> (il più diffuso) e <b>SQLite</b>.',
469
-	'install_types_db_connus_avertissement' => 'Il supporto <b>PostgreSQL</b> viene proposto a titolo sperimentale', # RELIRE
470
-	'intem_redacteur' => 'redattrice',
471
-	'intitule_licence' => 'Licenza',
472
-	'item_accepter_inscriptions' => 'Accetta le iscrizioni',
473
-	'item_activer_messages_avertissement' => 'Attiva i messaggi d’avvertimento',
474
-	'item_administrateur_2' => 'amministratrice',
475
-	'item_afficher_calendrier' => 'Pubblica nel calendario',
476
-	'item_autoriser_syndication_integrale' => 'Diffondere la versione integrale degli articoli nei file di syndication',
477
-	'item_choix_administrateurs' => 'le amministratrici',
478
-	'item_choix_generation_miniature' => 'Genera automaticamente le thumbnail delle immagini.',
479
-	'item_choix_non_generation_miniature' => 'Non creare le thumbnail delle immagini.',
480
-	'item_choix_redacteurs' => 'le redattrici',
481
-	'item_choix_visiteurs' => 'i visitatori del sito pubblico',
482
-	'item_creer_fichiers_authent' => 'Crea i file .htpasswd',
483
-	'item_login' => 'Login',
484
-	'item_messagerie_agenda' => 'Attiva la messaggistica e l’agenda',
485
-	'item_mots_cles_association_articles' => 'agli articoli',
486
-	'item_mots_cles_association_rubriques' => 'alle rubriche',
487
-	'item_mots_cles_association_sites' => 'ai siti repertoriati o in syndication.',
488
-	'item_non' => 'No',
489
-	'item_non_accepter_inscriptions' => 'Non accettare le iscrizioni',
490
-	'item_non_activer_messages_avertissement' => 'Nessun messaggio d’avvertimento',
491
-	'item_non_afficher_calendrier' => 'Non pubblicare nel calendario',
492
-	'item_non_autoriser_syndication_integrale' => 'Diffondere solo un riassunto',
493
-	'item_non_creer_fichiers_authent' => 'Non creare questi file',
494
-	'item_non_messagerie_agenda' => 'Disattiva la messaggistica e l’agenda',
495
-	'item_non_publier_articles' => 'Non pubblicare gli articoli prima della data impostata.',
496
-	'item_nouvel_auteur' => 'Nuova autrice',
497
-	'item_nouvelle_rubrique' => 'Nuova rubrica',
498
-	'item_oui' => 'Sì',
499
-	'item_publier_articles' => 'Pubblica gli articoli indipendentemente dalla data impostata.',
500
-	'item_reponse_article' => 'Risposta all’articolo ',
501
-	'item_visiteur' => 'visitatore',
438
+    'info_travail_colaboratif' => 'Lavoro di collaborazione sugli articoli',
439
+    'info_un_article' => 'un articolo, ',
440
+    'info_un_site' => 'un sito, ',
441
+    'info_une_rubrique' => 'una rubrica, ',
442
+    'info_une_rubrique_02' => '1 rubrica',
443
+    'info_url' => 'URL:',
444
+    'info_urlref' => 'Link ipertestuale:',
445
+    'info_utilisation_spip' => 'Puoi ora cominciare ad utilizzare il sistema di pubblicazione assistita...',
446
+    'info_visites_par_mois' => 'Visualizzazione per mese:',
447
+    'info_visiteur_1' => 'Visitatori',
448
+    'info_visiteur_2' => 'del sito pubblico',
449
+    'info_visiteurs' => 'Visitatori',
450
+    'info_visiteurs_02' => 'Visitatori del sito pubblico',
451
+    'install_adresse_base_hebergeur' => 'Indirizzo del database attribuito dal provider',
452
+    'install_echec_annonce' => 'L’installazione potrebbe fallire oppure causare problemi di funzionalità al sito...',
453
+    'install_extension_mbstring' => 'SPIP non funziona con:',
454
+    'install_extension_php_obligatoire' => 'SPIP esige l’estensione php:',
455
+    'install_login_base_hebergeur' => 'Login di connessione attribuito dal provider',
456
+    'install_nom_base_hebergeur' => 'Nome del database attribuito dal provider:',
457
+    'install_pas_table' => 'Database attualmente senza tabelle',
458
+    'install_pass_base_hebergeur' => 'Password di connessione attribuito dal provider',
459
+    'install_php_version' => 'PHP versione @version@ insufficiente (minimo = @minimum@)',
460
+    'install_select_langue' => 'Seleziona una lingua e poi clicca sul bottone « Avanti » per lanciare la procedura di installazione.',
461
+    'install_select_type_db' => 'Indicare il tipo di database:',
462
+    'install_select_type_mysql' => 'MySQL',
463
+    'install_select_type_sqlite2' => 'SQLite 2',
464
+    'install_select_type_sqlite3' => 'SQLite 3',
465
+    'install_serveur_hebergeur' => 'Server del database attribuito dall’hoster',
466
+    'install_table_prefix_hebergeur' => 'Prefisso della tabella attribuito dal provider:',
467
+    'install_tables_base' => 'Tabelle del database',
468
+    'install_types_db_connus' => 'SPIP può utilizzare <b>MySQL</b> (il più diffuso) e <b>SQLite</b>.',
469
+    'install_types_db_connus_avertissement' => 'Il supporto <b>PostgreSQL</b> viene proposto a titolo sperimentale', # RELIRE
470
+    'intem_redacteur' => 'redattrice',
471
+    'intitule_licence' => 'Licenza',
472
+    'item_accepter_inscriptions' => 'Accetta le iscrizioni',
473
+    'item_activer_messages_avertissement' => 'Attiva i messaggi d’avvertimento',
474
+    'item_administrateur_2' => 'amministratrice',
475
+    'item_afficher_calendrier' => 'Pubblica nel calendario',
476
+    'item_autoriser_syndication_integrale' => 'Diffondere la versione integrale degli articoli nei file di syndication',
477
+    'item_choix_administrateurs' => 'le amministratrici',
478
+    'item_choix_generation_miniature' => 'Genera automaticamente le thumbnail delle immagini.',
479
+    'item_choix_non_generation_miniature' => 'Non creare le thumbnail delle immagini.',
480
+    'item_choix_redacteurs' => 'le redattrici',
481
+    'item_choix_visiteurs' => 'i visitatori del sito pubblico',
482
+    'item_creer_fichiers_authent' => 'Crea i file .htpasswd',
483
+    'item_login' => 'Login',
484
+    'item_messagerie_agenda' => 'Attiva la messaggistica e l’agenda',
485
+    'item_mots_cles_association_articles' => 'agli articoli',
486
+    'item_mots_cles_association_rubriques' => 'alle rubriche',
487
+    'item_mots_cles_association_sites' => 'ai siti repertoriati o in syndication.',
488
+    'item_non' => 'No',
489
+    'item_non_accepter_inscriptions' => 'Non accettare le iscrizioni',
490
+    'item_non_activer_messages_avertissement' => 'Nessun messaggio d’avvertimento',
491
+    'item_non_afficher_calendrier' => 'Non pubblicare nel calendario',
492
+    'item_non_autoriser_syndication_integrale' => 'Diffondere solo un riassunto',
493
+    'item_non_creer_fichiers_authent' => 'Non creare questi file',
494
+    'item_non_messagerie_agenda' => 'Disattiva la messaggistica e l’agenda',
495
+    'item_non_publier_articles' => 'Non pubblicare gli articoli prima della data impostata.',
496
+    'item_nouvel_auteur' => 'Nuova autrice',
497
+    'item_nouvelle_rubrique' => 'Nuova rubrica',
498
+    'item_oui' => 'Sì',
499
+    'item_publier_articles' => 'Pubblica gli articoli indipendentemente dalla data impostata.',
500
+    'item_reponse_article' => 'Risposta all’articolo ',
501
+    'item_visiteur' => 'visitatore',
502 502
 
503
-	// J
504
-	'jour_non_connu_nc' => 'n.c.',
503
+    // J
504
+    'jour_non_connu_nc' => 'n.c.',
505 505
 
506
-	// L
507
-	'lien_ajouter_auteur' => 'Aggiungi questa autrice',
508
-	'lien_email' => 'email',
509
-	'lien_nom_site' => 'NOME DEL SITO:',
510
-	'lien_retirer_auteur' => 'Rimuovere l’autrice',
511
-	'lien_site' => 'sito',
512
-	'lien_tout_deplier' => 'Espandi',
513
-	'lien_tout_replier' => 'Richiudi',
514
-	'lien_tout_supprimer' => 'Eliminare tutto',
515
-	'lien_trier_nom' => 'Ordina per nome',
516
-	'lien_trier_nombre_articles' => 'Ordina per numero di articoli',
517
-	'lien_trier_statut' => 'Ordina per status',
518
-	'lien_voir_en_ligne' => 'VEDI ON LINE:',
519
-	'logo_article' => 'Logo dell’articolo',
520
-	'logo_auteur' => 'Logo dell’autrice',
521
-	'logo_rubrique' => 'Logo della rubrica',
522
-	'logo_site' => 'Logo di questo sito',
523
-	'logo_standard_rubrique' => 'Logo standard delle rubriche',
524
-	'logo_survol' => 'Logo rollover', # RELIRE
506
+    // L
507
+    'lien_ajouter_auteur' => 'Aggiungi questa autrice',
508
+    'lien_email' => 'email',
509
+    'lien_nom_site' => 'NOME DEL SITO:',
510
+    'lien_retirer_auteur' => 'Rimuovere l’autrice',
511
+    'lien_site' => 'sito',
512
+    'lien_tout_deplier' => 'Espandi',
513
+    'lien_tout_replier' => 'Richiudi',
514
+    'lien_tout_supprimer' => 'Eliminare tutto',
515
+    'lien_trier_nom' => 'Ordina per nome',
516
+    'lien_trier_nombre_articles' => 'Ordina per numero di articoli',
517
+    'lien_trier_statut' => 'Ordina per status',
518
+    'lien_voir_en_ligne' => 'VEDI ON LINE:',
519
+    'logo_article' => 'Logo dell’articolo',
520
+    'logo_auteur' => 'Logo dell’autrice',
521
+    'logo_rubrique' => 'Logo della rubrica',
522
+    'logo_site' => 'Logo di questo sito',
523
+    'logo_standard_rubrique' => 'Logo standard delle rubriche',
524
+    'logo_survol' => 'Logo rollover', # RELIRE
525 525
 
526
-	// M
527
-	'menu_aide_installation_choix_base' => 'Scegliere il database',
528
-	'module_fichier_langue' => 'File lingua',
529
-	'module_raccourci' => 'Scorciatoia',
530
-	'module_texte_affiche' => 'Testo visualizzato',
531
-	'module_texte_explicatif' => 'È possibile inserire le scorciatoie nel modello di layout del proprio sito pubblico. Queste verranno tradotte automaticamente nelle diverse lingue (se esiste già un file lingua).',
532
-	'module_texte_traduction' => 'Il file lingua «@module@» è disponibile in:',
533
-	'mois_non_connu' => 'sconosciuto',
526
+    // M
527
+    'menu_aide_installation_choix_base' => 'Scegliere il database',
528
+    'module_fichier_langue' => 'File lingua',
529
+    'module_raccourci' => 'Scorciatoia',
530
+    'module_texte_affiche' => 'Testo visualizzato',
531
+    'module_texte_explicatif' => 'È possibile inserire le scorciatoie nel modello di layout del proprio sito pubblico. Queste verranno tradotte automaticamente nelle diverse lingue (se esiste già un file lingua).',
532
+    'module_texte_traduction' => 'Il file lingua «@module@» è disponibile in:',
533
+    'mois_non_connu' => 'sconosciuto',
534 534
 
535
-	// O
536
-	'onglet_contenu' => 'Contenuto',
537
-	'onglet_declarer_une_autre_base' => 'Dichiarare un altro database',
538
-	'onglet_discuter' => 'Discuti',
539
-	'onglet_interactivite' => 'Interattività',
540
-	'onglet_proprietes' => 'Proprietà',
541
-	'onglet_repartition_actuelle' => 'attualmente',
542
-	'onglet_sous_rubriques' => 'Sotto-rubriche',
535
+    // O
536
+    'onglet_contenu' => 'Contenuto',
537
+    'onglet_declarer_une_autre_base' => 'Dichiarare un altro database',
538
+    'onglet_discuter' => 'Discuti',
539
+    'onglet_interactivite' => 'Interattività',
540
+    'onglet_proprietes' => 'Proprietà',
541
+    'onglet_repartition_actuelle' => 'attualmente',
542
+    'onglet_sous_rubriques' => 'Sotto-rubriche',
543 543
 
544
-	// P
545
-	'page_pas_proxy' => 'Questa pagina non deve passare attraverso il proxy',
546
-	'pas_de_proxy_pour' => 'Se necessario, indicare i server o i domini per i quali non si deve applicare questo proxy (per esempio: @exemple@)',
547
-	'plugin_charge_paquet' => 'Caricamento del pacchetto @name@',
548
-	'plugin_erreur_charger' => 'errore: impossibile caricare @zip@',
549
-	'plugin_erreur_droit1' => 'La cartella <code>@dest@</code> non ha i permessi di scrittura.',
550
-	'plugin_erreur_droit2' => 'Verificare i diritti su questa cartella (e, se necessario, crearla), o installare i file tramite FTP.',
551
-	'plugin_erreur_zip' => 'fallimento pclzip: errore @status@',
552
-	'plugin_etat_developpement' => 'in corso di sviluppo',
553
-	'plugin_etat_experimental' => 'sperimentale',
554
-	'plugin_etat_stable' => 'stabile',
555
-	'plugin_etat_test' => 'in prova',
556
-	'plugin_impossible_activer' => 'Impossibile attivare il plug-in @plugin@',
557
-	'plugin_info_automatique1' => 'Se si desidera autorizzare l’installazione automatica dei plug-in è necessario: ',
558
-	'plugin_info_automatique2' => 'creare una cartella <code>@rep@</code>;',
559
-	'plugin_info_automatique3' => 'verificare che il server sia autorizzato a scrivere in questa cartella.',
560
-	'plugin_info_automatique_creer' => 'da creare alla radice del sito.',
561
-	'plugin_info_automatique_exemples' => 'esempi:',
562
-	'plugin_info_automatique_ftp' => 'È possibile installare plug-in tramite FTP, nella cartella <tt>@rep@</tt>',
563
-	'plugin_info_automatique_lib' => 'Alcuni plug-in richiedono anche di poter trasferire dei file nella cartella <code>lib/</code>, da creare (se necessario) alla radice del sito.',
564
-	'plugin_info_automatique_liste' => 'Gli elenchi dei plug-in:',
565
-	'plugin_info_automatique_liste_officielle' => 'i plug-in ufficiali',
566
-	'plugin_info_automatique_liste_update' => 'Aggiornare gli elenchi',
567
-	'plugin_info_automatique_ou' => 'oppure...',
568
-	'plugin_info_automatique_select' => 'Selezionata un plug-in qui sotto: SPIP lo scaricherà e lo installerà nella cartella <code>@rep@</code>; se questo plug-in è già presente verrà aggiornato.',
569
-	'plugin_info_telecharger' => 'da scaricare da @url@ e da installare in @rep@',
570
-	'plugin_librairies_installees' => 'Librerie installate',
571
-	'plugin_necessite_lib' => 'Questo plug-in richiede la libreria @lib@',
572
-	'plugin_necessite_plugin' => 'Necessita il plug-in @plugin@ con almeno la versione @version@.', # MODIF
573
-	'plugin_necessite_spip' => 'Necessita SPIP con almeno la versione @version@.',
574
-	'plugin_source' => 'origine: ',
575
-	'plugin_titre_automatique' => 'Installazione automatica',
576
-	'plugin_titre_automatique_ajouter' => 'Aggiungere dei plug-in',
577
-	'plugin_zip_active' => 'Continuare per attivarlo',
578
-	'plugin_zip_adresse' => 'indicate qui sotto l’indirizzo di un file zip del plug-in da scaricare, oppure l’indirizzo di un elenco di plug-in.',
579
-	'plugin_zip_adresse_champ' => 'Indirizzo del plug-in o dell’elenco ',
580
-	'plugin_zip_content' => 'Esso contiene i file seguenti (@taille@),<br />pronti per essere installati nella cartella <code>@rep@</code>',
581
-	'plugin_zip_installe_finie' => 'Il file @zip@ è stato decompresso e installato.',
582
-	'plugin_zip_installe_rep_finie' => 'Il file @zip@ è stato decompresso e installato nella cartella @rep@',
583
-	'plugin_zip_installer' => 'Ora è possibile installarlo.',
584
-	'plugin_zip_telecharge' => 'Il file @zip@ è stato scaricato',
585
-	'plugins_actifs' => '@count@ plug-in attivati.',
586
-	'plugins_compte' => '@count@ plug-in',
587
-	'plugins_disponibles' => '@count@ plug-in disponibili.',
588
-	'plugins_erreur' => 'Errore nei plug-in: @plugins@',
589
-	'plugins_liste' => 'Elenco dei plugin',
590
-	'plugins_vue_hierarchie' => 'Struttura gerarchica',
591
-	'plugins_vue_liste' => 'Elenco',
592
-	'protocole_ldap' => 'Versione del protocollo:',
544
+    // P
545
+    'page_pas_proxy' => 'Questa pagina non deve passare attraverso il proxy',
546
+    'pas_de_proxy_pour' => 'Se necessario, indicare i server o i domini per i quali non si deve applicare questo proxy (per esempio: @exemple@)',
547
+    'plugin_charge_paquet' => 'Caricamento del pacchetto @name@',
548
+    'plugin_erreur_charger' => 'errore: impossibile caricare @zip@',
549
+    'plugin_erreur_droit1' => 'La cartella <code>@dest@</code> non ha i permessi di scrittura.',
550
+    'plugin_erreur_droit2' => 'Verificare i diritti su questa cartella (e, se necessario, crearla), o installare i file tramite FTP.',
551
+    'plugin_erreur_zip' => 'fallimento pclzip: errore @status@',
552
+    'plugin_etat_developpement' => 'in corso di sviluppo',
553
+    'plugin_etat_experimental' => 'sperimentale',
554
+    'plugin_etat_stable' => 'stabile',
555
+    'plugin_etat_test' => 'in prova',
556
+    'plugin_impossible_activer' => 'Impossibile attivare il plug-in @plugin@',
557
+    'plugin_info_automatique1' => 'Se si desidera autorizzare l’installazione automatica dei plug-in è necessario: ',
558
+    'plugin_info_automatique2' => 'creare una cartella <code>@rep@</code>;',
559
+    'plugin_info_automatique3' => 'verificare che il server sia autorizzato a scrivere in questa cartella.',
560
+    'plugin_info_automatique_creer' => 'da creare alla radice del sito.',
561
+    'plugin_info_automatique_exemples' => 'esempi:',
562
+    'plugin_info_automatique_ftp' => 'È possibile installare plug-in tramite FTP, nella cartella <tt>@rep@</tt>',
563
+    'plugin_info_automatique_lib' => 'Alcuni plug-in richiedono anche di poter trasferire dei file nella cartella <code>lib/</code>, da creare (se necessario) alla radice del sito.',
564
+    'plugin_info_automatique_liste' => 'Gli elenchi dei plug-in:',
565
+    'plugin_info_automatique_liste_officielle' => 'i plug-in ufficiali',
566
+    'plugin_info_automatique_liste_update' => 'Aggiornare gli elenchi',
567
+    'plugin_info_automatique_ou' => 'oppure...',
568
+    'plugin_info_automatique_select' => 'Selezionata un plug-in qui sotto: SPIP lo scaricherà e lo installerà nella cartella <code>@rep@</code>; se questo plug-in è già presente verrà aggiornato.',
569
+    'plugin_info_telecharger' => 'da scaricare da @url@ e da installare in @rep@',
570
+    'plugin_librairies_installees' => 'Librerie installate',
571
+    'plugin_necessite_lib' => 'Questo plug-in richiede la libreria @lib@',
572
+    'plugin_necessite_plugin' => 'Necessita il plug-in @plugin@ con almeno la versione @version@.', # MODIF
573
+    'plugin_necessite_spip' => 'Necessita SPIP con almeno la versione @version@.',
574
+    'plugin_source' => 'origine: ',
575
+    'plugin_titre_automatique' => 'Installazione automatica',
576
+    'plugin_titre_automatique_ajouter' => 'Aggiungere dei plug-in',
577
+    'plugin_zip_active' => 'Continuare per attivarlo',
578
+    'plugin_zip_adresse' => 'indicate qui sotto l’indirizzo di un file zip del plug-in da scaricare, oppure l’indirizzo di un elenco di plug-in.',
579
+    'plugin_zip_adresse_champ' => 'Indirizzo del plug-in o dell’elenco ',
580
+    'plugin_zip_content' => 'Esso contiene i file seguenti (@taille@),<br />pronti per essere installati nella cartella <code>@rep@</code>',
581
+    'plugin_zip_installe_finie' => 'Il file @zip@ è stato decompresso e installato.',
582
+    'plugin_zip_installe_rep_finie' => 'Il file @zip@ è stato decompresso e installato nella cartella @rep@',
583
+    'plugin_zip_installer' => 'Ora è possibile installarlo.',
584
+    'plugin_zip_telecharge' => 'Il file @zip@ è stato scaricato',
585
+    'plugins_actifs' => '@count@ plug-in attivati.',
586
+    'plugins_compte' => '@count@ plug-in',
587
+    'plugins_disponibles' => '@count@ plug-in disponibili.',
588
+    'plugins_erreur' => 'Errore nei plug-in: @plugins@',
589
+    'plugins_liste' => 'Elenco dei plugin',
590
+    'plugins_vue_hierarchie' => 'Struttura gerarchica',
591
+    'plugins_vue_liste' => 'Elenco',
592
+    'protocole_ldap' => 'Versione del protocollo:',
593 593
 
594
-	// R
595
-	'repertoire_plugins' => 'Cartella:',
596
-	'required' => '(obbligatorio)', # MODIF
594
+    // R
595
+    'repertoire_plugins' => 'Cartella:',
596
+    'required' => '(obbligatorio)', # MODIF
597 597
 
598
-	// S
599
-	'sans_heure' => 'ora mancante',
600
-	'statut_admin_restreint' => 'admin limitato', # RELIRE
598
+    // S
599
+    'sans_heure' => 'ora mancante',
600
+    'statut_admin_restreint' => 'admin limitato', # RELIRE
601 601
 
602
-	// T
603
-	'taille_cache_image' => 'Le immagini elaborate automaticamente da SPIP (icone dei documenti, titoli in formato grafico, funzioni matematiche in formato TeX...) occupano nella cartella @dir@ in tutto @taille@.',
604
-	'taille_cache_infinie' => 'Questo sito non prevede limiti alle dimensioni della cartella della cache.',
605
-	'taille_cache_maxi' => 'SPIP tenta di limitare le dimensioni della cartella della cache di questo sito a circa <b>@octets@</b> di dati.',
606
-	'taille_cache_octets' => 'Attualmente la cache è di circa @octets@.', # RELIRE
607
-	'taille_cache_vide' => 'La cache è vuota.',
608
-	'taille_repertoire_cache' => 'Dimensioni della cartella di cache',
609
-	'text_article_propose_publication' => 'Articolo proposto per la pubblicazione. ',
610
-	'texte_acces_ldap_anonyme_1' => 'Alcuni server LDAP non consentono accessi anonimi. In questo caso si deve specificare un identificatore d’accesso iniziale al fine di poter poi ricercare delle informazioni nell’elenco. Nella maggior parte dei casi tuttavia, i campi seguenti potranno essere lasciati vuoti.',
611
-	'texte_admin_effacer_01' => 'Questo commando cancella <i>tutto</i> il contenuto del database,
602
+    // T
603
+    'taille_cache_image' => 'Le immagini elaborate automaticamente da SPIP (icone dei documenti, titoli in formato grafico, funzioni matematiche in formato TeX...) occupano nella cartella @dir@ in tutto @taille@.',
604
+    'taille_cache_infinie' => 'Questo sito non prevede limiti alle dimensioni della cartella della cache.',
605
+    'taille_cache_maxi' => 'SPIP tenta di limitare le dimensioni della cartella della cache di questo sito a circa <b>@octets@</b> di dati.',
606
+    'taille_cache_octets' => 'Attualmente la cache è di circa @octets@.', # RELIRE
607
+    'taille_cache_vide' => 'La cache è vuota.',
608
+    'taille_repertoire_cache' => 'Dimensioni della cartella di cache',
609
+    'text_article_propose_publication' => 'Articolo proposto per la pubblicazione. ',
610
+    'texte_acces_ldap_anonyme_1' => 'Alcuni server LDAP non consentono accessi anonimi. In questo caso si deve specificare un identificatore d’accesso iniziale al fine di poter poi ricercare delle informazioni nell’elenco. Nella maggior parte dei casi tuttavia, i campi seguenti potranno essere lasciati vuoti.',
611
+    'texte_admin_effacer_01' => 'Questo commando cancella <i>tutto</i> il contenuto del database,
612 612
  compresi <i>tutti</i> i login delle redattrici e delle amministratrici. Dopo averlo eseguito, dovrai riavviare la procedura di installazione per ricreare un nuovo database e un primo ID amministrativo.',
613
-	'texte_adresse_annuaire_1' => '(Se la rubrica è installata nella stessa macchina di questo sito, dovrai probabilmente inserire "localhost".)',
614
-	'texte_ajout_auteur' => 'La seguente autrice è stata aggiunta all’articolo:',
615
-	'texte_annuaire_ldap_1' => 'Se hai accesso ad una rubrica (LDAP), puoi utilizzarla per importare automaticamente delle utenti sotto SPIP.',
616
-	'texte_article_statut' => 'Questo articolo è:',
617
-	'texte_article_virtuel' => 'Articolo virtuale',
618
-	'texte_article_virtuel_reference' => '<b>Articolo virtuale:</b> articolo citato nel tuo sito SPIP, ma reindrizzato verso un’altro URL. Per eliminare il reindirizzamento, cancella l’URL qui sopra.',
619
-	'texte_aucun_resultat_auteur' => 'Nessun risultato per "@cherche_auteur@"',
620
-	'texte_auteur_messagerie' => 'Questo sito può costantemente visualizzare la lista delle redattrici collegate, permettendo lo scambio di messaggi in tempo reale. Si può però decidere di non comparire in questo elenco (rendendosi quindi «invisibili» alle altre utenti).',
621
-	'texte_auteurs' => 'LE AUTRICI',
622
-	'texte_choix_base_1' => 'Scegli il database:',
623
-	'texte_choix_base_2' => 'Il server SQL contiene diversi database.',
624
-	'texte_choix_base_3' => '<b>Seleziona</b> quello che è stato attribuito al tuo dominio:',
625
-	'texte_choix_table_prefix' => 'Prefisso delle tabelle:',
626
-	'texte_compte_element' => '@count@ elemento',
627
-	'texte_compte_elements' => '@count@ elementi',
628
-	'texte_conflit_edition_correction' => 'Controllare qui sotto le differenze tra le due versioni del testo; è possibile anche copiare le modifiche e poi ricominciare.',
629
-	'texte_connexion_mysql' => 'Consulta le informazioni fornite dal tuo hoster: devi poterci trovare, i codici di collegamento alla base di dati.',
630
-	'texte_contenu_article' => 'Contenuto dell’articolo in poche parole (<em>abstract</em>)',
631
-	'texte_contenu_articles' => 'A seconda del modello di presentazione adottato per il sito, puoi decidere
613
+    'texte_adresse_annuaire_1' => '(Se la rubrica è installata nella stessa macchina di questo sito, dovrai probabilmente inserire "localhost".)',
614
+    'texte_ajout_auteur' => 'La seguente autrice è stata aggiunta all’articolo:',
615
+    'texte_annuaire_ldap_1' => 'Se hai accesso ad una rubrica (LDAP), puoi utilizzarla per importare automaticamente delle utenti sotto SPIP.',
616
+    'texte_article_statut' => 'Questo articolo è:',
617
+    'texte_article_virtuel' => 'Articolo virtuale',
618
+    'texte_article_virtuel_reference' => '<b>Articolo virtuale:</b> articolo citato nel tuo sito SPIP, ma reindrizzato verso un’altro URL. Per eliminare il reindirizzamento, cancella l’URL qui sopra.',
619
+    'texte_aucun_resultat_auteur' => 'Nessun risultato per "@cherche_auteur@"',
620
+    'texte_auteur_messagerie' => 'Questo sito può costantemente visualizzare la lista delle redattrici collegate, permettendo lo scambio di messaggi in tempo reale. Si può però decidere di non comparire in questo elenco (rendendosi quindi «invisibili» alle altre utenti).',
621
+    'texte_auteurs' => 'LE AUTRICI',
622
+    'texte_choix_base_1' => 'Scegli il database:',
623
+    'texte_choix_base_2' => 'Il server SQL contiene diversi database.',
624
+    'texte_choix_base_3' => '<b>Seleziona</b> quello che è stato attribuito al tuo dominio:',
625
+    'texte_choix_table_prefix' => 'Prefisso delle tabelle:',
626
+    'texte_compte_element' => '@count@ elemento',
627
+    'texte_compte_elements' => '@count@ elementi',
628
+    'texte_conflit_edition_correction' => 'Controllare qui sotto le differenze tra le due versioni del testo; è possibile anche copiare le modifiche e poi ricominciare.',
629
+    'texte_connexion_mysql' => 'Consulta le informazioni fornite dal tuo hoster: devi poterci trovare, i codici di collegamento alla base di dati.',
630
+    'texte_contenu_article' => 'Contenuto dell’articolo in poche parole (<em>abstract</em>)',
631
+    'texte_contenu_articles' => 'A seconda del modello di presentazione adottato per il sito, puoi decidere
632 632
 che alcuni elementi degli articoli siano utilizzati oppure no.
633 633
 Serviti dell’elenco qui sotto per indicare quali elementi rendere disponibili.',
634
-	'texte_crash_base' => 'Se il database è stato danneggiato, puoi tentare un ripristino automatico.',
635
-	'texte_creer_rubrique' => 'Prima di poter scrivere degli articoli,<br /> devi creare una rubrica.',
636
-	'texte_date_creation_article' => 'DATA DI CREAZIONE DELL’ARTICOLO:',
637
-	'texte_date_publication_anterieure' => 'DATA DI REDAZIONE ANTERIORE',
638
-	'texte_date_publication_anterieure_nonaffichee' => 'Non visualizzare la data di redazione anteriore.',
639
-	'texte_date_publication_article' => 'DATA DI PUBBLICAZIONE:',
640
-	'texte_descriptif_rapide' => 'Descrizione rapida',
641
-	'texte_effacer_base' => 'Cancella il database SPIP',
642
-	'texte_effacer_statistiques' => 'Cancellare le statistiche',
643
-	'texte_en_cours_validation' => 'I contenuti qui di seguito sono in attesa di validazione. ', # RELIRE
644
-	'texte_enrichir_mise_a_jour' => 'Puoi arricchire la formattazione del testo utilizzando le «scorciatoie tipografiche»',
645
-	'texte_fichier_authent' => '<b>SPIP deve creare i file speciali
634
+    'texte_crash_base' => 'Se il database è stato danneggiato, puoi tentare un ripristino automatico.',
635
+    'texte_creer_rubrique' => 'Prima di poter scrivere degli articoli,<br /> devi creare una rubrica.',
636
+    'texte_date_creation_article' => 'DATA DI CREAZIONE DELL’ARTICOLO:',
637
+    'texte_date_publication_anterieure' => 'DATA DI REDAZIONE ANTERIORE',
638
+    'texte_date_publication_anterieure_nonaffichee' => 'Non visualizzare la data di redazione anteriore.',
639
+    'texte_date_publication_article' => 'DATA DI PUBBLICAZIONE:',
640
+    'texte_descriptif_rapide' => 'Descrizione rapida',
641
+    'texte_effacer_base' => 'Cancella il database SPIP',
642
+    'texte_effacer_statistiques' => 'Cancellare le statistiche',
643
+    'texte_en_cours_validation' => 'I contenuti qui di seguito sono in attesa di validazione. ', # RELIRE
644
+    'texte_enrichir_mise_a_jour' => 'Puoi arricchire la formattazione del testo utilizzando le «scorciatoie tipografiche»',
645
+    'texte_fichier_authent' => '<b>SPIP deve creare i file speciali
646 646
 <tt>.htpasswd</tt> e <tt>.htpasswd-admin</tt> nella cartella @dossier@ ?</b>
647 647
 <p>Questi file possono servire a limitare l’accesso alle autrici
648 648
 e alle amministratrici in particolari aree del vostro sito (per esempio, per un programma esterno di statistiche).</p>
649 649
 <p>Se ciò non è necessario, lasciare quest’opzione al suo valore predefinito (nessuna creazione 
650 650
 di file).</p>', # RELIRE
651
-	'texte_informations_personnelles_1' => 'Il sistema creerà un tuo accesso personalizzato al sito.',
652
-	'texte_informations_personnelles_2' => '(Nota : trattandosi di una reinstallazione, se il tuo accesso funziona ancora potete ', # RELIRE
653
-	'texte_introductif_article' => 'Testo introduttivo dell’articolo',
654
-	'texte_jeu_caractere' => 'Si consiglia di utilizzare sul proprio sito l’alfabeto universale (<tt>utf-8</tt>): esso permette di visualizzare i testi in tutte le lingue e non pone problemi di compatibilità con i browser moderni.',
655
-	'texte_jeu_caractere_3' => 'Il tuo sito usa attualmente il set di caratteri:',
656
-	'texte_jeu_caractere_4' => 'Se ciò non corrisponde alla realtà dei propri dati (a causa, per esempio, di un ripristino del database), o se  <em>si avvia il sito</em> e si desidera partire con un altro set di caratteri è necessario indicare quest’ultimo qui:',
657
-	'texte_login_ldap_1' => '(Lascia vuoto per un accesso anonimo, o inserisci il percorso completo, per esempio «<tt>uid=rossi, ou=users, dc=mio-dominio, dc=com</tt> ».)',
658
-	'texte_login_precaution' => 'Attenzione! Questo è l’ID con il quale sei attualmente collegato.
651
+    'texte_informations_personnelles_1' => 'Il sistema creerà un tuo accesso personalizzato al sito.',
652
+    'texte_informations_personnelles_2' => '(Nota : trattandosi di una reinstallazione, se il tuo accesso funziona ancora potete ', # RELIRE
653
+    'texte_introductif_article' => 'Testo introduttivo dell’articolo',
654
+    'texte_jeu_caractere' => 'Si consiglia di utilizzare sul proprio sito l’alfabeto universale (<tt>utf-8</tt>): esso permette di visualizzare i testi in tutte le lingue e non pone problemi di compatibilità con i browser moderni.',
655
+    'texte_jeu_caractere_3' => 'Il tuo sito usa attualmente il set di caratteri:',
656
+    'texte_jeu_caractere_4' => 'Se ciò non corrisponde alla realtà dei propri dati (a causa, per esempio, di un ripristino del database), o se  <em>si avvia il sito</em> e si desidera partire con un altro set di caratteri è necessario indicare quest’ultimo qui:',
657
+    'texte_login_ldap_1' => '(Lascia vuoto per un accesso anonimo, o inserisci il percorso completo, per esempio «<tt>uid=rossi, ou=users, dc=mio-dominio, dc=com</tt> ».)',
658
+    'texte_login_precaution' => 'Attenzione! Questo è l’ID con il quale sei attualmente collegato.
659 659
 Utilizza questo modulo con cognizione di causa...',
660
-	'texte_messagerie_agenda' => 'La messageria permette alle redattrici del sito di comunicare tra loro in maniera diretta nell’area riservata. Essa è associata a una agenda.',
661
-	'texte_mise_a_niveau_base_1' => 'Hai aggiornato i file SPIP.
660
+    'texte_messagerie_agenda' => 'La messageria permette alle redattrici del sito di comunicare tra loro in maniera diretta nell’area riservata. Essa è associata a una agenda.',
661
+    'texte_mise_a_niveau_base_1' => 'Hai aggiornato i file SPIP.
662 662
 Adesso è necessario aggiornare il database.',
663
-	'texte_modifier_article' => 'Modifica l’articolo:',
664
-	'texte_multilinguisme' => 'Se desideri gestire gli articoli in diverse lingue, con un sistema di navigazione complesso, è possibile aggiungere un menu di selezione della lingua negli articoli e/o nelle rubriche, in funzione della struttura del sito.', # RELIRE
665
-	'texte_multilinguisme_trad' => 'È anche possibile attivare un sistema di gestione di link fra le diverse traduzioni relative ad alcuni elementi.', # RELIRE
666
-	'texte_non_compresse' => '<i>non compresso</i> (il tuo server non supporta questa funzionalità)',
667
-	'texte_nouvelle_version_spip_1' => 'Hai installato una nuova versione di SPIP.',
668
-	'texte_nouvelle_version_spip_2' => 'Questa nuova versione necessita un aggiornamento più radicale del solito. Se sei la webmistress del sito, cancella il file @connect@ e riprendi l’installazione al fine di aggiornare i parametri di connessione al database.<p> (NB: se hai dimenticato i parametri di connessione, rileggi il file @connect@ prima di cancellarlo...)</p>', # RELIRE
669
-	'texte_operation_echec' => 'Torna alla pagina precedente, seleziona un altro database o creane uno nuovo. Verifica le informazioni fornite dal tuo hoster.',
670
-	'texte_plus_trois_car' => 'più di tre caratteri',
671
-	'texte_plusieurs_articles' => 'Diversi autori trovati per "@cherche_auteur@":',
672
-	'texte_port_annuaire' => '(Il valore predefinito è in genere quello adatto.)',
673
-	'texte_presente_plugin' => 'Questa pagina elenca i plugin disponibili sul sito. È possibile attivare i plugin necessari selezionando la casella corrispondente.',
674
-	'texte_proposer_publication' => 'Quando l’articolo è completo,<br /> puoi proporne la pubblicazione.',
675
-	'texte_proxy' => 'In alcuni casi (intranet, reti protette...), i siti distanti (documetazione di SPIP, siti in syndication, ecc.) sono accessibili unicamente attraverso un <i>proxy HTTP</i>. In questo caso, va indicato l’indirizzo del server nella forma @proxy_en_cours@. In genere questa casella va lasciata vuota.',
676
-	'texte_publication_articles_post_dates' => 'Come si deve comportare SPIP quando gli articoli hanno
663
+    'texte_modifier_article' => 'Modifica l’articolo:',
664
+    'texte_multilinguisme' => 'Se desideri gestire gli articoli in diverse lingue, con un sistema di navigazione complesso, è possibile aggiungere un menu di selezione della lingua negli articoli e/o nelle rubriche, in funzione della struttura del sito.', # RELIRE
665
+    'texte_multilinguisme_trad' => 'È anche possibile attivare un sistema di gestione di link fra le diverse traduzioni relative ad alcuni elementi.', # RELIRE
666
+    'texte_non_compresse' => '<i>non compresso</i> (il tuo server non supporta questa funzionalità)',
667
+    'texte_nouvelle_version_spip_1' => 'Hai installato una nuova versione di SPIP.',
668
+    'texte_nouvelle_version_spip_2' => 'Questa nuova versione necessita un aggiornamento più radicale del solito. Se sei la webmistress del sito, cancella il file @connect@ e riprendi l’installazione al fine di aggiornare i parametri di connessione al database.<p> (NB: se hai dimenticato i parametri di connessione, rileggi il file @connect@ prima di cancellarlo...)</p>', # RELIRE
669
+    'texte_operation_echec' => 'Torna alla pagina precedente, seleziona un altro database o creane uno nuovo. Verifica le informazioni fornite dal tuo hoster.',
670
+    'texte_plus_trois_car' => 'più di tre caratteri',
671
+    'texte_plusieurs_articles' => 'Diversi autori trovati per "@cherche_auteur@":',
672
+    'texte_port_annuaire' => '(Il valore predefinito è in genere quello adatto.)',
673
+    'texte_presente_plugin' => 'Questa pagina elenca i plugin disponibili sul sito. È possibile attivare i plugin necessari selezionando la casella corrispondente.',
674
+    'texte_proposer_publication' => 'Quando l’articolo è completo,<br /> puoi proporne la pubblicazione.',
675
+    'texte_proxy' => 'In alcuni casi (intranet, reti protette...), i siti distanti (documetazione di SPIP, siti in syndication, ecc.) sono accessibili unicamente attraverso un <i>proxy HTTP</i>. In questo caso, va indicato l’indirizzo del server nella forma @proxy_en_cours@. In genere questa casella va lasciata vuota.',
676
+    'texte_publication_articles_post_dates' => 'Come si deve comportare SPIP quando gli articoli hanno
677 677
 una data di pubblicazione impostata nel futuro?',
678
-	'texte_rappel_selection_champs' => '[Non dimenticare di impostare correttamente questo campo]',
679
-	'texte_recalcul_page' => 'Se vuoi rigenerare
678
+    'texte_rappel_selection_champs' => '[Non dimenticare di impostare correttamente questo campo]',
679
+    'texte_recalcul_page' => 'Se vuoi rigenerare
680 680
 una sola pagina, utilizza piuttosto lo spazio pubblico e clicca sul pulsante «rigenera».',
681
-	'texte_recuperer_base' => 'Ripara il database',
682
-	'texte_reference_mais_redirige' => 'articolo catalogato nel tuo sito SPIP, ma con reindirizzamento verso un altro URL.',
683
-	'texte_requetes_echouent' => '<b>Quando alcune query SQL falliscono
681
+    'texte_recuperer_base' => 'Ripara il database',
682
+    'texte_reference_mais_redirige' => 'articolo catalogato nel tuo sito SPIP, ma con reindirizzamento verso un altro URL.',
683
+    'texte_requetes_echouent' => '<b>Quando alcune query SQL falliscono
684 684
 ripetutamente e senza un chiaro motivo, è possibile
685 685
 che sia per colpa del database
686 686
 stesso.</b><p>
@@ -691,79 +691,79 @@  discard block
 block discarded – undo
691 691
 forse, delle informazioni preziose...</p><p>
692 692
 Se il problema persiste, contattate la vostra
693 693
 webmistress.</p>', # RELIRE
694
-	'texte_selection_langue_principale' => 'Puoi selezionare qui sotto la «lingua predefinita» del sito. Questa scelta non obbliga - fortunatamente! - a scrivere gli articoli nella stessa lingua, ma permette di determinare:
694
+    'texte_selection_langue_principale' => 'Puoi selezionare qui sotto la «lingua predefinita» del sito. Questa scelta non obbliga - fortunatamente! - a scrivere gli articoli nella stessa lingua, ma permette di determinare:
695 695
 <ul><li> il formato di default delle date sul sito pubblico;</li>
696 696
 <li> la tipologia di motore tipografico che SPIP deve utilizzare per la resa del testo;</li>
697 697
 <li> la lingua utilizzata nelle finestre di dialogo del sito pubblico;</li>
698 698
 <li> la lingua di default nell’area riservata all’amministrazione.</li></ul>',
699
-	'texte_sous_titre' => 'Sottotitolo',
700
-	'texte_statistiques_visites' => '(barre scure:  domenica / curve scure: evoluzione della media)',
701
-	'texte_statut_attente_validation' => 'in attesa di convalida',
702
-	'texte_statut_publies' => 'pubblicato on line',
703
-	'texte_statut_refuses' => 'rifiutati',
704
-	'texte_suppression_fichiers' => 'Utilizza questo commando per cancellare tutti i file presenti nella
699
+    'texte_sous_titre' => 'Sottotitolo',
700
+    'texte_statistiques_visites' => '(barre scure:  domenica / curve scure: evoluzione della media)',
701
+    'texte_statut_attente_validation' => 'in attesa di convalida',
702
+    'texte_statut_publies' => 'pubblicato on line',
703
+    'texte_statut_refuses' => 'rifiutati',
704
+    'texte_suppression_fichiers' => 'Utilizza questo commando per cancellare tutti i file presenti nella
705 705
 cache di SPIP. Ciò permette ad esempio di forzare la rigenerazione di tutte le pagine se hai fatto delle importanti modifiche di grafica o di struttura del sito.',
706
-	'texte_sur_titre' => 'Occhiello',
707
-	'texte_table_ok' => ': questa tabella è OK.',
708
-	'texte_tentative_recuperation' => 'Tentativo di ripristino',
709
-	'texte_tenter_reparation' => 'Tenta un ripristino del database',
710
-	'texte_test_proxy' => 'Per fare una prova di questo proxy, indicare qui l’indirizzo
706
+    'texte_sur_titre' => 'Occhiello',
707
+    'texte_table_ok' => ': questa tabella è OK.',
708
+    'texte_tentative_recuperation' => 'Tentativo di ripristino',
709
+    'texte_tenter_reparation' => 'Tenta un ripristino del database',
710
+    'texte_test_proxy' => 'Per fare una prova di questo proxy, indicare qui l’indirizzo
711 711
 di un sito Web da testare.',
712
-	'texte_titre_02' => 'Titolo:',
713
-	'texte_titre_obligatoire' => '<b>Titolo</b> [Obbligatorio]',
714
-	'texte_travail_article' => '@nom_auteur_modif@ ha lavorato su questo articolo @date_diff@ minuti fa',
715
-	'texte_travail_collaboratif' => 'Se diverse autrici lavorano spesso sullo stesso articolo,
712
+    'texte_titre_02' => 'Titolo:',
713
+    'texte_titre_obligatoire' => '<b>Titolo</b> [Obbligatorio]',
714
+    'texte_travail_article' => '@nom_auteur_modif@ ha lavorato su questo articolo @date_diff@ minuti fa',
715
+    'texte_travail_collaboratif' => 'Se diverse autrici lavorano spesso sullo stesso articolo,
716 716
 il sistema può segnalare gli articoli «aperti»
717 717
 di recente al fine di evitare modifiche simultanee.
718 718
 Questa opzione è disattivata di default
719 719
 per evitare di generare messaggi d’avvertimento intempestivi.',
720
-	'texte_vide' => 'vuoto',
721
-	'texte_vider_cache' => 'Svuota la cache',
722
-	'titre_admin_tech' => 'Manutenzione tecnica',
723
-	'titre_admin_vider' => 'Manutenzione tecnica',
724
-	'titre_cadre_afficher_article' => 'Visualizza gli articoli',
725
-	'titre_cadre_afficher_traductions' => 'Visualizzare lo stato delle traduzioni per le seguenti lingue:',
726
-	'titre_cadre_ajouter_auteur' => 'AGGIUNGI UN’AUTRICE: ',
727
-	'titre_cadre_interieur_rubrique' => 'All’interno della rubrica',
728
-	'titre_cadre_numero_auteur' => 'AUTRICE NUMERO',
729
-	'titre_cadre_signature_obligatoire' => '<b>Firma</b> [Obbligatoria]<br />',
730
-	'titre_config_contenu_notifications' => 'Notifiche',
731
-	'titre_config_contenu_prive' => 'Nell’area riservata',
732
-	'titre_config_contenu_public' => 'Sul sito pubblico',
733
-	'titre_config_fonctions' => 'Configurazione del sito',
734
-	'titre_configuration' => 'Configurazione del sito',
735
-	'titre_conflit_edition' => 'Conflitto all’atto dell’edizione',
736
-	'titre_connexion_ldap' => 'Opzioni: <b>La connessione LDAP</b>',
737
-	'titre_groupe_mots' => 'GRUPPO DI PAROLE CHIAVE:',
738
-	'titre_langue_article' => 'Lingua dell’articolo',
739
-	'titre_langue_rubrique' => 'Lingua della rubrica',
740
-	'titre_langue_trad_article' => 'LINGUA E TRADUZIONI DELL’ARTICOLO',
741
-	'titre_les_articles' => 'GLI ARTICOLI',
742
-	'titre_messagerie_agenda' => 'Messagistica e agenda',
743
-	'titre_naviguer_dans_le_site' => 'Navigare nel sito...',
744
-	'titre_nouvelle_rubrique' => 'Nuova rubrica',
745
-	'titre_numero_rubrique' => 'RUBRICA NUMERO:',
746
-	'titre_page_articles_edit' => 'Modifica: @titre@',
747
-	'titre_page_articles_page' => 'Gli articoli',
748
-	'titre_page_articles_tous' => 'Tutto il sito',
749
-	'titre_page_calendrier' => 'Calendario @nom_mois@ @annee@',
750
-	'titre_page_config_contenu' => 'Configurazione del sito',
751
-	'titre_page_delete_all' => 'eliminazione totale e irreversible',
752
-	'titre_page_recherche' => 'Risultati della ricerca @recherche@',
753
-	'titre_page_statistiques_referers' => 'Statistiche (link al tuo sito)',
754
-	'titre_page_upgrade' => 'Aggiornamento di SPIP',
755
-	'titre_publication_articles_post_dates' => 'Pubblicazione di articoli postdatati',
756
-	'titre_reparation' => 'Riparazione',
757
-	'titre_suivi_petition' => 'Monitoraggio delle petizioni',
758
-	'tls_ldap' => 'Transport Layer Security:',
759
-	'trad_article_traduction' => 'Tutte le versioni di questo articolo:',
760
-	'trad_delier' => 'Non collegare più a queste traduzioni', # RELIRE
761
-	'trad_lier' => 'Questo articolo è una traduzione dell’articolo numero:',
762
-	'trad_new' => 'Scrivere una nuova traduzione',
720
+    'texte_vide' => 'vuoto',
721
+    'texte_vider_cache' => 'Svuota la cache',
722
+    'titre_admin_tech' => 'Manutenzione tecnica',
723
+    'titre_admin_vider' => 'Manutenzione tecnica',
724
+    'titre_cadre_afficher_article' => 'Visualizza gli articoli',
725
+    'titre_cadre_afficher_traductions' => 'Visualizzare lo stato delle traduzioni per le seguenti lingue:',
726
+    'titre_cadre_ajouter_auteur' => 'AGGIUNGI UN’AUTRICE: ',
727
+    'titre_cadre_interieur_rubrique' => 'All’interno della rubrica',
728
+    'titre_cadre_numero_auteur' => 'AUTRICE NUMERO',
729
+    'titre_cadre_signature_obligatoire' => '<b>Firma</b> [Obbligatoria]<br />',
730
+    'titre_config_contenu_notifications' => 'Notifiche',
731
+    'titre_config_contenu_prive' => 'Nell’area riservata',
732
+    'titre_config_contenu_public' => 'Sul sito pubblico',
733
+    'titre_config_fonctions' => 'Configurazione del sito',
734
+    'titre_configuration' => 'Configurazione del sito',
735
+    'titre_conflit_edition' => 'Conflitto all’atto dell’edizione',
736
+    'titre_connexion_ldap' => 'Opzioni: <b>La connessione LDAP</b>',
737
+    'titre_groupe_mots' => 'GRUPPO DI PAROLE CHIAVE:',
738
+    'titre_langue_article' => 'Lingua dell’articolo',
739
+    'titre_langue_rubrique' => 'Lingua della rubrica',
740
+    'titre_langue_trad_article' => 'LINGUA E TRADUZIONI DELL’ARTICOLO',
741
+    'titre_les_articles' => 'GLI ARTICOLI',
742
+    'titre_messagerie_agenda' => 'Messagistica e agenda',
743
+    'titre_naviguer_dans_le_site' => 'Navigare nel sito...',
744
+    'titre_nouvelle_rubrique' => 'Nuova rubrica',
745
+    'titre_numero_rubrique' => 'RUBRICA NUMERO:',
746
+    'titre_page_articles_edit' => 'Modifica: @titre@',
747
+    'titre_page_articles_page' => 'Gli articoli',
748
+    'titre_page_articles_tous' => 'Tutto il sito',
749
+    'titre_page_calendrier' => 'Calendario @nom_mois@ @annee@',
750
+    'titre_page_config_contenu' => 'Configurazione del sito',
751
+    'titre_page_delete_all' => 'eliminazione totale e irreversible',
752
+    'titre_page_recherche' => 'Risultati della ricerca @recherche@',
753
+    'titre_page_statistiques_referers' => 'Statistiche (link al tuo sito)',
754
+    'titre_page_upgrade' => 'Aggiornamento di SPIP',
755
+    'titre_publication_articles_post_dates' => 'Pubblicazione di articoli postdatati',
756
+    'titre_reparation' => 'Riparazione',
757
+    'titre_suivi_petition' => 'Monitoraggio delle petizioni',
758
+    'tls_ldap' => 'Transport Layer Security:',
759
+    'trad_article_traduction' => 'Tutte le versioni di questo articolo:',
760
+    'trad_delier' => 'Non collegare più a queste traduzioni', # RELIRE
761
+    'trad_lier' => 'Questo articolo è una traduzione dell’articolo numero:',
762
+    'trad_new' => 'Scrivere una nuova traduzione',
763 763
 
764
-	// U
765
-	'utf8_convert_erreur_orig' => 'Errore: il set di caratteri @charset@ non è supportato.',
764
+    // U
765
+    'utf8_convert_erreur_orig' => 'Errore: il set di caratteri @charset@ non è supportato.',
766 766
 
767
-	// V
768
-	'version' => 'Versione:'
767
+    // V
768
+    'version' => 'Versione:'
769 769
 );
Please login to merge, or discard this patch.
ecrire/public/quete.php 1 patch
Indentation   +402 added lines, -402 removed lines patch added patch discarded remove patch
@@ -19,7 +19,7 @@  discard block
 block discarded – undo
19 19
  **/
20 20
 
21 21
 if (!defined('_ECRIRE_INC_VERSION')) {
22
-	return;
22
+    return;
23 23
 }
24 24
 
25 25
 
@@ -33,16 +33,16 @@  discard block
 block discarded – undo
33 33
  * @return array|bool|null
34 34
  */
35 35
 function quete_virtuel($id_article, $connect) {
36
-	return sql_getfetsel(
37
-		'virtuel',
38
-		'spip_articles',
39
-		array('id_article=' . intval($id_article), "statut='publie'"),
40
-		'',
41
-		'',
42
-		'',
43
-		'',
44
-		$connect
45
-	);
36
+    return sql_getfetsel(
37
+        'virtuel',
38
+        'spip_articles',
39
+        array('id_article=' . intval($id_article), "statut='publie'"),
40
+        '',
41
+        '',
42
+        '',
43
+        '',
44
+        $connect
45
+    );
46 46
 }
47 47
 
48 48
 /**
@@ -57,38 +57,38 @@  discard block
 block discarded – undo
57 57
  * @return array
58 58
  */
59 59
 function quete_parent_lang($table, $id, $connect = '') {
60
-	static $cache_quete = array();
61
-
62
-	if (!isset($cache_quete[$connect][$table][$id])) {
63
-		if (!isset($cache_quete[$connect][$table]['_select'])) {
64
-			$trouver_table = charger_fonction('trouver_table', 'base');
65
-			if (!$desc = $trouver_table($table,
66
-					$connect) or !isset($desc['field']['id_rubrique'])
67
-			) {
68
-				// pas de parent rubrique, on passe
69
-				$cache_quete[$connect][$table]['_select'] = false;
70
-			} else {
71
-				$select = ($table == 'spip_rubriques' ? 'id_parent' : 'id_rubrique');
72
-				$select .= isset($desc['field']['lang']) ? ', lang' : '';
73
-				$cache_quete[$connect][$table]['_select'] = $select;
74
-				$cache_quete[$connect][$table]['_id'] = id_table_objet(objet_type($table));
75
-			}
76
-		}
77
-		if ($cache_quete[$connect][$table]['_select']) {
78
-			$cache_quete[$connect][$table][$id] = sql_fetsel(
79
-				$cache_quete[$connect][$table]['_select'],
80
-				$table,
81
-				$cache_quete[$connect][$table]['_id'] . '=' . intval($id),
82
-				'',
83
-				'',
84
-				'',
85
-				'',
86
-				$connect
87
-			);
88
-		}
89
-	}
90
-
91
-	return isset($cache_quete[$connect][$table][$id]) ? $cache_quete[$connect][$table][$id] : null;
60
+    static $cache_quete = array();
61
+
62
+    if (!isset($cache_quete[$connect][$table][$id])) {
63
+        if (!isset($cache_quete[$connect][$table]['_select'])) {
64
+            $trouver_table = charger_fonction('trouver_table', 'base');
65
+            if (!$desc = $trouver_table($table,
66
+                    $connect) or !isset($desc['field']['id_rubrique'])
67
+            ) {
68
+                // pas de parent rubrique, on passe
69
+                $cache_quete[$connect][$table]['_select'] = false;
70
+            } else {
71
+                $select = ($table == 'spip_rubriques' ? 'id_parent' : 'id_rubrique');
72
+                $select .= isset($desc['field']['lang']) ? ', lang' : '';
73
+                $cache_quete[$connect][$table]['_select'] = $select;
74
+                $cache_quete[$connect][$table]['_id'] = id_table_objet(objet_type($table));
75
+            }
76
+        }
77
+        if ($cache_quete[$connect][$table]['_select']) {
78
+            $cache_quete[$connect][$table][$id] = sql_fetsel(
79
+                $cache_quete[$connect][$table]['_select'],
80
+                $table,
81
+                $cache_quete[$connect][$table]['_id'] . '=' . intval($id),
82
+                '',
83
+                '',
84
+                '',
85
+                '',
86
+                $connect
87
+            );
88
+        }
89
+    }
90
+
91
+    return isset($cache_quete[$connect][$table][$id]) ? $cache_quete[$connect][$table][$id] : null;
92 92
 }
93 93
 
94 94
 
@@ -105,11 +105,11 @@  discard block
 block discarded – undo
105 105
  * @return int
106 106
  */
107 107
 function quete_parent($id_rubrique, $connect = '') {
108
-	if (!$id_rubrique = intval($id_rubrique)) {
109
-		return 0;
110
-	}
111
-	$id_parent = quete_parent_lang('spip_rubriques', $id_rubrique, $connect);
112
-	return $id_parent ? $id_parent['id_parent'] : 0;
108
+    if (!$id_rubrique = intval($id_rubrique)) {
109
+        return 0;
110
+    }
111
+    $id_parent = quete_parent_lang('spip_rubriques', $id_rubrique, $connect);
112
+    return $id_parent ? $id_parent['id_parent'] : 0;
113 113
 }
114 114
 
115 115
 /**
@@ -125,9 +125,9 @@  discard block
 block discarded – undo
125 125
  * @return int
126 126
  */
127 127
 function quete_rubrique($id_article, $serveur) {
128
-	$id_parent = quete_parent_lang('spip_articles', $id_article, $serveur);
128
+    $id_parent = quete_parent_lang('spip_articles', $id_article, $serveur);
129 129
 
130
-	return $id_parent['id_rubrique'];
130
+    return $id_parent['id_rubrique'];
131 131
 }
132 132
 
133 133
 
@@ -141,13 +141,13 @@  discard block
 block discarded – undo
141 141
  * @return int
142 142
  */
143 143
 function quete_profondeur($id, $connect = '') {
144
-	$n = 0;
145
-	while ($id) {
146
-		$n++;
147
-		$id = quete_parent($id, $connect);
148
-	}
144
+    $n = 0;
145
+    while ($id) {
146
+        $n++;
147
+        $id = quete_parent($id, $connect);
148
+    }
149 149
 
150
-	return $n;
150
+    return $n;
151 151
 }
152 152
 
153 153
 
@@ -163,15 +163,15 @@  discard block
 block discarded – undo
163 163
  *     Morceau de la requête SQL testant la date
164 164
  */
165 165
 function quete_condition_postdates($champ_date, $serveur = '', $ignore_previsu = false) {
166
-	if (defined('_VAR_PREVIEW') and _VAR_PREVIEW and !$ignore_previsu) {
167
-		return '1=1';
168
-	}
169
-
170
-	return
171
-		(isset($GLOBALS['meta']['date_prochain_postdate'])
172
-			and $GLOBALS['meta']['date_prochain_postdate'] > time())
173
-			? "$champ_date<" . sql_quote(date('Y-m-d H:i:s', $GLOBALS['meta']['date_prochain_postdate']), $serveur)
174
-			: '1=1';
166
+    if (defined('_VAR_PREVIEW') and _VAR_PREVIEW and !$ignore_previsu) {
167
+        return '1=1';
168
+    }
169
+
170
+    return
171
+        (isset($GLOBALS['meta']['date_prochain_postdate'])
172
+            and $GLOBALS['meta']['date_prochain_postdate'] > time())
173
+            ? "$champ_date<" . sql_quote(date('Y-m-d H:i:s', $GLOBALS['meta']['date_prochain_postdate']), $serveur)
174
+            : '1=1';
175 175
 }
176 176
 
177 177
 
@@ -191,100 +191,100 @@  discard block
 block discarded – undo
191 191
  * @return array|string
192 192
  */
193 193
 function quete_condition_statut($mstatut, $previsu, $publie, $serveur = '', $ignore_previsu = false) {
194
-	static $cond = array();
195
-	$key = func_get_args();
196
-	$key = implode('-', $key);
197
-	if (isset($cond[$key])) {
198
-		return $cond[$key];
199
-	}
200
-
201
-	$liste_statuts = $publie;
202
-	if (defined('_VAR_PREVIEW') and _VAR_PREVIEW and !$ignore_previsu) {
203
-		$liste_statuts = $previsu;
204
-	}
205
-	$not = false;
206
-	if (strncmp($liste_statuts, '!', 1) == 0) {
207
-		$not = true;
208
-		$liste_statuts = substr($liste_statuts, 1);
209
-	}
210
-	// '' => ne rien afficher, '!'=> ne rien filtrer
211
-	if (!strlen($liste_statuts)) {
212
-		return $cond[$key] = ($not ? '1=1' : '0=1');
213
-	}
214
-
215
-	$liste_statuts = explode(',', $liste_statuts);
216
-	$where = array();
217
-	foreach ($liste_statuts as $k => $v) {
218
-		// filtrage /auteur pour limiter les objets d'un statut (prepa en general)
219
-		// a ceux de l'auteur identifie
220
-		if (strpos($v, '/') !== false) {
221
-			$v = explode('/', $v);
222
-			$filtre = end($v);
223
-			$v = reset($v);
224
-			$v = preg_replace(',\W,', '', $v);
225
-			if ($filtre == 'auteur'
226
-				and (strpos($mstatut, '.') !== false)
227
-				and $objet = explode('.', $mstatut)
228
-				and $id_table = reset($objet)
229
-				and $objet = objet_type($id_table)
230
-			) {
231
-				$w = "$mstatut<>" . sql_quote($v);
232
-
233
-				// retrouver l’id_auteur qui a filé un lien de prévisu éventuellement,
234
-				// sinon l’auteur en session
235
-				include_spip('inc/securiser_action');
236
-				if ($desc = decrire_token_previsu()) {
237
-					$id_auteur = $desc['id_auteur'];
238
-				} elseif (isset($GLOBALS['visiteur_session']['id_auteur'])) {
239
-					$id_auteur = intval($GLOBALS['visiteur_session']['id_auteur']);
240
-				} else {
241
-					$id_auteur = null;
242
-				}
243
-
244
-				// dans ce cas (admin en general), pas de filtrage sur ce statut
245
-				if (!autoriser('previsualiser' . $v, $objet, '', $id_auteur)) {
246
-					// si pas d'auteur identifie pas de sous-requete car pas d'article qui matche
247
-					if (!$id_auteur) {
248
-						$where[] = $w;
249
-					} else {
250
-						$primary = id_table_objet($objet);
251
-						$where[] = "($w OR $id_table.$primary IN (" . sql_get_select(
252
-								'ssss.id_objet',
253
-								'spip_auteurs_liens AS ssss',
254
-								'ssss.objet=' . sql_quote($objet) . ' AND ssss.id_auteur=' . intval($id_auteur),
255
-								'',
256
-								'',
257
-								'',
258
-								'',
259
-								$serveur
260
-							) . '))';
261
-					}
262
-				}
263
-			} // ignorer ce statut si on ne sait pas comment le filtrer
264
-			else {
265
-				$v = '';
266
-			}
267
-		}
268
-		// securite
269
-		$liste_statuts[$k] = preg_replace(',\W,', '', $v);
270
-	}
271
-	$liste_statuts = array_filter($liste_statuts);
272
-	if (count($liste_statuts) == 1) {
273
-		$where[] = array('=', $mstatut, sql_quote(reset($liste_statuts), $serveur));
274
-	} else {
275
-		$where[] = sql_in($mstatut, $liste_statuts, $not, $serveur);
276
-	}
277
-
278
-	while (count($where) > 1) {
279
-		$and = array('AND', array_pop($where), array_pop($where));
280
-		$where[] = $and;
281
-	}
282
-	$cond[$key] = reset($where);
283
-	if ($not) {
284
-		$cond[$key] = array('NOT', $cond[$key]);
285
-	}
286
-
287
-	return $cond[$key];
194
+    static $cond = array();
195
+    $key = func_get_args();
196
+    $key = implode('-', $key);
197
+    if (isset($cond[$key])) {
198
+        return $cond[$key];
199
+    }
200
+
201
+    $liste_statuts = $publie;
202
+    if (defined('_VAR_PREVIEW') and _VAR_PREVIEW and !$ignore_previsu) {
203
+        $liste_statuts = $previsu;
204
+    }
205
+    $not = false;
206
+    if (strncmp($liste_statuts, '!', 1) == 0) {
207
+        $not = true;
208
+        $liste_statuts = substr($liste_statuts, 1);
209
+    }
210
+    // '' => ne rien afficher, '!'=> ne rien filtrer
211
+    if (!strlen($liste_statuts)) {
212
+        return $cond[$key] = ($not ? '1=1' : '0=1');
213
+    }
214
+
215
+    $liste_statuts = explode(',', $liste_statuts);
216
+    $where = array();
217
+    foreach ($liste_statuts as $k => $v) {
218
+        // filtrage /auteur pour limiter les objets d'un statut (prepa en general)
219
+        // a ceux de l'auteur identifie
220
+        if (strpos($v, '/') !== false) {
221
+            $v = explode('/', $v);
222
+            $filtre = end($v);
223
+            $v = reset($v);
224
+            $v = preg_replace(',\W,', '', $v);
225
+            if ($filtre == 'auteur'
226
+                and (strpos($mstatut, '.') !== false)
227
+                and $objet = explode('.', $mstatut)
228
+                and $id_table = reset($objet)
229
+                and $objet = objet_type($id_table)
230
+            ) {
231
+                $w = "$mstatut<>" . sql_quote($v);
232
+
233
+                // retrouver l’id_auteur qui a filé un lien de prévisu éventuellement,
234
+                // sinon l’auteur en session
235
+                include_spip('inc/securiser_action');
236
+                if ($desc = decrire_token_previsu()) {
237
+                    $id_auteur = $desc['id_auteur'];
238
+                } elseif (isset($GLOBALS['visiteur_session']['id_auteur'])) {
239
+                    $id_auteur = intval($GLOBALS['visiteur_session']['id_auteur']);
240
+                } else {
241
+                    $id_auteur = null;
242
+                }
243
+
244
+                // dans ce cas (admin en general), pas de filtrage sur ce statut
245
+                if (!autoriser('previsualiser' . $v, $objet, '', $id_auteur)) {
246
+                    // si pas d'auteur identifie pas de sous-requete car pas d'article qui matche
247
+                    if (!$id_auteur) {
248
+                        $where[] = $w;
249
+                    } else {
250
+                        $primary = id_table_objet($objet);
251
+                        $where[] = "($w OR $id_table.$primary IN (" . sql_get_select(
252
+                                'ssss.id_objet',
253
+                                'spip_auteurs_liens AS ssss',
254
+                                'ssss.objet=' . sql_quote($objet) . ' AND ssss.id_auteur=' . intval($id_auteur),
255
+                                '',
256
+                                '',
257
+                                '',
258
+                                '',
259
+                                $serveur
260
+                            ) . '))';
261
+                    }
262
+                }
263
+            } // ignorer ce statut si on ne sait pas comment le filtrer
264
+            else {
265
+                $v = '';
266
+            }
267
+        }
268
+        // securite
269
+        $liste_statuts[$k] = preg_replace(',\W,', '', $v);
270
+    }
271
+    $liste_statuts = array_filter($liste_statuts);
272
+    if (count($liste_statuts) == 1) {
273
+        $where[] = array('=', $mstatut, sql_quote(reset($liste_statuts), $serveur));
274
+    } else {
275
+        $where[] = sql_in($mstatut, $liste_statuts, $not, $serveur);
276
+    }
277
+
278
+    while (count($where) > 1) {
279
+        $and = array('AND', array_pop($where), array_pop($where));
280
+        $where[] = $and;
281
+    }
282
+    $cond[$key] = reset($where);
283
+    if ($not) {
284
+        $cond[$key] = array('NOT', $cond[$key]);
285
+    }
286
+
287
+    return $cond[$key];
288 288
 }
289 289
 
290 290
 /**
@@ -295,7 +295,7 @@  discard block
 block discarded – undo
295 295
  * @return array|bool|null
296 296
  */
297 297
 function quete_fichier($id_document, $serveur = '') {
298
-	return sql_getfetsel('fichier', 'spip_documents', ('id_document=' . intval($id_document)), '', array(), '', '', $serveur);
298
+    return sql_getfetsel('fichier', 'spip_documents', ('id_document=' . intval($id_document)), '', array(), '', '', $serveur);
299 299
 }
300 300
 
301 301
 /**
@@ -306,7 +306,7 @@  discard block
 block discarded – undo
306 306
  * @return array|bool
307 307
  */
308 308
 function quete_document($id_document, $serveur = '') {
309
-	return sql_fetsel('*', 'spip_documents', ('id_document=' . intval($id_document)), '', array(), '', '', $serveur);
309
+    return sql_fetsel('*', 'spip_documents', ('id_document=' . intval($id_document)), '', array(), '', '', $serveur);
310 310
 }
311 311
 
312 312
 /**
@@ -317,7 +317,7 @@  discard block
 block discarded – undo
317 317
  * @return array|bool|null
318 318
  */
319 319
 function quete_meta($nom, $serveur) {
320
-	return sql_getfetsel('valeur', 'spip_meta', 'nom=' . sql_quote($nom), '', '', '', '', $serveur);
320
+    return sql_getfetsel('valeur', 'spip_meta', 'nom=' . sql_quote($nom), '', '', '', '', $serveur);
321 321
 }
322 322
 
323 323
 /**
@@ -343,66 +343,66 @@  discard block
 block discarded – undo
343 343
  *     Retourne soit un tableau, soit le chemin du fichier.
344 344
  */
345 345
 function quete_logo($cle_objet, $onoff, $id, $id_rubrique, $flag) {
346
-	include_spip('base/objets');
347
-	$nom = strtolower($onoff);
348
-
349
-	$cle_objet = id_table_objet($cle_objet);
350
-
351
-	while (1) {
352
-		$objet = objet_type($cle_objet);
353
-
354
-		$on = quete_logo_objet($id, $objet, $nom);
355
-
356
-		if ($on) {
357
-			if ($flag) {
358
-				return basename($on['chemin']);
359
-			} else {
360
-				$taille = @spip_getimagesize($on['chemin']);
361
-
362
-				// Si on a déjà demandé un survol directement ($onoff = off)
363
-				// ou qu'on a demandé uniquement le normal ($onoff = on)
364
-				// alors on ne cherche pas du tout le survol ici
365
-				if ($onoff != 'ON') {
366
-					$off = '';
367
-				} else {
368
-					// Sinon, c'est qu'on demande normal ET survol à la fois, donc on cherche maintenant le survol
369
-					$off = quete_logo_objet($id, $objet, 'off');
370
-				}
371
-
372
-				// on retourne une url du type IMG/artonXX?timestamp
373
-				// qui permet de distinguer le changement de logo
374
-				// et placer un expire sur le dossier IMG/
375
-				$res = array(
376
-					$on['chemin'] . ($on['timestamp'] ? "?{$on['timestamp']}" : ''),
377
-					($off ? $off['chemin'] . ($off['timestamp'] ? "?{$off['timestamp']}" : '') : ''),
378
-					(!$taille ? '' : (' ' . $taille[3]))
379
-				);
380
-				$res['src'] = $res[0];
381
-				$res['logo_on'] = $res[0];
382
-				$res['logo_off'] = $res[1];
383
-				$res['width'] = ($taille ? $taille[0] : '');
384
-				$res['height'] = ($taille ? $taille[1] : '');
385
-
386
-				return $res;
387
-			}
388
-		} else {
389
-			if (defined('_LOGO_RUBRIQUE_DESACTIVER_HERITAGE')) {
390
-				return '';
391
-			} else {
392
-				if ($id_rubrique) {
393
-					$cle_objet = 'id_rubrique';
394
-					$id = $id_rubrique;
395
-					$id_rubrique = 0;
396
-				} else {
397
-					if ($id and $cle_objet == 'id_rubrique') {
398
-						$id = quete_parent($id);
399
-					} else {
400
-						return '';
401
-					}
402
-				}
403
-			}
404
-		}
405
-	}
346
+    include_spip('base/objets');
347
+    $nom = strtolower($onoff);
348
+
349
+    $cle_objet = id_table_objet($cle_objet);
350
+
351
+    while (1) {
352
+        $objet = objet_type($cle_objet);
353
+
354
+        $on = quete_logo_objet($id, $objet, $nom);
355
+
356
+        if ($on) {
357
+            if ($flag) {
358
+                return basename($on['chemin']);
359
+            } else {
360
+                $taille = @spip_getimagesize($on['chemin']);
361
+
362
+                // Si on a déjà demandé un survol directement ($onoff = off)
363
+                // ou qu'on a demandé uniquement le normal ($onoff = on)
364
+                // alors on ne cherche pas du tout le survol ici
365
+                if ($onoff != 'ON') {
366
+                    $off = '';
367
+                } else {
368
+                    // Sinon, c'est qu'on demande normal ET survol à la fois, donc on cherche maintenant le survol
369
+                    $off = quete_logo_objet($id, $objet, 'off');
370
+                }
371
+
372
+                // on retourne une url du type IMG/artonXX?timestamp
373
+                // qui permet de distinguer le changement de logo
374
+                // et placer un expire sur le dossier IMG/
375
+                $res = array(
376
+                    $on['chemin'] . ($on['timestamp'] ? "?{$on['timestamp']}" : ''),
377
+                    ($off ? $off['chemin'] . ($off['timestamp'] ? "?{$off['timestamp']}" : '') : ''),
378
+                    (!$taille ? '' : (' ' . $taille[3]))
379
+                );
380
+                $res['src'] = $res[0];
381
+                $res['logo_on'] = $res[0];
382
+                $res['logo_off'] = $res[1];
383
+                $res['width'] = ($taille ? $taille[0] : '');
384
+                $res['height'] = ($taille ? $taille[1] : '');
385
+
386
+                return $res;
387
+            }
388
+        } else {
389
+            if (defined('_LOGO_RUBRIQUE_DESACTIVER_HERITAGE')) {
390
+                return '';
391
+            } else {
392
+                if ($id_rubrique) {
393
+                    $cle_objet = 'id_rubrique';
394
+                    $id = $id_rubrique;
395
+                    $id_rubrique = 0;
396
+                } else {
397
+                    if ($id and $cle_objet == 'id_rubrique') {
398
+                        $id = quete_parent($id);
399
+                    } else {
400
+                        return '';
401
+                    }
402
+                }
403
+            }
404
+        }
405
+    }
406 406
 }
407 407
 
408 408
 /**
@@ -416,37 +416,37 @@  discard block
 block discarded – undo
416 416
  * 		"on" ou "off" suivant le logo normal ou survol
417 417
  **/
418 418
 function quete_logo_objet($id_objet, $objet, $mode) {
419
-	static $chercher_logo;
420
-	if (is_null($chercher_logo)) {
421
-		$chercher_logo = charger_fonction('chercher_logo', 'inc');
422
-	}
423
-	$cle_objet = id_table_objet($objet);
424
-
425
-	// On cherche pas la méthode classique
426
-	$infos_logo = $chercher_logo($id_objet, $cle_objet, $mode);
427
-	// Si la méthode classique a trouvé quelque chose, on utilise le nouveau format
428
-	if (!empty($infos_logo)) {
429
-		$infos_logo = array(
430
-			'chemin' => $infos_logo[0],
431
-			'timestamp' => $infos_logo[4],
432
-		);
433
-	}
434
-
435
-	// On passe cette recherche de logo dans un pipeline
436
-	$infos_logo = pipeline(
437
-		'quete_logo_objet',
438
-		array(
439
-			'args' => array(
440
-				'id_objet' => $id_objet,
441
-				'objet' => $objet,
442
-				'cle_objet' => $cle_objet,
443
-				'mode' => $mode,
444
-			),
445
-			'data' => $infos_logo,
446
-		)
447
-	);
448
-
449
-	return $infos_logo;
419
+    static $chercher_logo;
420
+    if (is_null($chercher_logo)) {
421
+        $chercher_logo = charger_fonction('chercher_logo', 'inc');
422
+    }
423
+    $cle_objet = id_table_objet($objet);
424
+
425
+    // On cherche pas la méthode classique
426
+    $infos_logo = $chercher_logo($id_objet, $cle_objet, $mode);
427
+    // Si la méthode classique a trouvé quelque chose, on utilise le nouveau format
428
+    if (!empty($infos_logo)) {
429
+        $infos_logo = array(
430
+            'chemin' => $infos_logo[0],
431
+            'timestamp' => $infos_logo[4],
432
+        );
433
+    }
434
+
435
+    // On passe cette recherche de logo dans un pipeline
436
+    $infos_logo = pipeline(
437
+        'quete_logo_objet',
438
+        array(
439
+            'args' => array(
440
+                'id_objet' => $id_objet,
441
+                'objet' => $objet,
442
+                'cle_objet' => $cle_objet,
443
+                'mode' => $mode,
444
+            ),
445
+            'data' => $infos_logo,
446
+        )
447
+    );
448
+
449
+    return $infos_logo;
450 450
 }
451 451
 
452 452
 /**
@@ -459,24 +459,24 @@  discard block
 block discarded – undo
459 459
  * @return bool|string
460 460
  */
461 461
 function quete_logo_file($row, $connect = null) {
462
-	include_spip('inc/documents');
463
-	$logo = vignette_logo_document($row, $connect);
464
-	if (!$logo) {
465
-		$logo = image_du_document($row, $connect);
466
-	}
467
-	if (!$logo) {
468
-		$f = charger_fonction('vignette', 'inc');
469
-		$logo = $f($row['extension'], false);
470
-	}
471
-	// si c'est une vignette type doc, la renvoyer direct
472
-	if (strcmp($logo, _DIR_PLUGINS) == 0
473
-		or strcmp($logo, _DIR_PLUGINS_DIST) == 0
474
-		or strcmp($logo, _DIR_RACINE . 'prive/') == 0
475
-	) {
476
-		return $logo;
477
-	}
478
-
479
-	return get_spip_doc($logo);
462
+    include_spip('inc/documents');
463
+    $logo = vignette_logo_document($row, $connect);
464
+    if (!$logo) {
465
+        $logo = image_du_document($row, $connect);
466
+    }
467
+    if (!$logo) {
468
+        $f = charger_fonction('vignette', 'inc');
469
+        $logo = $f($row['extension'], false);
470
+    }
471
+    // si c'est une vignette type doc, la renvoyer direct
472
+    if (strcmp($logo, _DIR_PLUGINS) == 0
473
+        or strcmp($logo, _DIR_PLUGINS_DIST) == 0
474
+        or strcmp($logo, _DIR_RACINE . 'prive/') == 0
475
+    ) {
476
+        return $logo;
477
+    }
478
+
479
+    return get_spip_doc($logo);
480 480
 }
481 481
 
482 482
 /**
@@ -504,20 +504,20 @@  discard block
 block discarded – undo
504 504
  */
505 505
 function quete_logo_document($row, $lien, $align, $mode_logo, $x, $y, $connect = null) {
506 506
 
507
-	include_spip('inc/documents');
508
-	$logo = '';
509
-	if (!in_array($mode_logo, array('icone', 'apercu'))) {
510
-		$logo = vignette_logo_document($row, $connect);
511
-	}
512
-	// si on veut explicitement la vignette, ne rien renvoyer si il n'y en a pas
513
-	if ($mode_logo == 'vignette' and !$logo) {
514
-		return '';
515
-	}
516
-	if ($mode_logo == 'icone') {
517
-		$row['fichier'] = '';
518
-	}
519
-
520
-	return vignette_automatique($logo, $row, $lien, $x, $y, $align, null, $connect);
507
+    include_spip('inc/documents');
508
+    $logo = '';
509
+    if (!in_array($mode_logo, array('icone', 'apercu'))) {
510
+        $logo = vignette_logo_document($row, $connect);
511
+    }
512
+    // si on veut explicitement la vignette, ne rien renvoyer si il n'y en a pas
513
+    if ($mode_logo == 'vignette' and !$logo) {
514
+        return '';
515
+    }
516
+    if ($mode_logo == 'icone') {
517
+        $row['fichier'] = '';
518
+    }
519
+
520
+    return vignette_automatique($logo, $row, $lien, $x, $y, $align, null, $connect);
521 521
 }
522 522
 
523 523
 /**
@@ -529,19 +529,19 @@  discard block
 block discarded – undo
529 529
  */
530 530
 function quete_html_logo($logo, $align, $lien) {
531 531
 
532
-	if (!is_array($logo)) {
533
-		return '';
534
-	}
535
-
536
-	$contexte = [];
537
-	foreach ($logo as $k=>$v) {
538
-		if (!is_numeric($k)) {
539
-			$contexte[$k] = $v;
540
-		}
541
-	}
542
-	$contexte['align'] = $align;
543
-	$contexte['lien'] = $lien;
544
-	return recuperer_fond('modeles/logo', $contexte);
532
+    if (!is_array($logo)) {
533
+        return '';
534
+    }
535
+
536
+    $contexte = [];
537
+    foreach ($logo as $k=>$v) {
538
+        if (!is_numeric($k)) {
539
+            $contexte[$k] = $v;
540
+        }
541
+    }
542
+    $contexte['align'] = $align;
543
+    $contexte['lien'] = $lien;
544
+    return recuperer_fond('modeles/logo', $contexte);
545 545
 }
546 546
 
547 547
 /**
@@ -555,14 +555,14 @@  discard block
 block discarded – undo
555 555
  * @return string|false
556 556
  */
557 557
 function document_spip_externe($fichier, $connect) {
558
-	if ($connect) {
559
-		$site = quete_meta('adresse_site', $connect);
560
-		if ($site) {
561
-			$dir = quete_meta('dir_img', $connect);
562
-			return "$site/$dir$fichier";
563
-		}
564
-	}
565
-	return false;
558
+    if ($connect) {
559
+        $site = quete_meta('adresse_site', $connect);
560
+        if ($site) {
561
+            $dir = quete_meta('dir_img', $connect);
562
+            return "$site/$dir$fichier";
563
+        }
564
+    }
565
+    return false;
566 566
 }
567 567
 
568 568
 /**
@@ -575,23 +575,23 @@  discard block
 block discarded – undo
575 575
  * @return string
576 576
  */
577 577
 function vignette_logo_document($row, $connect = '') {
578
-	if (!$row['id_vignette']) {
579
-		return '';
580
-	}
581
-	$fichier = quete_fichier($row['id_vignette'], $connect);
582
-	if ($url = document_spip_externe($fichier, $connect)) {
583
-		return $url;
584
-	}
585
-
586
-	$f = get_spip_doc($fichier);
587
-	if ($f and @file_exists($f)) {
588
-		return $f;
589
-	}
590
-	if ($row['mode'] !== 'vignette') {
591
-		return '';
592
-	}
593
-
594
-	return generer_url_entite($row['id_document'], 'document', '', '', $connect);
578
+    if (!$row['id_vignette']) {
579
+        return '';
580
+    }
581
+    $fichier = quete_fichier($row['id_vignette'], $connect);
582
+    if ($url = document_spip_externe($fichier, $connect)) {
583
+        return $url;
584
+    }
585
+
586
+    $f = get_spip_doc($fichier);
587
+    if ($f and @file_exists($f)) {
588
+        return $f;
589
+    }
590
+    if ($row['mode'] !== 'vignette') {
591
+        return '';
592
+    }
593
+
594
+    return generer_url_entite($row['id_document'], 'document', '', '', $connect);
595 595
 }
596 596
 
597 597
 /**
@@ -607,68 +607,68 @@  discard block
 block discarded – undo
607 607
  * @return bool|string
608 608
  */
609 609
 function calcul_exposer($id, $prim, $reference, $parent, $type, $connect = '') {
610
-	static $exposer = array();
611
-
612
-	// Que faut-il exposer ? Tous les elements de $reference
613
-	// ainsi que leur hierarchie ; on ne fait donc ce calcul
614
-	// qu'une fois (par squelette) et on conserve le resultat
615
-	// en static.
616
-	if (!isset($exposer[$m = md5(serialize($reference))][$prim])) {
617
-		$principal = isset($reference[$type]) ? $reference[$type] :
618
-			// cas de la pagination indecte @xx qui positionne la page avec l'id xx
619
-			// et donne la reference dynamique @type=xx dans le contexte
620
-			(isset($reference["@$type"]) ? $reference["@$type"] : '');
621
-		// le parent fournit en argument est le parent de $id, pas celui de $principal
622
-		// il n'est donc pas utile
623
-		$parent = 0;
624
-		if (!$principal) { // regarder si un enfant est dans le contexte, auquel cas il expose peut etre le parent courant
625
-			$enfants = array('id_rubrique' => array('id_article'), 'id_groupe' => array('id_mot'));
626
-			if (isset($enfants[$type])) {
627
-				foreach ($enfants[$type] as $t) {
628
-					if (isset($reference[$t])
629
-						// cas de la reference donnee dynamiquement par la pagination
630
-						or isset($reference["@$t"])
631
-					) {
632
-						$type = $t;
633
-						$principal = isset($reference[$type]) ? $reference[$type] : $reference["@$type"];
634
-						continue;
635
-					}
636
-				}
637
-			}
638
-		}
639
-		$exposer[$m][$type] = array();
640
-		if ($principal) {
641
-			$principaux = is_array($principal) ? $principal : array($principal);
642
-			foreach ($principaux as $principal) {
643
-				$exposer[$m][$type][$principal] = true;
644
-				if ($type == 'id_mot') {
645
-					if (!$parent) {
646
-						$parent = sql_getfetsel('id_groupe', 'spip_mots', 'id_mot=' . intval($principal), '', '', '', '', $connect);
647
-					}
648
-					if ($parent) {
649
-						$exposer[$m]['id_groupe'][$parent] = true;
650
-					}
651
-				} else {
652
-					if ($type != 'id_groupe') {
653
-						if (!$parent) {
654
-							if ($type == 'id_rubrique') {
655
-								$parent = $principal;
656
-							}
657
-							if ($type == 'id_article') {
658
-								$parent = quete_rubrique($principal, $connect);
659
-							}
660
-						}
661
-						do {
662
-							$exposer[$m]['id_rubrique'][$parent] = true;
663
-						} while ($parent = quete_parent($parent, $connect));
664
-					}
665
-				}
666
-			}
667
-		}
668
-	}
669
-
670
-	// And the winner is...
671
-	return isset($exposer[$m][$prim]) ? isset($exposer[$m][$prim][$id]) : '';
610
+    static $exposer = array();
611
+
612
+    // Que faut-il exposer ? Tous les elements de $reference
613
+    // ainsi que leur hierarchie ; on ne fait donc ce calcul
614
+    // qu'une fois (par squelette) et on conserve le resultat
615
+    // en static.
616
+    if (!isset($exposer[$m = md5(serialize($reference))][$prim])) {
617
+        $principal = isset($reference[$type]) ? $reference[$type] :
618
+            // cas de la pagination indecte @xx qui positionne la page avec l'id xx
619
+            // et donne la reference dynamique @type=xx dans le contexte
620
+            (isset($reference["@$type"]) ? $reference["@$type"] : '');
621
+        // le parent fournit en argument est le parent de $id, pas celui de $principal
622
+        // il n'est donc pas utile
623
+        $parent = 0;
624
+        if (!$principal) { // regarder si un enfant est dans le contexte, auquel cas il expose peut etre le parent courant
625
+            $enfants = array('id_rubrique' => array('id_article'), 'id_groupe' => array('id_mot'));
626
+            if (isset($enfants[$type])) {
627
+                foreach ($enfants[$type] as $t) {
628
+                    if (isset($reference[$t])
629
+                        // cas de la reference donnee dynamiquement par la pagination
630
+                        or isset($reference["@$t"])
631
+                    ) {
632
+                        $type = $t;
633
+                        $principal = isset($reference[$type]) ? $reference[$type] : $reference["@$type"];
634
+                        continue;
635
+                    }
636
+                }
637
+            }
638
+        }
639
+        $exposer[$m][$type] = array();
640
+        if ($principal) {
641
+            $principaux = is_array($principal) ? $principal : array($principal);
642
+            foreach ($principaux as $principal) {
643
+                $exposer[$m][$type][$principal] = true;
644
+                if ($type == 'id_mot') {
645
+                    if (!$parent) {
646
+                        $parent = sql_getfetsel('id_groupe', 'spip_mots', 'id_mot=' . intval($principal), '', '', '', '', $connect);
647
+                    }
648
+                    if ($parent) {
649
+                        $exposer[$m]['id_groupe'][$parent] = true;
650
+                    }
651
+                } else {
652
+                    if ($type != 'id_groupe') {
653
+                        if (!$parent) {
654
+                            if ($type == 'id_rubrique') {
655
+                                $parent = $principal;
656
+                            }
657
+                            if ($type == 'id_article') {
658
+                                $parent = quete_rubrique($principal, $connect);
659
+                            }
660
+                        }
661
+                        do {
662
+                            $exposer[$m]['id_rubrique'][$parent] = true;
663
+                        } while ($parent = quete_parent($parent, $connect));
664
+                    }
665
+                }
666
+            }
667
+        }
668
+    }
669
+
670
+    // And the winner is...
671
+    return isset($exposer[$m][$prim]) ? isset($exposer[$m][$prim][$id]) : '';
672 672
 }
673 673
 
674 674
 /**
@@ -683,21 +683,21 @@  discard block
 block discarded – undo
683 683
  * @return int
684 684
  */
685 685
 function quete_debut_pagination($primary, $valeur, $pas, $iter) {
686
-	// on ne devrait pas arriver ici si la cle primaire est inexistante
687
-	// ou composee, mais verifions
688
-	if (!$primary or preg_match('/[,\s]/', $primary)) {
689
-		return 0;
690
-	}
691
-
692
-	$pos = 0;
693
-	while ($row = $iter->fetch() and $row[$primary] != $valeur) {
694
-		$pos++;
695
-	}
696
-	// si on a pas trouve
697
-	if (!$row or $row[$primary] != $valeur) {
698
-		return 0;
699
-	}
700
-
701
-	// sinon, calculer le bon numero de page
702
-	return floor($pos / $pas) * $pas;
686
+    // on ne devrait pas arriver ici si la cle primaire est inexistante
687
+    // ou composee, mais verifions
688
+    if (!$primary or preg_match('/[,\s]/', $primary)) {
689
+        return 0;
690
+    }
691
+
692
+    $pos = 0;
693
+    while ($row = $iter->fetch() and $row[$primary] != $valeur) {
694
+        $pos++;
695
+    }
696
+    // si on a pas trouve
697
+    if (!$row or $row[$primary] != $valeur) {
698
+        return 0;
699
+    }
700
+
701
+    // sinon, calculer le bon numero de page
702
+    return floor($pos / $pas) * $pas;
703 703
 }
Please login to merge, or discard this patch.
ecrire/inc/config.php 1 patch
Indentation   +400 added lines, -400 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
 
@@ -28,7 +28,7 @@  discard block
 block discarded – undo
28 28
  * @return void
29 29
  */
30 30
 function inc_config_dist() {
31
-	actualise_metas(liste_metas());
31
+    actualise_metas(liste_metas());
32 32
 }
33 33
 
34 34
 /**
@@ -45,34 +45,34 @@  discard block
 block discarded – undo
45 45
  *     Liste (table, casier, sous_casier)
46 46
  */
47 47
 function expliquer_config($cfg) {
48
-	// par defaut, sur la table des meta
49
-	$table = 'meta';
50
-	$casier = null;
51
-	$sous_casier = array();
52
-	$cfg = explode('/', $cfg);
53
-
54
-	// si le premier argument est vide, c'est une syntaxe /table/ ou un appel vide ''
55
-	if (!reset($cfg) and count($cfg) > 1) {
56
-		array_shift($cfg);
57
-		$table = array_shift($cfg);
58
-		if (!isset($GLOBALS[$table])) {
59
-			lire_metas($table);
60
-		}
61
-	}
62
-
63
-	// si on a demande #CONFIG{/meta,'',0}
64
-	if (count($cfg)) {
65
-		// pas sur un appel vide ''
66
-		if ('' !== ($c = array_shift($cfg))) {
67
-			$casier = $c;
68
-		}
69
-	}
70
-
71
-	if (count($cfg)) {
72
-		$sous_casier = $cfg;
73
-	}
74
-
75
-	return array($table, $casier, $sous_casier);
48
+    // par defaut, sur la table des meta
49
+    $table = 'meta';
50
+    $casier = null;
51
+    $sous_casier = array();
52
+    $cfg = explode('/', $cfg);
53
+
54
+    // si le premier argument est vide, c'est une syntaxe /table/ ou un appel vide ''
55
+    if (!reset($cfg) and count($cfg) > 1) {
56
+        array_shift($cfg);
57
+        $table = array_shift($cfg);
58
+        if (!isset($GLOBALS[$table])) {
59
+            lire_metas($table);
60
+        }
61
+    }
62
+
63
+    // si on a demande #CONFIG{/meta,'',0}
64
+    if (count($cfg)) {
65
+        // pas sur un appel vide ''
66
+        if ('' !== ($c = array_shift($cfg))) {
67
+            $casier = $c;
68
+        }
69
+    }
70
+
71
+    if (count($cfg)) {
72
+        $sous_casier = $cfg;
73
+    }
74
+
75
+    return array($table, $casier, $sous_casier);
76 76
 }
77 77
 
78 78
 /**
@@ -100,65 +100,65 @@  discard block
 block discarded – undo
100 100
  *    Contenu de la configuration obtenue
101 101
  */
102 102
 function lire_config($cfg = '', $def = null, $unserialize = true) {
103
-	// lire le stockage sous la forme /table/valeur
104
-	// ou valeur qui est en fait implicitement /meta/valeur
105
-	// ou casier/valeur qui est en fait implicitement /meta/casier/valeur
106
-
107
-	// traiter en priorite le cas simple et frequent
108
-	// de lecture direct $GLOBALS['meta']['truc'], si $cfg ne contient ni / ni :
109
-	if ($cfg and strpbrk($cfg, '/:') === false) {
110
-		$r = isset($GLOBALS['meta'][$cfg]) ?
111
-			((!$unserialize
112
-				// ne pas essayer de deserialiser autre chose qu'une chaine
113
-				or !is_string($GLOBALS['meta'][$cfg])
114
-				// ne pas essayer de deserialiser si ce n'est visiblement pas une chaine serializee
115
-				or strpos($GLOBALS['meta'][$cfg], ':') === false
116
-				or ($t = @unserialize($GLOBALS['meta'][$cfg])) === false) ? $GLOBALS['meta'][$cfg] : $t)
117
-			: $def;
118
-
119
-		return $r;
120
-	}
121
-
122
-	// Brancher sur methodes externes si besoin
123
-	if ($cfg and $p = strpos($cfg, '::')) {
124
-		$methode = substr($cfg, 0, $p);
125
-		$lire_config = charger_fonction($methode, 'lire_config');
126
-
127
-		return $lire_config(substr($cfg, $p + 2), $def, $unserialize);
128
-	}
129
-
130
-	list($table, $casier, $sous_casier) = expliquer_config($cfg);
131
-
132
-	if (!isset($GLOBALS[$table])) {
133
-		return $def;
134
-	}
135
-
136
-	$r = $GLOBALS[$table];
137
-
138
-	// si on a demande #CONFIG{/meta,'',0}
139
-	if (!$casier) {
140
-		return $unserialize ? $r : serialize($r);
141
-	}
142
-
143
-	// casier principal :
144
-	// le deserializer si demande
145
-	// ou si on a besoin
146
-	// d'un sous casier
147
-	$r = isset($r[$casier]) ? $r[$casier] : null;
148
-	if (($unserialize or count($sous_casier)) and $r and is_string($r)) {
149
-		$r = (($t = @unserialize($r)) === false ? $r : $t);
150
-	}
151
-
152
-	// aller chercher le sous_casier
153
-	while (!is_null($r) and $casier = array_shift($sous_casier)) {
154
-		$r = isset($r[$casier]) ? $r[$casier] : null;
155
-	}
156
-
157
-	if (is_null($r)) {
158
-		return $def;
159
-	}
160
-
161
-	return $r;
103
+    // lire le stockage sous la forme /table/valeur
104
+    // ou valeur qui est en fait implicitement /meta/valeur
105
+    // ou casier/valeur qui est en fait implicitement /meta/casier/valeur
106
+
107
+    // traiter en priorite le cas simple et frequent
108
+    // de lecture direct $GLOBALS['meta']['truc'], si $cfg ne contient ni / ni :
109
+    if ($cfg and strpbrk($cfg, '/:') === false) {
110
+        $r = isset($GLOBALS['meta'][$cfg]) ?
111
+            ((!$unserialize
112
+                // ne pas essayer de deserialiser autre chose qu'une chaine
113
+                or !is_string($GLOBALS['meta'][$cfg])
114
+                // ne pas essayer de deserialiser si ce n'est visiblement pas une chaine serializee
115
+                or strpos($GLOBALS['meta'][$cfg], ':') === false
116
+                or ($t = @unserialize($GLOBALS['meta'][$cfg])) === false) ? $GLOBALS['meta'][$cfg] : $t)
117
+            : $def;
118
+
119
+        return $r;
120
+    }
121
+
122
+    // Brancher sur methodes externes si besoin
123
+    if ($cfg and $p = strpos($cfg, '::')) {
124
+        $methode = substr($cfg, 0, $p);
125
+        $lire_config = charger_fonction($methode, 'lire_config');
126
+
127
+        return $lire_config(substr($cfg, $p + 2), $def, $unserialize);
128
+    }
129
+
130
+    list($table, $casier, $sous_casier) = expliquer_config($cfg);
131
+
132
+    if (!isset($GLOBALS[$table])) {
133
+        return $def;
134
+    }
135
+
136
+    $r = $GLOBALS[$table];
137
+
138
+    // si on a demande #CONFIG{/meta,'',0}
139
+    if (!$casier) {
140
+        return $unserialize ? $r : serialize($r);
141
+    }
142
+
143
+    // casier principal :
144
+    // le deserializer si demande
145
+    // ou si on a besoin
146
+    // d'un sous casier
147
+    $r = isset($r[$casier]) ? $r[$casier] : null;
148
+    if (($unserialize or count($sous_casier)) and $r and is_string($r)) {
149
+        $r = (($t = @unserialize($r)) === false ? $r : $t);
150
+    }
151
+
152
+    // aller chercher le sous_casier
153
+    while (!is_null($r) and $casier = array_shift($sous_casier)) {
154
+        $r = isset($r[$casier]) ? $r[$casier] : null;
155
+    }
156
+
157
+    if (is_null($r)) {
158
+        return $def;
159
+    }
160
+
161
+    return $r;
162 162
 }
163 163
 
164 164
 /**
@@ -172,7 +172,7 @@  discard block
 block discarded – undo
172 172
  * @return mixed
173 173
  */
174 174
 function lire_config_metapack_dist($cfg = '', $def = null, $unserialize = true) {
175
-	return lire_config($cfg, $def, $unserialize);
175
+    return lire_config($cfg, $def, $unserialize);
176 176
 }
177 177
 
178 178
 
@@ -184,98 +184,98 @@  discard block
 block discarded – undo
184 184
  * @return bool
185 185
  */
186 186
 function ecrire_config($cfg, $store) {
187
-	// Brancher sur methodes externes si besoin
188
-	if ($cfg and $p = strpos($cfg, '::')) {
189
-		$methode = substr($cfg, 0, $p);
190
-		$ecrire_config = charger_fonction($methode, 'ecrire_config');
191
-
192
-		return $ecrire_config(substr($cfg, $p + 2), $store);
193
-	}
194
-
195
-	list($table, $casier, $sous_casier) = expliquer_config($cfg);
196
-	// il faut au moins un casier pour ecrire
197
-	if (!$casier) {
198
-		return false;
199
-	}
200
-
201
-	// trouvons ou creons le pointeur sur le casier
202
-	$st = isset($GLOBALS[$table][$casier]) ? $GLOBALS[$table][$casier] : null;
203
-	if (!is_array($st) and ($sous_casier or is_array($store))) {
204
-		$st = unserialize($st);
205
-		if ($st === false) {
206
-			// ne rien creer si c'est une demande d'effacement
207
-			if (is_null($store)) {
208
-				return false;
209
-			}
210
-			$st = array();
211
-		}
212
-	}
213
-
214
-	// si on a affaire a un sous caiser
215
-	// il faut ecrire au bon endroit sans perdre les autres sous casier freres
216
-	if ($c = $sous_casier) {
217
-		$sc = &$st;
218
-		$pointeurs = array();
219
-		while (count($c) and $cc = array_shift($c)) {
220
-			// creer l'entree si elle n'existe pas
221
-			if (!isset($sc[$cc])) {
222
-				// si on essaye d'effacer une config qui n'existe pas
223
-				// ne rien creer mais sortir
224
-				if (is_null($store)) {
225
-					return false;
226
-				}
227
-				$sc[$cc] = array();
228
-			}
229
-			$pointeurs[$cc] = &$sc;
230
-			$sc = &$sc[$cc];
231
-		}
232
-
233
-		// si c'est une demande d'effacement
234
-		if (is_null($store)) {
235
-			$c = $sous_casier;
236
-			$sous = array_pop($c);
237
-			// effacer, et remonter pour effacer les parents vides
238
-			do {
239
-				unset($pointeurs[$sous][$sous]);
240
-			} while ($sous = array_pop($c) and !count($pointeurs[$sous][$sous]));
241
-
242
-			// si on a vide tous les sous casiers,
243
-			// et que le casier est vide
244
-			// vider aussi la meta
245
-			if (!$sous and !count($st)) {
246
-				$st = null;
247
-			}
248
-		} // dans tous les autres cas, on ecrase
249
-		else {
250
-			$sc = $store;
251
-		}
252
-
253
-		// Maintenant que $st est modifiee
254
-		// reprenons la comme valeur a stocker dans le casier principal
255
-		$store = $st;
256
-	}
257
-
258
-	if (is_null($store)) {
259
-		if (is_null($st) and !$sous_casier) {
260
-			return false;
261
-		} // la config n'existait deja pas !
262
-		effacer_meta($casier, $table);
263
-		supprimer_table_meta($table); // supprimons la table (si elle est bien vide)
264
-	} // les meta ne peuvent etre que des chaines : il faut serializer le reste
265
-	else {
266
-		if (!isset($GLOBALS[$table])) {
267
-			installer_table_meta($table);
268
-		}
269
-		// si ce n'est pas une chaine
270
-		// il faut serializer
271
-		if (!is_string($store)) {
272
-			$store = serialize($store);
273
-		}
274
-		ecrire_meta($casier, $store, null, $table);
275
-	}
276
-
277
-	// verifier que lire_config($cfg)==$store ?
278
-	return true;
187
+    // Brancher sur methodes externes si besoin
188
+    if ($cfg and $p = strpos($cfg, '::')) {
189
+        $methode = substr($cfg, 0, $p);
190
+        $ecrire_config = charger_fonction($methode, 'ecrire_config');
191
+
192
+        return $ecrire_config(substr($cfg, $p + 2), $store);
193
+    }
194
+
195
+    list($table, $casier, $sous_casier) = expliquer_config($cfg);
196
+    // il faut au moins un casier pour ecrire
197
+    if (!$casier) {
198
+        return false;
199
+    }
200
+
201
+    // trouvons ou creons le pointeur sur le casier
202
+    $st = isset($GLOBALS[$table][$casier]) ? $GLOBALS[$table][$casier] : null;
203
+    if (!is_array($st) and ($sous_casier or is_array($store))) {
204
+        $st = unserialize($st);
205
+        if ($st === false) {
206
+            // ne rien creer si c'est une demande d'effacement
207
+            if (is_null($store)) {
208
+                return false;
209
+            }
210
+            $st = array();
211
+        }
212
+    }
213
+
214
+    // si on a affaire a un sous caiser
215
+    // il faut ecrire au bon endroit sans perdre les autres sous casier freres
216
+    if ($c = $sous_casier) {
217
+        $sc = &$st;
218
+        $pointeurs = array();
219
+        while (count($c) and $cc = array_shift($c)) {
220
+            // creer l'entree si elle n'existe pas
221
+            if (!isset($sc[$cc])) {
222
+                // si on essaye d'effacer une config qui n'existe pas
223
+                // ne rien creer mais sortir
224
+                if (is_null($store)) {
225
+                    return false;
226
+                }
227
+                $sc[$cc] = array();
228
+            }
229
+            $pointeurs[$cc] = &$sc;
230
+            $sc = &$sc[$cc];
231
+        }
232
+
233
+        // si c'est une demande d'effacement
234
+        if (is_null($store)) {
235
+            $c = $sous_casier;
236
+            $sous = array_pop($c);
237
+            // effacer, et remonter pour effacer les parents vides
238
+            do {
239
+                unset($pointeurs[$sous][$sous]);
240
+            } while ($sous = array_pop($c) and !count($pointeurs[$sous][$sous]));
241
+
242
+            // si on a vide tous les sous casiers,
243
+            // et que le casier est vide
244
+            // vider aussi la meta
245
+            if (!$sous and !count($st)) {
246
+                $st = null;
247
+            }
248
+        } // dans tous les autres cas, on ecrase
249
+        else {
250
+            $sc = $store;
251
+        }
252
+
253
+        // Maintenant que $st est modifiee
254
+        // reprenons la comme valeur a stocker dans le casier principal
255
+        $store = $st;
256
+    }
257
+
258
+    if (is_null($store)) {
259
+        if (is_null($st) and !$sous_casier) {
260
+            return false;
261
+        } // la config n'existait deja pas !
262
+        effacer_meta($casier, $table);
263
+        supprimer_table_meta($table); // supprimons la table (si elle est bien vide)
264
+    } // les meta ne peuvent etre que des chaines : il faut serializer le reste
265
+    else {
266
+        if (!isset($GLOBALS[$table])) {
267
+            installer_table_meta($table);
268
+        }
269
+        // si ce n'est pas une chaine
270
+        // il faut serializer
271
+        if (!is_string($store)) {
272
+            $store = serialize($store);
273
+        }
274
+        ecrire_meta($casier, $store, null, $table);
275
+    }
276
+
277
+    // verifier que lire_config($cfg)==$store ?
278
+    return true;
279 279
 }
280 280
 
281 281
 
@@ -289,14 +289,14 @@  discard block
 block discarded – undo
289 289
  * @return bool
290 290
  */
291 291
 function ecrire_config_metapack_dist($cfg, $store) {
292
-	// cas particulier en metapack::
293
-	// si on ecrit une chaine deja serializee, il faut la reserializer pour la rendre
294
-	// intacte en sortie ...
295
-	if (is_string($store) and strpos($store, ':') and unserialize($store)) {
296
-		$store = serialize($store);
297
-	}
298
-
299
-	return ecrire_config($cfg, $store);
292
+    // cas particulier en metapack::
293
+    // si on ecrit une chaine deja serializee, il faut la reserializer pour la rendre
294
+    // intacte en sortie ...
295
+    if (is_string($store) and strpos($store, ':') and unserialize($store)) {
296
+        $store = serialize($store);
297
+    }
298
+
299
+    return ecrire_config($cfg, $store);
300 300
 }
301 301
 
302 302
 /**
@@ -306,9 +306,9 @@  discard block
 block discarded – undo
306 306
  * @return bool
307 307
  */
308 308
 function effacer_config($cfg) {
309
-	ecrire_config($cfg, null);
309
+    ecrire_config($cfg, null);
310 310
 
311
-	return true;
311
+    return true;
312 312
 }
313 313
 
314 314
 /**
@@ -325,71 +325,71 @@  discard block
 block discarded – undo
325 325
  * @return array
326 326
  */
327 327
 function lister_configurer($exclure = array()) {
328
-	return array();
329
-
330
-	// lister les pages de config deja dans les menus
331
-	$deja = array();
332
-	foreach ($exclure as $id => $b) {
333
-		$url = ($b['url'] ? $b['url'] : $id);
334
-		if (!$b['url'] or !isset($exclure[$url])) {
335
-			if (strncmp($url, 'configurer_', 11) == 0) {
336
-				$deja[$url] = $b;
337
-			} elseif ($b['url'] == 'configurer' and preg_match(',cfg=([a-z0-9_]+),i', $b['args'], $match)) {
338
-				$deja["configurer_" . $match[1]] = $b;
339
-			}
340
-		}
341
-
342
-	}
343
-	$exclure = $exclure + $deja;
344
-
345
-	$icone_defaut = "images/configuration-16.png";
346
-	$liste = array();
347
-	$skels = array();
348
-	$forms = array();
349
-
350
-	// trouver toutes les pages configurer_xxx de l'espace prive
351
-	// et construire un tableau des entrees qui ne sont pas dans $deja
352
-	$pages = find_all_in_path("prive/squelettes/contenu/", "configurer_.*[.]" . _EXTENSION_SQUELETTES . '$');
353
-
354
-	foreach ($pages as $page) {
355
-		$configurer = basename($page, "." . _EXTENSION_SQUELETTES);
356
-		if (!isset($exclure[$configurer])) {
357
-			$liste[$configurer] = array(
358
-				'parent' => 'bando_configuration',
359
-				'url' => $configurer,
360
-				'titre' => _T("configurer:{$configurer}_titre"),
361
-				'icone' => find_in_theme($i = "images/{$configurer}-16.png") ? $i : $icone_defaut,
362
-			);
363
-		}
364
-		$skels[$configurer] = $page;
365
-	}
366
-
367
-	// analyser la liste des $skels pour voir les #FORMULAIRE_CONFIGURER_ inclus
368
-	foreach ($skels as $file) {
369
-		$forms = array_merge($forms, lister_formulaires_configurer($file));
370
-	}
371
-	$forms = array_flip($forms);
372
-
373
-	// trouver tous les formulaires/configurer_
374
-	// et construire un tableau des entrees
375
-	$pages = find_all_in_path("formulaires/", "configurer_.*[.]" . _EXTENSION_SQUELETTES . '$');
376
-	foreach ($pages as $page) {
377
-		$configurer = basename($page, "." . _EXTENSION_SQUELETTES);
378
-		if (!isset($forms[$configurer])
379
-			and !isset($liste[$configurer])
380
-			and !isset($exclure[$configurer])
381
-		) {
382
-			$liste[$configurer] = array(
383
-				'parent' => 'bando_configuration',
384
-				'url' => 'configurer',
385
-				'args' => 'cfg=' . substr($configurer, 11),
386
-				'titre' => _T("configurer:{$configurer}_titre"),
387
-				'icone' => find_in_theme($i = "images/{$configurer}-16.png") ? $i : $icone_defaut,
388
-			);
389
-		}
390
-	}
391
-
392
-	return $liste;
328
+    return array();
329
+
330
+    // lister les pages de config deja dans les menus
331
+    $deja = array();
332
+    foreach ($exclure as $id => $b) {
333
+        $url = ($b['url'] ? $b['url'] : $id);
334
+        if (!$b['url'] or !isset($exclure[$url])) {
335
+            if (strncmp($url, 'configurer_', 11) == 0) {
336
+                $deja[$url] = $b;
337
+            } elseif ($b['url'] == 'configurer' and preg_match(',cfg=([a-z0-9_]+),i', $b['args'], $match)) {
338
+                $deja["configurer_" . $match[1]] = $b;
339
+            }
340
+        }
341
+
342
+    }
343
+    $exclure = $exclure + $deja;
344
+
345
+    $icone_defaut = "images/configuration-16.png";
346
+    $liste = array();
347
+    $skels = array();
348
+    $forms = array();
349
+
350
+    // trouver toutes les pages configurer_xxx de l'espace prive
351
+    // et construire un tableau des entrees qui ne sont pas dans $deja
352
+    $pages = find_all_in_path("prive/squelettes/contenu/", "configurer_.*[.]" . _EXTENSION_SQUELETTES . '$');
353
+
354
+    foreach ($pages as $page) {
355
+        $configurer = basename($page, "." . _EXTENSION_SQUELETTES);
356
+        if (!isset($exclure[$configurer])) {
357
+            $liste[$configurer] = array(
358
+                'parent' => 'bando_configuration',
359
+                'url' => $configurer,
360
+                'titre' => _T("configurer:{$configurer}_titre"),
361
+                'icone' => find_in_theme($i = "images/{$configurer}-16.png") ? $i : $icone_defaut,
362
+            );
363
+        }
364
+        $skels[$configurer] = $page;
365
+    }
366
+
367
+    // analyser la liste des $skels pour voir les #FORMULAIRE_CONFIGURER_ inclus
368
+    foreach ($skels as $file) {
369
+        $forms = array_merge($forms, lister_formulaires_configurer($file));
370
+    }
371
+    $forms = array_flip($forms);
372
+
373
+    // trouver tous les formulaires/configurer_
374
+    // et construire un tableau des entrees
375
+    $pages = find_all_in_path("formulaires/", "configurer_.*[.]" . _EXTENSION_SQUELETTES . '$');
376
+    foreach ($pages as $page) {
377
+        $configurer = basename($page, "." . _EXTENSION_SQUELETTES);
378
+        if (!isset($forms[$configurer])
379
+            and !isset($liste[$configurer])
380
+            and !isset($exclure[$configurer])
381
+        ) {
382
+            $liste[$configurer] = array(
383
+                'parent' => 'bando_configuration',
384
+                'url' => 'configurer',
385
+                'args' => 'cfg=' . substr($configurer, 11),
386
+                'titre' => _T("configurer:{$configurer}_titre"),
387
+                'icone' => find_in_theme($i = "images/{$configurer}-16.png") ? $i : $icone_defaut,
388
+            );
389
+        }
390
+    }
391
+
392
+    return $liste;
393 393
 }
394 394
 
395 395
 
@@ -403,35 +403,35 @@  discard block
 block discarded – undo
403 403
  *    Liste des formulaires trouvés
404 404
  **/
405 405
 function lister_formulaires_configurer($file) {
406
-	$forms = array();
407
-
408
-	lire_fichier($file, $skel);
409
-	if (preg_match_all(",#FORMULAIRE_(CONFIGURER_[A-Z0-9_]*),", $skel, $matches, PREG_SET_ORDER)) {
410
-		$matches = array_map('end', $matches);
411
-		$matches = array_map('strtolower', $matches);
412
-		$forms = array_merge($forms, $matches);
413
-	}
414
-
415
-	// evaluer le fond en lui passant un exec coherent pour que les pipelines le reconnaissent
416
-	// et reperer les formulaires CVT configurer_xx insereres par les plugins via pipeline
417
-	$config = basename(substr($file, 0, -strlen("." . _EXTENSION_SQUELETTES)));
418
-	spip_log('Calcul de ' . "prive/squelettes/contenu/$config");
419
-	$fond = recuperer_fond("prive/squelettes/contenu/$config", array("exec" => $config));
420
-
421
-	// passer dans le pipeline affiche_milieu pour que les plugins puissent ajouter leur formulaires...
422
-	// et donc que l'on puisse les referencer aussi !
423
-	$fond = pipeline('affiche_milieu', array('args' => array("exec" => $config), 'data' => $fond));
424
-
425
-	// recuperer les noms des formulaires presents.
426
-	if (is_array($inputs = extraire_balises($fond, "input"))) {
427
-		foreach ($inputs as $i) {
428
-			if (extraire_attribut($i, 'name') == 'formulaire_action') {
429
-				$forms[] = ($c = extraire_attribut($i, 'value'));
430
-			}
431
-		}
432
-	}
433
-
434
-	return $forms;
406
+    $forms = array();
407
+
408
+    lire_fichier($file, $skel);
409
+    if (preg_match_all(",#FORMULAIRE_(CONFIGURER_[A-Z0-9_]*),", $skel, $matches, PREG_SET_ORDER)) {
410
+        $matches = array_map('end', $matches);
411
+        $matches = array_map('strtolower', $matches);
412
+        $forms = array_merge($forms, $matches);
413
+    }
414
+
415
+    // evaluer le fond en lui passant un exec coherent pour que les pipelines le reconnaissent
416
+    // et reperer les formulaires CVT configurer_xx insereres par les plugins via pipeline
417
+    $config = basename(substr($file, 0, -strlen("." . _EXTENSION_SQUELETTES)));
418
+    spip_log('Calcul de ' . "prive/squelettes/contenu/$config");
419
+    $fond = recuperer_fond("prive/squelettes/contenu/$config", array("exec" => $config));
420
+
421
+    // passer dans le pipeline affiche_milieu pour que les plugins puissent ajouter leur formulaires...
422
+    // et donc que l'on puisse les referencer aussi !
423
+    $fond = pipeline('affiche_milieu', array('args' => array("exec" => $config), 'data' => $fond));
424
+
425
+    // recuperer les noms des formulaires presents.
426
+    if (is_array($inputs = extraire_balises($fond, "input"))) {
427
+        foreach ($inputs as $i) {
428
+            if (extraire_attribut($i, 'name') == 'formulaire_action') {
429
+                $forms[] = ($c = extraire_attribut($i, 'value'));
430
+            }
431
+        }
432
+    }
433
+
434
+    return $forms;
435 435
 }
436 436
 
437 437
 
@@ -449,58 +449,58 @@  discard block
 block discarded – undo
449 449
  *    Couples nom de la `meta` => valeur par défaut
450 450
  */
451 451
 function liste_metas() {
452
-	return pipeline('configurer_liste_metas', array(
453
-		'nom_site' => _T('info_mon_site_spip'),
454
-		'slogan_site' => '',
455
-		'adresse_site' => preg_replace(",/$,", "", url_de_base()),
456
-		'descriptif_site' => '',
457
-		'activer_logos' => 'oui',
458
-		'activer_logos_survol' => 'non',
459
-		'articles_surtitre' => 'non',
460
-		'articles_soustitre' => 'non',
461
-		'articles_descriptif' => 'non',
462
-		'articles_chapeau' => 'non',
463
-		'articles_texte' => 'oui',
464
-		'articles_ps' => 'non',
465
-		'articles_redac' => 'non',
466
-		'post_dates' => 'non',
467
-		'articles_urlref' => 'non',
468
-		'articles_redirection' => 'non',
469
-		'creer_preview' => 'non',
470
-		'taille_preview' => 150,
471
-		'articles_modif' => 'non',
472
-
473
-		'rubriques_descriptif' => 'non',
474
-		'rubriques_texte' => 'oui',
475
-
476
-		'accepter_inscriptions' => 'non',
477
-		'accepter_visiteurs' => 'non',
478
-		'prevenir_auteurs' => 'non',
479
-		'suivi_edito' => 'non',
480
-		'adresse_suivi' => '',
481
-		'adresse_suivi_inscription' => '',
482
-		'adresse_neuf' => '',
483
-		'jours_neuf' => '',
484
-		'quoi_de_neuf' => 'non',
485
-		'preview' => ',0minirezo,1comite,',
486
-
487
-		'syndication_integrale' => 'oui',
488
-		'charset' => _DEFAULT_CHARSET,
489
-		'dir_img' => substr(_DIR_IMG, strlen(_DIR_RACINE)),
490
-
491
-		'multi_rubriques' => 'non',
492
-		'multi_secteurs' => 'non',
493
-		'gerer_trad' => 'non',
494
-		'langues_multilingue' => '',
495
-
496
-		'version_html_max' => 'html4',
497
-
498
-		'type_urls' => 'page',
499
-
500
-		'email_envoi' => '',
501
-		'email_webmaster' => '',
502
-		'auto_compress_http' => 'non',
503
-	));
452
+    return pipeline('configurer_liste_metas', array(
453
+        'nom_site' => _T('info_mon_site_spip'),
454
+        'slogan_site' => '',
455
+        'adresse_site' => preg_replace(",/$,", "", url_de_base()),
456
+        'descriptif_site' => '',
457
+        'activer_logos' => 'oui',
458
+        'activer_logos_survol' => 'non',
459
+        'articles_surtitre' => 'non',
460
+        'articles_soustitre' => 'non',
461
+        'articles_descriptif' => 'non',
462
+        'articles_chapeau' => 'non',
463
+        'articles_texte' => 'oui',
464
+        'articles_ps' => 'non',
465
+        'articles_redac' => 'non',
466
+        'post_dates' => 'non',
467
+        'articles_urlref' => 'non',
468
+        'articles_redirection' => 'non',
469
+        'creer_preview' => 'non',
470
+        'taille_preview' => 150,
471
+        'articles_modif' => 'non',
472
+
473
+        'rubriques_descriptif' => 'non',
474
+        'rubriques_texte' => 'oui',
475
+
476
+        'accepter_inscriptions' => 'non',
477
+        'accepter_visiteurs' => 'non',
478
+        'prevenir_auteurs' => 'non',
479
+        'suivi_edito' => 'non',
480
+        'adresse_suivi' => '',
481
+        'adresse_suivi_inscription' => '',
482
+        'adresse_neuf' => '',
483
+        'jours_neuf' => '',
484
+        'quoi_de_neuf' => 'non',
485
+        'preview' => ',0minirezo,1comite,',
486
+
487
+        'syndication_integrale' => 'oui',
488
+        'charset' => _DEFAULT_CHARSET,
489
+        'dir_img' => substr(_DIR_IMG, strlen(_DIR_RACINE)),
490
+
491
+        'multi_rubriques' => 'non',
492
+        'multi_secteurs' => 'non',
493
+        'gerer_trad' => 'non',
494
+        'langues_multilingue' => '',
495
+
496
+        'version_html_max' => 'html4',
497
+
498
+        'type_urls' => 'page',
499
+
500
+        'email_envoi' => '',
501
+        'email_webmaster' => '',
502
+        'auto_compress_http' => 'non',
503
+    ));
504 504
 }
505 505
 
506 506
 /**
@@ -511,43 +511,43 @@  discard block
 block discarded – undo
511 511
  * @return void
512 512
  */
513 513
 function actualise_metas($liste_meta) {
514
-	$meta_serveur =
515
-		array(
516
-			'version_installee',
517
-			'adresse_site',
518
-			'alea_ephemere_ancien',
519
-			'alea_ephemere',
520
-			'alea_ephemere_date',
521
-			'langue_site',
522
-			'langues_proposees',
523
-			'date_calcul_rubriques',
524
-			'derniere_modif',
525
-			'optimiser_table',
526
-			'drapeau_edition',
527
-			'creer_preview',
528
-			'taille_preview',
529
-			'creer_htpasswd',
530
-			'creer_htaccess',
531
-			'gd_formats_read',
532
-			'gd_formats',
533
-			'netpbm_formats',
534
-			'formats_graphiques',
535
-			'image_process',
536
-			'plugin_header',
537
-			'plugin'
538
-		);
539
-	// verifier le impt=non
540
-	sql_updateq('spip_meta', array('impt' => 'non'), sql_in('nom', $meta_serveur));
541
-
542
-	foreach ($liste_meta as $nom => $valeur) {
543
-		if (empty($GLOBALS['meta'][$nom])) {
544
-			ecrire_meta($nom, $valeur);
545
-		}
546
-	}
547
-
548
-	include_spip('inc/rubriques');
549
-	$langues = calculer_langues_utilisees();
550
-	ecrire_meta('langues_utilisees', $langues);
514
+    $meta_serveur =
515
+        array(
516
+            'version_installee',
517
+            'adresse_site',
518
+            'alea_ephemere_ancien',
519
+            'alea_ephemere',
520
+            'alea_ephemere_date',
521
+            'langue_site',
522
+            'langues_proposees',
523
+            'date_calcul_rubriques',
524
+            'derniere_modif',
525
+            'optimiser_table',
526
+            'drapeau_edition',
527
+            'creer_preview',
528
+            'taille_preview',
529
+            'creer_htpasswd',
530
+            'creer_htaccess',
531
+            'gd_formats_read',
532
+            'gd_formats',
533
+            'netpbm_formats',
534
+            'formats_graphiques',
535
+            'image_process',
536
+            'plugin_header',
537
+            'plugin'
538
+        );
539
+    // verifier le impt=non
540
+    sql_updateq('spip_meta', array('impt' => 'non'), sql_in('nom', $meta_serveur));
541
+
542
+    foreach ($liste_meta as $nom => $valeur) {
543
+        if (empty($GLOBALS['meta'][$nom])) {
544
+            ecrire_meta($nom, $valeur);
545
+        }
546
+    }
547
+
548
+    include_spip('inc/rubriques');
549
+    $langues = calculer_langues_utilisees();
550
+    ecrire_meta('langues_utilisees', $langues);
551 551
 }
552 552
 
553 553
 
@@ -569,18 +569,18 @@  discard block
 block discarded – undo
569 569
  */
570 570
 function appliquer_modifs_config($purger_skel = false) {
571 571
 
572
-	foreach (liste_metas() as $i => $v) {
573
-		if (($x = _request($i)) !== null) {
574
-			ecrire_meta($i, $x);
575
-		} elseif (!isset($GLOBALS['meta'][$i])) {
576
-			ecrire_meta($i, $v);
577
-		}
578
-	}
579
-
580
-	if ($purger_skel) {
581
-		include_spip('inc/invalideur');
582
-		purger_repertoire(_DIR_SKELS);
583
-	}
572
+    foreach (liste_metas() as $i => $v) {
573
+        if (($x = _request($i)) !== null) {
574
+            ecrire_meta($i, $x);
575
+        } elseif (!isset($GLOBALS['meta'][$i])) {
576
+            ecrire_meta($i, $v);
577
+        }
578
+    }
579
+
580
+    if ($purger_skel) {
581
+        include_spip('inc/invalideur');
582
+        purger_repertoire(_DIR_SKELS);
583
+    }
584 584
 }
585 585
 
586 586
 /**
@@ -591,21 +591,21 @@  discard block
 block discarded – undo
591 591
  * @return string
592 592
  */
593 593
 function appliquer_adresse_site($adresse_site) {
594
-	if ($adresse_site !== null) {
595
-		if (!strlen($adresse_site)) {
596
-			$GLOBALS['profondeur_url'] = _DIR_RESTREINT ? 0 : 1;
597
-			$adresse_site = url_de_base();
598
-		}
599
-		$adresse_site = preg_replace(",/?\s*$,", "", $adresse_site);
594
+    if ($adresse_site !== null) {
595
+        if (!strlen($adresse_site)) {
596
+            $GLOBALS['profondeur_url'] = _DIR_RESTREINT ? 0 : 1;
597
+            $adresse_site = url_de_base();
598
+        }
599
+        $adresse_site = preg_replace(",/?\s*$,", "", $adresse_site);
600 600
 
601
-		if (!tester_url_absolue($adresse_site)) {
602
-			$adresse_site = "http://$adresse_site";
603
-		}
601
+        if (!tester_url_absolue($adresse_site)) {
602
+            $adresse_site = "http://$adresse_site";
603
+        }
604 604
 
605
-		$adresse_site = entites_html($adresse_site);
605
+        $adresse_site = entites_html($adresse_site);
606 606
 
607
-		ecrire_meta('adresse_site', $adresse_site);
608
-	}
607
+        ecrire_meta('adresse_site', $adresse_site);
608
+    }
609 609
 
610
-	return $adresse_site;
610
+    return $adresse_site;
611 611
 }
Please login to merge, or discard this patch.
ecrire/public/iterateur.php 1 patch
Indentation   +564 added lines, -564 removed lines patch added patch discarded remove patch
@@ -12,7 +12,7 @@  discard block
 block discarded – undo
12 12
 \***************************************************************************/
13 13
 
14 14
 if (!defined('_ECRIRE_INC_VERSION')) {
15
-	return;
15
+    return;
16 16
 }
17 17
 
18 18
 /**
@@ -22,578 +22,578 @@  discard block
 block discarded – undo
22 22
  *
23 23
  */
24 24
 class IterFactory {
25
-	public static function create($iterateur, $command, $info = null) {
26
-
27
-		// cas des SI {si expression} analises tres tot
28
-		// pour eviter le chargement de tout iterateur
29
-		if (isset($command['si'])) {
30
-			foreach ($command['si'] as $si) {
31
-				if (!$si) {
32
-					// $command pour boucle SQL peut generer des erreurs de compilation
33
-					// s'il est transmis alors qu'on est dans un iterateur vide
34
-					return new IterDecorator(new EmptyIterator(), array(), $info);
35
-				}
36
-			}
37
-		}
38
-
39
-		// chercher un iterateur PHP existant (par exemple dans SPL)
40
-		// (il faudrait passer l'argument ->sql_serveur
41
-		// pour etre certain qu'on est sur un "php:")
42
-		if (class_exists($iterateur)) {
43
-			$a = isset($command['args']) ? $command['args'] : array();
44
-
45
-			// permettre de passer un Iterateur directement {args #ITERATEUR} :
46
-			// si on recoit deja un iterateur en argument, on l'utilise
47
-			if (count($a) == 1 and is_object($a[0]) and is_subclass_of($a[0], 'Iterator')) {
48
-				$iter = $a[0];
49
-
50
-				// sinon, on cree un iterateur du type donne
51
-			} else {
52
-				// arguments de creation de l'iterateur...
53
-				// (pas glop)
54
-				try {
55
-					switch (count($a)) {
56
-						case 0:
57
-							$iter = new $iterateur();
58
-							break;
59
-						case 1:
60
-							$iter = new $iterateur($a[0]);
61
-							break;
62
-						case 2:
63
-							$iter = new $iterateur($a[0], $a[1]);
64
-							break;
65
-						case 3:
66
-							$iter = new $iterateur($a[0], $a[1], $a[2]);
67
-							break;
68
-						case 4:
69
-							$iter = new $iterateur($a[0], $a[1], $a[2], $a[3]);
70
-							break;
71
-					}
72
-				} catch (Exception $e) {
73
-					spip_log("Erreur de chargement de l'iterateur $iterateur");
74
-					spip_log($e->getMessage());
75
-					$iter = new EmptyIterator();
76
-				}
77
-			}
78
-		} else {
79
-			// chercher la classe d'iterateur
80
-			// IterateurXXX
81
-			// definie dans le fichier iterateurs/xxx.php
82
-			$class = "Iterateur" . $iterateur;
83
-			if (!class_exists($class)) {
84
-				if (!include_spip("iterateur/" . strtolower($iterateur))
85
-					or !class_exists($class)
86
-				) {
87
-					die("Iterateur $iterateur non trouv&#233;");
88
-					// si l'iterateur n'existe pas, on se rabat sur le generique
89
-					# $iter = new EmptyIterator();
90
-				}
91
-			}
92
-			$iter = new $class($command, $info);
93
-		}
94
-
95
-		return new IterDecorator($iter, $command, $info);
96
-	}
25
+    public static function create($iterateur, $command, $info = null) {
26
+
27
+        // cas des SI {si expression} analises tres tot
28
+        // pour eviter le chargement de tout iterateur
29
+        if (isset($command['si'])) {
30
+            foreach ($command['si'] as $si) {
31
+                if (!$si) {
32
+                    // $command pour boucle SQL peut generer des erreurs de compilation
33
+                    // s'il est transmis alors qu'on est dans un iterateur vide
34
+                    return new IterDecorator(new EmptyIterator(), array(), $info);
35
+                }
36
+            }
37
+        }
38
+
39
+        // chercher un iterateur PHP existant (par exemple dans SPL)
40
+        // (il faudrait passer l'argument ->sql_serveur
41
+        // pour etre certain qu'on est sur un "php:")
42
+        if (class_exists($iterateur)) {
43
+            $a = isset($command['args']) ? $command['args'] : array();
44
+
45
+            // permettre de passer un Iterateur directement {args #ITERATEUR} :
46
+            // si on recoit deja un iterateur en argument, on l'utilise
47
+            if (count($a) == 1 and is_object($a[0]) and is_subclass_of($a[0], 'Iterator')) {
48
+                $iter = $a[0];
49
+
50
+                // sinon, on cree un iterateur du type donne
51
+            } else {
52
+                // arguments de creation de l'iterateur...
53
+                // (pas glop)
54
+                try {
55
+                    switch (count($a)) {
56
+                        case 0:
57
+                            $iter = new $iterateur();
58
+                            break;
59
+                        case 1:
60
+                            $iter = new $iterateur($a[0]);
61
+                            break;
62
+                        case 2:
63
+                            $iter = new $iterateur($a[0], $a[1]);
64
+                            break;
65
+                        case 3:
66
+                            $iter = new $iterateur($a[0], $a[1], $a[2]);
67
+                            break;
68
+                        case 4:
69
+                            $iter = new $iterateur($a[0], $a[1], $a[2], $a[3]);
70
+                            break;
71
+                    }
72
+                } catch (Exception $e) {
73
+                    spip_log("Erreur de chargement de l'iterateur $iterateur");
74
+                    spip_log($e->getMessage());
75
+                    $iter = new EmptyIterator();
76
+                }
77
+            }
78
+        } else {
79
+            // chercher la classe d'iterateur
80
+            // IterateurXXX
81
+            // definie dans le fichier iterateurs/xxx.php
82
+            $class = "Iterateur" . $iterateur;
83
+            if (!class_exists($class)) {
84
+                if (!include_spip("iterateur/" . strtolower($iterateur))
85
+                    or !class_exists($class)
86
+                ) {
87
+                    die("Iterateur $iterateur non trouv&#233;");
88
+                    // si l'iterateur n'existe pas, on se rabat sur le generique
89
+                    # $iter = new EmptyIterator();
90
+                }
91
+            }
92
+            $iter = new $class($command, $info);
93
+        }
94
+
95
+        return new IterDecorator($iter, $command, $info);
96
+    }
97 97
 }
98 98
 
99 99
 
100 100
 class IterDecorator extends FilterIterator {
101
-	private $iter;
102
-
103
-	/**
104
-	 * Conditions de filtrage
105
-	 * ie criteres de selection
106
-	 *
107
-	 * @var array
108
-	 */
109
-	protected $filtre = array();
110
-
111
-	/**
112
-	 * Fonction de filtrage compilee a partir des criteres de filtre
113
-	 *
114
-	 * @var string
115
-	 */
116
-	protected $func_filtre = null;
117
-
118
-	/**
119
-	 * Critere {offset, limit}
120
-	 *
121
-	 * @var int
122
-	 * @var int
123
-	 */
124
-	protected $offset = null;
125
-	protected $limit = null;
126
-
127
-	/**
128
-	 * nombre d'elements recuperes depuis la position 0,
129
-	 * en tenant compte des filtres
130
-	 *
131
-	 * @var int
132
-	 */
133
-	protected $fetched = 0;
134
-
135
-	/**
136
-	 * Y a t'il une erreur ?
137
-	 *
138
-	 * @var bool
139
-	 **/
140
-	protected $err = false;
141
-
142
-	/**
143
-	 * Drapeau a activer en cas d'echec
144
-	 * (select SQL errone, non chargement des DATA, etc)
145
-	 */
146
-	public function err() {
147
-		if (method_exists($this->iter, 'err')) {
148
-			return $this->iter->err();
149
-		}
150
-		if (property_exists($this->iter, 'err')) {
151
-			return $this->iter->err;
152
-		}
153
-
154
-		return false;
155
-	}
156
-
157
-	public function __construct(Iterator $iter, $command, $info) {
158
-		parent::__construct($iter);
159
-		parent::rewind(); // remettre a la premiere position (bug? connu de FilterIterator)
160
-
161
-		// recuperer l'iterateur transmis
162
-		$this->iter = $this->getInnerIterator();
163
-		$this->command = $command;
164
-		$this->info = $info;
165
-		$this->pos = 0;
166
-		$this->fetched = 0;
167
-
168
-		// chercher la liste des champs a retourner par
169
-		// fetch si l'objet ne les calcule pas tout seul
170
-		if (!method_exists($this->iter, 'fetch')) {
171
-			$this->calculer_select();
172
-			$this->calculer_filtres();
173
-		}
174
-
175
-		// emptyIterator critere {si} faux n'a pas d'erreur !
176
-		if (isset($this->iter->err)) {
177
-			$this->err = $this->iter->err;
178
-		}
179
-
180
-		// pas d'init a priori, le calcul ne sera fait qu'en cas de besoin (provoque une double requete souvent inutile en sqlite)
181
-		//$this->total = $this->count();
182
-	}
183
-
184
-
185
-	// calcule les elements a retournes par fetch()
186
-	// enleve les elements inutiles du select()
187
-	// 
188
-	private function calculer_select() {
189
-		if ($select = &$this->command['select']) {
190
-			foreach ($select as $s) {
191
-				// /!\ $s = '.nom'
192
-				if ($s[0] == '.') {
193
-					$s = substr($s, 1);
194
-				}
195
-				$this->select[] = $s;
196
-			}
197
-		}
198
-	}
199
-
200
-	// recuperer la valeur d'une balise #X
201
-	// en fonction des methodes 
202
-	// et proprietes disponibles
203
-	public function get_select($nom) {
204
-		if (is_object($this->iter)
205
-			and method_exists($this->iter, $nom)
206
-		) {
207
-			try {
208
-				return $this->iter->$nom();
209
-			} catch (Exception $e) {
210
-				// #GETCHILDREN sur un fichier de DirectoryIterator ...
211
-				spip_log("Methode $nom en echec sur " . get_class($this->iter));
212
-				spip_log("Cela peut être normal : retour d'une ligne de resultat ne pouvant pas calculer cette methode");
213
-
214
-				return '';
215
-			}
216
-		}
217
-		/*
101
+    private $iter;
102
+
103
+    /**
104
+     * Conditions de filtrage
105
+     * ie criteres de selection
106
+     *
107
+     * @var array
108
+     */
109
+    protected $filtre = array();
110
+
111
+    /**
112
+     * Fonction de filtrage compilee a partir des criteres de filtre
113
+     *
114
+     * @var string
115
+     */
116
+    protected $func_filtre = null;
117
+
118
+    /**
119
+     * Critere {offset, limit}
120
+     *
121
+     * @var int
122
+     * @var int
123
+     */
124
+    protected $offset = null;
125
+    protected $limit = null;
126
+
127
+    /**
128
+     * nombre d'elements recuperes depuis la position 0,
129
+     * en tenant compte des filtres
130
+     *
131
+     * @var int
132
+     */
133
+    protected $fetched = 0;
134
+
135
+    /**
136
+     * Y a t'il une erreur ?
137
+     *
138
+     * @var bool
139
+     **/
140
+    protected $err = false;
141
+
142
+    /**
143
+     * Drapeau a activer en cas d'echec
144
+     * (select SQL errone, non chargement des DATA, etc)
145
+     */
146
+    public function err() {
147
+        if (method_exists($this->iter, 'err')) {
148
+            return $this->iter->err();
149
+        }
150
+        if (property_exists($this->iter, 'err')) {
151
+            return $this->iter->err;
152
+        }
153
+
154
+        return false;
155
+    }
156
+
157
+    public function __construct(Iterator $iter, $command, $info) {
158
+        parent::__construct($iter);
159
+        parent::rewind(); // remettre a la premiere position (bug? connu de FilterIterator)
160
+
161
+        // recuperer l'iterateur transmis
162
+        $this->iter = $this->getInnerIterator();
163
+        $this->command = $command;
164
+        $this->info = $info;
165
+        $this->pos = 0;
166
+        $this->fetched = 0;
167
+
168
+        // chercher la liste des champs a retourner par
169
+        // fetch si l'objet ne les calcule pas tout seul
170
+        if (!method_exists($this->iter, 'fetch')) {
171
+            $this->calculer_select();
172
+            $this->calculer_filtres();
173
+        }
174
+
175
+        // emptyIterator critere {si} faux n'a pas d'erreur !
176
+        if (isset($this->iter->err)) {
177
+            $this->err = $this->iter->err;
178
+        }
179
+
180
+        // pas d'init a priori, le calcul ne sera fait qu'en cas de besoin (provoque une double requete souvent inutile en sqlite)
181
+        //$this->total = $this->count();
182
+    }
183
+
184
+
185
+    // calcule les elements a retournes par fetch()
186
+    // enleve les elements inutiles du select()
187
+    // 
188
+    private function calculer_select() {
189
+        if ($select = &$this->command['select']) {
190
+            foreach ($select as $s) {
191
+                // /!\ $s = '.nom'
192
+                if ($s[0] == '.') {
193
+                    $s = substr($s, 1);
194
+                }
195
+                $this->select[] = $s;
196
+            }
197
+        }
198
+    }
199
+
200
+    // recuperer la valeur d'une balise #X
201
+    // en fonction des methodes 
202
+    // et proprietes disponibles
203
+    public function get_select($nom) {
204
+        if (is_object($this->iter)
205
+            and method_exists($this->iter, $nom)
206
+        ) {
207
+            try {
208
+                return $this->iter->$nom();
209
+            } catch (Exception $e) {
210
+                // #GETCHILDREN sur un fichier de DirectoryIterator ...
211
+                spip_log("Methode $nom en echec sur " . get_class($this->iter));
212
+                spip_log("Cela peut être normal : retour d'une ligne de resultat ne pouvant pas calculer cette methode");
213
+
214
+                return '';
215
+            }
216
+        }
217
+        /*
218 218
 		if (property_exists($this->iter, $nom)) {
219 219
 			return $this->iter->$nom;
220 220
 		}*/
221
-		// cle et valeur par defaut
222
-		// ICI PLANTAGE SI ON NE CONTROLE PAS $nom
223
-		if (in_array($nom, array('cle', 'valeur'))
224
-			and method_exists($this, $nom)
225
-		) {
226
-			return $this->$nom();
227
-		}
228
-
229
-		// Par defaut chercher en xpath dans la valeur()
230
-		return table_valeur($this->valeur(), $nom, null);
231
-	}
232
-
233
-
234
-	private function calculer_filtres() {
235
-
236
-		// Issu de calculer_select() de public/composer L.519
237
-		// TODO: externaliser...
238
-		//
239
-		// retirer les criteres vides:
240
-		// {X ?} avec X absent de l'URL
241
-		// {par #ENV{X}} avec X absent de l'URL
242
-		// IN sur collection vide (ce dernier devrait pouvoir etre fait a la compil)
243
-		if ($where = &$this->command['where']) {
244
-			foreach ($where as $k => $v) {
245
-				if (is_array($v)) {
246
-					if ((count($v) >= 2) && ($v[0] == 'REGEXP') && ($v[2] == "'.*'")) {
247
-						$op = false;
248
-					} elseif ((count($v) >= 2) && ($v[0] == 'LIKE') && ($v[2] == "'%'")) {
249
-						$op = false;
250
-					} else {
251
-						$op = $v[0] ? $v[0] : $v;
252
-					}
253
-				} else {
254
-					$op = $v;
255
-				}
256
-				if ((!$op) or ($op == 1) or ($op == '0=0')) {
257
-					unset($where[$k]);
258
-				}
259
-				// traiter {cle IN a,b} ou {valeur !IN a,b}
260
-				if (preg_match(',^\(([\w/]+)(\s+NOT)?\s+IN\s+(\(.*\))\)$,', $op, $regs)) {
261
-					$this->ajouter_filtre($regs[1], 'IN', $regs[3], $regs[2]);
262
-					unset($op, $where[$k]);
263
-				}
264
-			}
265
-			foreach ($where as $k => $v) {
266
-				// 3 possibilites : count($v) =
267
-				// * 1 : {x y} ; on recoit $v[0] = y
268
-				// * 2 : {x !op y} ; on recoit $v[0] = 'NOT', $v[1] = array() // array du type {x op y}
269
-				// * 3 : {x op y} ; on recoit $v[0] = 'op', $v[1] = x, $v[2] = y
270
-
271
-				// 1 : forcement traite par un critere, on passe
272
-				if (!$v or count($v) == 1) {
273
-					continue;
274
-				}
275
-				if (count($v) == 2 and is_array($v[1])) {
276
-					$this->ajouter_filtre($v[1][1], $v[1][0], $v[1][2], 'NOT');
277
-				}
278
-				if (count($v) == 3) {
279
-					$this->ajouter_filtre($v[1], $v[0], $v[2]);
280
-				}
281
-			}
282
-		}
283
-
284
-		// critere {2,7}
285
-		if (isset($this->command['limit']) and $this->command['limit']) {
286
-			$limit = explode(',', $this->command['limit']);
287
-			$this->offset = $limit[0];
288
-			$this->limit = $limit[1];
289
-		}
290
-
291
-		// Creer la fonction de filtrage sur $this
292
-		if ($this->filtre) {
293
-			$filtres = 'return (' . join(') AND (', $this->filtre) . ');';
294
-			$this->func_filtre = function () use ($filtres) {
295
-				return eval($filtres);
296
-			};
297
-		}
298
-	}
299
-
300
-
301
-	protected function ajouter_filtre($cle, $op, $valeur, $not = false) {
302
-		if (method_exists($this->iter, 'exception_des_criteres')) {
303
-			if (in_array($cle, $this->iter->exception_des_criteres())) {
304
-				return;
305
-			}
306
-		}
307
-		// TODO: analyser le filtre pour refuser ce qu'on ne sait pas traiter ?
308
-		# mais c'est normalement deja opere par calculer_critere_infixe()
309
-		# qui regarde la description 'desc' (en casse reelle d'ailleurs : {isDir=1}
310
-		# ne sera pas vu si l'on a defini desc['field']['isdir'] pour que #ISDIR soit present.
311
-		# il faudrait peut etre definir les 2 champs isDir et isdir... a reflechir...
312
-
313
-		# if (!in_array($cle, array('cle', 'valeur')))
314
-		#	return;
315
-
316
-		$a = '$this->get_select(\'' . $cle . '\')';
317
-
318
-		$filtre = '';
319
-
320
-		if ($op == 'REGEXP') {
321
-			$filtre = 'filtrer("match", ' . $a . ', ' . str_replace('\"', '"', $valeur) . ')';
322
-			$op = '';
323
-		} else {
324
-			if ($op == 'LIKE') {
325
-				$valeur = str_replace(array('\"', '_', '%'), array('"', '.', '.*'), preg_quote($valeur));
326
-				$filtre = 'filtrer("match", ' . $a . ', ' . $valeur . ')';
327
-				$op = '';
328
-			} else {
329
-				if ($op == '=') {
330
-					$op = '==';
331
-				} else {
332
-					if ($op == 'IN') {
333
-						$filtre = 'in_array(' . $a . ', array' . $valeur . ')';
334
-						$op = '';
335
-					} else {
336
-						if (!in_array($op, array('<', '<=', '>', '>='))) {
337
-							spip_log('operateur non reconnu ' . $op); // [todo] mettre une erreur de squelette
338
-							$op = '';
339
-						}
340
-					}
341
-				}
342
-			}
343
-		}
344
-
345
-		if ($op) {
346
-			$filtre = $a . $op . str_replace('\"', '"', $valeur);
347
-		}
348
-
349
-		if ($not) {
350
-			$filtre = "!($filtre)";
351
-		}
352
-
353
-		if ($filtre) {
354
-			$this->filtre[] = $filtre;
355
-		}
356
-	}
357
-
358
-
359
-	public function next() {
360
-		$this->pos++;
361
-		parent::next();
362
-	}
363
-
364
-	/**
365
-	 * revient au depart
366
-	 *
367
-	 * @return void
368
-	 */
369
-	public function rewind() {
370
-		$this->pos = 0;
371
-		$this->fetched = 0;
372
-		parent::rewind();
373
-	}
374
-
375
-
376
-	# Extension SPIP des iterateurs PHP
377
-	/**
378
-	 * type de l'iterateur
379
-	 *
380
-	 * @var string
381
-	 */
382
-	protected $type;
383
-
384
-	/**
385
-	 * parametres de l'iterateur
386
-	 *
387
-	 * @var array
388
-	 */
389
-	protected $command;
390
-
391
-	/**
392
-	 * infos de compilateur
393
-	 *
394
-	 * @var array
395
-	 */
396
-	protected $info;
397
-
398
-	/**
399
-	 * position courante de l'iterateur
400
-	 *
401
-	 * @var int
402
-	 */
403
-	protected $pos = null;
404
-
405
-	/**
406
-	 * nombre total resultats dans l'iterateur
407
-	 *
408
-	 * @var int
409
-	 */
410
-	protected $total = null;
411
-
412
-	/**
413
-	 * nombre maximal de recherche pour $total
414
-	 * si l'iterateur n'implemente pas de fonction specifique
415
-	 */
416
-	protected $max = 100000;
417
-
418
-
419
-	/**
420
-	 * Liste des champs a inserer dans les $row
421
-	 * retournes par ->fetch()
422
-	 */
423
-	protected $select = array();
424
-
425
-
426
-	/**
427
-	 * aller a la position absolue n,
428
-	 * comptee depuis le debut
429
-	 *
430
-	 * @param int $n
431
-	 *   absolute pos
432
-	 * @param string $continue
433
-	 *   param for sql_ api
434
-	 * @return bool
435
-	 *   success or fail if not implemented
436
-	 */
437
-	public function seek($n = 0, $continue = null) {
438
-		if ($this->func_filtre or !method_exists($this->iter, 'seek') or !$this->iter->seek($n)) {
439
-			$this->seek_loop($n);
440
-		}
441
-		$this->pos = $n;
442
-		$this->fetched = $n;
443
-
444
-		return true;
445
-	}
446
-
447
-	/*
221
+        // cle et valeur par defaut
222
+        // ICI PLANTAGE SI ON NE CONTROLE PAS $nom
223
+        if (in_array($nom, array('cle', 'valeur'))
224
+            and method_exists($this, $nom)
225
+        ) {
226
+            return $this->$nom();
227
+        }
228
+
229
+        // Par defaut chercher en xpath dans la valeur()
230
+        return table_valeur($this->valeur(), $nom, null);
231
+    }
232
+
233
+
234
+    private function calculer_filtres() {
235
+
236
+        // Issu de calculer_select() de public/composer L.519
237
+        // TODO: externaliser...
238
+        //
239
+        // retirer les criteres vides:
240
+        // {X ?} avec X absent de l'URL
241
+        // {par #ENV{X}} avec X absent de l'URL
242
+        // IN sur collection vide (ce dernier devrait pouvoir etre fait a la compil)
243
+        if ($where = &$this->command['where']) {
244
+            foreach ($where as $k => $v) {
245
+                if (is_array($v)) {
246
+                    if ((count($v) >= 2) && ($v[0] == 'REGEXP') && ($v[2] == "'.*'")) {
247
+                        $op = false;
248
+                    } elseif ((count($v) >= 2) && ($v[0] == 'LIKE') && ($v[2] == "'%'")) {
249
+                        $op = false;
250
+                    } else {
251
+                        $op = $v[0] ? $v[0] : $v;
252
+                    }
253
+                } else {
254
+                    $op = $v;
255
+                }
256
+                if ((!$op) or ($op == 1) or ($op == '0=0')) {
257
+                    unset($where[$k]);
258
+                }
259
+                // traiter {cle IN a,b} ou {valeur !IN a,b}
260
+                if (preg_match(',^\(([\w/]+)(\s+NOT)?\s+IN\s+(\(.*\))\)$,', $op, $regs)) {
261
+                    $this->ajouter_filtre($regs[1], 'IN', $regs[3], $regs[2]);
262
+                    unset($op, $where[$k]);
263
+                }
264
+            }
265
+            foreach ($where as $k => $v) {
266
+                // 3 possibilites : count($v) =
267
+                // * 1 : {x y} ; on recoit $v[0] = y
268
+                // * 2 : {x !op y} ; on recoit $v[0] = 'NOT', $v[1] = array() // array du type {x op y}
269
+                // * 3 : {x op y} ; on recoit $v[0] = 'op', $v[1] = x, $v[2] = y
270
+
271
+                // 1 : forcement traite par un critere, on passe
272
+                if (!$v or count($v) == 1) {
273
+                    continue;
274
+                }
275
+                if (count($v) == 2 and is_array($v[1])) {
276
+                    $this->ajouter_filtre($v[1][1], $v[1][0], $v[1][2], 'NOT');
277
+                }
278
+                if (count($v) == 3) {
279
+                    $this->ajouter_filtre($v[1], $v[0], $v[2]);
280
+                }
281
+            }
282
+        }
283
+
284
+        // critere {2,7}
285
+        if (isset($this->command['limit']) and $this->command['limit']) {
286
+            $limit = explode(',', $this->command['limit']);
287
+            $this->offset = $limit[0];
288
+            $this->limit = $limit[1];
289
+        }
290
+
291
+        // Creer la fonction de filtrage sur $this
292
+        if ($this->filtre) {
293
+            $filtres = 'return (' . join(') AND (', $this->filtre) . ');';
294
+            $this->func_filtre = function () use ($filtres) {
295
+                return eval($filtres);
296
+            };
297
+        }
298
+    }
299
+
300
+
301
+    protected function ajouter_filtre($cle, $op, $valeur, $not = false) {
302
+        if (method_exists($this->iter, 'exception_des_criteres')) {
303
+            if (in_array($cle, $this->iter->exception_des_criteres())) {
304
+                return;
305
+            }
306
+        }
307
+        // TODO: analyser le filtre pour refuser ce qu'on ne sait pas traiter ?
308
+        # mais c'est normalement deja opere par calculer_critere_infixe()
309
+        # qui regarde la description 'desc' (en casse reelle d'ailleurs : {isDir=1}
310
+        # ne sera pas vu si l'on a defini desc['field']['isdir'] pour que #ISDIR soit present.
311
+        # il faudrait peut etre definir les 2 champs isDir et isdir... a reflechir...
312
+
313
+        # if (!in_array($cle, array('cle', 'valeur')))
314
+        #	return;
315
+
316
+        $a = '$this->get_select(\'' . $cle . '\')';
317
+
318
+        $filtre = '';
319
+
320
+        if ($op == 'REGEXP') {
321
+            $filtre = 'filtrer("match", ' . $a . ', ' . str_replace('\"', '"', $valeur) . ')';
322
+            $op = '';
323
+        } else {
324
+            if ($op == 'LIKE') {
325
+                $valeur = str_replace(array('\"', '_', '%'), array('"', '.', '.*'), preg_quote($valeur));
326
+                $filtre = 'filtrer("match", ' . $a . ', ' . $valeur . ')';
327
+                $op = '';
328
+            } else {
329
+                if ($op == '=') {
330
+                    $op = '==';
331
+                } else {
332
+                    if ($op == 'IN') {
333
+                        $filtre = 'in_array(' . $a . ', array' . $valeur . ')';
334
+                        $op = '';
335
+                    } else {
336
+                        if (!in_array($op, array('<', '<=', '>', '>='))) {
337
+                            spip_log('operateur non reconnu ' . $op); // [todo] mettre une erreur de squelette
338
+                            $op = '';
339
+                        }
340
+                    }
341
+                }
342
+            }
343
+        }
344
+
345
+        if ($op) {
346
+            $filtre = $a . $op . str_replace('\"', '"', $valeur);
347
+        }
348
+
349
+        if ($not) {
350
+            $filtre = "!($filtre)";
351
+        }
352
+
353
+        if ($filtre) {
354
+            $this->filtre[] = $filtre;
355
+        }
356
+    }
357
+
358
+
359
+    public function next() {
360
+        $this->pos++;
361
+        parent::next();
362
+    }
363
+
364
+    /**
365
+     * revient au depart
366
+     *
367
+     * @return void
368
+     */
369
+    public function rewind() {
370
+        $this->pos = 0;
371
+        $this->fetched = 0;
372
+        parent::rewind();
373
+    }
374
+
375
+
376
+    # Extension SPIP des iterateurs PHP
377
+    /**
378
+     * type de l'iterateur
379
+     *
380
+     * @var string
381
+     */
382
+    protected $type;
383
+
384
+    /**
385
+     * parametres de l'iterateur
386
+     *
387
+     * @var array
388
+     */
389
+    protected $command;
390
+
391
+    /**
392
+     * infos de compilateur
393
+     *
394
+     * @var array
395
+     */
396
+    protected $info;
397
+
398
+    /**
399
+     * position courante de l'iterateur
400
+     *
401
+     * @var int
402
+     */
403
+    protected $pos = null;
404
+
405
+    /**
406
+     * nombre total resultats dans l'iterateur
407
+     *
408
+     * @var int
409
+     */
410
+    protected $total = null;
411
+
412
+    /**
413
+     * nombre maximal de recherche pour $total
414
+     * si l'iterateur n'implemente pas de fonction specifique
415
+     */
416
+    protected $max = 100000;
417
+
418
+
419
+    /**
420
+     * Liste des champs a inserer dans les $row
421
+     * retournes par ->fetch()
422
+     */
423
+    protected $select = array();
424
+
425
+
426
+    /**
427
+     * aller a la position absolue n,
428
+     * comptee depuis le debut
429
+     *
430
+     * @param int $n
431
+     *   absolute pos
432
+     * @param string $continue
433
+     *   param for sql_ api
434
+     * @return bool
435
+     *   success or fail if not implemented
436
+     */
437
+    public function seek($n = 0, $continue = null) {
438
+        if ($this->func_filtre or !method_exists($this->iter, 'seek') or !$this->iter->seek($n)) {
439
+            $this->seek_loop($n);
440
+        }
441
+        $this->pos = $n;
442
+        $this->fetched = $n;
443
+
444
+        return true;
445
+    }
446
+
447
+    /*
448 448
 	 * aller a la position $n en parcourant
449 449
 	 * un par un tous les elements
450 450
 	 */
451
-	private function seek_loop($n) {
452
-		if ($this->pos > $n) {
453
-			$this->rewind();
454
-		}
455
-
456
-		while ($this->pos < $n and $this->valid()) {
457
-			$this->next();
458
-		}
459
-
460
-		return true;
461
-	}
462
-
463
-	/**
464
-	 * Avancer de $saut pas
465
-	 *
466
-	 * @param  $saut
467
-	 * @param  $max
468
-	 * @return int
469
-	 */
470
-	public function skip($saut, $max = null) {
471
-		// pas de saut en arriere autorise pour cette fonction
472
-		if (($saut = intval($saut)) <= 0) {
473
-			return $this->pos;
474
-		}
475
-		$seek = $this->pos + $saut;
476
-		// si le saut fait depasser le maxi, on libere la resource
477
-		// et on sort
478
-		if (is_null($max)) {
479
-			$max = $this->count();
480
-		}
481
-
482
-		if ($seek >= $max or $seek >= $this->count()) {
483
-			// sortie plus rapide que de faire next() jusqu'a la fin !
484
-			$this->free();
485
-
486
-			return $max;
487
-		}
488
-
489
-		$this->seek($seek);
490
-
491
-		return $this->pos;
492
-	}
493
-
494
-	/**
495
-	 * Renvoyer un tableau des donnees correspondantes
496
-	 * a la position courante de l'iterateur
497
-	 * en controlant si on respecte le filtre
498
-	 * Appliquer aussi le critere {offset,limit}
499
-	 *
500
-	 * @return array|bool
501
-	 */
502
-	public function fetch() {
503
-		if (method_exists($this->iter, 'fetch')) {
504
-			return $this->iter->fetch();
505
-		} else {
506
-
507
-			while ($this->valid()
508
-				and (
509
-					!$this->accept()
510
-					or (isset($this->offset) and $this->fetched++ < $this->offset)
511
-				)) {
512
-				$this->next();
513
-			}
514
-
515
-			if (!$this->valid()) {
516
-				return false;
517
-			}
518
-
519
-			if (isset($this->limit)
520
-				and $this->fetched > $this->offset + $this->limit
521
-			) {
522
-				return false;
523
-			}
524
-
525
-			$r = array();
526
-			foreach ($this->select as $nom) {
527
-				$r[$nom] = $this->get_select($nom);
528
-			}
529
-			$this->next();
530
-
531
-			return $r;
532
-		}
533
-	}
534
-
535
-	// retourner la cle pour #CLE
536
-	public function cle() {
537
-		return $this->key();
538
-	}
539
-
540
-	// retourner la valeur pour #VALEUR
541
-	public function valeur() {
542
-		return $this->current();
543
-	}
544
-
545
-	/**
546
-	 * Accepte-t-on l'entree courante lue ?
547
-	 * On execute les filtres pour le savoir.
548
-	 **/
549
-	public function accept() {
550
-		if ($f = $this->func_filtre) {
551
-			return $f();
552
-		}
553
-
554
-		return true;
555
-	}
556
-
557
-	/**
558
-	 * liberer la ressource
559
-	 *
560
-	 * @return bool
561
-	 */
562
-	public function free() {
563
-		if (method_exists($this->iter, 'free')) {
564
-			$this->iter->free();
565
-		}
566
-		$this->pos = $this->total = 0;
567
-
568
-		return true;
569
-	}
570
-
571
-	/**
572
-	 * Compter le nombre total de resultats
573
-	 * pour #TOTAL_BOUCLE
574
-	 *
575
-	 * @return int
576
-	 */
577
-	public function count() {
578
-		if (is_null($this->total)) {
579
-			if (method_exists($this->iter, 'count')
580
-				and !$this->func_filtre
581
-			) {
582
-				return $this->total = $this->iter->count();
583
-			} else {
584
-				// compter les lignes et rembobiner
585
-				$total = 0;
586
-				$pos = $this->pos; // sauver la position
587
-				$this->rewind();
588
-				while ($this->fetch() and $total < $this->max) {
589
-					$total++;
590
-				}
591
-				$this->seek($pos);
592
-				$this->total = $total;
593
-			}
594
-		}
595
-
596
-		return $this->total;
597
-	}
451
+    private function seek_loop($n) {
452
+        if ($this->pos > $n) {
453
+            $this->rewind();
454
+        }
455
+
456
+        while ($this->pos < $n and $this->valid()) {
457
+            $this->next();
458
+        }
459
+
460
+        return true;
461
+    }
462
+
463
+    /**
464
+     * Avancer de $saut pas
465
+     *
466
+     * @param  $saut
467
+     * @param  $max
468
+     * @return int
469
+     */
470
+    public function skip($saut, $max = null) {
471
+        // pas de saut en arriere autorise pour cette fonction
472
+        if (($saut = intval($saut)) <= 0) {
473
+            return $this->pos;
474
+        }
475
+        $seek = $this->pos + $saut;
476
+        // si le saut fait depasser le maxi, on libere la resource
477
+        // et on sort
478
+        if (is_null($max)) {
479
+            $max = $this->count();
480
+        }
481
+
482
+        if ($seek >= $max or $seek >= $this->count()) {
483
+            // sortie plus rapide que de faire next() jusqu'a la fin !
484
+            $this->free();
485
+
486
+            return $max;
487
+        }
488
+
489
+        $this->seek($seek);
490
+
491
+        return $this->pos;
492
+    }
493
+
494
+    /**
495
+     * Renvoyer un tableau des donnees correspondantes
496
+     * a la position courante de l'iterateur
497
+     * en controlant si on respecte le filtre
498
+     * Appliquer aussi le critere {offset,limit}
499
+     *
500
+     * @return array|bool
501
+     */
502
+    public function fetch() {
503
+        if (method_exists($this->iter, 'fetch')) {
504
+            return $this->iter->fetch();
505
+        } else {
506
+
507
+            while ($this->valid()
508
+                and (
509
+                    !$this->accept()
510
+                    or (isset($this->offset) and $this->fetched++ < $this->offset)
511
+                )) {
512
+                $this->next();
513
+            }
514
+
515
+            if (!$this->valid()) {
516
+                return false;
517
+            }
518
+
519
+            if (isset($this->limit)
520
+                and $this->fetched > $this->offset + $this->limit
521
+            ) {
522
+                return false;
523
+            }
524
+
525
+            $r = array();
526
+            foreach ($this->select as $nom) {
527
+                $r[$nom] = $this->get_select($nom);
528
+            }
529
+            $this->next();
530
+
531
+            return $r;
532
+        }
533
+    }
534
+
535
+    // retourner la cle pour #CLE
536
+    public function cle() {
537
+        return $this->key();
538
+    }
539
+
540
+    // retourner la valeur pour #VALEUR
541
+    public function valeur() {
542
+        return $this->current();
543
+    }
544
+
545
+    /**
546
+     * Accepte-t-on l'entree courante lue ?
547
+     * On execute les filtres pour le savoir.
548
+     **/
549
+    public function accept() {
550
+        if ($f = $this->func_filtre) {
551
+            return $f();
552
+        }
553
+
554
+        return true;
555
+    }
556
+
557
+    /**
558
+     * liberer la ressource
559
+     *
560
+     * @return bool
561
+     */
562
+    public function free() {
563
+        if (method_exists($this->iter, 'free')) {
564
+            $this->iter->free();
565
+        }
566
+        $this->pos = $this->total = 0;
567
+
568
+        return true;
569
+    }
570
+
571
+    /**
572
+     * Compter le nombre total de resultats
573
+     * pour #TOTAL_BOUCLE
574
+     *
575
+     * @return int
576
+     */
577
+    public function count() {
578
+        if (is_null($this->total)) {
579
+            if (method_exists($this->iter, 'count')
580
+                and !$this->func_filtre
581
+            ) {
582
+                return $this->total = $this->iter->count();
583
+            } else {
584
+                // compter les lignes et rembobiner
585
+                $total = 0;
586
+                $pos = $this->pos; // sauver la position
587
+                $this->rewind();
588
+                while ($this->fetch() and $total < $this->max) {
589
+                    $total++;
590
+                }
591
+                $this->seek($pos);
592
+                $this->total = $total;
593
+            }
594
+        }
595
+
596
+        return $this->total;
597
+    }
598 598
 
599 599
 }
Please login to merge, or discard this patch.
ecrire/inc/pipelines.php 1 patch
Indentation   +126 added lines, -126 removed lines patch added patch discarded remove patch
@@ -16,10 +16,10 @@  discard block
 block discarded – undo
16 16
  * @package SPIP\Core\Pipelines
17 17
  **/
18 18
 if (!defined('_ECRIRE_INC_VERSION')) {
19
-	return;
19
+    return;
20 20
 }
21 21
 if (test_espace_prive()) {
22
-	include_spip('inc/pipelines_ecrire');
22
+    include_spip('inc/pipelines_ecrire');
23 23
 }
24 24
 
25 25
 
@@ -45,28 +45,28 @@  discard block
 block discarded – undo
45 45
  * @return string          Contenu qui sera inséré dans le head HTML
46 46
  **/
47 47
 function f_jQuery($texte) {
48
-	$x = '';
49
-	$jquery_plugins = pipeline('jquery_plugins',
50
-		array(
51
-			'javascript/jquery.js',
52
-			'javascript/jquery-migrate-3.2.0.js',
53
-			'javascript/jquery.form.js',
54
-			'javascript/jquery.autosave.js',
55
-			'javascript/jquery.placeholder-label.js',
56
-			'javascript/ajaxCallback.js',
57
-			'javascript/js.cookie.js',
58
-			'javascript/jquery.cookie.js'
59
-		));
60
-	foreach (array_unique($jquery_plugins) as $script) {
61
-		if ($script = find_in_path(supprimer_timestamp($script))) {
62
-			$script = timestamp($script);
63
-			$x .= "\n<script src=\"$script\" type=\"text/javascript\"></script>\n";
64
-		}
65
-	}
48
+    $x = '';
49
+    $jquery_plugins = pipeline('jquery_plugins',
50
+        array(
51
+            'javascript/jquery.js',
52
+            'javascript/jquery-migrate-3.2.0.js',
53
+            'javascript/jquery.form.js',
54
+            'javascript/jquery.autosave.js',
55
+            'javascript/jquery.placeholder-label.js',
56
+            'javascript/ajaxCallback.js',
57
+            'javascript/js.cookie.js',
58
+            'javascript/jquery.cookie.js'
59
+        ));
60
+    foreach (array_unique($jquery_plugins) as $script) {
61
+        if ($script = find_in_path(supprimer_timestamp($script))) {
62
+            $script = timestamp($script);
63
+            $x .= "\n<script src=\"$script\" type=\"text/javascript\"></script>\n";
64
+        }
65
+    }
66 66
 
67
-	$texte = $x . $texte;
67
+    $texte = $x . $texte;
68 68
 
69
-	return $texte;
69
+    return $texte;
70 70
 }
71 71
 
72 72
 
@@ -85,27 +85,27 @@  discard block
 block discarded – undo
85 85
  * @return string         Contenu de la page envoyée au navigateur
86 86
  **/
87 87
 function f_surligne($texte) {
88
-	if (!$GLOBALS['html']) {
89
-		return $texte;
90
-	}
91
-	$rech = _request('var_recherche');
92
-	if (!$rech
93
-		and (!defined('_SURLIGNE_RECHERCHE_REFERERS')
94
-			or !_SURLIGNE_RECHERCHE_REFERERS
95
-			or !isset($_SERVER['HTTP_REFERER']))
96
-	) {
97
-		return $texte;
98
-	}
99
-	include_spip('inc/surligne');
88
+    if (!$GLOBALS['html']) {
89
+        return $texte;
90
+    }
91
+    $rech = _request('var_recherche');
92
+    if (!$rech
93
+        and (!defined('_SURLIGNE_RECHERCHE_REFERERS')
94
+            or !_SURLIGNE_RECHERCHE_REFERERS
95
+            or !isset($_SERVER['HTTP_REFERER']))
96
+    ) {
97
+        return $texte;
98
+    }
99
+    include_spip('inc/surligne');
100 100
 
101
-	if (isset($_SERVER['HTTP_REFERER'])) {
102
-		$_SERVER['HTTP_REFERER'] = preg_replace(',[^\w\,/#&;:-]+,', ' ', $_SERVER['HTTP_REFERER']);
103
-	}
104
-	if ($rech){
105
-		$rech = preg_replace(',[^\w\,/#&;:-]+,', ' ', $rech);
106
-	}
101
+    if (isset($_SERVER['HTTP_REFERER'])) {
102
+        $_SERVER['HTTP_REFERER'] = preg_replace(',[^\w\,/#&;:-]+,', ' ', $_SERVER['HTTP_REFERER']);
103
+    }
104
+    if ($rech){
105
+        $rech = preg_replace(',[^\w\,/#&;:-]+,', ' ', $rech);
106
+    }
107 107
 
108
-	return surligner_mots($texte, $rech);
108
+    return surligner_mots($texte, $rech);
109 109
 }
110 110
 
111 111
 /**
@@ -122,32 +122,32 @@  discard block
 block discarded – undo
122 122
  * @return string         Contenu de la page envoyée au navigateur
123 123
  **/
124 124
 function f_tidy($texte) {
125
-	/**
126
-	 * Indentation à faire ?
127
-	 *
128
-	 * - true : actif.
129
-	 * - false par défaut.
130
-	 */
125
+    /**
126
+     * Indentation à faire ?
127
+     *
128
+     * - true : actif.
129
+     * - false par défaut.
130
+     */
131 131
 
132
-	if ($GLOBALS['xhtml'] # tidy demande
133
-		and $GLOBALS['html'] # verifie que la page avait l'entete text/html
134
-		and strlen($texte)
135
-		and !headers_sent()
136
-	) {
137
-		# Compatibilite ascendante
138
-		if (!is_string($GLOBALS['xhtml'])) {
139
-			$GLOBALS['xhtml'] = 'tidy';
140
-		}
132
+    if ($GLOBALS['xhtml'] # tidy demande
133
+        and $GLOBALS['html'] # verifie que la page avait l'entete text/html
134
+        and strlen($texte)
135
+        and !headers_sent()
136
+    ) {
137
+        # Compatibilite ascendante
138
+        if (!is_string($GLOBALS['xhtml'])) {
139
+            $GLOBALS['xhtml'] = 'tidy';
140
+        }
141 141
 
142
-		if (!$f = charger_fonction($GLOBALS['xhtml'], 'inc', true)) {
143
-			spip_log("tidy absent, l'indenteur SPIP le remplace");
144
-			$f = charger_fonction('sax', 'xml');
145
-		}
142
+        if (!$f = charger_fonction($GLOBALS['xhtml'], 'inc', true)) {
143
+            spip_log("tidy absent, l'indenteur SPIP le remplace");
144
+            $f = charger_fonction('sax', 'xml');
145
+        }
146 146
 
147
-		return $f($texte);
148
-	}
147
+        return $f($texte);
148
+    }
149 149
 
150
-	return $texte;
150
+    return $texte;
151 151
 }
152 152
 
153 153
 
@@ -166,21 +166,21 @@  discard block
 block discarded – undo
166 166
  * @return string         Contenu de la page envoyée au navigateur
167 167
  **/
168 168
 function f_insert_head($texte) {
169
-	if (!$GLOBALS['html']) {
170
-		return $texte;
171
-	}
172
-	include_spip('public/admin'); // pour strripos
169
+    if (!$GLOBALS['html']) {
170
+        return $texte;
171
+    }
172
+    include_spip('public/admin'); // pour strripos
173 173
 
174
-	($pos = stripos($texte, '</head>'))
175
-	|| ($pos = stripos($texte, '<body>'))
176
-	|| ($pos = 0);
174
+    ($pos = stripos($texte, '</head>'))
175
+    || ($pos = stripos($texte, '<body>'))
176
+    || ($pos = 0);
177 177
 
178
-	if (false === strpos(substr($texte, 0, $pos), '<!-- insert_head -->')) {
179
-		$insert = "\n" . pipeline('insert_head', '<!-- f_insert_head -->') . "\n";
180
-		$texte = substr_replace($texte, $insert, $pos, 0);
181
-	}
178
+    if (false === strpos(substr($texte, 0, $pos), '<!-- insert_head -->')) {
179
+        $insert = "\n" . pipeline('insert_head', '<!-- f_insert_head -->') . "\n";
180
+        $texte = substr_replace($texte, $insert, $pos, 0);
181
+    }
182 182
 
183
-	return $texte;
183
+    return $texte;
184 184
 }
185 185
 
186 186
 
@@ -196,34 +196,34 @@  discard block
 block discarded – undo
196 196
  * @return string         Contenu de la page envoyée au navigateur
197 197
  **/
198 198
 function f_admin($texte) {
199
-	if (defined('_VAR_PREVIEW') and _VAR_PREVIEW and $GLOBALS['html']) {
200
-		include_spip('inc/filtres'); // pour http_img_pack
201
-		$x = "<div class='spip-previsu' "
202
-			. http_style_background('preview-32.png', '', 32)
203
-			. ">"
204
-			. _T('previsualisation')
205
-			. "</div>";
206
-		if (!$pos = stripos($texte, '</body>')) {
207
-			$pos = strlen($texte);
208
-		}
209
-		$texte = substr_replace($texte, $x, $pos, 0);
210
-		// pas de preview en fenetre enfant
211
-		$x = "<script type='text/javascript'>const frameEl = window.frameElement;if (frameEl) {frameEl.sandbox='sandbox';window.location.href='".addslashes($GLOBALS['meta']['adresse_site'])."';}</script>";
212
-		if (!$pos = stripos($texte, '<head') or !$pos = strpos($texte, '>', $pos)) {
213
-			$pos = -1;
214
-		}
215
-		$texte = substr_replace($texte, $x, $pos+1, 0);
216
-	}
199
+    if (defined('_VAR_PREVIEW') and _VAR_PREVIEW and $GLOBALS['html']) {
200
+        include_spip('inc/filtres'); // pour http_img_pack
201
+        $x = "<div class='spip-previsu' "
202
+            . http_style_background('preview-32.png', '', 32)
203
+            . ">"
204
+            . _T('previsualisation')
205
+            . "</div>";
206
+        if (!$pos = stripos($texte, '</body>')) {
207
+            $pos = strlen($texte);
208
+        }
209
+        $texte = substr_replace($texte, $x, $pos, 0);
210
+        // pas de preview en fenetre enfant
211
+        $x = "<script type='text/javascript'>const frameEl = window.frameElement;if (frameEl) {frameEl.sandbox='sandbox';window.location.href='".addslashes($GLOBALS['meta']['adresse_site'])."';}</script>";
212
+        if (!$pos = stripos($texte, '<head') or !$pos = strpos($texte, '>', $pos)) {
213
+            $pos = -1;
214
+        }
215
+        $texte = substr_replace($texte, $x, $pos+1, 0);
216
+    }
217 217
 
218
-	if (isset($GLOBALS['affiche_boutons_admin']) and $GLOBALS['affiche_boutons_admin']) {
219
-		include_spip('public/admin');
220
-		$texte = affiche_boutons_admin($texte);
221
-	}
222
-	if (_request('var_mode') == 'noajax') {
223
-		$texte = preg_replace(',(class=[\'"][^\'"]*)ajax([^\'"]*[\'"]),Uims', "\\1\\2", $texte);
224
-	}
218
+    if (isset($GLOBALS['affiche_boutons_admin']) and $GLOBALS['affiche_boutons_admin']) {
219
+        include_spip('public/admin');
220
+        $texte = affiche_boutons_admin($texte);
221
+    }
222
+    if (_request('var_mode') == 'noajax') {
223
+        $texte = preg_replace(',(class=[\'"][^\'"]*)ajax([^\'"]*[\'"]),Uims', "\\1\\2", $texte);
224
+    }
225 225
 
226
-	return $texte;
226
+    return $texte;
227 227
 }
228 228
 
229 229
 /**
@@ -241,11 +241,11 @@  discard block
 block discarded – undo
241 241
  * @return array $flux  Description et contenu de l'inclusion
242 242
  **/
243 243
 function f_recuperer_fond($flux) {
244
-	if (!test_espace_prive()) {
245
-		return $flux;
246
-	}
244
+    if (!test_espace_prive()) {
245
+        return $flux;
246
+    }
247 247
 
248
-	return f_afficher_blocs_ecrire($flux);
248
+    return f_afficher_blocs_ecrire($flux);
249 249
 }
250 250
 
251 251
 /**
@@ -259,29 +259,29 @@  discard block
 block discarded – undo
259 259
  * @return string         Contenu de la page envoyée au navigateur
260 260
  */
261 261
 function f_queue($texte) {
262
-	// eviter une inclusion si rien a faire
263
-	if (_request('action') == 'cron'
264
-		or queue_sleep_time_to_next_job() > 0
265
-		or defined('_DEBUG_BLOCK_QUEUE')
266
-	) {
267
-		return $texte;
268
-	}
262
+    // eviter une inclusion si rien a faire
263
+    if (_request('action') == 'cron'
264
+        or queue_sleep_time_to_next_job() > 0
265
+        or defined('_DEBUG_BLOCK_QUEUE')
266
+    ) {
267
+        return $texte;
268
+    }
269 269
 
270
-	include_spip('inc/queue');
271
-	$code = queue_affichage_cron();
270
+    include_spip('inc/queue');
271
+    $code = queue_affichage_cron();
272 272
 
273
-	// si rien a afficher
274
-	// ou si on est pas dans une page html, on ne sait rien faire de mieux
275
-	if (!$code or !isset($GLOBALS['html']) or !$GLOBALS['html']) {
276
-		return $texte;
277
-	}
273
+    // si rien a afficher
274
+    // ou si on est pas dans une page html, on ne sait rien faire de mieux
275
+    if (!$code or !isset($GLOBALS['html']) or !$GLOBALS['html']) {
276
+        return $texte;
277
+    }
278 278
 
279
-	// inserer avant le </body> fermant si on peut, a la fin de la page sinon
280
-	if (($p = strpos($texte, '</body>')) !== false) {
281
-		$texte = substr($texte, 0, $p) . $code . substr($texte, $p);
282
-	} else {
283
-		$texte .= $code;
284
-	}
279
+    // inserer avant le </body> fermant si on peut, a la fin de la page sinon
280
+    if (($p = strpos($texte, '</body>')) !== false) {
281
+        $texte = substr($texte, 0, $p) . $code . substr($texte, $p);
282
+    } else {
283
+        $texte .= $code;
284
+    }
285 285
 
286
-	return $texte;
286
+    return $texte;
287 287
 }
Please login to merge, or discard this patch.