Completed
Push — master ( 3a7980...c8fa57 )
by cam
04:18
created
ecrire/inc/rubriques.php 4 patches
Spacing   +34 added lines, -34 removed lines patch added patch discarded remove patch
@@ -105,8 +105,8 @@  discard block
 block discarded – undo
105 105
 	$id_pred = $id_rubrique;
106 106
 	while (true) {
107 107
 		sql_updateq('spip_rubriques', array('statut' => 'publie', 'date' => date('Y-m-d H:i:s')),
108
-			"id_rubrique=" . intval($id_rubrique));
109
-		$id_parent = sql_getfetsel('id_parent', 'spip_rubriques AS R', "R.id_rubrique=" . intval($id_rubrique));
108
+			"id_rubrique=".intval($id_rubrique));
109
+		$id_parent = sql_getfetsel('id_parent', 'spip_rubriques AS R', "R.id_rubrique=".intval($id_rubrique));
110 110
 		if (!$id_parent) {
111 111
 			break;
112 112
 		}
@@ -142,7 +142,7 @@  discard block
 block discarded – undo
142 142
 			return $id_pred != $id_rubrique;
143 143
 		}
144 144
 		// passer au parent si on a depublie
145
-		$r = sql_fetsel("id_parent", "spip_rubriques", "id_rubrique=" . intval($id_pred));
145
+		$r = sql_fetsel("id_parent", "spip_rubriques", "id_rubrique=".intval($id_pred));
146 146
 		$id_pred = $r['id_parent'];
147 147
 	}
148 148
 
@@ -167,14 +167,14 @@  discard block
 block discarded – undo
167 167
 		$date = date('Y-m-d H:i:s');
168 168
 	}
169 169
 	$postdates = ($GLOBALS['meta']["post_dates"] == "non") ?
170
-		" AND date <= " . sql_quote($date) : '';
170
+		" AND date <= ".sql_quote($date) : '';
171 171
 
172 172
 	if (!$id_rubrique = intval($id_rubrique)) {
173 173
 		return false;
174 174
 	}
175 175
 
176 176
 	// verifier qu'elle existe et est bien publiee
177
-	$r = sql_fetsel('id_rubrique,statut', 'spip_rubriques', "id_rubrique=" . intval($id_rubrique));
177
+	$r = sql_fetsel('id_rubrique,statut', 'spip_rubriques', "id_rubrique=".intval($id_rubrique));
178 178
 	if (!$r or $r['statut'] !== 'publie') {
179 179
 		return false;
180 180
 	}
@@ -183,11 +183,11 @@  discard block
 block discarded – undo
183 183
 	// Le type de l'objet est au pluriel
184 184
 	$compte = array(
185 185
 		'articles' => sql_countsel("spip_articles",
186
-			"id_rubrique=" . intval($id_rubrique) . " AND statut='publie'$postdates"),
187
-		'rubriques' => sql_countsel("spip_rubriques", "id_parent=" . intval($id_rubrique) . " AND statut='publie'"),
186
+			"id_rubrique=".intval($id_rubrique)." AND statut='publie'$postdates"),
187
+		'rubriques' => sql_countsel("spip_rubriques", "id_parent=".intval($id_rubrique)." AND statut='publie'"),
188 188
 		'documents' => sql_countsel(
189 189
 			"spip_documents AS D JOIN spip_documents_liens AS L ON D.id_document=L.id_document", 
190
-			"L.id_objet=" . intval($id_rubrique) . " AND L.objet='rubrique' and D.mode NOT IN('logoon', 'logooff') ")
190
+			"L.id_objet=".intval($id_rubrique)." AND L.objet='rubrique' and D.mode NOT IN('logoon', 'logooff') ")
191 191
 	);
192 192
 
193 193
 	// On passe le tableau des comptes dans un pipeline pour que les plugins puissent ajouter (ou retirer) des enfants
@@ -210,7 +210,7 @@  discard block
 block discarded – undo
210 210
 		}
211 211
 	}
212 212
 
213
-	sql_updateq("spip_rubriques", array("statut" => 'prepa'), "id_rubrique=" . intval($id_rubrique));
213
+	sql_updateq("spip_rubriques", array("statut" => 'prepa'), "id_rubrique=".intval($id_rubrique));
214 214
 
215 215
 #		spip_log("depublier_rubrique $id_pred");
216 216
 	return true;
@@ -273,7 +273,7 @@  discard block
 block discarded – undo
273 273
 
274 274
 	// Afficher les articles post-dates ?
275 275
 	$postdates = ($GLOBALS['meta']["post_dates"] == "non") ?
276
-		"AND A.date <= " . sql_quote(date('Y-m-d H:i:s')) : '';
276
+		"AND A.date <= ".sql_quote(date('Y-m-d H:i:s')) : '';
277 277
 
278 278
 	$r = sql_select(
279 279
 		"R.id_rubrique AS id, max(A.date) AS date_h",
@@ -281,7 +281,7 @@  discard block
 block discarded – undo
281 281
 		"A.date>R.date_tmp AND A.statut='publie' $postdates ", "R.id_rubrique");
282 282
 	while ($row = sql_fetch($r)) {
283 283
 		sql_updateq("spip_rubriques", array("statut_tmp" => 'publie', "date_tmp" => $row['date_h']),
284
-			"id_rubrique=" . intval($row['id']));
284
+			"id_rubrique=".intval($row['id']));
285 285
 	}
286 286
 
287 287
 	// point d'entree pour permettre a des plugins de gerer le statut
@@ -302,7 +302,7 @@  discard block
 block discarded – undo
302 302
 			"(SR.date_tmp>R.date_tmp OR R.statut_tmp<>'publie') AND SR.statut_tmp='publie' ", "R.id_rubrique");
303 303
 		while ($row = sql_fetch($r)) {
304 304
 			sql_updateq('spip_rubriques', array('statut_tmp' => 'publie', 'date_tmp' => $row['date_h']),
305
-				"id_rubrique=" . intval($row['id']));
305
+				"id_rubrique=".intval($row['id']));
306 306
 			$continuer = true;
307 307
 		}
308 308
 	} while ($continuer);
@@ -353,7 +353,7 @@  discard block
 block discarded – undo
353 353
 			and $rows = sql_allfetsel(
354 354
 				"A.id_rubrique AS id, R.id_secteur AS id_secteur, R.profondeur+1 as profondeur",
355 355
 				"spip_rubriques AS A JOIN spip_rubriques AS R ON A.id_parent = R.id_rubrique",
356
-				"R.profondeur=" . intval($prof) . " AND (A.id_secteur <> R.id_secteur OR A.profondeur > R.profondeur+1)",
356
+				"R.profondeur=".intval($prof)." AND (A.id_secteur <> R.id_secteur OR A.profondeur > R.profondeur+1)",
357 357
 				"", "R.id_secteur", "0,100")) {
358 358
 
359 359
 			$id_secteur = null;
@@ -382,8 +382,8 @@  discard block
 block discarded – undo
382 382
 			and $rows = sql_allfetsel(
383 383
 				"id_rubrique as id",
384 384
 				"spip_rubriques",
385
-				"profondeur=" . intval($prof + 1) . " AND id_parent NOT IN (" . sql_get_select("zzz.id_rubrique",
386
-					"spip_rubriques AS zzz", "zzz.profondeur=" . intval($prof)) . ")", '', '', '0,100')) {
385
+				"profondeur=".intval($prof + 1)." AND id_parent NOT IN (".sql_get_select("zzz.id_rubrique",
386
+					"spip_rubriques AS zzz", "zzz.profondeur=".intval($prof)).")", '', '', '0,100')) {
387 387
 			$rows = array_column($rows, 'id');
388 388
 			sql_updateq("spip_rubriques", array('profondeur' => $prof + 2), sql_in("id_rubrique", $rows));
389 389
 		}
@@ -392,7 +392,7 @@  discard block
 block discarded – undo
392 392
 		// si pas de rubrique a profondeur $prof+1 pas la peine de continuer
393 393
 		// si il reste des rubriques non vues, c'est une branche morte ou reference circulaire (base foireuse)
394 394
 		// on arrete les frais
395
-		if (sql_countsel("spip_rubriques", "profondeur=" . intval($prof + 1))) {
395
+		if (sql_countsel("spip_rubriques", "profondeur=".intval($prof + 1))) {
396 396
 			$prof++;
397 397
 			$continuer = true;
398 398
 		}
@@ -400,10 +400,10 @@  discard block
 block discarded – undo
400 400
 
401 401
 	// loger si la table des rubriques semble foireuse
402 402
 	// et mettre un id_secteur=0 sur ces rubriques pour eviter toute selection par les boucles
403
-	if (sql_countsel("spip_rubriques", "profondeur>" . intval($prof + 1))) {
404
-		spip_log("Les rubriques de profondeur>" . ($prof + 1) . " semblent suspectes (branches morte ou reference circulaire dans les parents)",
403
+	if (sql_countsel("spip_rubriques", "profondeur>".intval($prof + 1))) {
404
+		spip_log("Les rubriques de profondeur>".($prof + 1)." semblent suspectes (branches morte ou reference circulaire dans les parents)",
405 405
 			_LOG_CRITIQUE);
406
-		sql_update("spip_rubriques", array('id_secteur' => 0), "profondeur>" . intval($prof + 1));
406
+		sql_update("spip_rubriques", array('id_secteur' => 0), "profondeur>".intval($prof + 1));
407 407
 	}
408 408
 
409 409
 	// reparer les articles
@@ -411,7 +411,7 @@  discard block
 block discarded – undo
411 411
 		"A.id_rubrique = R.id_rubrique AND A.id_secteur <> R.id_secteur");
412 412
 
413 413
 	while ($row = sql_fetch($r)) {
414
-		sql_update("spip_articles", array("id_secteur" => $row['secteur']), "id_article=" . intval($row['id']));
414
+		sql_update("spip_articles", array("id_secteur" => $row['secteur']), "id_article=".intval($row['id']));
415 415
 	}
416 416
 
417 417
 	// avertir les plugins qui peuvent faire leur mises a jour egalement
@@ -437,7 +437,7 @@  discard block
 block discarded – undo
437 437
 	while ($row = sql_fetch($s)) {
438 438
 		$id_rubrique = $row['id_rubrique'];
439 439
 		$t = sql_updateq('spip_rubriques', array('lang' => $row['lang'], 'langue_choisie' => 'non'),
440
-			"id_rubrique=" . intval($id_rubrique));
440
+			"id_rubrique=".intval($id_rubrique));
441 441
 	}
442 442
 
443 443
 	return $t;
@@ -473,7 +473,7 @@  discard block
 block discarded – undo
473 473
 	while ($row = sql_fetch($s)) {
474 474
 		$id_article = $row['id_article'];
475 475
 		sql_updateq('spip_articles', array("lang" => $row['lang'], 'langue_choisie' => 'non'),
476
-			"id_article=" . intval($id_article));
476
+			"id_article=".intval($id_article));
477 477
 	}
478 478
 
479 479
 	if ($GLOBALS['meta']['multi_rubriques'] == 'oui') {
@@ -545,11 +545,11 @@  discard block
 block discarded – undo
545 545
 				);
546 546
 				// generer un nom de fonction "anonyme" unique
547 547
 				do {
548
-					$functionname = 'f_calculer_langues_utilisees_' . $boucle->id_table . '_' . time() . '_' . rand();
548
+					$functionname = 'f_calculer_langues_utilisees_'.$boucle->id_table.'_'.time().'_'.rand();
549 549
 				} while (function_exists($functionname));
550 550
 				$code = calculer_boucle('calculer_langues_utilisees', $boucles);
551
-				$code = '$SP=0; $command=array();$command["connect"] = $connect = "' . $serveur . '"; $Pile=array(0=>array());' . "\n" . $code;
552
-				$code = 'function ' . $functionname . '(){' . $code . '};$res = ' . $functionname . '();';
551
+				$code = '$SP=0; $command=array();$command["connect"] = $connect = "'.$serveur.'"; $Pile=array(0=>array());'."\n".$code;
552
+				$code = 'function '.$functionname.'(){'.$code.'};$res = '.$functionname.'();';
553 553
 				$res = '';
554 554
 				eval($code);
555 555
 				$res = explode(',', $res);
@@ -663,10 +663,10 @@  discard block
 block discarded – undo
663 663
 	while ($maxiter-- and $filles = sql_allfetsel(
664 664
 			'id_rubrique',
665 665
 			'spip_rubriques',
666
-			sql_in('id_parent', $r) . " AND " . sql_in('id_rubrique', $r, 'NOT')
666
+			sql_in('id_parent', $r)." AND ".sql_in('id_rubrique', $r, 'NOT')
667 667
 		)) {
668 668
 		$r = join(',', array_column($filles, 'id_rubrique'));
669
-		$branche .= ',' . $r;
669
+		$branche .= ','.$r;
670 670
 	}
671 671
 
672 672
 	# securite pour ne pas plomber la conso memoire sur les sites prolifiques
@@ -706,7 +706,7 @@  discard block
 block discarded – undo
706 706
 
707 707
 	if (isset($b[$id])) {
708 708
 		// Notre branche commence par la rubrique de depart si $tout=true
709
-		return $tout ? (strlen($b[$id]) ? $b[$id] . ",$id" : $id) : $b[$id];
709
+		return $tout ? (strlen($b[$id]) ? $b[$id].",$id" : $id) : $b[$id];
710 710
 	}
711 711
 
712 712
 	$hier = "";
@@ -718,10 +718,10 @@  discard block
 block discarded – undo
718 718
 	while ($maxiter-- and $parents = sql_allfetsel(
719 719
 			'id_parent',
720 720
 			'spip_rubriques',
721
-			sql_in('id_rubrique', $ids_nouveaux_parents) . " AND " . sql_in('id_parent', $hier, 'NOT')
721
+			sql_in('id_rubrique', $ids_nouveaux_parents)." AND ".sql_in('id_parent', $hier, 'NOT')
722 722
 		)) {
723 723
 		$ids_nouveaux_parents = join(',', array_column($parents, 'id_parent'));
724
-		$hier = $ids_nouveaux_parents . (strlen($hier) ? ',' . $hier : '');
724
+		$hier = $ids_nouveaux_parents.(strlen($hier) ? ','.$hier : '');
725 725
 	}
726 726
 
727 727
 	# securite pour ne pas plomber la conso memoire sur les sites prolifiques
@@ -753,7 +753,7 @@  discard block
 block discarded – undo
753 753
 	include_spip('base/abstract_sql');
754 754
 	if ($check) {
755 755
 		$postdates = ($GLOBALS['meta']["post_dates"] == "non") ?
756
-			"AND A.date <= " . sql_quote(date('Y-m-d H:i:s')) : '';
756
+			"AND A.date <= ".sql_quote(date('Y-m-d H:i:s')) : '';
757 757
 
758 758
 		$r = sql_select("DISTINCT A.id_rubrique AS id",
759 759
 			"spip_articles AS A LEFT JOIN spip_rubriques AS R ON A.id_rubrique=R.id_rubrique",
@@ -765,7 +765,7 @@  discard block
 block discarded – undo
765 765
 		pipeline('trig_calculer_prochain_postdate', '');
766 766
 	}
767 767
 
768
-	$t = sql_fetsel("date", "spip_articles", "statut='publie' AND date > " . sql_quote(date('Y-m-d H:i:s')), "", "date",
768
+	$t = sql_fetsel("date", "spip_articles", "statut='publie' AND date > ".sql_quote(date('Y-m-d H:i:s')), "", "date",
769 769
 		"1");
770 770
 
771 771
 	if ($t) {
@@ -815,7 +815,7 @@  discard block
 block discarded – undo
815 815
 		// retablir les </multi> et autres balises fermantes html
816 816
 		$titre = preg_replace(",<@([a-z][^>]*)>,ims", "</\\1>", $titre);
817 817
 		$r = sql_getfetsel("id_rubrique", "spip_rubriques",
818
-			"titre = " . sql_quote($titre) . " AND id_parent=" . intval($id_parent),
818
+			"titre = ".sql_quote($titre)." AND id_parent=".intval($id_parent),
819 819
 			$groupby = array(), $orderby = array(), $limit = '', $having = array(), $serveur);
820 820
 		if ($r !== null) {
821 821
 			$id_parent = $r;
@@ -836,7 +836,7 @@  discard block
 block discarded – undo
836 836
 			}
837 837
 
838 838
 			sql_updateq('spip_rubriques', array('id_secteur' => $id_secteur, "lang" => $lang),
839
-				"id_rubrique=" . intval($id_rubrique), $desc = '', $serveur);
839
+				"id_rubrique=".intval($id_rubrique), $desc = '', $serveur);
840 840
 
841 841
 			// pour la recursion
842 842
 			$id_parent = $id_rubrique;
Please login to merge, or discard this patch.
Doc Comments   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -50,7 +50,7 @@  discard block
 block discarded – undo
50 50
  *     Infos sur l'objet modifié : statut_ancien, objet, id_objet…
51 51
  * @param bool $postdate
52 52
  *     true pour recalculer aussi la date du prochain article post-daté
53
- * @return bool
53
+ * @return boolean|null
54 54
  *     true si le statut change effectivement
55 55
  **/
56 56
 function calculer_rubriques_if($id_rubrique, $modifs, $infos = array(), $postdate = false) {
@@ -453,7 +453,7 @@  discard block
 block discarded – undo
453 453
  * de la rubrique parente lorsque langue_choisie est différent de oui,
454 454
  * et les corrige.
455 455
  *
456
- * @return bool
456
+ * @return boolean|string
457 457
  *     true si un changement a eu lieu
458 458
  **/
459 459
 function calculer_langues_rubriques_etape() {
Please login to merge, or discard this patch.
Braces   +4 added lines, -3 removed lines patch added patch discarded remove patch
@@ -77,8 +77,7 @@  discard block
 block discarded – undo
77 77
 				break; // stop on a trouvé le bon champ
78 78
 			}
79 79
 		}
80
-	}
81
-	else {
80
+	} else {
82 81
 		$statuts_publies = array('publie');
83 82
 	}
84 83
 	
@@ -105,10 +104,12 @@  discard block
 block discarded – undo
105 104
 		}
106 105
 	}
107 106
 
108
-	if ($neuf) // Sauver la date de la derniere mise a jour (pour menu_rubriques)
107
+	if ($neuf) {
108
+	    // Sauver la date de la derniere mise a jour (pour menu_rubriques)
109 109
 	{
110 110
 		ecrire_meta("date_calcul_rubriques", date("U"));
111 111
 	}
112
+	}
112 113
 
113 114
 	$langues = calculer_langues_utilisees();
114 115
 	ecrire_meta('langues_utilisees', $langues);
Please login to merge, or discard this patch.
Indentation   +523 added lines, -523 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
 
@@ -54,64 +54,64 @@  discard block
 block discarded – undo
54 54
  *     true si le statut change effectivement
55 55
  **/
56 56
 function calculer_rubriques_if($id_rubrique, $modifs, $infos = array(), $postdate = false) {
57
-	$neuf = false;
57
+    $neuf = false;
58 58
 	
59
-	// Compat avec l'ancienne signature
60
-	if (is_string($infos)) {
61
-		$infos = array('statut_ancien' => $infos);
62
-	}
63
-	if (!isset($infos['statut_ancien'])) {
64
-		$infos['statut_ancien'] = '';
65
-	}
59
+    // Compat avec l'ancienne signature
60
+    if (is_string($infos)) {
61
+        $infos = array('statut_ancien' => $infos);
62
+    }
63
+    if (!isset($infos['statut_ancien'])) {
64
+        $infos['statut_ancien'] = '';
65
+    }
66 66
 	
67
-	// On recherche quels statuts tester
68
-	if (
69
-		isset($infos['objet'])
70
-		and include_spip('inc/filtres')
71
-		and $declaration_statut = objet_info($infos['objet'], 'statut')
72
-		and is_array($declaration_statut)
73
-	) {
74
-		foreach ($declaration_statut as $champ_statut) {
75
-			if ($champ_statut['champ'] == 'statut') {
76
-				$statuts_publies = array_map('trim', explode(',', $champ_statut['publie']));
77
-				break; // stop on a trouvé le bon champ
78
-			}
79
-		}
80
-	}
81
-	else {
82
-		$statuts_publies = array('publie');
83
-	}
67
+    // On recherche quels statuts tester
68
+    if (
69
+        isset($infos['objet'])
70
+        and include_spip('inc/filtres')
71
+        and $declaration_statut = objet_info($infos['objet'], 'statut')
72
+        and is_array($declaration_statut)
73
+    ) {
74
+        foreach ($declaration_statut as $champ_statut) {
75
+            if ($champ_statut['champ'] == 'statut') {
76
+                $statuts_publies = array_map('trim', explode(',', $champ_statut['publie']));
77
+                break; // stop on a trouvé le bon champ
78
+            }
79
+        }
80
+    }
81
+    else {
82
+        $statuts_publies = array('publie');
83
+    }
84 84
 	
85
-	if (in_array($infos['statut_ancien'], $statuts_publies)) {
86
-		if (isset($modifs['statut'])
87
-			or isset($modifs['id_rubrique'])
88
-			or ($postdate and strtotime($postdate) > time())
89
-		) {
90
-			$neuf |= depublier_branche_rubrique_if($id_rubrique);
91
-		}
92
-		// ne publier que si c'est pas un postdate, ou si la date n'est pas dans le futur
93
-		if ($postdate) {
94
-			calculer_prochain_postdate(true);
95
-			$neuf |= (strtotime($postdate) <= time()); // par securite
96
-		} elseif (isset($modifs['id_rubrique'])) {
97
-			$neuf |= publier_branche_rubrique($modifs['id_rubrique']);
98
-		}
99
-	} elseif (isset($modifs['statut']) and in_array($modifs['statut'], $statuts_publies)) {
100
-		if ($postdate) {
101
-			calculer_prochain_postdate(true);
102
-			$neuf |= (strtotime($postdate) <= time()); // par securite
103
-		} else {
104
-			$neuf |= publier_branche_rubrique($id_rubrique);
105
-		}
106
-	}
107
-
108
-	if ($neuf) // Sauver la date de la derniere mise a jour (pour menu_rubriques)
109
-	{
110
-		ecrire_meta("date_calcul_rubriques", date("U"));
111
-	}
112
-
113
-	$langues = calculer_langues_utilisees();
114
-	ecrire_meta('langues_utilisees', $langues);
85
+    if (in_array($infos['statut_ancien'], $statuts_publies)) {
86
+        if (isset($modifs['statut'])
87
+            or isset($modifs['id_rubrique'])
88
+            or ($postdate and strtotime($postdate) > time())
89
+        ) {
90
+            $neuf |= depublier_branche_rubrique_if($id_rubrique);
91
+        }
92
+        // ne publier que si c'est pas un postdate, ou si la date n'est pas dans le futur
93
+        if ($postdate) {
94
+            calculer_prochain_postdate(true);
95
+            $neuf |= (strtotime($postdate) <= time()); // par securite
96
+        } elseif (isset($modifs['id_rubrique'])) {
97
+            $neuf |= publier_branche_rubrique($modifs['id_rubrique']);
98
+        }
99
+    } elseif (isset($modifs['statut']) and in_array($modifs['statut'], $statuts_publies)) {
100
+        if ($postdate) {
101
+            calculer_prochain_postdate(true);
102
+            $neuf |= (strtotime($postdate) <= time()); // par securite
103
+        } else {
104
+            $neuf |= publier_branche_rubrique($id_rubrique);
105
+        }
106
+    }
107
+
108
+    if ($neuf) // Sauver la date de la derniere mise a jour (pour menu_rubriques)
109
+    {
110
+        ecrire_meta("date_calcul_rubriques", date("U"));
111
+    }
112
+
113
+    $langues = calculer_langues_utilisees();
114
+    ecrire_meta('langues_utilisees', $langues);
115 115
 }
116 116
 
117 117
 
@@ -129,19 +129,19 @@  discard block
 block discarded – undo
129 129
  *     true si le statut change effectivement
130 130
  */
131 131
 function publier_branche_rubrique($id_rubrique) {
132
-	$id_pred = $id_rubrique;
133
-	while (true) {
134
-		sql_updateq('spip_rubriques', array('statut' => 'publie', 'date' => date('Y-m-d H:i:s')),
135
-			"id_rubrique=" . intval($id_rubrique));
136
-		$id_parent = sql_getfetsel('id_parent', 'spip_rubriques AS R', "R.id_rubrique=" . intval($id_rubrique));
137
-		if (!$id_parent) {
138
-			break;
139
-		}
140
-		$id_rubrique = $id_parent;
141
-	}
132
+    $id_pred = $id_rubrique;
133
+    while (true) {
134
+        sql_updateq('spip_rubriques', array('statut' => 'publie', 'date' => date('Y-m-d H:i:s')),
135
+            "id_rubrique=" . intval($id_rubrique));
136
+        $id_parent = sql_getfetsel('id_parent', 'spip_rubriques AS R', "R.id_rubrique=" . intval($id_rubrique));
137
+        if (!$id_parent) {
138
+            break;
139
+        }
140
+        $id_rubrique = $id_parent;
141
+    }
142 142
 
143 143
 #	spip_log(" publier_branche_rubrique($id_rubrique $id_pred");
144
-	return $id_pred != $id_rubrique;
144
+    return $id_pred != $id_rubrique;
145 145
 }
146 146
 
147 147
 /**
@@ -159,21 +159,21 @@  discard block
 block discarded – undo
159 159
  *     true si le statut change effectivement
160 160
  */
161 161
 function depublier_branche_rubrique_if($id_rubrique) {
162
-	$date = date('Y-m-d H:i:s'); // figer la date
162
+    $date = date('Y-m-d H:i:s'); // figer la date
163 163
 
164
-	#	spip_log("depublier_branche_rubrique($id_rubrique ?");
165
-	$id_pred = $id_rubrique;
166
-	while ($id_pred) {
164
+    #	spip_log("depublier_branche_rubrique($id_rubrique ?");
165
+    $id_pred = $id_rubrique;
166
+    while ($id_pred) {
167 167
 
168
-		if (!depublier_rubrique_if($id_pred, $date)) {
169
-			return $id_pred != $id_rubrique;
170
-		}
171
-		// passer au parent si on a depublie
172
-		$r = sql_fetsel("id_parent", "spip_rubriques", "id_rubrique=" . intval($id_pred));
173
-		$id_pred = $r['id_parent'];
174
-	}
168
+        if (!depublier_rubrique_if($id_pred, $date)) {
169
+            return $id_pred != $id_rubrique;
170
+        }
171
+        // passer au parent si on a depublie
172
+        $r = sql_fetsel("id_parent", "spip_rubriques", "id_rubrique=" . intval($id_pred));
173
+        $id_pred = $r['id_parent'];
174
+    }
175 175
 
176
-	return $id_pred != $id_rubrique;
176
+    return $id_pred != $id_rubrique;
177 177
 }
178 178
 
179 179
 /**
@@ -190,57 +190,57 @@  discard block
 block discarded – undo
190 190
  *    true si la rubrique a été dépubliée
191 191
  */
192 192
 function depublier_rubrique_if($id_rubrique, $date = null) {
193
-	if (is_null($date)) {
194
-		$date = date('Y-m-d H:i:s');
195
-	}
196
-	$postdates = ($GLOBALS['meta']["post_dates"] == "non") ?
197
-		" AND date <= " . sql_quote($date) : '';
198
-
199
-	if (!$id_rubrique = intval($id_rubrique)) {
200
-		return false;
201
-	}
202
-
203
-	// verifier qu'elle existe et est bien publiee
204
-	$r = sql_fetsel('id_rubrique,statut', 'spip_rubriques', "id_rubrique=" . intval($id_rubrique));
205
-	if (!$r or $r['statut'] !== 'publie') {
206
-		return false;
207
-	}
208
-
209
-	// On met le nombre de chaque type d'enfants dans un tableau
210
-	// Le type de l'objet est au pluriel
211
-	$compte = array(
212
-		'articles' => sql_countsel("spip_articles",
213
-			"id_rubrique=" . intval($id_rubrique) . " AND statut='publie'$postdates"),
214
-		'rubriques' => sql_countsel("spip_rubriques", "id_parent=" . intval($id_rubrique) . " AND statut='publie'"),
215
-		'documents' => sql_countsel(
216
-			"spip_documents AS D JOIN spip_documents_liens AS L ON D.id_document=L.id_document", 
217
-			"L.id_objet=" . intval($id_rubrique) . " AND L.objet='rubrique' and D.mode NOT IN('logoon', 'logooff') ")
218
-	);
219
-
220
-	// On passe le tableau des comptes dans un pipeline pour que les plugins puissent ajouter (ou retirer) des enfants
221
-	$compte = pipeline('objet_compte_enfants',
222
-		array(
223
-			'args' => array(
224
-				'objet' => 'rubrique',
225
-				'id_objet' => $id_rubrique,
226
-				'statut' => 'publie',
227
-				'date' => $date
228
-			),
229
-			'data' => $compte
230
-		)
231
-	);
232
-
233
-	// S'il y a au moins un enfant de n'importe quoi, on ne dépublie pas
234
-	foreach ($compte as $objet => $n) {
235
-		if ($n) {
236
-			return false;
237
-		}
238
-	}
239
-
240
-	sql_updateq("spip_rubriques", array("statut" => 'prepa'), "id_rubrique=" . intval($id_rubrique));
193
+    if (is_null($date)) {
194
+        $date = date('Y-m-d H:i:s');
195
+    }
196
+    $postdates = ($GLOBALS['meta']["post_dates"] == "non") ?
197
+        " AND date <= " . sql_quote($date) : '';
198
+
199
+    if (!$id_rubrique = intval($id_rubrique)) {
200
+        return false;
201
+    }
202
+
203
+    // verifier qu'elle existe et est bien publiee
204
+    $r = sql_fetsel('id_rubrique,statut', 'spip_rubriques', "id_rubrique=" . intval($id_rubrique));
205
+    if (!$r or $r['statut'] !== 'publie') {
206
+        return false;
207
+    }
208
+
209
+    // On met le nombre de chaque type d'enfants dans un tableau
210
+    // Le type de l'objet est au pluriel
211
+    $compte = array(
212
+        'articles' => sql_countsel("spip_articles",
213
+            "id_rubrique=" . intval($id_rubrique) . " AND statut='publie'$postdates"),
214
+        'rubriques' => sql_countsel("spip_rubriques", "id_parent=" . intval($id_rubrique) . " AND statut='publie'"),
215
+        'documents' => sql_countsel(
216
+            "spip_documents AS D JOIN spip_documents_liens AS L ON D.id_document=L.id_document", 
217
+            "L.id_objet=" . intval($id_rubrique) . " AND L.objet='rubrique' and D.mode NOT IN('logoon', 'logooff') ")
218
+    );
219
+
220
+    // On passe le tableau des comptes dans un pipeline pour que les plugins puissent ajouter (ou retirer) des enfants
221
+    $compte = pipeline('objet_compte_enfants',
222
+        array(
223
+            'args' => array(
224
+                'objet' => 'rubrique',
225
+                'id_objet' => $id_rubrique,
226
+                'statut' => 'publie',
227
+                'date' => $date
228
+            ),
229
+            'data' => $compte
230
+        )
231
+    );
232
+
233
+    // S'il y a au moins un enfant de n'importe quoi, on ne dépublie pas
234
+    foreach ($compte as $objet => $n) {
235
+        if ($n) {
236
+            return false;
237
+        }
238
+    }
239
+
240
+    sql_updateq("spip_rubriques", array("statut" => 'prepa'), "id_rubrique=" . intval($id_rubrique));
241 241
 
242 242
 #		spip_log("depublier_rubrique $id_pred");
243
-	return true;
243
+    return true;
244 244
 }
245 245
 
246 246
 
@@ -263,18 +263,18 @@  discard block
 block discarded – undo
263 263
  **/
264 264
 function calculer_rubriques() {
265 265
 
266
-	calculer_rubriques_publiees();
266
+    calculer_rubriques_publiees();
267 267
 
268
-	// Apres chaque (de)publication 
269
-	// recalculer les langues utilisees sur le site
270
-	$langues = calculer_langues_utilisees();
271
-	ecrire_meta('langues_utilisees', $langues);
268
+    // Apres chaque (de)publication 
269
+    // recalculer les langues utilisees sur le site
270
+    $langues = calculer_langues_utilisees();
271
+    ecrire_meta('langues_utilisees', $langues);
272 272
 
273
-	// Sauver la date de la derniere mise a jour (pour menu_rubriques)
274
-	ecrire_meta("date_calcul_rubriques", date("U"));
273
+    // Sauver la date de la derniere mise a jour (pour menu_rubriques)
274
+    ecrire_meta("date_calcul_rubriques", date("U"));
275 275
 
276
-	// on calcule la date du prochain article post-date
277
-	calculer_prochain_postdate();
276
+    // on calcule la date du prochain article post-date
277
+    calculer_prochain_postdate();
278 278
 }
279 279
 
280 280
 
@@ -291,51 +291,51 @@  discard block
 block discarded – undo
291 291
  **/
292 292
 function calculer_rubriques_publiees() {
293 293
 
294
-	// Mettre les compteurs a zero
295
-	sql_updateq('spip_rubriques', array('date_tmp' => '0000-00-00 00:00:00', 'statut_tmp' => 'prepa'));
296
-
297
-	//
298
-	// Publier et dater les rubriques qui ont un article publie
299
-	//
300
-
301
-	// Afficher les articles post-dates ?
302
-	$postdates = ($GLOBALS['meta']["post_dates"] == "non") ?
303
-		"AND A.date <= " . sql_quote(date('Y-m-d H:i:s')) : '';
304
-
305
-	$r = sql_select(
306
-		"R.id_rubrique AS id, max(A.date) AS date_h",
307
-		"spip_rubriques AS R JOIN spip_articles AS A ON R.id_rubrique = A.id_rubrique",
308
-		"A.date>R.date_tmp AND A.statut='publie' $postdates ", "R.id_rubrique");
309
-	while ($row = sql_fetch($r)) {
310
-		sql_updateq("spip_rubriques", array("statut_tmp" => 'publie', "date_tmp" => $row['date_h']),
311
-			"id_rubrique=" . intval($row['id']));
312
-	}
313
-
314
-	// point d'entree pour permettre a des plugins de gerer le statut
315
-	// autrement (par ex: toute rubrique est publiee des sa creation)
316
-	// Ce pipeline fait ce qu'il veut, mais s'il touche aux statuts/dates
317
-	// c'est statut_tmp/date_tmp qu'il doit modifier
318
-	// [C'est un trigger... a renommer en trig_calculer_rubriques ?]
319
-	pipeline('calculer_rubriques', null);
320
-
321
-
322
-	// Les rubriques qui ont une rubrique fille plus recente
323
-	// on tourne tant que les donnees remontent vers la racine.
324
-	do {
325
-		$continuer = false;
326
-		$r = sql_select(
327
-			"R.id_rubrique AS id, max(SR.date_tmp) AS date_h",
328
-			"spip_rubriques AS R JOIN spip_rubriques AS SR ON R.id_rubrique = SR.id_parent",
329
-			"(SR.date_tmp>R.date_tmp OR R.statut_tmp<>'publie') AND SR.statut_tmp='publie' ", "R.id_rubrique");
330
-		while ($row = sql_fetch($r)) {
331
-			sql_updateq('spip_rubriques', array('statut_tmp' => 'publie', 'date_tmp' => $row['date_h']),
332
-				"id_rubrique=" . intval($row['id']));
333
-			$continuer = true;
334
-		}
335
-	} while ($continuer);
336
-
337
-	// Enregistrement des modifs
338
-	sql_update('spip_rubriques', array('date' => 'date_tmp', 'statut' => 'statut_tmp'));
294
+    // Mettre les compteurs a zero
295
+    sql_updateq('spip_rubriques', array('date_tmp' => '0000-00-00 00:00:00', 'statut_tmp' => 'prepa'));
296
+
297
+    //
298
+    // Publier et dater les rubriques qui ont un article publie
299
+    //
300
+
301
+    // Afficher les articles post-dates ?
302
+    $postdates = ($GLOBALS['meta']["post_dates"] == "non") ?
303
+        "AND A.date <= " . sql_quote(date('Y-m-d H:i:s')) : '';
304
+
305
+    $r = sql_select(
306
+        "R.id_rubrique AS id, max(A.date) AS date_h",
307
+        "spip_rubriques AS R JOIN spip_articles AS A ON R.id_rubrique = A.id_rubrique",
308
+        "A.date>R.date_tmp AND A.statut='publie' $postdates ", "R.id_rubrique");
309
+    while ($row = sql_fetch($r)) {
310
+        sql_updateq("spip_rubriques", array("statut_tmp" => 'publie', "date_tmp" => $row['date_h']),
311
+            "id_rubrique=" . intval($row['id']));
312
+    }
313
+
314
+    // point d'entree pour permettre a des plugins de gerer le statut
315
+    // autrement (par ex: toute rubrique est publiee des sa creation)
316
+    // Ce pipeline fait ce qu'il veut, mais s'il touche aux statuts/dates
317
+    // c'est statut_tmp/date_tmp qu'il doit modifier
318
+    // [C'est un trigger... a renommer en trig_calculer_rubriques ?]
319
+    pipeline('calculer_rubriques', null);
320
+
321
+
322
+    // Les rubriques qui ont une rubrique fille plus recente
323
+    // on tourne tant que les donnees remontent vers la racine.
324
+    do {
325
+        $continuer = false;
326
+        $r = sql_select(
327
+            "R.id_rubrique AS id, max(SR.date_tmp) AS date_h",
328
+            "spip_rubriques AS R JOIN spip_rubriques AS SR ON R.id_rubrique = SR.id_parent",
329
+            "(SR.date_tmp>R.date_tmp OR R.statut_tmp<>'publie') AND SR.statut_tmp='publie' ", "R.id_rubrique");
330
+        while ($row = sql_fetch($r)) {
331
+            sql_updateq('spip_rubriques', array('statut_tmp' => 'publie', 'date_tmp' => $row['date_h']),
332
+                "id_rubrique=" . intval($row['id']));
333
+            $continuer = true;
334
+        }
335
+    } while ($continuer);
336
+
337
+    // Enregistrement des modifs
338
+    sql_update('spip_rubriques', array('date' => 'date_tmp', 'statut' => 'statut_tmp'));
339 339
 }
340 340
 
341 341
 /**
@@ -350,99 +350,99 @@  discard block
 block discarded – undo
350 350
  * @return void
351 351
  **/
352 352
 function propager_les_secteurs() {
353
-	// Profondeur 0
354
-	// Toutes les rubriques racines sont de profondeur 0
355
-	// et fixer les id_secteur des rubriques racines
356
-	sql_update('spip_rubriques', array('id_secteur' => 'id_rubrique', 'profondeur' => 0), "id_parent=0");
357
-	// Toute rubrique non racine est de profondeur >0
358
-	sql_updateq('spip_rubriques', array('profondeur' => 1), "id_parent<>0 AND profondeur=0");
359
-
360
-	// securite : pas plus d'iteration que de rubriques dans la base
361
-	$maxiter = sql_countsel("spip_rubriques");
362
-
363
-	// reparer les rubriques qui n'ont pas l'id_secteur de leur parent
364
-	// on fait profondeur par profondeur
365
-
366
-	$prof = 0;
367
-	do {
368
-		$continuer = false;
369
-
370
-		// Par recursivite : si toutes les rubriques de profondeur $prof sont bonnes
371
-		// on fixe le profondeur $prof+1
372
-
373
-		// Toutes les rubriques dont le parent est de profondeur $prof ont une profondeur $prof+1
374
-		// on teste A.profondeur > $prof+1 car :
375
-		// - toutes les rubriques de profondeur 0 à $prof sont bonnes
376
-		// - si A.profondeur = $prof+1 c'est bon
377
-		// - cela nous protege de la boucle infinie en cas de reference circulaire dans les rubriques
378
-		$maxiter2 = $maxiter;
379
-		while ($maxiter2--
380
-			and $rows = sql_allfetsel(
381
-				"A.id_rubrique AS id, R.id_secteur AS id_secteur, R.profondeur+1 as profondeur",
382
-				"spip_rubriques AS A JOIN spip_rubriques AS R ON A.id_parent = R.id_rubrique",
383
-				"R.profondeur=" . intval($prof) . " AND (A.id_secteur <> R.id_secteur OR A.profondeur > R.profondeur+1)",
384
-				"", "R.id_secteur", "0,100")) {
385
-
386
-			$id_secteur = null;
387
-			$ids = array();
388
-			while ($row = array_shift($rows)) {
389
-				if ($row['id_secteur'] !== $id_secteur) {
390
-					if (count($ids)) {
391
-						sql_updateq("spip_rubriques", array("id_secteur" => $id_secteur, 'profondeur' => $prof + 1),
392
-							sql_in('id_rubrique', $ids));
393
-					}
394
-					$id_secteur = $row['id_secteur'];
395
-					$ids = array();
396
-				}
397
-				$ids[] = $row['id'];
398
-			}
399
-			if (count($ids)) {
400
-				sql_updateq("spip_rubriques", array("id_secteur" => $id_secteur, 'profondeur' => $prof + 1),
401
-					sql_in('id_rubrique', $ids));
402
-			}
403
-		}
404
-
405
-
406
-		// Toutes les rubriques de profondeur $prof+1 qui n'ont pas un parent de profondeur $prof sont decalees
407
-		$maxiter2 = $maxiter;
408
-		while ($maxiter2--
409
-			and $rows = sql_allfetsel(
410
-				"id_rubrique as id",
411
-				"spip_rubriques",
412
-				"profondeur=" . intval($prof + 1) . " AND id_parent NOT IN (" . sql_get_select("zzz.id_rubrique",
413
-					"spip_rubriques AS zzz", "zzz.profondeur=" . intval($prof)) . ")", '', '', '0,100')) {
414
-			$rows = array_column($rows, 'id');
415
-			sql_updateq("spip_rubriques", array('profondeur' => $prof + 2), sql_in("id_rubrique", $rows));
416
-		}
417
-
418
-		// ici on a fini de valider $prof+1, toutes les rubriques de prondeur 0 a $prof+1 sont OK
419
-		// si pas de rubrique a profondeur $prof+1 pas la peine de continuer
420
-		// si il reste des rubriques non vues, c'est une branche morte ou reference circulaire (base foireuse)
421
-		// on arrete les frais
422
-		if (sql_countsel("spip_rubriques", "profondeur=" . intval($prof + 1))) {
423
-			$prof++;
424
-			$continuer = true;
425
-		}
426
-	} while ($continuer and $maxiter--);
427
-
428
-	// loger si la table des rubriques semble foireuse
429
-	// et mettre un id_secteur=0 sur ces rubriques pour eviter toute selection par les boucles
430
-	if (sql_countsel("spip_rubriques", "profondeur>" . intval($prof + 1))) {
431
-		spip_log("Les rubriques de profondeur>" . ($prof + 1) . " semblent suspectes (branches morte ou reference circulaire dans les parents)",
432
-			_LOG_CRITIQUE);
433
-		sql_update("spip_rubriques", array('id_secteur' => 0), "profondeur>" . intval($prof + 1));
434
-	}
435
-
436
-	// reparer les articles
437
-	$r = sql_select("A.id_article AS id, R.id_secteur AS secteur", "spip_articles AS A, spip_rubriques AS R",
438
-		"A.id_rubrique = R.id_rubrique AND A.id_secteur <> R.id_secteur");
439
-
440
-	while ($row = sql_fetch($r)) {
441
-		sql_update("spip_articles", array("id_secteur" => $row['secteur']), "id_article=" . intval($row['id']));
442
-	}
443
-
444
-	// avertir les plugins qui peuvent faire leur mises a jour egalement
445
-	pipeline('trig_propager_les_secteurs', '');
353
+    // Profondeur 0
354
+    // Toutes les rubriques racines sont de profondeur 0
355
+    // et fixer les id_secteur des rubriques racines
356
+    sql_update('spip_rubriques', array('id_secteur' => 'id_rubrique', 'profondeur' => 0), "id_parent=0");
357
+    // Toute rubrique non racine est de profondeur >0
358
+    sql_updateq('spip_rubriques', array('profondeur' => 1), "id_parent<>0 AND profondeur=0");
359
+
360
+    // securite : pas plus d'iteration que de rubriques dans la base
361
+    $maxiter = sql_countsel("spip_rubriques");
362
+
363
+    // reparer les rubriques qui n'ont pas l'id_secteur de leur parent
364
+    // on fait profondeur par profondeur
365
+
366
+    $prof = 0;
367
+    do {
368
+        $continuer = false;
369
+
370
+        // Par recursivite : si toutes les rubriques de profondeur $prof sont bonnes
371
+        // on fixe le profondeur $prof+1
372
+
373
+        // Toutes les rubriques dont le parent est de profondeur $prof ont une profondeur $prof+1
374
+        // on teste A.profondeur > $prof+1 car :
375
+        // - toutes les rubriques de profondeur 0 à $prof sont bonnes
376
+        // - si A.profondeur = $prof+1 c'est bon
377
+        // - cela nous protege de la boucle infinie en cas de reference circulaire dans les rubriques
378
+        $maxiter2 = $maxiter;
379
+        while ($maxiter2--
380
+            and $rows = sql_allfetsel(
381
+                "A.id_rubrique AS id, R.id_secteur AS id_secteur, R.profondeur+1 as profondeur",
382
+                "spip_rubriques AS A JOIN spip_rubriques AS R ON A.id_parent = R.id_rubrique",
383
+                "R.profondeur=" . intval($prof) . " AND (A.id_secteur <> R.id_secteur OR A.profondeur > R.profondeur+1)",
384
+                "", "R.id_secteur", "0,100")) {
385
+
386
+            $id_secteur = null;
387
+            $ids = array();
388
+            while ($row = array_shift($rows)) {
389
+                if ($row['id_secteur'] !== $id_secteur) {
390
+                    if (count($ids)) {
391
+                        sql_updateq("spip_rubriques", array("id_secteur" => $id_secteur, 'profondeur' => $prof + 1),
392
+                            sql_in('id_rubrique', $ids));
393
+                    }
394
+                    $id_secteur = $row['id_secteur'];
395
+                    $ids = array();
396
+                }
397
+                $ids[] = $row['id'];
398
+            }
399
+            if (count($ids)) {
400
+                sql_updateq("spip_rubriques", array("id_secteur" => $id_secteur, 'profondeur' => $prof + 1),
401
+                    sql_in('id_rubrique', $ids));
402
+            }
403
+        }
404
+
405
+
406
+        // Toutes les rubriques de profondeur $prof+1 qui n'ont pas un parent de profondeur $prof sont decalees
407
+        $maxiter2 = $maxiter;
408
+        while ($maxiter2--
409
+            and $rows = sql_allfetsel(
410
+                "id_rubrique as id",
411
+                "spip_rubriques",
412
+                "profondeur=" . intval($prof + 1) . " AND id_parent NOT IN (" . sql_get_select("zzz.id_rubrique",
413
+                    "spip_rubriques AS zzz", "zzz.profondeur=" . intval($prof)) . ")", '', '', '0,100')) {
414
+            $rows = array_column($rows, 'id');
415
+            sql_updateq("spip_rubriques", array('profondeur' => $prof + 2), sql_in("id_rubrique", $rows));
416
+        }
417
+
418
+        // ici on a fini de valider $prof+1, toutes les rubriques de prondeur 0 a $prof+1 sont OK
419
+        // si pas de rubrique a profondeur $prof+1 pas la peine de continuer
420
+        // si il reste des rubriques non vues, c'est une branche morte ou reference circulaire (base foireuse)
421
+        // on arrete les frais
422
+        if (sql_countsel("spip_rubriques", "profondeur=" . intval($prof + 1))) {
423
+            $prof++;
424
+            $continuer = true;
425
+        }
426
+    } while ($continuer and $maxiter--);
427
+
428
+    // loger si la table des rubriques semble foireuse
429
+    // et mettre un id_secteur=0 sur ces rubriques pour eviter toute selection par les boucles
430
+    if (sql_countsel("spip_rubriques", "profondeur>" . intval($prof + 1))) {
431
+        spip_log("Les rubriques de profondeur>" . ($prof + 1) . " semblent suspectes (branches morte ou reference circulaire dans les parents)",
432
+            _LOG_CRITIQUE);
433
+        sql_update("spip_rubriques", array('id_secteur' => 0), "profondeur>" . intval($prof + 1));
434
+    }
435
+
436
+    // reparer les articles
437
+    $r = sql_select("A.id_article AS id, R.id_secteur AS secteur", "spip_articles AS A, spip_rubriques AS R",
438
+        "A.id_rubrique = R.id_rubrique AND A.id_secteur <> R.id_secteur");
439
+
440
+    while ($row = sql_fetch($r)) {
441
+        sql_update("spip_articles", array("id_secteur" => $row['secteur']), "id_article=" . intval($row['id']));
442
+    }
443
+
444
+    // avertir les plugins qui peuvent faire leur mises a jour egalement
445
+    pipeline('trig_propager_les_secteurs', '');
446 446
 }
447 447
 
448 448
 
@@ -457,17 +457,17 @@  discard block
 block discarded – undo
457 457
  *     true si un changement a eu lieu
458 458
  **/
459 459
 function calculer_langues_rubriques_etape() {
460
-	$s = sql_select("A.id_rubrique AS id_rubrique, R.lang AS lang", "spip_rubriques AS A, spip_rubriques AS R",
461
-		"A.id_parent = R.id_rubrique AND A.langue_choisie != 'oui' AND R.lang<>'' AND R.lang<>A.lang");
460
+    $s = sql_select("A.id_rubrique AS id_rubrique, R.lang AS lang", "spip_rubriques AS A, spip_rubriques AS R",
461
+        "A.id_parent = R.id_rubrique AND A.langue_choisie != 'oui' AND R.lang<>'' AND R.lang<>A.lang");
462 462
 
463
-	$t = false;
464
-	while ($row = sql_fetch($s)) {
465
-		$id_rubrique = $row['id_rubrique'];
466
-		$t = sql_updateq('spip_rubriques', array('lang' => $row['lang'], 'langue_choisie' => 'non'),
467
-			"id_rubrique=" . intval($id_rubrique));
468
-	}
463
+    $t = false;
464
+    while ($row = sql_fetch($s)) {
465
+        $id_rubrique = $row['id_rubrique'];
466
+        $t = sql_updateq('spip_rubriques', array('lang' => $row['lang'], 'langue_choisie' => 'non'),
467
+            "id_rubrique=" . intval($id_rubrique));
468
+    }
469 469
 
470
-	return $t;
470
+    return $t;
471 471
 }
472 472
 
473 473
 /**
@@ -487,30 +487,30 @@  discard block
 block discarded – undo
487 487
  **/
488 488
 function calculer_langues_rubriques() {
489 489
 
490
-	// rubriques (recursivite)
491
-	sql_updateq("spip_rubriques", array("lang" => $GLOBALS['meta']['langue_site'], "langue_choisie" => 'non'),
492
-		"id_parent=0 AND langue_choisie != 'oui'");
493
-	while (calculer_langues_rubriques_etape()) {
494
-		;
495
-	}
496
-
497
-	// articles
498
-	$s = sql_select("A.id_article AS id_article, R.lang AS lang", "spip_articles AS A, spip_rubriques AS R",
499
-		"A.id_rubrique = R.id_rubrique AND A.langue_choisie != 'oui' AND (length(A.lang)=0 OR length(R.lang)>0) AND R.lang<>A.lang");
500
-	while ($row = sql_fetch($s)) {
501
-		$id_article = $row['id_article'];
502
-		sql_updateq('spip_articles', array("lang" => $row['lang'], 'langue_choisie' => 'non'),
503
-			"id_article=" . intval($id_article));
504
-	}
505
-
506
-	if ($GLOBALS['meta']['multi_rubriques'] == 'oui') {
507
-
508
-		$langues = calculer_langues_utilisees();
509
-		ecrire_meta('langues_utilisees', $langues);
510
-	}
511
-
512
-	// avertir les plugins qui peuvent faire leur mises a jour egalement
513
-	pipeline('trig_calculer_langues_rubriques', '');
490
+    // rubriques (recursivite)
491
+    sql_updateq("spip_rubriques", array("lang" => $GLOBALS['meta']['langue_site'], "langue_choisie" => 'non'),
492
+        "id_parent=0 AND langue_choisie != 'oui'");
493
+    while (calculer_langues_rubriques_etape()) {
494
+        ;
495
+    }
496
+
497
+    // articles
498
+    $s = sql_select("A.id_article AS id_article, R.lang AS lang", "spip_articles AS A, spip_rubriques AS R",
499
+        "A.id_rubrique = R.id_rubrique AND A.langue_choisie != 'oui' AND (length(A.lang)=0 OR length(R.lang)>0) AND R.lang<>A.lang");
500
+    while ($row = sql_fetch($s)) {
501
+        $id_article = $row['id_article'];
502
+        sql_updateq('spip_articles', array("lang" => $row['lang'], 'langue_choisie' => 'non'),
503
+            "id_article=" . intval($id_article));
504
+    }
505
+
506
+    if ($GLOBALS['meta']['multi_rubriques'] == 'oui') {
507
+
508
+        $langues = calculer_langues_utilisees();
509
+        ecrire_meta('langues_utilisees', $langues);
510
+    }
511
+
512
+    // avertir les plugins qui peuvent faire leur mises a jour egalement
513
+    pipeline('trig_calculer_langues_rubriques', '');
514 514
 }
515 515
 
516 516
 
@@ -527,78 +527,78 @@  discard block
 block discarded – undo
527 527
  *    Liste des langues utilisées séparées par des virgules
528 528
  **/
529 529
 function calculer_langues_utilisees($serveur = '') {
530
-	include_spip('public/interfaces');
531
-	include_spip('public/compiler');
532
-	include_spip('public/composer');
533
-	include_spip('public/phraser_html');
534
-	$langues = array();
535
-
536
-	$langues[$GLOBALS['meta']['langue_site']] = 1;
537
-
538
-	include_spip('base/objets');
539
-	$tables = lister_tables_objets_sql();
540
-	$trouver_table = charger_fonction('trouver_table', 'base');
541
-
542
-	foreach (array_keys($tables) as $t) {
543
-		$desc = $trouver_table($t, $serveur);
544
-		// c'est une table avec des langues
545
-		if ($desc['exist']
546
-			and isset($desc['field']['lang'])
547
-			and isset($desc['field']['langue_choisie'])
548
-		) {
549
-
550
-			$boucle = new Boucle();
551
-			$boucle->show = $desc;
552
-			$boucle->nom = 'calculer_langues_utilisees';
553
-			$boucle->id_boucle = $desc['table_objet'];
554
-			$boucle->id_table = $desc['table_objet'];
555
-			$boucle->sql_serveur = $serveur;
556
-			$boucle->select[] = "DISTINCT lang";
557
-			$boucle->from[$desc['table_objet']] = $t;
558
-			$boucle->separateur[] = ',';
559
-			$boucle->return = '$Pile[$SP][\'lang\']';
560
-			$boucle->iterateur = 'sql';
561
-
562
-			$boucle->descr['nom'] = 'calculer_langues_utilisees'; // eviter notice php
563
-			$boucle->descr['sourcefile'] = 'internal';
564
-			$boucle->descr['gram'] = 'html';
565
-
566
-			$boucle = pipeline('pre_boucle', $boucle);
567
-
568
-			if (isset($desc['statut'])
569
-				and $desc['statut']
570
-			) {
571
-				$boucles = array(
572
-					'calculer_langues_utilisees' => $boucle,
573
-				);
574
-				// generer un nom de fonction "anonyme" unique
575
-				do {
576
-					$functionname = 'f_calculer_langues_utilisees_' . $boucle->id_table . '_' . time() . '_' . rand();
577
-				} while (function_exists($functionname));
578
-				$code = calculer_boucle('calculer_langues_utilisees', $boucles);
579
-				$code = '$SP=0; $command=array();$command["connect"] = $connect = "' . $serveur . '"; $Pile=array(0=>array());' . "\n" . $code;
580
-				$code = 'function ' . $functionname . '(){' . $code . '};$res = ' . $functionname . '();';
581
-				$res = '';
582
-				eval($code);
583
-				$res = explode(',', $res);
584
-				foreach ($res as $lang) {
585
-					$langues[$lang] = 1;
586
-				}
587
-			} else {
588
-				$res = sql_select(implode(',', $boucle->select), $boucle->from);
589
-				while ($row = sql_fetch($res)) {
590
-					$langues[$row['lang']] = 1;
591
-				}
592
-			}
593
-		}
594
-	}
595
-
596
-	$langues = array_filter(array_keys($langues));
597
-	sort($langues);
598
-	$langues = join(',', $langues);
599
-	spip_log("langues utilisees: $langues");
600
-
601
-	return $langues;
530
+    include_spip('public/interfaces');
531
+    include_spip('public/compiler');
532
+    include_spip('public/composer');
533
+    include_spip('public/phraser_html');
534
+    $langues = array();
535
+
536
+    $langues[$GLOBALS['meta']['langue_site']] = 1;
537
+
538
+    include_spip('base/objets');
539
+    $tables = lister_tables_objets_sql();
540
+    $trouver_table = charger_fonction('trouver_table', 'base');
541
+
542
+    foreach (array_keys($tables) as $t) {
543
+        $desc = $trouver_table($t, $serveur);
544
+        // c'est une table avec des langues
545
+        if ($desc['exist']
546
+            and isset($desc['field']['lang'])
547
+            and isset($desc['field']['langue_choisie'])
548
+        ) {
549
+
550
+            $boucle = new Boucle();
551
+            $boucle->show = $desc;
552
+            $boucle->nom = 'calculer_langues_utilisees';
553
+            $boucle->id_boucle = $desc['table_objet'];
554
+            $boucle->id_table = $desc['table_objet'];
555
+            $boucle->sql_serveur = $serveur;
556
+            $boucle->select[] = "DISTINCT lang";
557
+            $boucle->from[$desc['table_objet']] = $t;
558
+            $boucle->separateur[] = ',';
559
+            $boucle->return = '$Pile[$SP][\'lang\']';
560
+            $boucle->iterateur = 'sql';
561
+
562
+            $boucle->descr['nom'] = 'calculer_langues_utilisees'; // eviter notice php
563
+            $boucle->descr['sourcefile'] = 'internal';
564
+            $boucle->descr['gram'] = 'html';
565
+
566
+            $boucle = pipeline('pre_boucle', $boucle);
567
+
568
+            if (isset($desc['statut'])
569
+                and $desc['statut']
570
+            ) {
571
+                $boucles = array(
572
+                    'calculer_langues_utilisees' => $boucle,
573
+                );
574
+                // generer un nom de fonction "anonyme" unique
575
+                do {
576
+                    $functionname = 'f_calculer_langues_utilisees_' . $boucle->id_table . '_' . time() . '_' . rand();
577
+                } while (function_exists($functionname));
578
+                $code = calculer_boucle('calculer_langues_utilisees', $boucles);
579
+                $code = '$SP=0; $command=array();$command["connect"] = $connect = "' . $serveur . '"; $Pile=array(0=>array());' . "\n" . $code;
580
+                $code = 'function ' . $functionname . '(){' . $code . '};$res = ' . $functionname . '();';
581
+                $res = '';
582
+                eval($code);
583
+                $res = explode(',', $res);
584
+                foreach ($res as $lang) {
585
+                    $langues[$lang] = 1;
586
+                }
587
+            } else {
588
+                $res = sql_select(implode(',', $boucle->select), $boucle->from);
589
+                while ($row = sql_fetch($res)) {
590
+                    $langues[$row['lang']] = 1;
591
+                }
592
+            }
593
+        }
594
+    }
595
+
596
+    $langues = array_filter(array_keys($langues));
597
+    sort($langues);
598
+    $langues = join(',', $langues);
599
+    spip_log("langues utilisees: $langues");
600
+
601
+    return $langues;
602 602
 }
603 603
 
604 604
 /**
@@ -628,9 +628,9 @@  discard block
 block discarded – undo
628 628
  *     incluant les rubriques noeuds et toutes leurs descendances
629 629
  */
630 630
 function calcul_branche_in($id) {
631
-	$calcul_branche_in = charger_fonction('calcul_branche_in', 'inc');
631
+    $calcul_branche_in = charger_fonction('calcul_branche_in', 'inc');
632 632
 
633
-	return $calcul_branche_in($id);
633
+    return $calcul_branche_in($id);
634 634
 }
635 635
 
636 636
 /**
@@ -648,9 +648,9 @@  discard block
 block discarded – undo
648 648
  *     incluant les rubriques transmises et toutes leurs parentées
649 649
  */
650 650
 function calcul_hierarchie_in($id, $tout = true) {
651
-	$calcul_hierarchie_in = charger_fonction('calcul_hierarchie_in', 'inc');
651
+    $calcul_hierarchie_in = charger_fonction('calcul_hierarchie_in', 'inc');
652 652
 
653
-	return $calcul_hierarchie_in($id, $tout);
653
+    return $calcul_hierarchie_in($id, $tout);
654 654
 }
655 655
 
656 656
 
@@ -671,38 +671,38 @@  discard block
 block discarded – undo
671 671
  *     incluant les rubriques noeuds et toutes leurs descendances
672 672
  */
673 673
 function inc_calcul_branche_in_dist($id) {
674
-	static $b = array();
675
-
676
-	// normaliser $id qui a pu arriver comme un array, comme un entier, ou comme une chaine NN,NN,NN
677
-	if (!is_array($id)) {
678
-		$id = explode(',', $id);
679
-	}
680
-	$id = join(',', array_map('intval', $id));
681
-	if (isset($b[$id])) {
682
-		return $b[$id];
683
-	}
684
-
685
-	// Notre branche commence par la rubrique de depart
686
-	$branche = $r = $id;
687
-
688
-	// On ajoute une generation (les filles de la generation precedente)
689
-	// jusqu'a epuisement, en se protegeant des references circulaires
690
-	$maxiter = 10000;
691
-	while ($maxiter-- and $filles = sql_allfetsel(
692
-			'id_rubrique',
693
-			'spip_rubriques',
694
-			sql_in('id_parent', $r) . " AND " . sql_in('id_rubrique', $r, 'NOT')
695
-		)) {
696
-		$r = join(',', array_column($filles, 'id_rubrique'));
697
-		$branche .= ',' . $r;
698
-	}
699
-
700
-	# securite pour ne pas plomber la conso memoire sur les sites prolifiques
701
-	if (strlen($branche) < 10000) {
702
-		$b[$id] = $branche;
703
-	}
704
-
705
-	return $branche;
674
+    static $b = array();
675
+
676
+    // normaliser $id qui a pu arriver comme un array, comme un entier, ou comme une chaine NN,NN,NN
677
+    if (!is_array($id)) {
678
+        $id = explode(',', $id);
679
+    }
680
+    $id = join(',', array_map('intval', $id));
681
+    if (isset($b[$id])) {
682
+        return $b[$id];
683
+    }
684
+
685
+    // Notre branche commence par la rubrique de depart
686
+    $branche = $r = $id;
687
+
688
+    // On ajoute une generation (les filles de la generation precedente)
689
+    // jusqu'a epuisement, en se protegeant des references circulaires
690
+    $maxiter = 10000;
691
+    while ($maxiter-- and $filles = sql_allfetsel(
692
+            'id_rubrique',
693
+            'spip_rubriques',
694
+            sql_in('id_parent', $r) . " AND " . sql_in('id_rubrique', $r, 'NOT')
695
+        )) {
696
+        $r = join(',', array_column($filles, 'id_rubrique'));
697
+        $branche .= ',' . $r;
698
+    }
699
+
700
+    # securite pour ne pas plomber la conso memoire sur les sites prolifiques
701
+    if (strlen($branche) < 10000) {
702
+        $b[$id] = $branche;
703
+    }
704
+
705
+    return $branche;
706 706
 }
707 707
 
708 708
 
@@ -724,43 +724,43 @@  discard block
 block discarded – undo
724 724
  *     incluant les rubriques transmises et toutes leurs parentées
725 725
  */
726 726
 function inc_calcul_hierarchie_in_dist($id, $tout = true) {
727
-	static $b = array();
728
-
729
-	// normaliser $id qui a pu arriver comme un array, comme un entier, ou comme une chaine NN,NN,NN
730
-	if (!is_array($id)) {
731
-		$id = explode(',', $id);
732
-	}
733
-	$id = join(',', array_map('intval', $id));
734
-
735
-	if (isset($b[$id])) {
736
-		// Notre branche commence par la rubrique de depart si $tout=true
737
-		return $tout ? (strlen($b[$id]) ? $b[$id] . ",$id" : $id) : $b[$id];
738
-	}
739
-
740
-	$hier = "";
741
-
742
-	// On ajoute une generation (les filles de la generation precedente)
743
-	// jusqu'a epuisement, en se protegeant des references circulaires
744
-	$ids_nouveaux_parents = $id;
745
-	$maxiter = 10000;
746
-	while ($maxiter-- and $parents = sql_allfetsel(
747
-			'id_parent',
748
-			'spip_rubriques',
749
-			sql_in('id_rubrique', $ids_nouveaux_parents) . " AND " . sql_in('id_parent', $hier, 'NOT')
750
-		)) {
751
-		$ids_nouveaux_parents = join(',', array_column($parents, 'id_parent'));
752
-		$hier = $ids_nouveaux_parents . (strlen($hier) ? ',' . $hier : '');
753
-	}
754
-
755
-	# securite pour ne pas plomber la conso memoire sur les sites prolifiques
756
-	if (strlen($hier) < 10000) {
757
-		$b[$id] = $hier;
758
-	}
759
-
760
-	// Notre branche commence par la rubrique de depart si $tout=true
761
-	$hier = $tout ? (strlen($hier) ? "$hier,$id" : $id) : $hier;
762
-
763
-	return $hier;
727
+    static $b = array();
728
+
729
+    // normaliser $id qui a pu arriver comme un array, comme un entier, ou comme une chaine NN,NN,NN
730
+    if (!is_array($id)) {
731
+        $id = explode(',', $id);
732
+    }
733
+    $id = join(',', array_map('intval', $id));
734
+
735
+    if (isset($b[$id])) {
736
+        // Notre branche commence par la rubrique de depart si $tout=true
737
+        return $tout ? (strlen($b[$id]) ? $b[$id] . ",$id" : $id) : $b[$id];
738
+    }
739
+
740
+    $hier = "";
741
+
742
+    // On ajoute une generation (les filles de la generation precedente)
743
+    // jusqu'a epuisement, en se protegeant des references circulaires
744
+    $ids_nouveaux_parents = $id;
745
+    $maxiter = 10000;
746
+    while ($maxiter-- and $parents = sql_allfetsel(
747
+            'id_parent',
748
+            'spip_rubriques',
749
+            sql_in('id_rubrique', $ids_nouveaux_parents) . " AND " . sql_in('id_parent', $hier, 'NOT')
750
+        )) {
751
+        $ids_nouveaux_parents = join(',', array_column($parents, 'id_parent'));
752
+        $hier = $ids_nouveaux_parents . (strlen($hier) ? ',' . $hier : '');
753
+    }
754
+
755
+    # securite pour ne pas plomber la conso memoire sur les sites prolifiques
756
+    if (strlen($hier) < 10000) {
757
+        $b[$id] = $hier;
758
+    }
759
+
760
+    // Notre branche commence par la rubrique de depart si $tout=true
761
+    $hier = $tout ? (strlen($hier) ? "$hier,$id" : $id) : $hier;
762
+
763
+    return $hier;
764 764
 }
765 765
 
766 766
 
@@ -778,38 +778,38 @@  discard block
 block discarded – undo
778 778
  * @return void
779 779
  **/
780 780
 function calculer_prochain_postdate($check = false) {
781
-	include_spip('base/abstract_sql');
782
-	if ($check) {
783
-		$postdates = ($GLOBALS['meta']["post_dates"] == "non") ?
784
-			"AND A.date <= " . sql_quote(date('Y-m-d H:i:s')) : '';
785
-
786
-		$r = sql_select("DISTINCT A.id_rubrique AS id",
787
-			"spip_articles AS A LEFT JOIN spip_rubriques AS R ON A.id_rubrique=R.id_rubrique",
788
-			"R.statut != 'publie' AND A.statut='publie'$postdates");
789
-		while ($row = sql_fetch($r)) {
790
-			publier_branche_rubrique($row['id']);
791
-		}
792
-
793
-		pipeline('trig_calculer_prochain_postdate', '');
794
-	}
795
-
796
-	$t = sql_fetsel("date", "spip_articles", "statut='publie' AND date > " . sql_quote(date('Y-m-d H:i:s')), "", "date",
797
-		"1");
798
-
799
-	if ($t) {
800
-		$t = $t['date'];
801
-		if (!isset($GLOBALS['meta']['date_prochain_postdate'])
802
-			or $t <> $GLOBALS['meta']['date_prochain_postdate']
803
-		) {
804
-			ecrire_meta('date_prochain_postdate', strtotime($t));
805
-			ecrire_meta('derniere_modif', time());
806
-		}
807
-	} else {
808
-		effacer_meta('date_prochain_postdate');
809
-		ecrire_meta('derniere_modif', time());
810
-	}
811
-
812
-	spip_log("prochain postdate: $t");
781
+    include_spip('base/abstract_sql');
782
+    if ($check) {
783
+        $postdates = ($GLOBALS['meta']["post_dates"] == "non") ?
784
+            "AND A.date <= " . sql_quote(date('Y-m-d H:i:s')) : '';
785
+
786
+        $r = sql_select("DISTINCT A.id_rubrique AS id",
787
+            "spip_articles AS A LEFT JOIN spip_rubriques AS R ON A.id_rubrique=R.id_rubrique",
788
+            "R.statut != 'publie' AND A.statut='publie'$postdates");
789
+        while ($row = sql_fetch($r)) {
790
+            publier_branche_rubrique($row['id']);
791
+        }
792
+
793
+        pipeline('trig_calculer_prochain_postdate', '');
794
+    }
795
+
796
+    $t = sql_fetsel("date", "spip_articles", "statut='publie' AND date > " . sql_quote(date('Y-m-d H:i:s')), "", "date",
797
+        "1");
798
+
799
+    if ($t) {
800
+        $t = $t['date'];
801
+        if (!isset($GLOBALS['meta']['date_prochain_postdate'])
802
+            or $t <> $GLOBALS['meta']['date_prochain_postdate']
803
+        ) {
804
+            ecrire_meta('date_prochain_postdate', strtotime($t));
805
+            ecrire_meta('derniere_modif', time());
806
+        }
807
+    } else {
808
+        effacer_meta('date_prochain_postdate');
809
+        ecrire_meta('derniere_modif', time());
810
+    }
811
+
812
+    spip_log("prochain postdate: $t");
813 813
 }
814 814
 
815 815
 /**
@@ -834,42 +834,42 @@  discard block
 block discarded – undo
834 834
  */
835 835
 function creer_rubrique_nommee($titre, $id_parent = 0, $serveur = '') {
836 836
 
837
-	// eclater l'arborescence demandee
838
-	// echapper les </multi> et autres balises fermantes html
839
-	$titre = preg_replace(",</([a-z][^>]*)>,ims", "<@\\1>", $titre);
840
-	$arbo = explode('/', preg_replace(',^/,', '', $titre));
841
-	include_spip('base/abstract_sql');
842
-	foreach ($arbo as $titre) {
843
-		// retablir les </multi> et autres balises fermantes html
844
-		$titre = preg_replace(",<@([a-z][^>]*)>,ims", "</\\1>", $titre);
845
-		$r = sql_getfetsel("id_rubrique", "spip_rubriques",
846
-			"titre = " . sql_quote($titre) . " AND id_parent=" . intval($id_parent),
847
-			$groupby = array(), $orderby = array(), $limit = '', $having = array(), $serveur);
848
-		if ($r !== null) {
849
-			$id_parent = $r;
850
-		} else {
851
-			$id_rubrique = sql_insertq('spip_rubriques', array(
852
-					'titre' => $titre,
853
-					'id_parent' => $id_parent,
854
-					'statut' => 'prepa'
855
-				), $desc = array(), $serveur);
856
-			if ($id_parent > 0) {
857
-				$data = sql_fetsel("id_secteur,lang", "spip_rubriques", "id_rubrique=$id_parent",
858
-					$groupby = array(), $orderby = array(), $limit = '', $having = array(), $serveur);
859
-				$id_secteur = $data['id_secteur'];
860
-				$lang = $data['lang'];
861
-			} else {
862
-				$id_secteur = $id_rubrique;
863
-				$lang = $GLOBALS['meta']['langue_site'];
864
-			}
865
-
866
-			sql_updateq('spip_rubriques', array('id_secteur' => $id_secteur, "lang" => $lang),
867
-				"id_rubrique=" . intval($id_rubrique), $desc = '', $serveur);
868
-
869
-			// pour la recursion
870
-			$id_parent = $id_rubrique;
871
-		}
872
-	}
873
-
874
-	return intval($id_parent);
837
+    // eclater l'arborescence demandee
838
+    // echapper les </multi> et autres balises fermantes html
839
+    $titre = preg_replace(",</([a-z][^>]*)>,ims", "<@\\1>", $titre);
840
+    $arbo = explode('/', preg_replace(',^/,', '', $titre));
841
+    include_spip('base/abstract_sql');
842
+    foreach ($arbo as $titre) {
843
+        // retablir les </multi> et autres balises fermantes html
844
+        $titre = preg_replace(",<@([a-z][^>]*)>,ims", "</\\1>", $titre);
845
+        $r = sql_getfetsel("id_rubrique", "spip_rubriques",
846
+            "titre = " . sql_quote($titre) . " AND id_parent=" . intval($id_parent),
847
+            $groupby = array(), $orderby = array(), $limit = '', $having = array(), $serveur);
848
+        if ($r !== null) {
849
+            $id_parent = $r;
850
+        } else {
851
+            $id_rubrique = sql_insertq('spip_rubriques', array(
852
+                    'titre' => $titre,
853
+                    'id_parent' => $id_parent,
854
+                    'statut' => 'prepa'
855
+                ), $desc = array(), $serveur);
856
+            if ($id_parent > 0) {
857
+                $data = sql_fetsel("id_secteur,lang", "spip_rubriques", "id_rubrique=$id_parent",
858
+                    $groupby = array(), $orderby = array(), $limit = '', $having = array(), $serveur);
859
+                $id_secteur = $data['id_secteur'];
860
+                $lang = $data['lang'];
861
+            } else {
862
+                $id_secteur = $id_rubrique;
863
+                $lang = $GLOBALS['meta']['langue_site'];
864
+            }
865
+
866
+            sql_updateq('spip_rubriques', array('id_secteur' => $id_secteur, "lang" => $lang),
867
+                "id_rubrique=" . intval($id_rubrique), $desc = '', $serveur);
868
+
869
+            // pour la recursion
870
+            $id_parent = $id_rubrique;
871
+        }
872
+    }
873
+
874
+    return intval($id_parent);
875 875
 }
Please login to merge, or discard this patch.
ecrire/exec/403.php 2 patches
Indentation   +28 added lines, -28 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
 /**
@@ -27,40 +27,40 @@  discard block
 block discarded – undo
27 27
  */
28 28
 function exec_403_dist($message = '') {
29 29
 
30
-	$exec = _request('exec');
30
+    $exec = _request('exec');
31 31
 
32
-	$titre = "exec_$exec";
33
-	$navigation = '';
34
-	$extra = '';
32
+    $titre = "exec_$exec";
33
+    $navigation = '';
34
+    $extra = '';
35 35
 
36
-	if (!$message) {
37
-		$message = _T('avis_acces_interdit_prive', array('exec' => _request('exec')));
38
-	}
36
+    if (!$message) {
37
+        $message = _T('avis_acces_interdit_prive', array('exec' => _request('exec')));
38
+    }
39 39
 
40
-	$contenu = "<h1 class='grostitre'>" . _T('info_acces_interdit') . '</h1>' . $message;
40
+    $contenu = "<h1 class='grostitre'>" . _T('info_acces_interdit') . '</h1>' . $message;
41 41
 
42
-	if (_request('var_zajax')) {
43
-		include_spip('inc/actions');
44
-		ajax_retour($contenu);
45
-	} else {
46
-		include_spip('inc/presentation'); // alleger les inclusions avec un inc/presentation_mini
42
+    if (_request('var_zajax')) {
43
+        include_spip('inc/actions');
44
+        ajax_retour($contenu);
45
+    } else {
46
+        include_spip('inc/presentation'); // alleger les inclusions avec un inc/presentation_mini
47 47
 
48
-		$commencer_page = charger_fonction('commencer_page', 'inc');
49
-		echo $commencer_page($titre);
48
+        $commencer_page = charger_fonction('commencer_page', 'inc');
49
+        echo $commencer_page($titre);
50 50
 
51
-		echo debut_gauche("403_$exec", true);
52
-		echo recuperer_fond('prive/squelettes/navigation/dist', array());
53
-		echo pipeline('affiche_gauche', array('args' => array('exec' => '403', 'exec_erreur' => $exec), 'data' => ''));
51
+        echo debut_gauche("403_$exec", true);
52
+        echo recuperer_fond('prive/squelettes/navigation/dist', array());
53
+        echo pipeline('affiche_gauche', array('args' => array('exec' => '403', 'exec_erreur' => $exec), 'data' => ''));
54 54
 
55
-		echo creer_colonne_droite('403', true);
56
-		echo pipeline('affiche_droite', array('args' => array('exec' => '403', 'exec_erreur' => $exec), 'data' => ''));
55
+        echo creer_colonne_droite('403', true);
56
+        echo pipeline('affiche_droite', array('args' => array('exec' => '403', 'exec_erreur' => $exec), 'data' => ''));
57 57
 
58
-		echo debut_droite('403', true);
59
-		echo pipeline(
60
-			'affiche_milieu',
61
-			array('args' => array('exec' => '403', 'exec_erreur' => $exec), 'data' => $contenu)
62
-		);
58
+        echo debut_droite('403', true);
59
+        echo pipeline(
60
+            'affiche_milieu',
61
+            array('args' => array('exec' => '403', 'exec_erreur' => $exec), 'data' => $contenu)
62
+        );
63 63
 
64
-		echo fin_gauche(), fin_page();
65
-	}
64
+        echo fin_gauche(), fin_page();
65
+    }
66 66
 }
Please login to merge, or discard this patch.
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -37,7 +37,7 @@
 block discarded – undo
37 37
 		$message = _T('avis_acces_interdit_prive', array('exec' => _request('exec')));
38 38
 	}
39 39
 
40
-	$contenu = "<h1 class='grostitre'>" . _T('info_acces_interdit') . '</h1>' . $message;
40
+	$contenu = "<h1 class='grostitre'>"._T('info_acces_interdit').'</h1>'.$message;
41 41
 
42 42
 	if (_request('var_zajax')) {
43 43
 		include_spip('inc/actions');
Please login to merge, or discard this patch.
ecrire/lang/public_fr.php 1 patch
Indentation   +110 added lines, -110 removed lines patch added patch discarded remove patch
@@ -2,118 +2,118 @@
 block discarded – undo
2 2
 // This is a SPIP language file  --  Ceci est un fichier langue de SPIP
3 3
 // Fichier source, a modifier dans https://git.spip.net/spip/spip.git
4 4
 if (!defined('_ECRIRE_INC_VERSION')) {
5
-	return;
5
+    return;
6 6
 }
7 7
 
8 8
 $GLOBALS[$GLOBALS['idx_lang']] = array(
9 9
 
10
-	// A
11
-	'accueil_site' => 'Accueil',
12
-	'article' => 'Article',
13
-	'articles' => 'Articles',
14
-	'articles_auteur' => 'Articles de cet auteur',
15
-	'articles_populaires' => 'Articles les plus populaires',
16
-	'articles_rubrique' => 'Articles de cette rubrique',
17
-	'aucun_article' => 'Il n’y a pas d’article à cette adresse',
18
-	'aucun_auteur' => 'Il n’y a pas d’auteur à cette adresse',
19
-	'aucun_site' => 'Il n’y a pas de site à cette adresse',
20
-	'aucune_breve' => 'Il n’y a pas de brève à cette adresse',
21
-	'aucune_rubrique' => 'Il n’y a pas de rubrique à cette adresse',
22
-	'auteur' => 'Auteur',
23
-	'autres' => 'Autres',
24
-	'autres_breves' => 'Autres brèves',
25
-	'autres_groupes_mots_clefs' => 'Autres groupes de mots-clés',
26
-	'autres_sites' => 'Autres sites',
27
-
28
-	// B
29
-	'bonjour' => 'Bonjour',
30
-
31
-	// C
32
-	'commenter_site' => 'Commenter ce site',
33
-	'contact' => 'Contact',
34
-	'copie_document_impossible' => 'Impossible de copier le document',
35
-
36
-	// D
37
-	'date' => 'Date',
38
-	'dernier_ajout' => 'Dernier ajout',
39
-	'dernieres_breves' => 'Dernières brèves',
40
-	'derniers_articles' => 'Derniers articles',
41
-	'derniers_commentaires' => 'Derniers commentaires',
42
-	'derniers_messages_forum' => 'Derniers messages publiés dans les forums',
43
-
44
-	// E
45
-	'edition_mode_texte' => 'Édition en mode texte de',
46
-	'en_reponse' => 'En réponse à :',
47
-	'en_resume' => 'En résumé',
48
-	'envoyer_message' => 'Envoyer un message',
49
-	'espace_prive' => 'Espace privé',
50
-
51
-	// F
52
-	'formats_acceptes' => 'Formats acceptés : @formats@.',
53
-
54
-	// H
55
-	'hierarchie_site' => 'Hiérarchie du site',
56
-
57
-	// J
58
-	'jours' => 'jours',
59
-
60
-	// L
61
-	'lien_connecter' => 'Se connecter',
62
-
63
-	// M
64
-	'meme_auteur' => 'Du même auteur',
65
-	'meme_rubrique' => 'Dans la même rubrique',
66
-	'memes_auteurs' => 'Des mêmes auteurs',
67
-	'message' => 'Message',
68
-	'messages_forum' => 'Messages',
69
-	'messages_recents' => 'Messages de forums les plus récents',
70
-	'mots_clef' => 'Mot-clé',
71
-	'mots_clefs' => 'Mots-clés',
72
-	'mots_clefs_meme_groupe' => 'Mots-clés dans le même groupe',
73
-
74
-	// N
75
-	'navigation' => 'Navigation',
76
-	'nom' => 'Nom',
77
-	'nouveautes' => 'Les nouveautés',
78
-	'nouveautes_web' => 'Nouveautés sur le Web',
79
-	'nouveaux_articles' => 'Nouveaux articles',
80
-	'nouvelles_breves' => 'Nouvelles brèves',
81
-
82
-	// P
83
-	'page_precedente' => 'page précédente',
84
-	'page_suivante' => 'page suivante',
85
-	'par_auteur' => 'par ',
86
-	'participer_site' => 'Vous pouvez participer à la vie de ce site et proposer vos propres articles en vous inscrivant ci-dessous. Vous recevrez immédiatement un email vous indiquant vos codes d’accès à l’espace privé du site.',
87
-	'plan_site' => 'Plan du site',
88
-	'popularite' => 'Popularité',
89
-	'poster_message' => 'Poster un message',
90
-	'proposer_site' => 'Vous pouvez proposer un site à ajouter dans cette rubrique :',
91
-
92
-	// R
93
-	'repondre_article' => 'Répondre à cet article',
94
-	'repondre_breve' => 'Répondre à cette brève',
95
-	'resultats_recherche' => 'Résultats de la recherche',
96
-	'retour_debut_forums' => 'Retour au début des forums',
97
-	'rubrique' => 'Rubrique',
98
-	'rubriques' => 'Rubriques',
99
-
100
-	// S
101
-	'signatures_petition' => 'Signatures',
102
-	'site_realise_avec_spip' => 'Site réalisé avec SPIP',
103
-	'sites_web' => 'Sites Web',
104
-	'sous_rubriques' => 'Sous-rubriques',
105
-	'spam' => 'Spam',
106
-	'suite' => 'suite',
107
-	'sur_web' => 'Sur le Web',
108
-	'syndiquer_rubrique' => 'Syndiquer cette rubrique',
109
-	'syndiquer_site' => 'Syndiquer tout le site',
110
-
111
-	// T
112
-	'texte_lettre_information' => 'Voici la lettre d’information du site',
113
-	'texte_lettre_information_2' => 'Cette lettre recense les nouveautés publiées depuis',
114
-
115
-	// V
116
-	'ver_imprimer' => 'Version à imprimer',
117
-	'voir_en_ligne' => 'Voir en ligne',
118
-	'voir_squelette' => 'voir le squelette de cette page'
10
+    // A
11
+    'accueil_site' => 'Accueil',
12
+    'article' => 'Article',
13
+    'articles' => 'Articles',
14
+    'articles_auteur' => 'Articles de cet auteur',
15
+    'articles_populaires' => 'Articles les plus populaires',
16
+    'articles_rubrique' => 'Articles de cette rubrique',
17
+    'aucun_article' => 'Il n’y a pas d’article à cette adresse',
18
+    'aucun_auteur' => 'Il n’y a pas d’auteur à cette adresse',
19
+    'aucun_site' => 'Il n’y a pas de site à cette adresse',
20
+    'aucune_breve' => 'Il n’y a pas de brève à cette adresse',
21
+    'aucune_rubrique' => 'Il n’y a pas de rubrique à cette adresse',
22
+    'auteur' => 'Auteur',
23
+    'autres' => 'Autres',
24
+    'autres_breves' => 'Autres brèves',
25
+    'autres_groupes_mots_clefs' => 'Autres groupes de mots-clés',
26
+    'autres_sites' => 'Autres sites',
27
+
28
+    // B
29
+    'bonjour' => 'Bonjour',
30
+
31
+    // C
32
+    'commenter_site' => 'Commenter ce site',
33
+    'contact' => 'Contact',
34
+    'copie_document_impossible' => 'Impossible de copier le document',
35
+
36
+    // D
37
+    'date' => 'Date',
38
+    'dernier_ajout' => 'Dernier ajout',
39
+    'dernieres_breves' => 'Dernières brèves',
40
+    'derniers_articles' => 'Derniers articles',
41
+    'derniers_commentaires' => 'Derniers commentaires',
42
+    'derniers_messages_forum' => 'Derniers messages publiés dans les forums',
43
+
44
+    // E
45
+    'edition_mode_texte' => 'Édition en mode texte de',
46
+    'en_reponse' => 'En réponse à :',
47
+    'en_resume' => 'En résumé',
48
+    'envoyer_message' => 'Envoyer un message',
49
+    'espace_prive' => 'Espace privé',
50
+
51
+    // F
52
+    'formats_acceptes' => 'Formats acceptés : @formats@.',
53
+
54
+    // H
55
+    'hierarchie_site' => 'Hiérarchie du site',
56
+
57
+    // J
58
+    'jours' => 'jours',
59
+
60
+    // L
61
+    'lien_connecter' => 'Se connecter',
62
+
63
+    // M
64
+    'meme_auteur' => 'Du même auteur',
65
+    'meme_rubrique' => 'Dans la même rubrique',
66
+    'memes_auteurs' => 'Des mêmes auteurs',
67
+    'message' => 'Message',
68
+    'messages_forum' => 'Messages',
69
+    'messages_recents' => 'Messages de forums les plus récents',
70
+    'mots_clef' => 'Mot-clé',
71
+    'mots_clefs' => 'Mots-clés',
72
+    'mots_clefs_meme_groupe' => 'Mots-clés dans le même groupe',
73
+
74
+    // N
75
+    'navigation' => 'Navigation',
76
+    'nom' => 'Nom',
77
+    'nouveautes' => 'Les nouveautés',
78
+    'nouveautes_web' => 'Nouveautés sur le Web',
79
+    'nouveaux_articles' => 'Nouveaux articles',
80
+    'nouvelles_breves' => 'Nouvelles brèves',
81
+
82
+    // P
83
+    'page_precedente' => 'page précédente',
84
+    'page_suivante' => 'page suivante',
85
+    'par_auteur' => 'par ',
86
+    'participer_site' => 'Vous pouvez participer à la vie de ce site et proposer vos propres articles en vous inscrivant ci-dessous. Vous recevrez immédiatement un email vous indiquant vos codes d’accès à l’espace privé du site.',
87
+    'plan_site' => 'Plan du site',
88
+    'popularite' => 'Popularité',
89
+    'poster_message' => 'Poster un message',
90
+    'proposer_site' => 'Vous pouvez proposer un site à ajouter dans cette rubrique :',
91
+
92
+    // R
93
+    'repondre_article' => 'Répondre à cet article',
94
+    'repondre_breve' => 'Répondre à cette brève',
95
+    'resultats_recherche' => 'Résultats de la recherche',
96
+    'retour_debut_forums' => 'Retour au début des forums',
97
+    'rubrique' => 'Rubrique',
98
+    'rubriques' => 'Rubriques',
99
+
100
+    // S
101
+    'signatures_petition' => 'Signatures',
102
+    'site_realise_avec_spip' => 'Site réalisé avec SPIP',
103
+    'sites_web' => 'Sites Web',
104
+    'sous_rubriques' => 'Sous-rubriques',
105
+    'spam' => 'Spam',
106
+    'suite' => 'suite',
107
+    'sur_web' => 'Sur le Web',
108
+    'syndiquer_rubrique' => 'Syndiquer cette rubrique',
109
+    'syndiquer_site' => 'Syndiquer tout le site',
110
+
111
+    // T
112
+    'texte_lettre_information' => 'Voici la lettre d’information du site',
113
+    'texte_lettre_information_2' => 'Cette lettre recense les nouveautés publiées depuis',
114
+
115
+    // V
116
+    'ver_imprimer' => 'Version à imprimer',
117
+    'voir_en_ligne' => 'Voir en ligne',
118
+    'voir_squelette' => 'voir le squelette de cette page'
119 119
 );
Please login to merge, or discard this patch.
ecrire/inc/icone_renommer.php 2 patches
Indentation   +51 added lines, -51 removed lines patch added patch discarded remove patch
@@ -11,69 +11,69 @@
 block discarded – undo
11 11
 \***************************************************************************/
12 12
 
13 13
 if (!defined('_ECRIRE_INC_VERSION')) {
14
-	return;
14
+    return;
15 15
 }
16 16
 
17 17
 include_spip('inc/boutons');
18 18
 include_spip('base/objets');
19 19
 
20 20
 function inc_icone_renommer_dist($fond, $fonction) {
21
-	$size = 24;
22
-	if (preg_match("/(?:-([0-9]{1,3}))?([.](gif|png|svg))?$/i", $fond, $match)
23
-		and ((isset($match[0]) and $match[0]) or (isset($match[1]) and $match[1]))
24
-	) {
25
-		if (isset($match[1]) and $match[1]) {
26
-			$size = $match[1];
27
-		}
28
-		$type = substr($fond, 0, -strlen($match[0]));
29
-		if (!isset($match[2]) or !$match[2]) {
30
-			$fond .= ".png";
31
-		}
32
-	} else {
33
-		$type = $fond;
34
-		$fond .= ".png";
35
-	}
21
+    $size = 24;
22
+    if (preg_match("/(?:-([0-9]{1,3}))?([.](gif|png|svg))?$/i", $fond, $match)
23
+        and ((isset($match[0]) and $match[0]) or (isset($match[1]) and $match[1]))
24
+    ) {
25
+        if (isset($match[1]) and $match[1]) {
26
+            $size = $match[1];
27
+        }
28
+        $type = substr($fond, 0, -strlen($match[0]));
29
+        if (!isset($match[2]) or !$match[2]) {
30
+            $fond .= ".png";
31
+        }
32
+    } else {
33
+        $type = $fond;
34
+        $fond .= ".png";
35
+    }
36 36
 
37
-	$rtl = false;
38
-	if (preg_match(',[-_]rtl$,i', $type, $match)) {
39
-		$rtl = true;
40
-		$type = substr($type, 0, -strlen($match[0]));
41
-	}
37
+    $rtl = false;
38
+    if (preg_match(',[-_]rtl$,i', $type, $match)) {
39
+        $rtl = true;
40
+        $type = substr($type, 0, -strlen($match[0]));
41
+    }
42 42
 
43
-	// objet_type garde invariant tout ce qui ne commence par par id_, spip_
44
-	// et ne finit pas par un s, sauf si c'est une exception declaree
45
-	$type = objet_type($type, false);
43
+    // objet_type garde invariant tout ce qui ne commence par par id_, spip_
44
+    // et ne finit pas par un s, sauf si c'est une exception declaree
45
+    $type = objet_type($type, false);
46 46
 
47
-	$dir = "images/";
48
-	$f = "$type-$size.png";
49
-	if ($icone = find_in_theme($dir . $f)) {
50
-		$dir = dirname($icone);
51
-		$fond = $icone;
47
+    $dir = "images/";
48
+    $f = "$type-$size.png";
49
+    if ($icone = find_in_theme($dir . $f)) {
50
+        $dir = dirname($icone);
51
+        $fond = $icone;
52 52
 
53
-		if ($rtl
54
-			and $fr = $dir . '/' . str_replace("$type-", "$type-rtl-", basename($icone))
55
-			and file_exists($fr)
56
-		) {
57
-			$fond = $fr;
58
-		}
53
+        if ($rtl
54
+            and $fr = $dir . '/' . str_replace("$type-", "$type-rtl-", basename($icone))
55
+            and file_exists($fr)
56
+        ) {
57
+            $fond = $fr;
58
+        }
59 59
 
60
-		$action = $fonction;
61
-		if ($action == "supprimer.gif") {
62
-			$action = "del";
63
-		} elseif ($action == "creer.gif") {
64
-			$action = "new";
65
-		} elseif ($action == "edit.gif") {
66
-			$action = "edit";
67
-		}
60
+        $action = $fonction;
61
+        if ($action == "supprimer.gif") {
62
+            $action = "del";
63
+        } elseif ($action == "creer.gif") {
64
+            $action = "new";
65
+        } elseif ($action == "edit.gif") {
66
+            $action = "edit";
67
+        }
68 68
 
69
-		$fonction = "";
70
-		if (in_array($action, array('add','del', 'new', 'edit', 'config'))) {
71
-			$fonction = $action;
72
-		}
69
+        $fonction = "";
70
+        if (in_array($action, array('add','del', 'new', 'edit', 'config'))) {
71
+            $fonction = $action;
72
+        }
73 73
 
74
-		// c'est bon !
75
-		return array($fond, $fonction);
76
-	}
74
+        // c'est bon !
75
+        return array($fond, $fonction);
76
+    }
77 77
 
78
-	return array($fond, $fonction);
78
+    return array($fond, $fonction);
79 79
 }
Please login to merge, or discard this patch.
Spacing   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -46,12 +46,12 @@  discard block
 block discarded – undo
46 46
 
47 47
 	$dir = "images/";
48 48
 	$f = "$type-$size.png";
49
-	if ($icone = find_in_theme($dir . $f)) {
49
+	if ($icone = find_in_theme($dir.$f)) {
50 50
 		$dir = dirname($icone);
51 51
 		$fond = $icone;
52 52
 
53 53
 		if ($rtl
54
-			and $fr = $dir . '/' . str_replace("$type-", "$type-rtl-", basename($icone))
54
+			and $fr = $dir.'/'.str_replace("$type-", "$type-rtl-", basename($icone))
55 55
 			and file_exists($fr)
56 56
 		) {
57 57
 			$fond = $fr;
@@ -67,7 +67,7 @@  discard block
 block discarded – undo
67 67
 		}
68 68
 
69 69
 		$fonction = "";
70
-		if (in_array($action, array('add','del', 'new', 'edit', 'config'))) {
70
+		if (in_array($action, array('add', 'del', 'new', 'edit', 'config'))) {
71 71
 			$fonction = $action;
72 72
 		}
73 73
 
Please login to merge, or discard this patch.
ecrire/action/purger.php 2 patches
Spacing   +7 added lines, -7 removed lines patch added patch discarded remove patch
@@ -61,7 +61,7 @@  discard block
 block discarded – undo
61 61
 			supprime_invalideurs();
62 62
 			@spip_unlink(_CACHE_RUBRIQUES);
63 63
 			@spip_unlink(_CACHE_CHEMIN);
64
-			@spip_unlink(_DIR_TMP . "plugin_xml_cache.gz");
64
+			@spip_unlink(_DIR_TMP."plugin_xml_cache.gz");
65 65
 			// on ne supprime que _CACHE_PLUGINS_OPT qui declenche la reconstruction des 3
66 66
 			// _CACHE_PIPELINES _CACHE_PLUGINS_PATH et _CACHE_PLUGINS_FCT
67 67
 			// pour eviter des problemes de concurence
@@ -72,8 +72,8 @@  discard block
 block discarded – undo
72 72
 			@spip_unlink(_CACHE_PLUGINS_OPT);
73 73
 			purger_repertoire(_DIR_CACHE, array('subdir' => true));
74 74
 			purger_repertoire(_DIR_AIDE);
75
-			purger_repertoire(_DIR_VAR . 'cache-css');
76
-			purger_repertoire(_DIR_VAR . 'cache-js');
75
+			purger_repertoire(_DIR_VAR.'cache-css');
76
+			purger_repertoire(_DIR_VAR.'cache-js');
77 77
 			break;
78 78
 
79 79
 		case 'squelettes':
@@ -81,10 +81,10 @@  discard block
 block discarded – undo
81 81
 			break;
82 82
 
83 83
 		case 'vignettes':
84
-			purger_repertoire(_DIR_VAR . 'cache-gd2', array('subdir' => true));
85
-			purger_repertoire(_DIR_VAR . 'cache-texte', array('subdir' => true));
86
-			purger_repertoire(_DIR_VAR . 'cache-vignettes', array('subdir' => true));
87
-			purger_repertoire(_DIR_VAR . 'cache-TeX', array('subdir' => true));
84
+			purger_repertoire(_DIR_VAR.'cache-gd2', array('subdir' => true));
85
+			purger_repertoire(_DIR_VAR.'cache-texte', array('subdir' => true));
86
+			purger_repertoire(_DIR_VAR.'cache-vignettes', array('subdir' => true));
87
+			purger_repertoire(_DIR_VAR.'cache-TeX', array('subdir' => true));
88 88
 			supprime_invalideurs();
89 89
 			purger_repertoire(_DIR_CACHE, array('subdir' => true));
90 90
 			break;
Please login to merge, or discard this patch.
Indentation   +47 added lines, -47 removed lines patch added patch discarded remove patch
@@ -16,7 +16,7 @@  discard block
 block discarded – undo
16 16
  * @package SPIP\Core\Cache
17 17
  **/
18 18
 if (!defined('_ECRIRE_INC_VERSION')) {
19
-	return;
19
+    return;
20 20
 }
21 21
 
22 22
 /**
@@ -39,57 +39,57 @@  discard block
 block discarded – undo
39 39
  *     de l'action sécurisée.
40 40
  */
41 41
 function action_purger_dist($arg = null) {
42
-	if (is_null($arg)) {
43
-		$securiser_action = charger_fonction('securiser_action', 'inc');
44
-		$arg = $securiser_action();
45
-	}
42
+    if (is_null($arg)) {
43
+        $securiser_action = charger_fonction('securiser_action', 'inc');
44
+        $arg = $securiser_action();
45
+    }
46 46
 
47
-	include_spip('inc/invalideur');
47
+    include_spip('inc/invalideur');
48 48
 
49
-	spip_log("purger $arg");
49
+    spip_log("purger $arg");
50 50
 
51
-	switch ($arg) {
52
-		case 'inhibe_cache':
53
-			// inhiber le cache pendant 24h
54
-			ecrire_meta('cache_inhib', $_SERVER['REQUEST_TIME'] + 24 * 3600);
55
-			break;
56
-		case 'reactive_cache':
57
-			effacer_meta('cache_inhib');
58
-			break;
51
+    switch ($arg) {
52
+        case 'inhibe_cache':
53
+            // inhiber le cache pendant 24h
54
+            ecrire_meta('cache_inhib', $_SERVER['REQUEST_TIME'] + 24 * 3600);
55
+            break;
56
+        case 'reactive_cache':
57
+            effacer_meta('cache_inhib');
58
+            break;
59 59
 
60
-		case 'cache':
61
-			supprime_invalideurs();
62
-			@spip_unlink(_CACHE_RUBRIQUES);
63
-			@spip_unlink(_CACHE_CHEMIN);
64
-			@spip_unlink(_DIR_TMP . "plugin_xml_cache.gz");
65
-			// on ne supprime que _CACHE_PLUGINS_OPT qui declenche la reconstruction des 3
66
-			// _CACHE_PIPELINES _CACHE_PLUGINS_PATH et _CACHE_PLUGINS_FCT
67
-			// pour eviter des problemes de concurence
68
-			// cf https://core.spip.net/issues/2989
69
-			//@spip_unlink(_CACHE_PIPELINES);
70
-			//@spip_unlink(_CACHE_PLUGINS_PATH);
71
-			//@spip_unlink(_CACHE_PLUGINS_FCT);
72
-			@spip_unlink(_CACHE_PLUGINS_OPT);
73
-			purger_repertoire(_DIR_CACHE, array('subdir' => true));
74
-			purger_repertoire(_DIR_AIDE);
75
-			purger_repertoire(_DIR_VAR . 'cache-css');
76
-			purger_repertoire(_DIR_VAR . 'cache-js');
77
-			break;
60
+        case 'cache':
61
+            supprime_invalideurs();
62
+            @spip_unlink(_CACHE_RUBRIQUES);
63
+            @spip_unlink(_CACHE_CHEMIN);
64
+            @spip_unlink(_DIR_TMP . "plugin_xml_cache.gz");
65
+            // on ne supprime que _CACHE_PLUGINS_OPT qui declenche la reconstruction des 3
66
+            // _CACHE_PIPELINES _CACHE_PLUGINS_PATH et _CACHE_PLUGINS_FCT
67
+            // pour eviter des problemes de concurence
68
+            // cf https://core.spip.net/issues/2989
69
+            //@spip_unlink(_CACHE_PIPELINES);
70
+            //@spip_unlink(_CACHE_PLUGINS_PATH);
71
+            //@spip_unlink(_CACHE_PLUGINS_FCT);
72
+            @spip_unlink(_CACHE_PLUGINS_OPT);
73
+            purger_repertoire(_DIR_CACHE, array('subdir' => true));
74
+            purger_repertoire(_DIR_AIDE);
75
+            purger_repertoire(_DIR_VAR . 'cache-css');
76
+            purger_repertoire(_DIR_VAR . 'cache-js');
77
+            break;
78 78
 
79
-		case 'squelettes':
80
-			purger_repertoire(_DIR_SKELS);
81
-			break;
79
+        case 'squelettes':
80
+            purger_repertoire(_DIR_SKELS);
81
+            break;
82 82
 
83
-		case 'vignettes':
84
-			purger_repertoire(_DIR_VAR . 'cache-gd2', array('subdir' => true));
85
-			purger_repertoire(_DIR_VAR . 'cache-texte', array('subdir' => true));
86
-			purger_repertoire(_DIR_VAR . 'cache-vignettes', array('subdir' => true));
87
-			purger_repertoire(_DIR_VAR . 'cache-TeX', array('subdir' => true));
88
-			supprime_invalideurs();
89
-			purger_repertoire(_DIR_CACHE, array('subdir' => true));
90
-			break;
91
-	}
83
+        case 'vignettes':
84
+            purger_repertoire(_DIR_VAR . 'cache-gd2', array('subdir' => true));
85
+            purger_repertoire(_DIR_VAR . 'cache-texte', array('subdir' => true));
86
+            purger_repertoire(_DIR_VAR . 'cache-vignettes', array('subdir' => true));
87
+            purger_repertoire(_DIR_VAR . 'cache-TeX', array('subdir' => true));
88
+            supprime_invalideurs();
89
+            purger_repertoire(_DIR_CACHE, array('subdir' => true));
90
+            break;
91
+    }
92 92
 
93
-	// le faire savoir aux plugins
94
-	pipeline('trig_purger', $arg);
93
+    // le faire savoir aux plugins
94
+    pipeline('trig_purger', $arg);
95 95
 }
Please login to merge, or discard this patch.
ecrire/lang/public_ar.php 1 patch
Indentation   +110 added lines, -110 removed lines patch added patch discarded remove patch
@@ -4,118 +4,118 @@
 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
-	'accueil_site' => 'الصفحة الرئيسية',
14
-	'article' => 'مقال',
15
-	'articles' => 'المقالات',
16
-	'articles_auteur' => 'مقالات هذا المؤلف',
17
-	'articles_populaires' => 'المقالات الأكثر شعبية',
18
-	'articles_rubrique' => 'مقالات هذا القسم',
19
-	'aucun_article' => 'لا توجد مقالات على هذا العنوان',
20
-	'aucun_auteur' => 'لا يوجد مؤلفون على هذا العنوان',
21
-	'aucun_site' => 'لا توجد مواقع على هذا العنوان',
22
-	'aucune_breve' => 'لا توجد أخبار على هذا العنوان',
23
-	'aucune_rubrique' => 'لا توجد أقسام على هذا العنوان',
24
-	'auteur' => 'مؤلف',
25
-	'autres' => 'آخرون',
26
-	'autres_breves' => 'أخبار أخرى',
27
-	'autres_groupes_mots_clefs' => 'مجموعات مفاتيح أخرى',
28
-	'autres_sites' => 'مواقع أخرى',
29
-
30
-	// B
31
-	'bonjour' => 'أهلاً وسهلاً',
32
-
33
-	// C
34
-	'commenter_site' => 'تعليق على هذا الموقع',
35
-	'contact' => 'للاتصال',
36
-	'copie_document_impossible' => 'لا يمكن نسخ المستند',
37
-
38
-	// D
39
-	'date' => 'التاريخ',
40
-	'dernier_ajout' => 'آخر إضافة',
41
-	'dernieres_breves' => 'آخر الأخبار',
42
-	'derniers_articles' => 'آخر المقالات',
43
-	'derniers_commentaires' => 'آخر التعليقات',
44
-	'derniers_messages_forum' => 'آخر المشاركات المنشورة في المنتديات',
45
-
46
-	// E
47
-	'edition_mode_texte' => 'النشرة في وضعية النصوص',
48
-	'en_reponse' => 'رداً على:',
49
-	'en_resume' => 'باختصار',
50
-	'envoyer_message' => 'إرسال مشاركة',
51
-	'espace_prive' => 'المجال الخاص',
52
-
53
-	// F
54
-	'formats_acceptes' => 'التنسيقات المسموحة: @formats@.',
55
-
56
-	// H
57
-	'hierarchie_site' => 'هرمية الموقع',
58
-
59
-	// J
60
-	'jours' => 'يوم',
61
-
62
-	// L
63
-	'lien_connecter' => 'دخول',
64
-
65
-	// M
66
-	'meme_auteur' => 'من نفس المؤلف',
67
-	'meme_rubrique' => 'في هذا القسم أيضاً',
68
-	'memes_auteurs' => 'من المؤلفين نفسهم ايضاً',
69
-	'message' => 'مشاركة',
70
-	'messages_forum' => 'مشاركة منتدى',
71
-	'messages_recents' => 'أحدث المشاركات',
72
-	'mots_clef' => 'مفتاح',
73
-	'mots_clefs' => 'المفاتيح',
74
-	'mots_clefs_meme_groupe' => 'المفاتيح الأخرى في هذه المجموعة',
75
-
76
-	// N
77
-	'navigation' => 'تصفح',
78
-	'nom' => 'الاسم',
79
-	'nouveautes' => 'الجديد',
80
-	'nouveautes_web' => 'الجديد على النسيج',
81
-	'nouveaux_articles' => 'المقالات الجديدة',
82
-	'nouvelles_breves' => 'الأخبار الجديدة',
83
-
84
-	// P
85
-	'page_precedente' => 'الصفحة السابقة',
86
-	'page_suivante' => 'الصفحة التالية',
87
-	'par_auteur' => 'بقلم ',
88
-	'participer_site' => 'يمكنك المشاركة في هذا الموقع، بالتسجيل أدناه ونشر مقالاتك. وبعد التسجيل، سوف تصلك رسالة فورية بالبريد الإلكتروني تتضمن معرفك الخاص الذي يسمح لك بالدخول الى المجال الخاص.',
89
-	'plan_site' => 'خريطة الموقع',
90
-	'popularite' => 'الشعبية',
91
-	'poster_message' => 'إبعث برسالة',
92
-	'proposer_site' => 'يمكنك افتراح إضافة موقع الى هذا القسم:',
93
-
94
-	// R
95
-	'repondre_article' => 'الرد على هذا المقال',
96
-	'repondre_breve' => 'الرد على هذا الخبر',
97
-	'resultats_recherche' => 'نتائج البحث',
98
-	'retour_debut_forums' => 'عودة الى بداية المنتديات',
99
-	'rubrique' => 'القسم',
100
-	'rubriques' => 'الأقسام',
101
-
102
-	// S
103
-	'signatures_petition' => 'التوقيعات',
104
-	'site_realise_avec_spip' => 'موقع صمم بنظام SPIP',
105
-	'sites_web' => 'مواقع النسيج',
106
-	'sous_rubriques' => 'الأقسام الفرعية',
107
-	'spam' => 'خنزرة',
108
-	'suite' => 'تتمة',
109
-	'sur_web' => 'على النسيج',
110
-	'syndiquer_rubrique' => 'ترخيص هذا القسم',
111
-	'syndiquer_site' => 'ترخيص كامل الموقع',
112
-
113
-	// T
114
-	'texte_lettre_information' => 'ها هي نشرة الموقع',
115
-	'texte_lettre_information_2' => 'تحصي هذه النشرة المقالات والأخبار المنشورة منذ ',
116
-
117
-	// V
118
-	'ver_imprimer' => 'نسخة للطباعة',
119
-	'voir_en_ligne' => 'عرض مباشر',
120
-	'voir_squelette' => 'عرض الصفحة النموذجية لهذه الصفحة'
12
+    // A
13
+    'accueil_site' => 'الصفحة الرئيسية',
14
+    'article' => 'مقال',
15
+    'articles' => 'المقالات',
16
+    'articles_auteur' => 'مقالات هذا المؤلف',
17
+    'articles_populaires' => 'المقالات الأكثر شعبية',
18
+    'articles_rubrique' => 'مقالات هذا القسم',
19
+    'aucun_article' => 'لا توجد مقالات على هذا العنوان',
20
+    'aucun_auteur' => 'لا يوجد مؤلفون على هذا العنوان',
21
+    'aucun_site' => 'لا توجد مواقع على هذا العنوان',
22
+    'aucune_breve' => 'لا توجد أخبار على هذا العنوان',
23
+    'aucune_rubrique' => 'لا توجد أقسام على هذا العنوان',
24
+    'auteur' => 'مؤلف',
25
+    'autres' => 'آخرون',
26
+    'autres_breves' => 'أخبار أخرى',
27
+    'autres_groupes_mots_clefs' => 'مجموعات مفاتيح أخرى',
28
+    'autres_sites' => 'مواقع أخرى',
29
+
30
+    // B
31
+    'bonjour' => 'أهلاً وسهلاً',
32
+
33
+    // C
34
+    'commenter_site' => 'تعليق على هذا الموقع',
35
+    'contact' => 'للاتصال',
36
+    'copie_document_impossible' => 'لا يمكن نسخ المستند',
37
+
38
+    // D
39
+    'date' => 'التاريخ',
40
+    'dernier_ajout' => 'آخر إضافة',
41
+    'dernieres_breves' => 'آخر الأخبار',
42
+    'derniers_articles' => 'آخر المقالات',
43
+    'derniers_commentaires' => 'آخر التعليقات',
44
+    'derniers_messages_forum' => 'آخر المشاركات المنشورة في المنتديات',
45
+
46
+    // E
47
+    'edition_mode_texte' => 'النشرة في وضعية النصوص',
48
+    'en_reponse' => 'رداً على:',
49
+    'en_resume' => 'باختصار',
50
+    'envoyer_message' => 'إرسال مشاركة',
51
+    'espace_prive' => 'المجال الخاص',
52
+
53
+    // F
54
+    'formats_acceptes' => 'التنسيقات المسموحة: @formats@.',
55
+
56
+    // H
57
+    'hierarchie_site' => 'هرمية الموقع',
58
+
59
+    // J
60
+    'jours' => 'يوم',
61
+
62
+    // L
63
+    'lien_connecter' => 'دخول',
64
+
65
+    // M
66
+    'meme_auteur' => 'من نفس المؤلف',
67
+    'meme_rubrique' => 'في هذا القسم أيضاً',
68
+    'memes_auteurs' => 'من المؤلفين نفسهم ايضاً',
69
+    'message' => 'مشاركة',
70
+    'messages_forum' => 'مشاركة منتدى',
71
+    'messages_recents' => 'أحدث المشاركات',
72
+    'mots_clef' => 'مفتاح',
73
+    'mots_clefs' => 'المفاتيح',
74
+    'mots_clefs_meme_groupe' => 'المفاتيح الأخرى في هذه المجموعة',
75
+
76
+    // N
77
+    'navigation' => 'تصفح',
78
+    'nom' => 'الاسم',
79
+    'nouveautes' => 'الجديد',
80
+    'nouveautes_web' => 'الجديد على النسيج',
81
+    'nouveaux_articles' => 'المقالات الجديدة',
82
+    'nouvelles_breves' => 'الأخبار الجديدة',
83
+
84
+    // P
85
+    'page_precedente' => 'الصفحة السابقة',
86
+    'page_suivante' => 'الصفحة التالية',
87
+    'par_auteur' => 'بقلم ',
88
+    'participer_site' => 'يمكنك المشاركة في هذا الموقع، بالتسجيل أدناه ونشر مقالاتك. وبعد التسجيل، سوف تصلك رسالة فورية بالبريد الإلكتروني تتضمن معرفك الخاص الذي يسمح لك بالدخول الى المجال الخاص.',
89
+    'plan_site' => 'خريطة الموقع',
90
+    'popularite' => 'الشعبية',
91
+    'poster_message' => 'إبعث برسالة',
92
+    'proposer_site' => 'يمكنك افتراح إضافة موقع الى هذا القسم:',
93
+
94
+    // R
95
+    'repondre_article' => 'الرد على هذا المقال',
96
+    'repondre_breve' => 'الرد على هذا الخبر',
97
+    'resultats_recherche' => 'نتائج البحث',
98
+    'retour_debut_forums' => 'عودة الى بداية المنتديات',
99
+    'rubrique' => 'القسم',
100
+    'rubriques' => 'الأقسام',
101
+
102
+    // S
103
+    'signatures_petition' => 'التوقيعات',
104
+    'site_realise_avec_spip' => 'موقع صمم بنظام SPIP',
105
+    'sites_web' => 'مواقع النسيج',
106
+    'sous_rubriques' => 'الأقسام الفرعية',
107
+    'spam' => 'خنزرة',
108
+    'suite' => 'تتمة',
109
+    'sur_web' => 'على النسيج',
110
+    'syndiquer_rubrique' => 'ترخيص هذا القسم',
111
+    'syndiquer_site' => 'ترخيص كامل الموقع',
112
+
113
+    // T
114
+    'texte_lettre_information' => 'ها هي نشرة الموقع',
115
+    'texte_lettre_information_2' => 'تحصي هذه النشرة المقالات والأخبار المنشورة منذ ',
116
+
117
+    // V
118
+    'ver_imprimer' => 'نسخة للطباعة',
119
+    'voir_en_ligne' => 'عرض مباشر',
120
+    'voir_squelette' => 'عرض الصفحة النموذجية لهذه الصفحة'
121 121
 );
Please login to merge, or discard this patch.
ecrire/lang/ecrire_bg.php 1 patch
Indentation   +544 added lines, -544 removed lines patch added patch discarded remove patch
@@ -4,311 +4,311 @@  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' => 'Активирайте плъгина',
14
-	'aide_non_disponible' => 'Тази част от рубриката "Помощник" все още не е публикувана на български език.',
15
-	'auteur' => 'Автор:',
16
-	'avis_acces_interdit' => 'Забранен достъп.',
17
-	'avis_article_modifie' => 'Предупреждение! @nom_auteur_modif@ е работил по тази статия преди @date_diff@ минути',
18
-	'avis_aucun_resultat' => 'Няма намерени резултати.',
19
-	'avis_chemin_invalide_1' => 'Името на файла, което сте избрали',
20
-	'avis_chemin_invalide_2' => 'е грешно. Моля, върнете се на предишната страница, за за проверите подадената информация. ',
21
-	'avis_connexion_echec_1' => 'Връзката към SQL сървъра се разпадна.', # MODIF
22
-	'avis_connexion_echec_2' => 'Моля, върнете се на предишната страница, за да проверите подадената информация.',
23
-	'avis_connexion_echec_3' => '<b>ВНИМАНИЕ!</b> За достъп до голяма част от сървърите е необходимо да се изпрати <b>заявка</b> за активиране достъпа до базите данни SQL, преди използването им. Ако не успеете да се свържете, проверете дали сте изпратили заявката.', # MODIF
24
-	'avis_connexion_ldap_echec_1' => 'Връзката с LDAP сървъра пропадна.',
25
-	'avis_connexion_ldap_echec_2' => 'Моля, върнете се на предишната страница, за за проверите подадената информация.',
26
-	'avis_connexion_ldap_echec_3' => 'Без използване на LDAP-поддръжка за вписване на потребители.',
27
-	'avis_deplacement_rubrique' => 'Предупреждение! Рубриката съдържа @contient_breves@ новина@scb@: ако желаете да я преместите, отметнете в полето за потвърждение. ',
28
-	'avis_erreur_connexion_mysql' => 'Грешка при свързване с SQL',
29
-	'avis_espace_interdit' => '<b>Забранена област</b><p>СПИП е вече инсталиран.', # MODIF
30
-	'avis_lecture_noms_bases_1' => 'Инсталаторът не може да прочете имената на инсталираните бази данни.',
31
-	'avis_lecture_noms_bases_2' => 'Или не съществува база данни, или свойството, позволяващо преглед на базите данни е забранено
12
+    // A
13
+    'activer_plugin' => 'Активирайте плъгина',
14
+    'aide_non_disponible' => 'Тази част от рубриката "Помощник" все още не е публикувана на български език.',
15
+    'auteur' => 'Автор:',
16
+    'avis_acces_interdit' => 'Забранен достъп.',
17
+    'avis_article_modifie' => 'Предупреждение! @nom_auteur_modif@ е работил по тази статия преди @date_diff@ минути',
18
+    'avis_aucun_resultat' => 'Няма намерени резултати.',
19
+    'avis_chemin_invalide_1' => 'Името на файла, което сте избрали',
20
+    'avis_chemin_invalide_2' => 'е грешно. Моля, върнете се на предишната страница, за за проверите подадената информация. ',
21
+    'avis_connexion_echec_1' => 'Връзката към SQL сървъра се разпадна.', # MODIF
22
+    'avis_connexion_echec_2' => 'Моля, върнете се на предишната страница, за да проверите подадената информация.',
23
+    'avis_connexion_echec_3' => '<b>ВНИМАНИЕ!</b> За достъп до голяма част от сървърите е необходимо да се изпрати <b>заявка</b> за активиране достъпа до базите данни SQL, преди използването им. Ако не успеете да се свържете, проверете дали сте изпратили заявката.', # MODIF
24
+    'avis_connexion_ldap_echec_1' => 'Връзката с LDAP сървъра пропадна.',
25
+    'avis_connexion_ldap_echec_2' => 'Моля, върнете се на предишната страница, за за проверите подадената информация.',
26
+    'avis_connexion_ldap_echec_3' => 'Без използване на LDAP-поддръжка за вписване на потребители.',
27
+    'avis_deplacement_rubrique' => 'Предупреждение! Рубриката съдържа @contient_breves@ новина@scb@: ако желаете да я преместите, отметнете в полето за потвърждение. ',
28
+    'avis_erreur_connexion_mysql' => 'Грешка при свързване с SQL',
29
+    'avis_espace_interdit' => '<b>Забранена област</b><p>СПИП е вече инсталиран.', # MODIF
30
+    'avis_lecture_noms_bases_1' => 'Инсталаторът не може да прочете имената на инсталираните бази данни.',
31
+    'avis_lecture_noms_bases_2' => 'Или не съществува база данни, или свойството, позволяващо преглед на базите данни е забранено
32 32
   поради съображения за сигурност (какъвто е случаят с много доставчици).',
33
-	'avis_lecture_noms_bases_3' => 'Ако втората възможност се окаже вярна, тогава е възможно да се използва базата данни, указана след Вашето влизане в системата.',
34
-	'avis_non_acces_page' => 'Забранен достъп до тази страница.',
35
-	'avis_operation_echec' => 'Операцията пропадна.',
36
-	'avis_suppression_base' => 'ПРЕДУПРЕЖДЕНИЕ: изтриването на данните е необратимо',
33
+    'avis_lecture_noms_bases_3' => 'Ако втората възможност се окаже вярна, тогава е възможно да се използва базата данни, указана след Вашето влизане в системата.',
34
+    'avis_non_acces_page' => 'Забранен достъп до тази страница.',
35
+    'avis_operation_echec' => 'Операцията пропадна.',
36
+    'avis_suppression_base' => 'ПРЕДУПРЕЖДЕНИЕ: изтриването на данните е необратимо',
37 37
 
38
-	// B
39
-	'bouton_acces_ldap' => 'Добавяне достъп до LDAP >>',
40
-	'bouton_ajouter' => 'Добавяне',
41
-	'bouton_demande_publication' => 'Заявка за публикуване на статията',
42
-	'bouton_desactive_tout' => 'Деактивирайте всички',
43
-	'bouton_effacer_tout' => 'Изтриване на ВСИЧКО',
44
-	'bouton_envoyer_message' => 'Последно съобщение: изпращане',
45
-	'bouton_modifier' => 'Промяна',
46
-	'bouton_radio_afficher' => 'Показване',
47
-	'bouton_radio_apparaitre_liste_redacteurs_connectes' => 'Добяване към списъка на текущо свързаните редактори',
48
-	'bouton_radio_envoi_annonces_adresse' => 'Изпращане на съобщения до следния адрес:',
49
-	'bouton_radio_envoi_liste_nouveautes' => 'Изпращане на списък с новини',
50
-	'bouton_radio_non_apparaitre_liste_redacteurs_connectes' => 'Изключване от списъка на текущо свързаните редактори',
51
-	'bouton_radio_non_envoi_annonces_editoriales' => 'Отказ от изпращане на редакторски съобщения',
52
-	'bouton_redirection' => 'ПРЕНАСОЧВАНЕ',
53
-	'bouton_relancer_installation' => 'Подновяване на инсталацията',
54
-	'bouton_suivant' => 'По-нататък',
55
-	'bouton_tenter_recuperation' => 'Опит за възстановяване',
56
-	'bouton_test_proxy' => 'Тестване на прокси',
57
-	'bouton_vider_cache' => 'Изпразване на кеш-паметта',
38
+    // B
39
+    'bouton_acces_ldap' => 'Добавяне достъп до LDAP >>',
40
+    'bouton_ajouter' => 'Добавяне',
41
+    'bouton_demande_publication' => 'Заявка за публикуване на статията',
42
+    'bouton_desactive_tout' => 'Деактивирайте всички',
43
+    'bouton_effacer_tout' => 'Изтриване на ВСИЧКО',
44
+    'bouton_envoyer_message' => 'Последно съобщение: изпращане',
45
+    'bouton_modifier' => 'Промяна',
46
+    'bouton_radio_afficher' => 'Показване',
47
+    'bouton_radio_apparaitre_liste_redacteurs_connectes' => 'Добяване към списъка на текущо свързаните редактори',
48
+    'bouton_radio_envoi_annonces_adresse' => 'Изпращане на съобщения до следния адрес:',
49
+    'bouton_radio_envoi_liste_nouveautes' => 'Изпращане на списък с новини',
50
+    'bouton_radio_non_apparaitre_liste_redacteurs_connectes' => 'Изключване от списъка на текущо свързаните редактори',
51
+    'bouton_radio_non_envoi_annonces_editoriales' => 'Отказ от изпращане на редакторски съобщения',
52
+    'bouton_redirection' => 'ПРЕНАСОЧВАНЕ',
53
+    'bouton_relancer_installation' => 'Подновяване на инсталацията',
54
+    'bouton_suivant' => 'По-нататък',
55
+    'bouton_tenter_recuperation' => 'Опит за възстановяване',
56
+    'bouton_test_proxy' => 'Тестване на прокси',
57
+    'bouton_vider_cache' => 'Изпразване на кеш-паметта',
58 58
 
59
-	// C
60
-	'cache_modifiable_webmestre' => 'Параметърът може да бъде променен от уеб-администратора. ',
61
-	'calendrier_synchro' => 'Ако инсталирате приложение за дневник, съвместимо с <b>iCal</b>, ще можете да го синхронизирате с информацията от сайта.',
59
+    // C
60
+    'cache_modifiable_webmestre' => 'Параметърът може да бъде променен от уеб-администратора. ',
61
+    'calendrier_synchro' => 'Ако инсталирате приложение за дневник, съвместимо с <b>iCal</b>, ще можете да го синхронизирате с информацията от сайта.',
62 62
 
63
-	// D
64
-	'date_mot_heures' => 'ч.',
63
+    // D
64
+    'date_mot_heures' => 'ч.',
65 65
 
66
-	// E
67
-	'email' => 'електронен адрес',
68
-	'email_2' => 'електронен адрес:',
69
-	'entree_adresse_annuaire' => 'Адрес на директорията',
70
-	'entree_adresse_email' => 'Електронен адрес (е-mail)',
71
-	'entree_base_donnee_1' => 'Адрес на базата данни',
72
-	'entree_base_donnee_2' => '(Често адресът съвпада с адрес от Вашия сайт, понякога съответства на името «localhost», а понякога се оставя празен.)',
73
-	'entree_biographie' => 'Кратка биография с няколко думи.',
74
-	'entree_chemin_acces' => '<b>Въвеждане</b> на път:',
75
-	'entree_cle_pgp' => 'PGP ключ',
76
-	'entree_contenu_rubrique' => '(Кратко съдържание на рубриката.)',
77
-	'entree_identifiants_connexion' => 'Идентефикатори за свързване',
78
-	'entree_informations_connexion_ldap' => 'Моля, попълнете бланката с информацията за LDAP връзка. Тази информация ще получите от системния или мрежовия администратор.',
79
-	'entree_infos_perso' => 'Кой си ти?',
80
-	'entree_interieur_rubrique' => 'В рубриката:',
81
-	'entree_liens_sites' => '<b>Хипертекстова препратка</b> (препратка, сайт за посещаване и т.н.)',
82
-	'entree_login' => 'Вход',
83
-	'entree_login_connexion_1' => 'Потребителско име за свързване',
84
-	'entree_login_connexion_2' => '(Понякога съвпада с Вашето потребителско име към FTP достъпа, понякога се оставя празно)',
85
-	'entree_mot_passe' => 'Парола',
86
-	'entree_mot_passe_1' => 'Парола за свързване',
87
-	'entree_mot_passe_2' => '(Понякога съвпада с паролата Ви за FTP-достъп, понякога се оставя празно)',
88
-	'entree_nom_fichier' => 'Моля, попълнете име на файла @texte_compresse@:',
89
-	'entree_nom_pseudo' => 'Име или прякор',
90
-	'entree_nom_pseudo_1' => '(Име или прякор)',
91
-	'entree_nom_site' => 'Име на сайта',
92
-	'entree_nouveau_passe' => 'Нова парола',
93
-	'entree_passe_ldap' => 'Парола',
94
-	'entree_port_annuaire' => 'Номер на порта на директорията',
95
-	'entree_signature' => 'Подпис',
96
-	'entree_titre_obligatoire' => '<b>Заглавие</b> [Задължително]<br />',
97
-	'entree_url' => 'URL на сайта',
98
-	'erreur_plugin_fichier_absent' => 'Липсва файл',
99
-	'erreur_plugin_fichier_def_absent' => 'Файлът - дефиниция липсва',
100
-	'erreur_plugin_nom_fonction_interdit' => 'Забранено име на функцията',
101
-	'erreur_plugin_nom_manquant' => 'Липсва име на плъгина',
102
-	'erreur_plugin_prefix_manquant' => 'Не е определено име, указващо мястото на плъгина',
103
-	'erreur_plugin_tag_plugin_absent' => '&lt;плъгин&gt; липсва във файла - дефиниция',
104
-	'erreur_plugin_version_manquant' => 'Липсва версията на плъгина',
66
+    // E
67
+    'email' => 'електронен адрес',
68
+    'email_2' => 'електронен адрес:',
69
+    'entree_adresse_annuaire' => 'Адрес на директорията',
70
+    'entree_adresse_email' => 'Електронен адрес (е-mail)',
71
+    'entree_base_donnee_1' => 'Адрес на базата данни',
72
+    'entree_base_donnee_2' => '(Често адресът съвпада с адрес от Вашия сайт, понякога съответства на името «localhost», а понякога се оставя празен.)',
73
+    'entree_biographie' => 'Кратка биография с няколко думи.',
74
+    'entree_chemin_acces' => '<b>Въвеждане</b> на път:',
75
+    'entree_cle_pgp' => 'PGP ключ',
76
+    'entree_contenu_rubrique' => '(Кратко съдържание на рубриката.)',
77
+    'entree_identifiants_connexion' => 'Идентефикатори за свързване',
78
+    'entree_informations_connexion_ldap' => 'Моля, попълнете бланката с информацията за LDAP връзка. Тази информация ще получите от системния или мрежовия администратор.',
79
+    'entree_infos_perso' => 'Кой си ти?',
80
+    'entree_interieur_rubrique' => 'В рубриката:',
81
+    'entree_liens_sites' => '<b>Хипертекстова препратка</b> (препратка, сайт за посещаване и т.н.)',
82
+    'entree_login' => 'Вход',
83
+    'entree_login_connexion_1' => 'Потребителско име за свързване',
84
+    'entree_login_connexion_2' => '(Понякога съвпада с Вашето потребителско име към FTP достъпа, понякога се оставя празно)',
85
+    'entree_mot_passe' => 'Парола',
86
+    'entree_mot_passe_1' => 'Парола за свързване',
87
+    'entree_mot_passe_2' => '(Понякога съвпада с паролата Ви за FTP-достъп, понякога се оставя празно)',
88
+    'entree_nom_fichier' => 'Моля, попълнете име на файла @texte_compresse@:',
89
+    'entree_nom_pseudo' => 'Име или прякор',
90
+    'entree_nom_pseudo_1' => '(Име или прякор)',
91
+    'entree_nom_site' => 'Име на сайта',
92
+    'entree_nouveau_passe' => 'Нова парола',
93
+    'entree_passe_ldap' => 'Парола',
94
+    'entree_port_annuaire' => 'Номер на порта на директорията',
95
+    'entree_signature' => 'Подпис',
96
+    'entree_titre_obligatoire' => '<b>Заглавие</b> [Задължително]<br />',
97
+    'entree_url' => 'URL на сайта',
98
+    'erreur_plugin_fichier_absent' => 'Липсва файл',
99
+    'erreur_plugin_fichier_def_absent' => 'Файлът - дефиниция липсва',
100
+    'erreur_plugin_nom_fonction_interdit' => 'Забранено име на функцията',
101
+    'erreur_plugin_nom_manquant' => 'Липсва име на плъгина',
102
+    'erreur_plugin_prefix_manquant' => 'Не е определено име, указващо мястото на плъгина',
103
+    'erreur_plugin_tag_plugin_absent' => '&lt;плъгин&gt; липсва във файла - дефиниция',
104
+    'erreur_plugin_version_manquant' => 'Липсва версията на плъгина',
105 105
 
106
-	// I
107
-	'ical_info1' => 'Тази страница представя няколко начина да останете във връзка с дейността на сайта.',
108
-	'ical_info2' => 'За повече информация, отидете на <a href="@spipnet@">Документация за СПИП</a>.', # MODIF
109
-	'ical_info_calendrier' => 'Имате на разположение два календара. Първият е карта на сайта, указваща всички публикувани статии. Вторият съдържа обявления за редакторите, както и най-новите лични съобщения до Вас. Този календар се показва само на Вас, благодарение на личнен ключ, който можете да променяте по всяко време чрез смяна на паролата.',
110
-	'ical_methode_http' => 'Сваляне',
111
-	'ical_methode_webcal' => 'Синхронизация (webcal://)', # MODIF
112
-	'ical_texte_js' => 'Един ред на скрипт Java позволява на всяка страница от сайта лесно да се показват най-новите публикувани статии.',
113
-	'ical_texte_prive' => 'Календарът е строго личен. Той уведомява за вътрешните редакторски дейности на сайта (напр. задачи, лични срещи, изпратени статии и новини и др.)',
114
-	'ical_texte_public' => 'Календарът Ви дава възможност да следите публичните дейности на сайта (напр. публикувани статии и новини).',
115
-	'ical_texte_rss' => 'Можете да обедините последните новини от сайта на всеки файлов четец от типа XML/RSS (Rich Site Summary). Това е същият формат, който позволява на СПИП да чете последните новини, публикувани от други сайтове като за целта използва съвместим формат за обмен.',
116
-	'ical_titre_js' => 'Скрипт Java',
117
-	'ical_titre_mailing' => 'Пощенски списък',
118
-	'ical_titre_rss' => 'Файлове за обединение',
119
-	'icone_activer_cookie' => 'Поставяне на cookie',
120
-	'icone_admin_plugin' => 'Управление на плъгините',
121
-	'icone_afficher_auteurs' => 'Показване на авторите',
122
-	'icone_afficher_visiteurs' => 'Показване на посетителите',
123
-	'icone_arret_discussion' => 'Прекъсване участието в тази дискусия',
124
-	'icone_calendrier' => 'Календар',
125
-	'icone_creer_auteur' => 'Създаване на автор и свързване със статията',
126
-	'icone_creer_mot_cle' => 'Създаване на ключова дума и свързване със статията',
127
-	'icone_creer_rubrique_2' => 'Създаване на рубрика',
128
-	'icone_modifier_article' => 'Промяна на статията',
129
-	'icone_modifier_rubrique' => 'Промяна на рубриката',
130
-	'icone_retour' => 'Обратно',
131
-	'icone_retour_article' => 'Обратно към статията',
132
-	'icone_supprimer_cookie' => 'Изтриване на cookie',
133
-	'icone_supprimer_rubrique' => 'Изтриване на рубриката',
134
-	'icone_supprimer_signature' => 'Изтриване на записа',
135
-	'icone_valider_signature' => 'Одобряване на записа',
136
-	'image_administrer_rubrique' => 'Управление на рубриката',
137
-	'impossible_modifier_login_auteur' => 'Impossible de modifier le login.', # MODIF
138
-	'impossible_modifier_pass_auteur' => 'Impossible de modifier le mot de passe.', # MODIF
139
-	'info_1_article' => '1 статия',
140
-	'info_activer_cookie' => 'Възможност за активиране на <b>cookie администриране</b>, което позволява
106
+    // I
107
+    'ical_info1' => 'Тази страница представя няколко начина да останете във връзка с дейността на сайта.',
108
+    'ical_info2' => 'За повече информация, отидете на <a href="@spipnet@">Документация за СПИП</a>.', # MODIF
109
+    'ical_info_calendrier' => 'Имате на разположение два календара. Първият е карта на сайта, указваща всички публикувани статии. Вторият съдържа обявления за редакторите, както и най-новите лични съобщения до Вас. Този календар се показва само на Вас, благодарение на личнен ключ, който можете да променяте по всяко време чрез смяна на паролата.',
110
+    'ical_methode_http' => 'Сваляне',
111
+    'ical_methode_webcal' => 'Синхронизация (webcal://)', # MODIF
112
+    'ical_texte_js' => 'Един ред на скрипт Java позволява на всяка страница от сайта лесно да се показват най-новите публикувани статии.',
113
+    'ical_texte_prive' => 'Календарът е строго личен. Той уведомява за вътрешните редакторски дейности на сайта (напр. задачи, лични срещи, изпратени статии и новини и др.)',
114
+    'ical_texte_public' => 'Календарът Ви дава възможност да следите публичните дейности на сайта (напр. публикувани статии и новини).',
115
+    'ical_texte_rss' => 'Можете да обедините последните новини от сайта на всеки файлов четец от типа XML/RSS (Rich Site Summary). Това е същият формат, който позволява на СПИП да чете последните новини, публикувани от други сайтове като за целта използва съвместим формат за обмен.',
116
+    'ical_titre_js' => 'Скрипт Java',
117
+    'ical_titre_mailing' => 'Пощенски списък',
118
+    'ical_titre_rss' => 'Файлове за обединение',
119
+    'icone_activer_cookie' => 'Поставяне на cookie',
120
+    'icone_admin_plugin' => 'Управление на плъгините',
121
+    'icone_afficher_auteurs' => 'Показване на авторите',
122
+    'icone_afficher_visiteurs' => 'Показване на посетителите',
123
+    'icone_arret_discussion' => 'Прекъсване участието в тази дискусия',
124
+    'icone_calendrier' => 'Календар',
125
+    'icone_creer_auteur' => 'Създаване на автор и свързване със статията',
126
+    'icone_creer_mot_cle' => 'Създаване на ключова дума и свързване със статията',
127
+    'icone_creer_rubrique_2' => 'Създаване на рубрика',
128
+    'icone_modifier_article' => 'Промяна на статията',
129
+    'icone_modifier_rubrique' => 'Промяна на рубриката',
130
+    'icone_retour' => 'Обратно',
131
+    'icone_retour_article' => 'Обратно към статията',
132
+    'icone_supprimer_cookie' => 'Изтриване на cookie',
133
+    'icone_supprimer_rubrique' => 'Изтриване на рубриката',
134
+    'icone_supprimer_signature' => 'Изтриване на записа',
135
+    'icone_valider_signature' => 'Одобряване на записа',
136
+    'image_administrer_rubrique' => 'Управление на рубриката',
137
+    'impossible_modifier_login_auteur' => 'Impossible de modifier le login.', # MODIF
138
+    'impossible_modifier_pass_auteur' => 'Impossible de modifier le mot de passe.', # MODIF
139
+    'info_1_article' => '1 статия',
140
+    'info_activer_cookie' => 'Възможност за активиране на <b>cookie администриране</b>, което позволява
141 141
  улеснено превключване между публичния сайт и личната зона.',
142
-	'info_administrateur' => 'Администратор',
143
-	'info_administrateur_1' => 'Администратор',
144
-	'info_administrateur_2' => 'на сайта (<i>внимавайте</i>)',
145
-	'info_administrateur_site_01' => 'Ако сте администратор на сайта, моля',
146
-	'info_administrateur_site_02' => 'посещаване на препратката',
147
-	'info_administrateurs' => 'Администратори',
148
-	'info_administrer_rubrique' => 'Вие можете да управлявате рубриката',
149
-	'info_adresse' => 'към адрес:',
150
-	'info_adresse_url' => 'Публичен URL на сайта ',
151
-	'info_aide_en_ligne' => 'Помощник',
152
-	'info_ajout_image' => 'Когато се добавят изображения под формата на приложени документи към 
142
+    'info_administrateur' => 'Администратор',
143
+    'info_administrateur_1' => 'Администратор',
144
+    'info_administrateur_2' => 'на сайта (<i>внимавайте</i>)',
145
+    'info_administrateur_site_01' => 'Ако сте администратор на сайта, моля',
146
+    'info_administrateur_site_02' => 'посещаване на препратката',
147
+    'info_administrateurs' => 'Администратори',
148
+    'info_administrer_rubrique' => 'Вие можете да управлявате рубриката',
149
+    'info_adresse' => 'към адрес:',
150
+    'info_adresse_url' => 'Публичен URL на сайта ',
151
+    'info_aide_en_ligne' => 'Помощник',
152
+    'info_ajout_image' => 'Когато се добавят изображения под формата на приложени документи към 
153 153
   статия, СПИП автоматично създава умалени образи (винетки)
154 154
   на поместените изображения. Това позволява, например да се създаде
155 155
   автоматично галерия от изображения.',
156
-	'info_ajouter_rubrique' => 'Добавяне на друга рубрика за управление:',
157
-	'info_annonce_nouveautes' => 'Най-новите съобщения',
158
-	'info_article' => 'статия',
159
-	'info_article_2' => 'статии',
160
-	'info_article_a_paraitre' => 'Статии за одобрение със стара дата ',
161
-	'info_articles_02' => 'статии',
162
-	'info_articles_2' => 'Статии',
163
-	'info_articles_auteur' => 'Статиите на автора',
164
-	'info_articles_trouves' => 'Намерени статии',
165
-	'info_attente_validation' => 'Вашите статии, очакващи одобрение за публикуване',
166
-	'info_aujourdhui' => 'днес:',
167
-	'info_auteur_gere_toutes_rubriques_2' => 'Je gère <b>toutes les rubriques</b>', # MODIF
168
-	'info_auteurs' => 'Автори',
169
-	'info_auteurs_par_tri' => 'Автори@partri@',
170
-	'info_auteurs_trouves' => 'Намерени автори',
171
-	'info_authentification_externe' => 'Външно удостоверяване на автентичността',
172
-	'info_avertissement' => 'Предупреждение',
173
-	'info_base_installee' => 'Структурата на Вашата база данни е инсталирана.',
174
-	'info_chapeau' => 'Преглед',
175
-	'info_chapeau_2' => 'Въведение:',
176
-	'info_chemin_acces_1' => 'Опции: <b>Път за достъп до директорията</b>',
177
-	'info_chemin_acces_2' => 'От сега нататък Вие трябва да определяте пътя за достъп до данните в директорията. Тази информация дава възможност за преглед на потребителските профили, съхранени там.',
178
-	'info_chemin_acces_annuaire' => 'Опции: <b>Път за достъп</b>',
179
-	'info_choix_base' => 'Трета стъпка:',
180
-	'info_classement_1' => '<sup>st</sup> от общо @liste@',
181
-	'info_classement_2' => '<sup>th</sup> от общо @liste@',
182
-	'info_code_acces' => 'Не забравяйте личния си код за достъп!',
183
-	'info_config_suivi' => 'Ако адресът отговаря а даден пощенски списък, можете да окажете отдолу адресът, където участниците на сайта биха могли да се регистрират. Този адрес може да бъде URL (наример страницата, където се прави регистрация през Интернет страница), или електронен адрес, заедно с определена тема на писмото (например: <tt>@adresse_suivi@?subject=subscribe</tt>):',
184
-	'info_config_suivi_explication' => 'Можете да се абонирате за пощенския списък на сайта. За целта ще получите автоматично електронно съобщение с обявленията, свързани с новините и статиите, изпратени за публикуване.',
185
-	'info_confirmer_passe' => 'Потвърдете новата парола:',
186
-	'info_connexion_base' => 'Втора стъпка: <b>Опит за свързване с базата данни</b>',
187
-	'info_connexion_ldap_ok' => '<b>Успешна LDAP връзка</b><p> Преминете към следващата стъпка.', # MODIF
188
-	'info_connexion_mysql' => 'Първа стъпка: <b>Вашата SQL връзка</b>',
189
-	'info_connexion_ok' => 'Успешно свързване.',
190
-	'info_contact' => 'Контакт',
191
-	'info_contenu_articles' => 'Съдържание на статиите',
192
-	'info_creation_paragraphe' => '(За нов ред оставете празни редове.)', # MODIF
193
-	'info_creation_rubrique' => 'Трябва да създадете поне една рубрика,<br />преди да започнете да пишете статии.<br />',
194
-	'info_creation_tables' => 'Четвърта стъпка: <b>Създаване на таблици с бази данни</b>',
195
-	'info_creer_base' => '<b>Създаване</b> на нова база данни:',
196
-	'info_dans_rubrique' => 'В рубриката:',
197
-	'info_date_publication_anterieure' => 'Дата на предишно публикуване:',
198
-	'info_date_referencement' => 'ДАТА НА СВЪРЗВАНЕ НА САЙТА:',
199
-	'info_derniere_etape' => 'Последна стъпка: <b>Приключено!',
200
-	'info_descriptif' => 'Описание:',
201
-	'info_discussion_cours' => 'Дискусии в ход',
202
-	'info_ecrire_article' => 'Преди да започнете за пишете статии, трябва да създадете поне една рубрика.',
203
-	'info_email_envoi' => 'Електронен адрес на изпращача (по желание)',
204
-	'info_email_envoi_txt' => 'Впишете електронния адрес на изпращача, който използвате (по подразбиране, адресът на получателя ще се използва за адрес на изпращача):',
205
-	'info_email_webmestre' => 'Електронен адрес на уеб-администратора (незадължителен)', # MODIF
206
-	'info_envoi_email_automatique' => 'Автоматично изпращане на съобщение',
207
-	'info_envoyer_maintenant' => 'Изпращане',
208
-	'info_etape_suivante' => 'Преминете към следващата стъпка',
209
-	'info_etape_suivante_1' => 'Можете да преминете към следващата стъпка.',
210
-	'info_etape_suivante_2' => 'Можете да преминете към следващата стъпка.',
211
-	'info_exportation_base' => 'експортиране на базата данни в @archive@',
212
-	'info_facilite_suivi_activite' => 'За улесняване по-нататъшните действия на редакторите,
156
+    'info_ajouter_rubrique' => 'Добавяне на друга рубрика за управление:',
157
+    'info_annonce_nouveautes' => 'Най-новите съобщения',
158
+    'info_article' => 'статия',
159
+    'info_article_2' => 'статии',
160
+    'info_article_a_paraitre' => 'Статии за одобрение със стара дата ',
161
+    'info_articles_02' => 'статии',
162
+    'info_articles_2' => 'Статии',
163
+    'info_articles_auteur' => 'Статиите на автора',
164
+    'info_articles_trouves' => 'Намерени статии',
165
+    'info_attente_validation' => 'Вашите статии, очакващи одобрение за публикуване',
166
+    'info_aujourdhui' => 'днес:',
167
+    'info_auteur_gere_toutes_rubriques_2' => 'Je gère <b>toutes les rubriques</b>', # MODIF
168
+    'info_auteurs' => 'Автори',
169
+    'info_auteurs_par_tri' => 'Автори@partri@',
170
+    'info_auteurs_trouves' => 'Намерени автори',
171
+    'info_authentification_externe' => 'Външно удостоверяване на автентичността',
172
+    'info_avertissement' => 'Предупреждение',
173
+    'info_base_installee' => 'Структурата на Вашата база данни е инсталирана.',
174
+    'info_chapeau' => 'Преглед',
175
+    'info_chapeau_2' => 'Въведение:',
176
+    'info_chemin_acces_1' => 'Опции: <b>Път за достъп до директорията</b>',
177
+    'info_chemin_acces_2' => 'От сега нататък Вие трябва да определяте пътя за достъп до данните в директорията. Тази информация дава възможност за преглед на потребителските профили, съхранени там.',
178
+    'info_chemin_acces_annuaire' => 'Опции: <b>Път за достъп</b>',
179
+    'info_choix_base' => 'Трета стъпка:',
180
+    'info_classement_1' => '<sup>st</sup> от общо @liste@',
181
+    'info_classement_2' => '<sup>th</sup> от общо @liste@',
182
+    'info_code_acces' => 'Не забравяйте личния си код за достъп!',
183
+    'info_config_suivi' => 'Ако адресът отговаря а даден пощенски списък, можете да окажете отдолу адресът, където участниците на сайта биха могли да се регистрират. Този адрес може да бъде URL (наример страницата, където се прави регистрация през Интернет страница), или електронен адрес, заедно с определена тема на писмото (например: <tt>@adresse_suivi@?subject=subscribe</tt>):',
184
+    'info_config_suivi_explication' => 'Можете да се абонирате за пощенския списък на сайта. За целта ще получите автоматично електронно съобщение с обявленията, свързани с новините и статиите, изпратени за публикуване.',
185
+    'info_confirmer_passe' => 'Потвърдете новата парола:',
186
+    'info_connexion_base' => 'Втора стъпка: <b>Опит за свързване с базата данни</b>',
187
+    'info_connexion_ldap_ok' => '<b>Успешна LDAP връзка</b><p> Преминете към следващата стъпка.', # MODIF
188
+    'info_connexion_mysql' => 'Първа стъпка: <b>Вашата SQL връзка</b>',
189
+    'info_connexion_ok' => 'Успешно свързване.',
190
+    'info_contact' => 'Контакт',
191
+    'info_contenu_articles' => 'Съдържание на статиите',
192
+    'info_creation_paragraphe' => '(За нов ред оставете празни редове.)', # MODIF
193
+    'info_creation_rubrique' => 'Трябва да създадете поне една рубрика,<br />преди да започнете да пишете статии.<br />',
194
+    'info_creation_tables' => 'Четвърта стъпка: <b>Създаване на таблици с бази данни</b>',
195
+    'info_creer_base' => '<b>Създаване</b> на нова база данни:',
196
+    'info_dans_rubrique' => 'В рубриката:',
197
+    'info_date_publication_anterieure' => 'Дата на предишно публикуване:',
198
+    'info_date_referencement' => 'ДАТА НА СВЪРЗВАНЕ НА САЙТА:',
199
+    'info_derniere_etape' => 'Последна стъпка: <b>Приключено!',
200
+    'info_descriptif' => 'Описание:',
201
+    'info_discussion_cours' => 'Дискусии в ход',
202
+    'info_ecrire_article' => 'Преди да започнете за пишете статии, трябва да създадете поне една рубрика.',
203
+    'info_email_envoi' => 'Електронен адрес на изпращача (по желание)',
204
+    'info_email_envoi_txt' => 'Впишете електронния адрес на изпращача, който използвате (по подразбиране, адресът на получателя ще се използва за адрес на изпращача):',
205
+    'info_email_webmestre' => 'Електронен адрес на уеб-администратора (незадължителен)', # MODIF
206
+    'info_envoi_email_automatique' => 'Автоматично изпращане на съобщение',
207
+    'info_envoyer_maintenant' => 'Изпращане',
208
+    'info_etape_suivante' => 'Преминете към следващата стъпка',
209
+    'info_etape_suivante_1' => 'Можете да преминете към следващата стъпка.',
210
+    'info_etape_suivante_2' => 'Можете да преминете към следващата стъпка.',
211
+    'info_exportation_base' => 'експортиране на базата данни в @archive@',
212
+    'info_facilite_suivi_activite' => 'За улесняване по-нататъшните действия на редакторите,
213 213
   СПИП изпраща по електронна поща съобщение с молбите за публикуване и одобрените статии до
214 214
   някой пощенски списък
215 215
   на редактори, например.
216 216
 ',
217
-	'info_fichiers_authent' => 'Файл за удостоверяване автентичността: „.htpasswd“',
218
-	'info_forums_abo_invites' => 'Сайтът Ви съдържа форуми посредством предварителен абонамент; посетителите могат да се регистират за тях през публичния сайт.',
219
-	'info_gauche_admin_tech' => '<b>Само администратори имат достъп до тази страница.</b><p> Тя осигурява достъп до различни
217
+    'info_fichiers_authent' => 'Файл за удостоверяване автентичността: „.htpasswd“',
218
+    'info_forums_abo_invites' => 'Сайтът Ви съдържа форуми посредством предварителен абонамент; посетителите могат да се регистират за тях през публичния сайт.',
219
+    'info_gauche_admin_tech' => '<b>Само администратори имат достъп до тази страница.</b><p> Тя осигурява достъп до различни
220 220
  технически задачи за поддръжка. Някои от тях позволяват специфичен процес на
221 221
 идентификация и изискват FTP достъп до сайта.', # MODIF
222
-	'info_gauche_admin_vider' => '<b>Само администратори имат достъп до тази страница.</b><p> Тя осигурява достъп доразлични
222
+    'info_gauche_admin_vider' => '<b>Само администратори имат достъп до тази страница.</b><p> Тя осигурява достъп доразлични
223 223
 технически задачи за поддръжка. Някои от тях позволяват специфичен процес на
224 224
 идентификация и изискват FTP достъп до сайта.', # MODIF
225
-	'info_gauche_auteurs' => 'Тук ще намерите всички автори на сайта.
225
+    'info_gauche_auteurs' => 'Тук ще намерите всички автори на сайта.
226 226
  Статусът на всеки от тях е обозначен с цвета на неговата икона (редактор - жълта; администратор - зелена).',
227
-	'info_gauche_auteurs_exterieurs' => 'Външни автори, без достъп до сайта, са обозначени със синя икона; изтритите автори - с кошче за боклук.', # MODIF
228
-	'info_gauche_messagerie' => 'Изпращането на съобщения позволява да се обменя информация между редакторите, да се съхраняват бележки (за лично ползване) или да се публикуват обяви в началната страница на личната зона (ако сте администратор).',
229
-	'info_gauche_statistiques_referers' => 'Тази страница показва списък с <i>препратки към сайтове</i>: т.е. сайтовете, съдържащи връзка към Вашия сайт, само за вчера и днес: този списък се акуализира на всеки 24 часа.',
230
-	'info_gauche_visiteurs_enregistres' => 'Тук ще намерите посетителите, регистрирани
227
+    'info_gauche_auteurs_exterieurs' => 'Външни автори, без достъп до сайта, са обозначени със синя икона; изтритите автори - с кошче за боклук.', # MODIF
228
+    'info_gauche_messagerie' => 'Изпращането на съобщения позволява да се обменя информация между редакторите, да се съхраняват бележки (за лично ползване) или да се публикуват обяви в началната страница на личната зона (ако сте администратор).',
229
+    'info_gauche_statistiques_referers' => 'Тази страница показва списък с <i>препратки към сайтове</i>: т.е. сайтовете, съдържащи връзка към Вашия сайт, само за вчера и днес: този списък се акуализира на всеки 24 часа.',
230
+    'info_gauche_visiteurs_enregistres' => 'Тук ще намерите посетителите, регистрирани
231 231
  в публичната зона на сайта (форумите са с предварително записване).',
232
-	'info_generation_miniatures_images' => 'Генерирана на умалени образи на изображенията',
233
-	'info_hebergeur_desactiver_envoi_email' => 'Някои доставчици не позволяват изпращането на автоматични съобщения
232
+    'info_generation_miniatures_images' => 'Генерирана на умалени образи на изображенията',
233
+    'info_hebergeur_desactiver_envoi_email' => 'Някои доставчици не позволяват изпращането на автоматични съобщения
234 234
   от техните сървъри. В този случай, следните свойства
235 235
   на СПИП не работят:',
236
-	'info_hier' => 'вчера:',
237
-	'info_identification_publique' => 'Публична самоличност...',
238
-	'info_image_process' => 'Изберете най-удобният начин да създавате миниатюри, чрез натискане въру съответната картинка.',
239
-	'info_image_process2' => '<b>N.B.</b> <i>Ако не можете да видите никакво изображение, следователно сървърът Ви не е конфигуриран да използва такива инструменти. Ако искате да ползвате това свойство, трябва да се свържете с доставчика си и да поискате да ви инсталират разширения от типа "GD" или "Imagick"</i>', # MODIF
240
-	'info_images_auto' => 'Автоматично изчислени изображения',
241
-	'info_informations_personnelles' => 'Стъпка пет: <b>Лични данни</b>',
242
-	'info_inscription_automatique' => 'Автоматична регистрация на нови редактори',
243
-	'info_jeu_caractere' => 'Кодировка на сайта',
244
-	'info_jours' => 'дни',
245
-	'info_laisser_champs_vides' => 'оставите празни полетата)',
246
-	'info_langues' => 'Езици на сайта',
247
-	'info_ldap_ok' => 'Инсталирана е аутентификация за LDAP.',
248
-	'info_lien_hypertexte' => 'Хипертекстова препратка:',
249
-	'info_liste_redacteurs_connectes' => 'Списък на свързаните редактори',
250
-	'info_login_existant' => 'Потребителското име вече съществува.',
251
-	'info_login_trop_court' => 'Потребителското име е твърде кратко.',
252
-	'info_maximum' => 'максимум:',
253
-	'info_meme_rubrique' => 'В същата рубрика',
254
-	'info_message_en_redaction' => 'Съобщения в процес на обработка',
255
-	'info_message_technique' => 'Техническо съобщение:',
256
-	'info_messagerie_interne' => 'Система за вътрешни съобщения',
257
-	'info_mise_a_niveau_base' => 'Актуализиране на базата данни SQL',
258
-	'info_mise_a_niveau_base_2' => '{{Предупреждение!}} Инсталираната версия на СПИП
236
+    'info_hier' => 'вчера:',
237
+    'info_identification_publique' => 'Публична самоличност...',
238
+    'info_image_process' => 'Изберете най-удобният начин да създавате миниатюри, чрез натискане въру съответната картинка.',
239
+    'info_image_process2' => '<b>N.B.</b> <i>Ако не можете да видите никакво изображение, следователно сървърът Ви не е конфигуриран да използва такива инструменти. Ако искате да ползвате това свойство, трябва да се свържете с доставчика си и да поискате да ви инсталират разширения от типа "GD" или "Imagick"</i>', # MODIF
240
+    'info_images_auto' => 'Автоматично изчислени изображения',
241
+    'info_informations_personnelles' => 'Стъпка пет: <b>Лични данни</b>',
242
+    'info_inscription_automatique' => 'Автоматична регистрация на нови редактори',
243
+    'info_jeu_caractere' => 'Кодировка на сайта',
244
+    'info_jours' => 'дни',
245
+    'info_laisser_champs_vides' => 'оставите празни полетата)',
246
+    'info_langues' => 'Езици на сайта',
247
+    'info_ldap_ok' => 'Инсталирана е аутентификация за LDAP.',
248
+    'info_lien_hypertexte' => 'Хипертекстова препратка:',
249
+    'info_liste_redacteurs_connectes' => 'Списък на свързаните редактори',
250
+    'info_login_existant' => 'Потребителското име вече съществува.',
251
+    'info_login_trop_court' => 'Потребителското име е твърде кратко.',
252
+    'info_maximum' => 'максимум:',
253
+    'info_meme_rubrique' => 'В същата рубрика',
254
+    'info_message_en_redaction' => 'Съобщения в процес на обработка',
255
+    'info_message_technique' => 'Техническо съобщение:',
256
+    'info_messagerie_interne' => 'Система за вътрешни съобщения',
257
+    'info_mise_a_niveau_base' => 'Актуализиране на базата данни SQL',
258
+    'info_mise_a_niveau_base_2' => '{{Предупреждение!}} Инсталираната версия на СПИП
259 259
  е по-стара от тази, показана на този сайт
260 260
   Има риск за изгубване на данни, както и Вашият сайт да
261 261
   спре да работи.<br />{{Преинсталирай
262 262
   файловете на СПИП.}}',
263
-	'info_modifier_rubrique' => 'Промяна на настройките на рубриката:',
264
-	'info_modifier_titre' => 'Промяна: @titre@',
265
-	'info_mon_site_spip' => 'Моят сайт под СПИП',
266
-	'info_moyenne' => 'средно:',
267
-	'info_multi_cet_article' => 'Език на статията:',
268
-	'info_multi_langues_choisies' => 'Изберете по-долу езиците, които желаете да са активни за редакторите на сайта.
263
+    'info_modifier_rubrique' => 'Промяна на настройките на рубриката:',
264
+    'info_modifier_titre' => 'Промяна: @titre@',
265
+    'info_mon_site_spip' => 'Моят сайт под СПИП',
266
+    'info_moyenne' => 'средно:',
267
+    'info_multi_cet_article' => 'Език на статията:',
268
+    'info_multi_langues_choisies' => 'Изберете по-долу езиците, които желаете да са активни за редакторите на сайта.
269 269
   Езиците, които вече са използвани в сайта (в началото на списъка) не могат да бъдат деактивирани.',
270
-	'info_multi_secteurs' => ' ... само за рубрики, намиращи се в схемата?',
271
-	'info_nom' => 'Име',
272
-	'info_nom_destinataire' => 'Име на получателя',
273
-	'info_nom_site' => 'Име на сайта Ви',
274
-	'info_nombre_articles' => '@nb_articles@ статии,',
275
-	'info_nombre_rubriques' => '@nb_rubriques@ рубрики,',
276
-	'info_nombre_sites' => '@nb_sites@ сайтове,',
277
-	'info_non_deplacer' => 'Не правете нищо...',
278
-	'info_non_envoi_annonce_dernieres_nouveautes' => 'СПИП може да изпраща регулярно информация за новостите на сайта.
270
+    'info_multi_secteurs' => ' ... само за рубрики, намиращи се в схемата?',
271
+    'info_nom' => 'Име',
272
+    'info_nom_destinataire' => 'Име на получателя',
273
+    'info_nom_site' => 'Име на сайта Ви',
274
+    'info_nombre_articles' => '@nb_articles@ статии,',
275
+    'info_nombre_rubriques' => '@nb_rubriques@ рубрики,',
276
+    'info_nombre_sites' => '@nb_sites@ сайтове,',
277
+    'info_non_deplacer' => 'Не правете нищо...',
278
+    'info_non_envoi_annonce_dernieres_nouveautes' => 'СПИП може да изпраща регулярно информация за новостите на сайта.
279 279
   (напр. съобщения за наскоро публикуваните статии и новини).',
280
-	'info_non_envoi_liste_nouveautes' => 'Бе изпращане на списък с най-новите съобщения',
281
-	'info_non_modifiable' => 'промяната е невъзможна',
282
-	'info_non_suppression_mot_cle' => 'Отказ от изтриване на ключовата дума.',
283
-	'info_notes' => 'Бележки под линия',
284
-	'info_nouvel_article' => 'Нова статия',
285
-	'info_nouvelle_traduction' => 'Нов превод:',
286
-	'info_numero_article' => 'НОМЕР НА СТАТИЯТА:',
287
-	'info_obligatoire_02' => '[Задължително]', # MODIF
288
-	'info_option_accepter_visiteurs' => 'Позволяване регистрацията на посетители от публичния сайт',
289
-	'info_option_ne_pas_accepter_visiteurs' => 'Отказ за регистрация на посетител',
290
-	'info_options_avancees' => 'ПОДРОБНИ ОПЦИИ',
291
-	'info_ou' => 'или ...',
292
-	'info_page_interdite' => 'Забранена страница',
293
-	'info_par_nombre_article' => '(по номер на статията)',
294
-	'info_passe_trop_court' => 'Паролата не е достатъчно дълга.',
295
-	'info_passes_identiques' => 'Двете пароли не съвадат.',
296
-	'info_plus_cinq_car' => 'повече от 5 знака',
297
-	'info_plus_cinq_car_2' => '(повече от 5 знака)',
298
-	'info_plus_trois_car' => '(повече от 3 знака)',
299
-	'info_popularite' => 'популярност: @popularite@; посещения: @visites@',
300
-	'info_post_scriptum' => 'Постскриптум',
301
-	'info_post_scriptum_2' => 'Постскриптум:',
302
-	'info_pour' => 'за',
303
-	'info_preview_texte' => 'Възможно е да се прави предварителен преглед на сайта все едно, че всички статии и новини (които имат статус "изпратени") са вече публикувани. Да бъде ли даден достъп към тази функция на администраторите само, да бъде ли възможна за всички автори на сайта или да бъде изключена напълно?', # MODIF
304
-	'info_procedez_par_etape' => 'моля, продължете напред стъпка по стъпка',
305
-	'info_procedure_maj_version' => 'процедурата по обновяване трябва да се стартира,
280
+    'info_non_envoi_liste_nouveautes' => 'Бе изпращане на списък с най-новите съобщения',
281
+    'info_non_modifiable' => 'промяната е невъзможна',
282
+    'info_non_suppression_mot_cle' => 'Отказ от изтриване на ключовата дума.',
283
+    'info_notes' => 'Бележки под линия',
284
+    'info_nouvel_article' => 'Нова статия',
285
+    'info_nouvelle_traduction' => 'Нов превод:',
286
+    'info_numero_article' => 'НОМЕР НА СТАТИЯТА:',
287
+    'info_obligatoire_02' => '[Задължително]', # MODIF
288
+    'info_option_accepter_visiteurs' => 'Позволяване регистрацията на посетители от публичния сайт',
289
+    'info_option_ne_pas_accepter_visiteurs' => 'Отказ за регистрация на посетител',
290
+    'info_options_avancees' => 'ПОДРОБНИ ОПЦИИ',
291
+    'info_ou' => 'или ...',
292
+    'info_page_interdite' => 'Забранена страница',
293
+    'info_par_nombre_article' => '(по номер на статията)',
294
+    'info_passe_trop_court' => 'Паролата не е достатъчно дълга.',
295
+    'info_passes_identiques' => 'Двете пароли не съвадат.',
296
+    'info_plus_cinq_car' => 'повече от 5 знака',
297
+    'info_plus_cinq_car_2' => '(повече от 5 знака)',
298
+    'info_plus_trois_car' => '(повече от 3 знака)',
299
+    'info_popularite' => 'популярност: @popularite@; посещения: @visites@',
300
+    'info_post_scriptum' => 'Постскриптум',
301
+    'info_post_scriptum_2' => 'Постскриптум:',
302
+    'info_pour' => 'за',
303
+    'info_preview_texte' => 'Възможно е да се прави предварителен преглед на сайта все едно, че всички статии и новини (които имат статус "изпратени") са вече публикувани. Да бъде ли даден достъп към тази функция на администраторите само, да бъде ли възможна за всички автори на сайта или да бъде изключена напълно?', # MODIF
304
+    'info_procedez_par_etape' => 'моля, продължете напред стъпка по стъпка',
305
+    'info_procedure_maj_version' => 'процедурата по обновяване трябва да се стартира,
306 306
  за да може базата данни да се адаптира към новата версия на СПИП.',
307
-	'info_ps' => 'П.С. ',
308
-	'info_publier' => 'публикуване',
309
-	'info_publies' => 'Вашите публикувани статии',
310
-	'info_question_accepter_visiteurs' => 'Ако шаблоните на сайта Ви позволяват посетителите да се регистират без да влизат в личната зона, активирайте следната опция:',
311
-	'info_question_inscription_nouveaux_redacteurs' => 'Позволявате ли регистрацията на нови редактори от
307
+    'info_ps' => 'П.С. ',
308
+    'info_publier' => 'публикуване',
309
+    'info_publies' => 'Вашите публикувани статии',
310
+    'info_question_accepter_visiteurs' => 'Ако шаблоните на сайта Ви позволяват посетителите да се регистират без да влизат в личната зона, активирайте следната опция:',
311
+    'info_question_inscription_nouveaux_redacteurs' => 'Позволявате ли регистрацията на нови редактори от
312 312
   публикувания сайт. Ако сте съгласни, посетителите трябва да се
313 313
   регистрират през автоматичната форма, за да имат достъп до личната зона и
314 314
   да предложат свои собствени статии. <blockquote><i>По време на регистрацията
@@ -317,208 +317,208 @@  discard block
 block discarded – undo
317 317
   доставчици спират съобщения, изпратени
318 318
   до техни сървъри: в този случай автоматичната регистрация
319 319
   не би могла да се осъществи.', # MODIF
320
-	'info_qui_edite' => '@nom_auteur_modif@ a travaillé sur ce contenu il y a @date_diff@ minutes', # MODIF
321
-	'info_racine_site' => 'Схема на сайта',
322
-	'info_recharger_page' => 'Моля, презаредете страницата след малко.',
323
-	'info_recherche_auteur_zero' => 'Няма намерени резултати за „@cherche_auteur@“.',
324
-	'info_recommencer' => 'Моля, опитайте отново.',
325
-	'info_redacteur_1' => 'Редактор',
326
-	'info_redacteur_2' => 'достъп до личната зона(<i>препоръчително</i>)',
327
-	'info_redacteurs' => 'Редактори',
328
-	'info_redaction_en_cours' => 'В ХОД Е ПИСАНЕ',
329
-	'info_redirection' => 'Пренасочване',
330
-	'info_refuses' => 'Вашите отхвърлени статии',
331
-	'info_reglage_ldap' => 'Опции: <b>Приспособяване на вписването чрез LDAP</b>',
332
-	'info_renvoi_article' => '<b>Пренасочване.</b> Статията се отнася към страница:',
333
-	'info_reserve_admin' => 'Този адрес може да се променя само от администратори.',
334
-	'info_restreindre_rubrique' => 'Забрана за управление на рубриката:',
335
-	'info_resultat_recherche' => 'Намерени резултати:',
336
-	'info_rubriques' => 'Рубрики',
337
-	'info_rubriques_02' => 'рубрики',
338
-	'info_rubriques_trouvees' => 'Намерени рубрики',
339
-	'info_sans_titre' => 'Без заглавие',
340
-	'info_selection_chemin_acces' => '<b>Изберете</b> по-долу път за достъп в директорията:',
341
-	'info_signatures' => 'подписи',
342
-	'info_site' => 'Сайт',
343
-	'info_site_2' => 'сайт:',
344
-	'info_site_min' => 'сайт',
345
-	'info_site_reference_2' => 'Свързан сайт',
346
-	'info_site_web' => 'ИНТЕРНЕТ САЙТ:', # MODIF
347
-	'info_sites' => 'сайтове',
348
-	'info_sites_lies_mot' => 'Свързани сайтове, асоциирани с ключовата дума',
349
-	'info_sites_proxy' => 'Използване на прокси',
350
-	'info_sites_trouves' => 'Намерени сайтове',
351
-	'info_sous_titre' => 'Подзаглавие:',
352
-	'info_statut_administrateur' => 'Администратор',
353
-	'info_statut_auteur' => 'Статус на автора:', # MODIF
354
-	'info_statut_auteur_a_confirmer' => 'Регистрация, предстояща за потвърждение',
355
-	'info_statut_auteur_autre' => 'Друг статус:',
356
-	'info_statut_redacteur' => 'Редактор',
357
-	'info_statut_utilisateurs_1' => 'Статус "по подразбиране" на вписаните потребители',
358
-	'info_statut_utilisateurs_2' => 'Изберете статус за хората, вписани в LDAP-директорията при свързването им за първи път. По-късно ще можете да променяте тази характеристика за всеки автор по отделно.',
359
-	'info_suivi_activite' => 'Дейности на редакторите',
360
-	'info_surtitre' => 'Челно заглавие:',
361
-	'info_syndication_integrale_1' => 'Сайтът Ви предлага файлове за обединение (вж “<a href="@url@">@titre@</a>“).',
362
-	'info_syndication_integrale_2' => 'Желаете ли да изпратите цели статии или само резюме от няколко стотин знака?',
363
-	'info_taille_maximale_vignette' => 'Максимален размер на винетките, който е генериран от системата:',
364
-	'info_terminer_installation' => 'Сега можете да приключите с процеса по стандартна инсталация.',
365
-	'info_texte' => 'Текст',
366
-	'info_texte_explicatif' => 'Обяснителен текст',
367
-	'info_texte_long' => '(текстът е прекалено дълъг: той ще се появи в няколко части, които ще бъдат събрани след одобрението.)',
368
-	'info_texte_message' => 'Текст на съобщението:', # MODIF
369
-	'info_texte_message_02' => 'Текст на съобщение',
370
-	'info_titre' => 'Заглавие:',
371
-	'info_total' => 'общо:',
372
-	'info_tous_articles_en_redaction' => 'Всички статии в процес на обработка',
373
-	'info_tous_articles_presents' => 'Всички статии в рубриката',
374
-	'info_tous_les' => 'всички:',
375
-	'info_tout_site' => 'Целият сайт',
376
-	'info_tout_site2' => 'Статията не е преведена на дадения език.',
377
-	'info_tout_site3' => 'Статията е преведена на дадения език, но след това са направени промени в основната статия. Преводът изисква актуализация.',
378
-	'info_tout_site4' => 'Статията е преведена на дадения език, а преводът - актуализиран.',
379
-	'info_tout_site5' => 'Оригинална статия.',
380
-	'info_tout_site6' => '<b>Предупреждение:</b> показани са само оригинални статии.
320
+    'info_qui_edite' => '@nom_auteur_modif@ a travaillé sur ce contenu il y a @date_diff@ minutes', # MODIF
321
+    'info_racine_site' => 'Схема на сайта',
322
+    'info_recharger_page' => 'Моля, презаредете страницата след малко.',
323
+    'info_recherche_auteur_zero' => 'Няма намерени резултати за „@cherche_auteur@“.',
324
+    'info_recommencer' => 'Моля, опитайте отново.',
325
+    'info_redacteur_1' => 'Редактор',
326
+    'info_redacteur_2' => 'достъп до личната зона(<i>препоръчително</i>)',
327
+    'info_redacteurs' => 'Редактори',
328
+    'info_redaction_en_cours' => 'В ХОД Е ПИСАНЕ',
329
+    'info_redirection' => 'Пренасочване',
330
+    'info_refuses' => 'Вашите отхвърлени статии',
331
+    'info_reglage_ldap' => 'Опции: <b>Приспособяване на вписването чрез LDAP</b>',
332
+    'info_renvoi_article' => '<b>Пренасочване.</b> Статията се отнася към страница:',
333
+    'info_reserve_admin' => 'Този адрес може да се променя само от администратори.',
334
+    'info_restreindre_rubrique' => 'Забрана за управление на рубриката:',
335
+    'info_resultat_recherche' => 'Намерени резултати:',
336
+    'info_rubriques' => 'Рубрики',
337
+    'info_rubriques_02' => 'рубрики',
338
+    'info_rubriques_trouvees' => 'Намерени рубрики',
339
+    'info_sans_titre' => 'Без заглавие',
340
+    'info_selection_chemin_acces' => '<b>Изберете</b> по-долу път за достъп в директорията:',
341
+    'info_signatures' => 'подписи',
342
+    'info_site' => 'Сайт',
343
+    'info_site_2' => 'сайт:',
344
+    'info_site_min' => 'сайт',
345
+    'info_site_reference_2' => 'Свързан сайт',
346
+    'info_site_web' => 'ИНТЕРНЕТ САЙТ:', # MODIF
347
+    'info_sites' => 'сайтове',
348
+    'info_sites_lies_mot' => 'Свързани сайтове, асоциирани с ключовата дума',
349
+    'info_sites_proxy' => 'Използване на прокси',
350
+    'info_sites_trouves' => 'Намерени сайтове',
351
+    'info_sous_titre' => 'Подзаглавие:',
352
+    'info_statut_administrateur' => 'Администратор',
353
+    'info_statut_auteur' => 'Статус на автора:', # MODIF
354
+    'info_statut_auteur_a_confirmer' => 'Регистрация, предстояща за потвърждение',
355
+    'info_statut_auteur_autre' => 'Друг статус:',
356
+    'info_statut_redacteur' => 'Редактор',
357
+    'info_statut_utilisateurs_1' => 'Статус "по подразбиране" на вписаните потребители',
358
+    'info_statut_utilisateurs_2' => 'Изберете статус за хората, вписани в LDAP-директорията при свързването им за първи път. По-късно ще можете да променяте тази характеристика за всеки автор по отделно.',
359
+    'info_suivi_activite' => 'Дейности на редакторите',
360
+    'info_surtitre' => 'Челно заглавие:',
361
+    'info_syndication_integrale_1' => 'Сайтът Ви предлага файлове за обединение (вж “<a href="@url@">@titre@</a>“).',
362
+    'info_syndication_integrale_2' => 'Желаете ли да изпратите цели статии или само резюме от няколко стотин знака?',
363
+    'info_taille_maximale_vignette' => 'Максимален размер на винетките, който е генериран от системата:',
364
+    'info_terminer_installation' => 'Сега можете да приключите с процеса по стандартна инсталация.',
365
+    'info_texte' => 'Текст',
366
+    'info_texte_explicatif' => 'Обяснителен текст',
367
+    'info_texte_long' => '(текстът е прекалено дълъг: той ще се появи в няколко части, които ще бъдат събрани след одобрението.)',
368
+    'info_texte_message' => 'Текст на съобщението:', # MODIF
369
+    'info_texte_message_02' => 'Текст на съобщение',
370
+    'info_titre' => 'Заглавие:',
371
+    'info_total' => 'общо:',
372
+    'info_tous_articles_en_redaction' => 'Всички статии в процес на обработка',
373
+    'info_tous_articles_presents' => 'Всички статии в рубриката',
374
+    'info_tous_les' => 'всички:',
375
+    'info_tout_site' => 'Целият сайт',
376
+    'info_tout_site2' => 'Статията не е преведена на дадения език.',
377
+    'info_tout_site3' => 'Статията е преведена на дадения език, но след това са направени промени в основната статия. Преводът изисква актуализация.',
378
+    'info_tout_site4' => 'Статията е преведена на дадения език, а преводът - актуализиран.',
379
+    'info_tout_site5' => 'Оригинална статия.',
380
+    'info_tout_site6' => '<b>Предупреждение:</b> показани са само оригинални статии.
381 381
 Преводите са свързани с оригинала в цвят, посочващ техния статус:',
382
-	'info_traductions' => 'Преводи',
383
-	'info_travail_colaboratif' => 'Съвместна работа по статии',
384
-	'info_un_article' => 'една статия,',
385
-	'info_un_site' => 'сайт,',
386
-	'info_une_rubrique' => 'рубрика,',
387
-	'info_une_rubrique_02' => '1 рубрика',
388
-	'info_url' => 'URL:',
389
-	'info_urlref' => 'Препратка в хипертекст:',
390
-	'info_utilisation_spip' => 'СПИП вече е готов за използване.',
391
-	'info_visites_par_mois' => 'Месечен дисплей:',
392
-	'info_visiteur_1' => 'Посетител',
393
-	'info_visiteur_2' => 'публичен сайт',
394
-	'info_visiteurs' => 'Посетители',
395
-	'info_visiteurs_02' => 'Посетители на публичния сайт',
396
-	'install_echec_annonce' => 'Инсталацията Ви вероятно няма да проработи или сайтът, който правите ще даде лош резултат...',
397
-	'install_extension_mbstring' => 'СПИП не работи с:',
398
-	'install_extension_php_obligatoire' => 'СПИП изисква разширение от типа php:',
399
-	'install_select_langue' => 'Изберете език и след това натиснете бутон „по-нататък“, за да стартирате процедурата по инсталацията.',
400
-	'intem_redacteur' => 'редактор',
401
-	'item_accepter_inscriptions' => 'Позволяване на регистрации',
402
-	'item_activer_messages_avertissement' => 'Активиране на предупредителни съобщения',
403
-	'item_administrateur_2' => 'администратор',
404
-	'item_afficher_calendrier' => 'Показване в календара',
405
-	'item_autoriser_syndication_integrale' => 'Включване на цели статии във файловете за обединяване',
406
-	'item_choix_administrateurs' => 'администратори',
407
-	'item_choix_generation_miniature' => 'Автоматично генериране на умалени образи.',
408
-	'item_choix_non_generation_miniature' => 'Без генериране на умалени образи.',
409
-	'item_choix_redacteurs' => 'редактори',
410
-	'item_choix_visiteurs' => 'посетители на публичния сайт',
411
-	'item_creer_fichiers_authent' => 'Създаване на файлове от типа .htpasswd',
412
-	'item_login' => 'Потребителско име',
413
-	'item_mots_cles_association_articles' => 'статиите',
414
-	'item_mots_cles_association_rubriques' => 'рубриките',
415
-	'item_mots_cles_association_sites' => 'свързаните или обединени сайтове.',
416
-	'item_non' => 'Не',
417
-	'item_non_accepter_inscriptions' => 'Забрана на регистрации',
418
-	'item_non_activer_messages_avertissement' => 'Без предупредителни съобщения',
419
-	'item_non_afficher_calendrier' => 'Без показване в календара',
420
-	'item_non_autoriser_syndication_integrale' => 'Изпращане на резюме',
421
-	'item_non_creer_fichiers_authent' => 'Забрана за създаване на файловете',
422
-	'item_non_publier_articles' => 'Забраняване публикуването на статии преди техните дати на публикуване.',
423
-	'item_nouvel_auteur' => 'Нов автор',
424
-	'item_nouvelle_rubrique' => 'Нова рубрика',
425
-	'item_oui' => 'Да',
426
-	'item_publier_articles' => 'Публикуване на статиите независимо от техните дати на публикуване.',
427
-	'item_reponse_article' => 'Отговор на статията',
428
-	'item_visiteur' => 'посетител',
382
+    'info_traductions' => 'Преводи',
383
+    'info_travail_colaboratif' => 'Съвместна работа по статии',
384
+    'info_un_article' => 'една статия,',
385
+    'info_un_site' => 'сайт,',
386
+    'info_une_rubrique' => 'рубрика,',
387
+    'info_une_rubrique_02' => '1 рубрика',
388
+    'info_url' => 'URL:',
389
+    'info_urlref' => 'Препратка в хипертекст:',
390
+    'info_utilisation_spip' => 'СПИП вече е готов за използване.',
391
+    'info_visites_par_mois' => 'Месечен дисплей:',
392
+    'info_visiteur_1' => 'Посетител',
393
+    'info_visiteur_2' => 'публичен сайт',
394
+    'info_visiteurs' => 'Посетители',
395
+    'info_visiteurs_02' => 'Посетители на публичния сайт',
396
+    'install_echec_annonce' => 'Инсталацията Ви вероятно няма да проработи или сайтът, който правите ще даде лош резултат...',
397
+    'install_extension_mbstring' => 'СПИП не работи с:',
398
+    'install_extension_php_obligatoire' => 'СПИП изисква разширение от типа php:',
399
+    'install_select_langue' => 'Изберете език и след това натиснете бутон „по-нататък“, за да стартирате процедурата по инсталацията.',
400
+    'intem_redacteur' => 'редактор',
401
+    'item_accepter_inscriptions' => 'Позволяване на регистрации',
402
+    'item_activer_messages_avertissement' => 'Активиране на предупредителни съобщения',
403
+    'item_administrateur_2' => 'администратор',
404
+    'item_afficher_calendrier' => 'Показване в календара',
405
+    'item_autoriser_syndication_integrale' => 'Включване на цели статии във файловете за обединяване',
406
+    'item_choix_administrateurs' => 'администратори',
407
+    'item_choix_generation_miniature' => 'Автоматично генериране на умалени образи.',
408
+    'item_choix_non_generation_miniature' => 'Без генериране на умалени образи.',
409
+    'item_choix_redacteurs' => 'редактори',
410
+    'item_choix_visiteurs' => 'посетители на публичния сайт',
411
+    'item_creer_fichiers_authent' => 'Създаване на файлове от типа .htpasswd',
412
+    'item_login' => 'Потребителско име',
413
+    'item_mots_cles_association_articles' => 'статиите',
414
+    'item_mots_cles_association_rubriques' => 'рубриките',
415
+    'item_mots_cles_association_sites' => 'свързаните или обединени сайтове.',
416
+    'item_non' => 'Не',
417
+    'item_non_accepter_inscriptions' => 'Забрана на регистрации',
418
+    'item_non_activer_messages_avertissement' => 'Без предупредителни съобщения',
419
+    'item_non_afficher_calendrier' => 'Без показване в календара',
420
+    'item_non_autoriser_syndication_integrale' => 'Изпращане на резюме',
421
+    'item_non_creer_fichiers_authent' => 'Забрана за създаване на файловете',
422
+    'item_non_publier_articles' => 'Забраняване публикуването на статии преди техните дати на публикуване.',
423
+    'item_nouvel_auteur' => 'Нов автор',
424
+    'item_nouvelle_rubrique' => 'Нова рубрика',
425
+    'item_oui' => 'Да',
426
+    'item_publier_articles' => 'Публикуване на статиите независимо от техните дати на публикуване.',
427
+    'item_reponse_article' => 'Отговор на статията',
428
+    'item_visiteur' => 'посетител',
429 429
 
430
-	// J
431
-	'jour_non_connu_nc' => 'непознат',
430
+    // J
431
+    'jour_non_connu_nc' => 'непознат',
432 432
 
433
-	// L
434
-	'lien_ajouter_auteur' => 'Добавяне на автора',
435
-	'lien_email' => 'Електронен адрес',
436
-	'lien_nom_site' => 'ИМЕ НА САЙТА:',
437
-	'lien_retirer_auteur' => 'Премахване на автор',
438
-	'lien_site' => 'сайт',
439
-	'lien_tout_deplier' => 'Разширяване на всички',
440
-	'lien_tout_replier' => 'Разтваряне на всички',
441
-	'lien_trier_nom' => 'Подреждане по име',
442
-	'lien_trier_nombre_articles' => 'Подреждане по номер на статията',
443
-	'lien_trier_statut' => 'Подреждане по статус',
444
-	'lien_voir_en_ligne' => 'ИЗГЛЕД НА САЙТА:',
445
-	'logo_article' => 'ЛОГО НА СТАТИЯТА', # MODIF
446
-	'logo_auteur' => 'ЛОГО НА АВТОРА', # MODIF
447
-	'logo_rubrique' => 'ЛОГО НА РУБРИКАТА', # MODIF
448
-	'logo_site' => 'ЛОГО НА САЙТА', # MODIF
449
-	'logo_standard_rubrique' => 'СТАНДАРТНО ЛОГО ЗА РУБРИКИ', # MODIF
450
-	'logo_survol' => 'АЛТЕРНАТИВНО ЛОГО', # MODIF
433
+    // L
434
+    'lien_ajouter_auteur' => 'Добавяне на автора',
435
+    'lien_email' => 'Електронен адрес',
436
+    'lien_nom_site' => 'ИМЕ НА САЙТА:',
437
+    'lien_retirer_auteur' => 'Премахване на автор',
438
+    'lien_site' => 'сайт',
439
+    'lien_tout_deplier' => 'Разширяване на всички',
440
+    'lien_tout_replier' => 'Разтваряне на всички',
441
+    'lien_trier_nom' => 'Подреждане по име',
442
+    'lien_trier_nombre_articles' => 'Подреждане по номер на статията',
443
+    'lien_trier_statut' => 'Подреждане по статус',
444
+    'lien_voir_en_ligne' => 'ИЗГЛЕД НА САЙТА:',
445
+    'logo_article' => 'ЛОГО НА СТАТИЯТА', # MODIF
446
+    'logo_auteur' => 'ЛОГО НА АВТОРА', # MODIF
447
+    'logo_rubrique' => 'ЛОГО НА РУБРИКАТА', # MODIF
448
+    'logo_site' => 'ЛОГО НА САЙТА', # MODIF
449
+    'logo_standard_rubrique' => 'СТАНДАРТНО ЛОГО ЗА РУБРИКИ', # MODIF
450
+    'logo_survol' => 'АЛТЕРНАТИВНО ЛОГО', # MODIF
451 451
 
452
-	// M
453
-	'menu_aide_installation_choix_base' => 'Избор на база данни',
454
-	'module_fichier_langue' => 'Езиков файл',
455
-	'module_raccourci' => 'Кратка команда',
456
-	'module_texte_affiche' => 'Показан текст',
457
-	'module_texte_explicatif' => 'Можете да впишете следните кратки команди в шаблоните на сайта си. Те ще бъдат автоматично преведени на различни езици, за които има езиков файл.',
458
-	'module_texte_traduction' => 'Езиковият файл ,, @module@ ’’ е достъпен на:',
459
-	'mois_non_connu' => 'непознат',
452
+    // M
453
+    'menu_aide_installation_choix_base' => 'Избор на база данни',
454
+    'module_fichier_langue' => 'Езиков файл',
455
+    'module_raccourci' => 'Кратка команда',
456
+    'module_texte_affiche' => 'Показан текст',
457
+    'module_texte_explicatif' => 'Можете да впишете следните кратки команди в шаблоните на сайта си. Те ще бъдат автоматично преведени на различни езици, за които има езиков файл.',
458
+    'module_texte_traduction' => 'Езиковият файл ,, @module@ ’’ е достъпен на:',
459
+    'mois_non_connu' => 'непознат',
460 460
 
461
-	// O
462
-	'onglet_repartition_actuelle' => 'сега',
461
+    // O
462
+    'onglet_repartition_actuelle' => 'сега',
463 463
 
464
-	// P
465
-	'plugin_etat_developpement' => 'в развитие',
466
-	'plugin_etat_experimental' => 'експериментален',
467
-	'plugin_etat_stable' => 'стабилен',
468
-	'plugin_etat_test' => 'в процес на тестване',
469
-	'plugins_liste' => 'Списък с плъгини',
464
+    // P
465
+    'plugin_etat_developpement' => 'в развитие',
466
+    'plugin_etat_experimental' => 'експериментален',
467
+    'plugin_etat_stable' => 'стабилен',
468
+    'plugin_etat_test' => 'в процес на тестване',
469
+    'plugins_liste' => 'Списък с плъгини',
470 470
 
471
-	// R
472
-	'repertoire_plugins' => 'Директория:',
473
-	'required' => '[Задължително]', # MODIF
471
+    // R
472
+    'repertoire_plugins' => 'Директория:',
473
+    'required' => '[Задължително]', # MODIF
474 474
 
475
-	// S
476
-	'statut_admin_restreint' => '(ограничен администратор)', # MODIF
475
+    // S
476
+    'statut_admin_restreint' => '(ограничен администратор)', # MODIF
477 477
 
478
-	// T
479
-	'taille_cache_image' => 'Изображенията, изчислени автоматично от СПИП (умалени изображения, заглавия, преобразени в графики, математически формули в TeX формат и др.) заемат общо @taille@ в директорията @dir@.',
480
-	'taille_cache_infinie' => 'Този сайт няма фиксиран лимит за размера на <code>CACHE/</code> директорията.',
481
-	'taille_cache_maxi' => 'СПИП се опитва да намали размера на данните в  <code>CACHE/</code> директорията до около  <b>@octets@</b>.',
482
-	'taille_cache_octets' => 'Размерът на кеш-паметта в момента е @octets@.', # MODIF
483
-	'taille_cache_vide' => 'Кеш-паметта е празна.',
484
-	'taille_repertoire_cache' => 'Размер на кеш-паметта в момента',
485
-	'text_article_propose_publication' => 'Изпратена е статия със заявка за публикуване. Не се колебайте да дадете мнението си за нея във форума, който е прикрепен към нея (най-долу на страницата).', # MODIF
486
-	'texte_acces_ldap_anonyme_1' => 'Някои LDAP-сървъри не позволяват анонимен достъп. В такива случаи, за да можете да правите справка в директорията, трябва да използвате началното си потребителско име за достъп. Въпреки това, в повечето случаи можете да оставяте следните полета празни. ',
487
-	'texte_admin_effacer_01' => 'Тази команда изтрива <i>цялото</i> съдържание в базата данни,
478
+    // T
479
+    'taille_cache_image' => 'Изображенията, изчислени автоматично от СПИП (умалени изображения, заглавия, преобразени в графики, математически формули в TeX формат и др.) заемат общо @taille@ в директорията @dir@.',
480
+    'taille_cache_infinie' => 'Този сайт няма фиксиран лимит за размера на <code>CACHE/</code> директорията.',
481
+    'taille_cache_maxi' => 'СПИП се опитва да намали размера на данните в  <code>CACHE/</code> директорията до около  <b>@octets@</b>.',
482
+    'taille_cache_octets' => 'Размерът на кеш-паметта в момента е @octets@.', # MODIF
483
+    'taille_cache_vide' => 'Кеш-паметта е празна.',
484
+    'taille_repertoire_cache' => 'Размер на кеш-паметта в момента',
485
+    'text_article_propose_publication' => 'Изпратена е статия със заявка за публикуване. Не се колебайте да дадете мнението си за нея във форума, който е прикрепен към нея (най-долу на страницата).', # MODIF
486
+    'texte_acces_ldap_anonyme_1' => 'Някои LDAP-сървъри не позволяват анонимен достъп. В такива случаи, за да можете да правите справка в директорията, трябва да използвате началното си потребителско име за достъп. Въпреки това, в повечето случаи можете да оставяте следните полета празни. ',
487
+    'texte_admin_effacer_01' => 'Тази команда изтрива <i>цялото</i> съдържание в базата данни,
488 488
 включително <i>всички</i> параметри за достъп за редактори и администратори. След нейното изпълнение, трябва
489 489
 да се преинсталира СПИП, за да се създаде нова база данни и първи администраторски достъп.',
490
-	'texte_adresse_annuaire_1' => '( Ако директорията Ви е инсталирана на същата машина, на която и Интернет сайта, вероятно е «localhost».)',
491
-	'texte_ajout_auteur' => 'Следният автор бе добавен към статията:',
492
-	'texte_annuaire_ldap_1' => 'Ако разполагате с достъп до (LDAP) директория, можете да я използвате, за да вписвате автоматично потребители в СПИП.',
493
-	'texte_article_statut' => 'Статията е:',
494
-	'texte_article_virtuel' => 'Виртуална статия',
495
-	'texte_article_virtuel_reference' => '<b>Виртуална статия:</b> свързана статия на Вашия СПИП сайт, която се пренасочва към друг URL адрес. За да премахнете пренасочването, изтрийте горепосочения URL.',
496
-	'texte_aucun_resultat_auteur' => 'Няма намерен разултат за „@cherche_auteur@“.',
497
-	'texte_auteur_messagerie' => 'Сайт може продължително да следи списъка от свързани редактори, което позволява изпращането та съобщения в реално време (ако съобщението е забранено по-горе, тогава целият списък от редактори е забранен). Вие можете да решите да не се появявате в този списък (т.е. да сте „невидим“ за останалите потребители).',
498
-	'texte_auteurs' => 'АВТОРИТЕ',
499
-	'texte_choix_base_1' => 'Изберете база данни:',
500
-	'texte_choix_base_2' => 'Сървърът SQL съдържа няколко бази данни.',
501
-	'texte_choix_base_3' => '<b>Изберете</b> по-долу това, което доставчикът Ви e разрешил:',
502
-	'texte_compte_element' => '@count@ елемент',
503
-	'texte_compte_elements' => '@count@ елементи',
504
-	'texte_connexion_mysql' => 'Погледнете информацията, предоставена от доставчика Ви: ако доставчикът ви поддържа SQL, трябва да са дадени кодовете за връзка със сървъра SQL.', # MODIF
505
-	'texte_contenu_article' => '(Съдържание на статията с няколко думи.)',
506
-	'texte_contenu_articles' => 'Въз основа на оформлението на сайта Ви, може да решите
490
+    'texte_adresse_annuaire_1' => '( Ако директорията Ви е инсталирана на същата машина, на която и Интернет сайта, вероятно е «localhost».)',
491
+    'texte_ajout_auteur' => 'Следният автор бе добавен към статията:',
492
+    'texte_annuaire_ldap_1' => 'Ако разполагате с достъп до (LDAP) директория, можете да я използвате, за да вписвате автоматично потребители в СПИП.',
493
+    'texte_article_statut' => 'Статията е:',
494
+    'texte_article_virtuel' => 'Виртуална статия',
495
+    'texte_article_virtuel_reference' => '<b>Виртуална статия:</b> свързана статия на Вашия СПИП сайт, която се пренасочва към друг URL адрес. За да премахнете пренасочването, изтрийте горепосочения URL.',
496
+    'texte_aucun_resultat_auteur' => 'Няма намерен разултат за „@cherche_auteur@“.',
497
+    'texte_auteur_messagerie' => 'Сайт може продължително да следи списъка от свързани редактори, което позволява изпращането та съобщения в реално време (ако съобщението е забранено по-горе, тогава целият списък от редактори е забранен). Вие можете да решите да не се появявате в този списък (т.е. да сте „невидим“ за останалите потребители).',
498
+    'texte_auteurs' => 'АВТОРИТЕ',
499
+    'texte_choix_base_1' => 'Изберете база данни:',
500
+    'texte_choix_base_2' => 'Сървърът SQL съдържа няколко бази данни.',
501
+    'texte_choix_base_3' => '<b>Изберете</b> по-долу това, което доставчикът Ви e разрешил:',
502
+    'texte_compte_element' => '@count@ елемент',
503
+    'texte_compte_elements' => '@count@ елементи',
504
+    'texte_connexion_mysql' => 'Погледнете информацията, предоставена от доставчика Ви: ако доставчикът ви поддържа SQL, трябва да са дадени кодовете за връзка със сървъра SQL.', # MODIF
505
+    'texte_contenu_article' => '(Съдържание на статията с няколко думи.)',
506
+    'texte_contenu_articles' => 'Въз основа на оформлението на сайта Ви, може да решите
507 507
   да не използвате някои елементи на статиите.
508 508
   Използвайте този списък, за да изберете кои елементи искате да направите активни.',
509
-	'texte_crash_base' => 'Ако Вашата база данни
509
+    'texte_crash_base' => 'Ако Вашата база данни
510 510
    блокира, можете да се опитате да я поправите
511 511
    автоматично.',
512
-	'texte_creer_rubrique' => 'Преди да пишете статии,<br /> трябва да създадете рубрика.',
513
-	'texte_date_creation_article' => 'ДАТА НА СЪЗДАВАНЕ НА СТАТИЯТА:',
514
-	'texte_date_publication_anterieure' => 'Дата на предишно публикуване:',
515
-	'texte_date_publication_anterieure_nonaffichee' => 'Скриване датата на предишно публикуване.',
516
-	'texte_date_publication_article' => 'ДАТА НА ПУБЛИКУВАНЕ В ИНТЕРНЕТ:',
517
-	'texte_descriptif_rapide' => 'Кратко описание',
518
-	'texte_effacer_base' => 'Изтриване на базата данни СПИП',
519
-	'texte_en_cours_validation' => 'Изпратени са следните статии със заявка за публикуване. Не се колебайте да дадете мнението си за тях във форума, който е прикрепен към тях. ', # MODIF
520
-	'texte_enrichir_mise_a_jour' => 'Можете да обогатите външния вид на текста като използвате «Типографски кратки команди».',
521
-	'texte_fichier_authent' => '<b>Да създаде ли СПИП специални  <tt>.htpasswd</tt>
512
+    'texte_creer_rubrique' => 'Преди да пишете статии,<br /> трябва да създадете рубрика.',
513
+    'texte_date_creation_article' => 'ДАТА НА СЪЗДАВАНЕ НА СТАТИЯТА:',
514
+    'texte_date_publication_anterieure' => 'Дата на предишно публикуване:',
515
+    'texte_date_publication_anterieure_nonaffichee' => 'Скриване датата на предишно публикуване.',
516
+    'texte_date_publication_article' => 'ДАТА НА ПУБЛИКУВАНЕ В ИНТЕРНЕТ:',
517
+    'texte_descriptif_rapide' => 'Кратко описание',
518
+    'texte_effacer_base' => 'Изтриване на базата данни СПИП',
519
+    'texte_en_cours_validation' => 'Изпратени са следните статии със заявка за публикуване. Не се колебайте да дадете мнението си за тях във форума, който е прикрепен към тях. ', # MODIF
520
+    'texte_enrichir_mise_a_jour' => 'Можете да обогатите външния вид на текста като използвате «Типографски кратки команди».',
521
+    'texte_fichier_authent' => '<b>Да създаде ли СПИП специални  <tt>.htpasswd</tt>
522 522
   и <tt>.htpasswd-admin</tt> файлове в директорията@dossier@?</b><p>
523 523
   Тези файлове ще бъдат използвани за ограничаване достъпа на авторите
524 524
   и администраторите до други части на сайта
@@ -526,44 +526,44 @@  discard block
 block discarded – undo
526 526
   Ако не сте използвали такива файлове преди, можете да осигурите възможност
527 527
   за стойност "по подразбиране" (без 
528 528
   да се създават файлове).', # MODIF
529
-	'texte_informations_personnelles_1' => 'Системата сега ще създаде личен достъп до сайта. ',
530
-	'texte_informations_personnelles_2' => '(Забележка: ако това е преинсталация и достъпът Ви все още е активен, можете', # MODIF
531
-	'texte_introductif_article' => '(Въведение към статията.)',
532
-	'texte_jeu_caractere' => 'Препоръчваме да използвате на сайта универсална кодировка на знаците от азбуката (<tt>utf-8</tt>), за да може да се показва под формата на текст на всякакъв език. Никой от настоящите Интернет - навигатори нямат проблеми с нея. ',
533
-	'texte_jeu_caractere_3' => 'Настоящата кодировка на сайта е:',
534
-	'texte_jeu_caractere_4' => 'Ако това не отговаря на ситуацията, която имате с данните си (например след възстановяване на базата от данни от архива) или ако <em>правите настройка на сайта си в момента</em> и желаете да използвате различна кодировка на символите, моля да обозначите кодировката тук:',
535
-	'texte_login_ldap_1' => '(Оставете празно поле за потребител за анонимен достъп или попълнете пълния път за достъп, например «<tt>uid=smith, ou=users, dc=my-domain, dc=com</tt>».)',
536
-	'texte_login_precaution' => 'Внимание! Това е потребителското име, с което в момента сте се свързали.
529
+    'texte_informations_personnelles_1' => 'Системата сега ще създаде личен достъп до сайта. ',
530
+    'texte_informations_personnelles_2' => '(Забележка: ако това е преинсталация и достъпът Ви все още е активен, можете', # MODIF
531
+    'texte_introductif_article' => '(Въведение към статията.)',
532
+    'texte_jeu_caractere' => 'Препоръчваме да използвате на сайта универсална кодировка на знаците от азбуката (<tt>utf-8</tt>), за да може да се показва под формата на текст на всякакъв език. Никой от настоящите Интернет - навигатори нямат проблеми с нея. ',
533
+    'texte_jeu_caractere_3' => 'Настоящата кодировка на сайта е:',
534
+    'texte_jeu_caractere_4' => 'Ако това не отговаря на ситуацията, която имате с данните си (например след възстановяване на базата от данни от архива) или ако <em>правите настройка на сайта си в момента</em> и желаете да използвате различна кодировка на символите, моля да обозначите кодировката тук:',
535
+    'texte_login_ldap_1' => '(Оставете празно поле за потребител за анонимен достъп или попълнете пълния път за достъп, например «<tt>uid=smith, ou=users, dc=my-domain, dc=com</tt>».)',
536
+    'texte_login_precaution' => 'Внимание! Това е потребителското име, с което в момента сте се свързали.
537 537
  Предпазливо използвайте формата ...',
538
-	'texte_mise_a_niveau_base_1' => 'СПИП файловете са актуализирани.
538
+    'texte_mise_a_niveau_base_1' => 'СПИП файловете са актуализирани.
539 539
  Сега остава да обновите базата данни на
540 540
  сайта.',
541
-	'texte_modifier_article' => 'Промяна на статията:',
542
-	'texte_multilinguisme' => 'Ако желаете да боравите със статии на няколко езика с усложнена навигация, можете да добавите меню "избор на език" към статиите и/или към рубриките, в зависимост от организацията на сайта Ви.', # MODIF
543
-	'texte_multilinguisme_trad' => 'Също така, можете да активирате система за управление на препратките към различните преводи на статията.', # MODIF
544
-	'texte_non_compresse' => '<i>uncompressed</i> (сървърът ви не поддрържа това свойство)',
545
-	'texte_nouvelle_version_spip_1' => 'Току-що инсталирахте нова версия на СПИП.',
546
-	'texte_nouvelle_version_spip_2' => 'Тази нова версия налага по-сериозна от обикновената актуализация. Ако сте администратор на сайта, изтрийте файла <tt>inc_connect.php3</tt> от директория <tt>ecrire</tt> и стартирайте отново инсталацията, с цел да актуализирате параметрите на базата данни за връзка. <p>(NB: ако сте забравили параметрите на базата данни за връзка, погледнете следния файл <tt>inc_connect.php3</tt> преди да го изтриете).', # MODIF
547
-	'texte_operation_echec' => 'Върнете се на предишната страница, за да изберете друга база или да създадете нова. Потвърдете информацията, изпратена от Вашия доставчик. ',
548
-	'texte_plus_trois_car' => 'повече от 3 знака',
549
-	'texte_plusieurs_articles' => 'Бяха намерени няколко автора за „@cherche_auteur@“:',
550
-	'texte_port_annuaire' => '(Обичайната стойност е подходяща като цяло.)',
551
-	'texte_presente_plugin' => 'На тази страница са указани наличните на сайта плъгини. Активирайте тези от тях, които Ви трябват, чрез отбелязване в съответната кутийка.',
552
-	'texte_proposer_publication' => 'Когато напишете статията,<br /> можете да я изпратите за публикуване.',
553
-	'texte_proxy' => 'В някои случаи (интранет, защитени мрежи и др.),
541
+    'texte_modifier_article' => 'Промяна на статията:',
542
+    'texte_multilinguisme' => 'Ако желаете да боравите със статии на няколко езика с усложнена навигация, можете да добавите меню "избор на език" към статиите и/или към рубриките, в зависимост от организацията на сайта Ви.', # MODIF
543
+    'texte_multilinguisme_trad' => 'Също така, можете да активирате система за управление на препратките към различните преводи на статията.', # MODIF
544
+    'texte_non_compresse' => '<i>uncompressed</i> (сървърът ви не поддрържа това свойство)',
545
+    'texte_nouvelle_version_spip_1' => 'Току-що инсталирахте нова версия на СПИП.',
546
+    'texte_nouvelle_version_spip_2' => 'Тази нова версия налага по-сериозна от обикновената актуализация. Ако сте администратор на сайта, изтрийте файла <tt>inc_connect.php3</tt> от директория <tt>ecrire</tt> и стартирайте отново инсталацията, с цел да актуализирате параметрите на базата данни за връзка. <p>(NB: ако сте забравили параметрите на базата данни за връзка, погледнете следния файл <tt>inc_connect.php3</tt> преди да го изтриете).', # MODIF
547
+    'texte_operation_echec' => 'Върнете се на предишната страница, за да изберете друга база или да създадете нова. Потвърдете информацията, изпратена от Вашия доставчик. ',
548
+    'texte_plus_trois_car' => 'повече от 3 знака',
549
+    'texte_plusieurs_articles' => 'Бяха намерени няколко автора за „@cherche_auteur@“:',
550
+    'texte_port_annuaire' => '(Обичайната стойност е подходяща като цяло.)',
551
+    'texte_presente_plugin' => 'На тази страница са указани наличните на сайта плъгини. Активирайте тези от тях, които Ви трябват, чрез отбелязване в съответната кутийка.',
552
+    'texte_proposer_publication' => 'Когато напишете статията,<br /> можете да я изпратите за публикуване.',
553
+    'texte_proxy' => 'В някои случаи (интранет, защитени мрежи и др.),
554 554
   е нужно да се използва <i>HTTP прокси</i>, за да се достигне до обединените сайтове.
555 555
   Ако има прокси, впишете адрес му отдолу по следния начин
556 556
   <tt><html>http://proxy:8080</html></tt>. По принцип,
557 557
   това поле се оставя празно.',
558
-	'texte_publication_articles_post_dates' => 'Какво би трябвало да направи СПИП във връзка със статии,
558
+    'texte_publication_articles_post_dates' => 'Какво би трябвало да направи СПИП във връзка със статии,
559 559
   чиято публикация е зададена
560 560
   за бъдеща дата?',
561
-	'texte_rappel_selection_champs' => '[Не забравяйте да изберете правилното поле.]',
562
-	'texte_recalcul_page' => 'Ако желаете да
561
+    'texte_rappel_selection_champs' => '[Не забравяйте да изберете правилното поле.]',
562
+    'texte_recalcul_page' => 'Ако желаете да
563 563
 презаредите само една страница, по-добре направете това от публичната зона, като използвате « бутона "Презареждане" ».',
564
-	'texte_recuperer_base' => 'Поправка на базата данни',
565
-	'texte_reference_mais_redirige' => 'свързана статия на Вашия СПИП сайт, но пренасочена към друг URL адрес.',
566
-	'texte_requetes_echouent' => '<b>Когато някои SQL справки
564
+    'texte_recuperer_base' => 'Поправка на базата данни',
565
+    'texte_reference_mais_redirige' => 'свързана статия на Вашия СПИП сайт, но пренасочена към друг URL адрес.',
566
+    'texte_requetes_echouent' => '<b>Когато някои SQL справки
567 567
   системно и без налична причина заочнат да се развалят, възможно е
568 568
   базата данни сама да
569 569
   го прави.</b>
@@ -574,7 +574,7 @@  discard block
 block discarded – undo
574 574
   указания за това, което е развалено.
575 575
   <p>Ако проблемът все още е налице, обадете се
576 576
   на Вашия хост.', # MODIF
577
-	'texte_selection_langue_principale' => 'Посочете по-долу „основният език“ на сайта. За щастие, този избор не ограничава статиите Ви да бъдат написани на избран от Вас езит. Той позволявя да определите
577
+    'texte_selection_langue_principale' => 'Посочете по-долу „основният език“ на сайта. За щастие, този избор не ограничава статиите Ви да бъдат написани на избран от Вас езит. Той позволявя да определите
578 578
 
579 579
 <ul><li> формата „по подразбиране“ на данните в публичния сайт</li>
580 580
 
@@ -583,71 +583,71 @@  discard block
 block discarded – undo
583 583
 <li> езикът, който се използва във формите на публичния сайт</li>
584 584
 
585 585
 <li> езикът „по подразбиране“ на данните в личната зона.</li></ul>',
586
-	'texte_sous_titre' => 'Подзаглавие',
587
-	'texte_statistiques_visites' => '(тъмни ивици: неделя / тъмна крива: средно развитие)',
588
-	'texte_statut_attente_validation' => 'за одобрение',
589
-	'texte_statut_publies' => 'публикувани на сайта',
590
-	'texte_statut_refuses' => 'отхвърлени',
591
-	'texte_suppression_fichiers' => 'Тази команда служи за изтриване на всички
586
+    'texte_sous_titre' => 'Подзаглавие',
587
+    'texte_statistiques_visites' => '(тъмни ивици: неделя / тъмна крива: средно развитие)',
588
+    'texte_statut_attente_validation' => 'за одобрение',
589
+    'texte_statut_publies' => 'публикувани на сайта',
590
+    'texte_statut_refuses' => 'отхвърлени',
591
+    'texte_suppression_fichiers' => 'Тази команда служи за изтриване на всички
592 592
  файлове в кеш-паметта на СПИП. Това позволява да се актуализират принудително всички страници, в
593 593
  случаи, когато са направени важни изменения в графиките или структурата на сайта.',
594
-	'texte_sur_titre' => 'Челно заглавие',
595
-	'texte_table_ok' => ' : тази таблица е добра.',
596
-	'texte_tentative_recuperation' => 'Опит за поправка',
597
-	'texte_tenter_reparation' => 'Опит за поправка на базата данни',
598
-	'texte_test_proxy' => 'За да изпробвате дали работи проксито, впишете на това място
594
+    'texte_sur_titre' => 'Челно заглавие',
595
+    'texte_table_ok' => ' : тази таблица е добра.',
596
+    'texte_tentative_recuperation' => 'Опит за поправка',
597
+    'texte_tenter_reparation' => 'Опит за поправка на базата данни',
598
+    'texte_test_proxy' => 'За да изпробвате дали работи проксито, впишете на това място
599 599
     URL-a на желана Интернет страница.',
600
-	'texte_titre_02' => 'Тема:',
601
-	'texte_titre_obligatoire' => '<b>Заглавие</b> [Задължително]',
602
-	'texte_travail_article' => '@nom_auteur_modif@ е работил по статията преди @date_diff@ минути',
603
-	'texte_travail_collaboratif' => 'Ако се случва често няколко редактора да
600
+    'texte_titre_02' => 'Тема:',
601
+    'texte_titre_obligatoire' => '<b>Заглавие</b> [Задължително]',
602
+    'texte_travail_article' => '@nom_auteur_modif@ е работил по статията преди @date_diff@ минути',
603
+    'texte_travail_collaboratif' => 'Ако се случва често няколко редактора да
604 604
   работят по една и съща статия, системата
605 605
   може да покаже наскоро отваряните статии,
606 606
   с цел да избегнат едновременни промени.
607 607
   Тази операция е изключена по начало,
608 608
   с цел да не се показват излишни
609 609
   предупредителни съобщения.',
610
-	'texte_vide' => 'празно',
611
-	'texte_vider_cache' => 'Изпразване на кеш-паметта',
612
-	'titre_admin_tech' => 'Техническа поддръжка',
613
-	'titre_admin_vider' => 'Техническа поддръжка',
614
-	'titre_cadre_afficher_article' => 'Показване на статиите:',
615
-	'titre_cadre_afficher_traductions' => 'Показване статуса на превод на следния език:',
616
-	'titre_cadre_ajouter_auteur' => 'ДОБАВЯНЕ НА АВТОР:',
617
-	'titre_cadre_interieur_rubrique' => 'В рубрика',
618
-	'titre_cadre_numero_auteur' => 'НОМЕР НА АВТОРА',
619
-	'titre_cadre_signature_obligatoire' => '<b>Подпис</b> [Задължителен]<br />',
620
-	'titre_config_fonctions' => 'Конфигуриране на сайта',
621
-	'titre_configuration' => 'Конфигуриране на сайта',
622
-	'titre_connexion_ldap' => 'Възможности: <b>Вашата LDAP-връзка</b>',
623
-	'titre_groupe_mots' => 'ГРУПА ОТ КЛЮЧОВИ ДУМИ:',
624
-	'titre_langue_article' => 'ЕЗИК НА СТАТИЯТА', # MODIF
625
-	'titre_langue_rubrique' => 'ЕЗИК НА РУБРИКАТА', # MODIF
626
-	'titre_langue_trad_article' => 'ЕЗИК И ПРЕВОДИ НА СТАТИЯТА',
627
-	'titre_les_articles' => 'СТАТИИ',
628
-	'titre_naviguer_dans_le_site' => 'Търсене на сайта',
629
-	'titre_nouvelle_rubrique' => 'Нова рубрика',
630
-	'titre_numero_rubrique' => 'НОМЕР НА РУБРИКАТА:',
631
-	'titre_page_articles_edit' => 'Промяна: @titre@',
632
-	'titre_page_articles_page' => 'Статии',
633
-	'titre_page_articles_tous' => 'Целият сайт',
634
-	'titre_page_calendrier' => 'Календар @nom_mois@ @annee@',
635
-	'titre_page_config_contenu' => 'Конфигуриране на сайта',
636
-	'titre_page_delete_all' => 'пълно и безвъзвратно изтриване',
637
-	'titre_page_recherche' => 'Резултати от търсенето @recherche@',
638
-	'titre_page_statistiques_referers' => 'Статистика (входящи препратки)',
639
-	'titre_page_upgrade' => 'Актуализация на СПИП',
640
-	'titre_publication_articles_post_dates' => 'Публикуване на статии с отминала дата',
641
-	'titre_reparation' => 'Поправка',
642
-	'titre_suivi_petition' => 'Допълнения на молбите',
643
-	'trad_article_traduction' => 'Всички версии на статията:',
644
-	'trad_delier' => 'Отказ от свързване на статията с нейните преводи', # MODIF
645
-	'trad_lier' => 'Статията е превод на статия номер ',
646
-	'trad_new' => 'Писане на нов превод на статията', # MODIF
610
+    'texte_vide' => 'празно',
611
+    'texte_vider_cache' => 'Изпразване на кеш-паметта',
612
+    'titre_admin_tech' => 'Техническа поддръжка',
613
+    'titre_admin_vider' => 'Техническа поддръжка',
614
+    'titre_cadre_afficher_article' => 'Показване на статиите:',
615
+    'titre_cadre_afficher_traductions' => 'Показване статуса на превод на следния език:',
616
+    'titre_cadre_ajouter_auteur' => 'ДОБАВЯНЕ НА АВТОР:',
617
+    'titre_cadre_interieur_rubrique' => 'В рубрика',
618
+    'titre_cadre_numero_auteur' => 'НОМЕР НА АВТОРА',
619
+    'titre_cadre_signature_obligatoire' => '<b>Подпис</b> [Задължителен]<br />',
620
+    'titre_config_fonctions' => 'Конфигуриране на сайта',
621
+    'titre_configuration' => 'Конфигуриране на сайта',
622
+    'titre_connexion_ldap' => 'Възможности: <b>Вашата LDAP-връзка</b>',
623
+    'titre_groupe_mots' => 'ГРУПА ОТ КЛЮЧОВИ ДУМИ:',
624
+    'titre_langue_article' => 'ЕЗИК НА СТАТИЯТА', # MODIF
625
+    'titre_langue_rubrique' => 'ЕЗИК НА РУБРИКАТА', # MODIF
626
+    'titre_langue_trad_article' => 'ЕЗИК И ПРЕВОДИ НА СТАТИЯТА',
627
+    'titre_les_articles' => 'СТАТИИ',
628
+    'titre_naviguer_dans_le_site' => 'Търсене на сайта',
629
+    'titre_nouvelle_rubrique' => 'Нова рубрика',
630
+    'titre_numero_rubrique' => 'НОМЕР НА РУБРИКАТА:',
631
+    'titre_page_articles_edit' => 'Промяна: @titre@',
632
+    'titre_page_articles_page' => 'Статии',
633
+    'titre_page_articles_tous' => 'Целият сайт',
634
+    'titre_page_calendrier' => 'Календар @nom_mois@ @annee@',
635
+    'titre_page_config_contenu' => 'Конфигуриране на сайта',
636
+    'titre_page_delete_all' => 'пълно и безвъзвратно изтриване',
637
+    'titre_page_recherche' => 'Резултати от търсенето @recherche@',
638
+    'titre_page_statistiques_referers' => 'Статистика (входящи препратки)',
639
+    'titre_page_upgrade' => 'Актуализация на СПИП',
640
+    'titre_publication_articles_post_dates' => 'Публикуване на статии с отминала дата',
641
+    'titre_reparation' => 'Поправка',
642
+    'titre_suivi_petition' => 'Допълнения на молбите',
643
+    'trad_article_traduction' => 'Всички версии на статията:',
644
+    'trad_delier' => 'Отказ от свързване на статията с нейните преводи', # MODIF
645
+    'trad_lier' => 'Статията е превод на статия номер ',
646
+    'trad_new' => 'Писане на нов превод на статията', # MODIF
647 647
 
648
-	// U
649
-	'utf8_convert_erreur_orig' => 'Грешка: кодировката на символите @charset@ не се поддържа.',
648
+    // U
649
+    'utf8_convert_erreur_orig' => 'Грешка: кодировката на символите @charset@ не се поддържа.',
650 650
 
651
-	// V
652
-	'version' => 'Версия:'
651
+    // V
652
+    'version' => 'Версия:'
653 653
 );
Please login to merge, or discard this patch.
ecrire/public/references.php 3 patches
Spacing   +14 added lines, -14 removed lines patch added patch discarded remove patch
@@ -124,7 +124,7 @@  discard block
 block discarded – undo
124 124
 	$select = true
125 125
 ) {
126 126
 	if (!is_string($defaut)) {
127
-		$defaut = '@$Pile[0][\'' . strtolower($nom_champ) . '\']';
127
+		$defaut = '@$Pile[0][\''.strtolower($nom_champ).'\']';
128 128
 	}
129 129
 
130 130
 	$i = 0;
@@ -152,7 +152,7 @@  discard block
 block discarded – undo
152 152
 			if ($select and !in_array($t, $boucles[$idb]->select)) {
153 153
 				$boucles[$idb]->select[] = $t;
154 154
 			}
155
-			$champ = '$Pile[$SP' . ($i ? "-$i" : "") . '][\'' . $c . '\']';
155
+			$champ = '$Pile[$SP'.($i ? "-$i" : "").'][\''.$c.'\']';
156 156
 			if (!$joker) {
157 157
 				return index_compose($conditionnel, $champ);
158 158
 			}
@@ -193,7 +193,7 @@  discard block
 block discarded – undo
193 193
 function index_compose($conditionnel, $defaut) {
194 194
 	while ($c = array_pop($conditionnel)) {
195 195
 		// si on passe defaut = '', ne pas générer d'erreur de compilation.
196
-		$defaut = "($c:(" . ($defaut ? $defaut : "''") . "))";
196
+		$defaut = "($c:(".($defaut ? $defaut : "''")."))";
197 197
 	}
198 198
 
199 199
 	return $defaut;
@@ -240,7 +240,7 @@  discard block
 block discarded – undo
240 240
 	if (!$r) {
241 241
 		$joker = false; // indiquer a l'appelant
242 242
 		# continuer pour chercher l'erreur suivante
243
-		return array("'#" . $r . ':' . $nom_champ . "'", '');
243
+		return array("'#".$r.':'.$nom_champ."'", '');
244 244
 	}
245 245
 
246 246
 	$desc = $boucles[$idb]->show;
@@ -340,8 +340,8 @@  discard block
 block discarded – undo
340 340
 			$t = $index_exception_derogatoire($boucle, $desc, $nom_champ, $excep);
341 341
 		}
342 342
 		if ($t == null) {
343
-			list($e, $x) = $excep;  #PHP4 affecte de gauche a droite
344
-			$excep = $x;    #PHP5 de droite a gauche !
343
+			list($e, $x) = $excep; #PHP4 affecte de gauche a droite
344
+			$excep = $x; #PHP5 de droite a gauche !
345 345
 			$j = $trouver_table($e, $boucle->sql_serveur);
346 346
 			if (!$j) {
347 347
 				return array('', '');
@@ -353,7 +353,7 @@  discard block
 block discarded – undo
353 353
 					$l = (preg_split('/\s*,\s*/', $k));
354 354
 					$k = $desc['key']['PRIMARY KEY'];
355 355
 					if (!in_array($k, $l)) {
356
-						spip_log("jointure impossible $e " . join(',', $l));
356
+						spip_log("jointure impossible $e ".join(',', $l));
357 357
 
358 358
 						return array('', '');
359 359
 					}
@@ -369,7 +369,7 @@  discard block
 block discarded – undo
369 369
 	// demander a SQL de gerer le synonyme
370 370
 	// ca permet que excep soit dynamique (Cedric, 2/3/06)
371 371
 	if ($excep != $nom_champ) {
372
-		$excep .= ' AS ' . $nom_champ;
372
+		$excep .= ' AS '.$nom_champ;
373 373
 	}
374 374
 
375 375
 	return array("$t.$excep", $nom_champ);
@@ -602,7 +602,7 @@  discard block
 block discarded – undo
602 602
 		join(',', $collecte),
603 603
 		($collecte ? $param : substr($param, 1)), # virer la virgule
604 604
 		memoriser_contexte_compil($p),
605
-		(!$supp ? '' : (', ' . join(',', $supp))));
605
+		(!$supp ? '' : (', '.join(',', $supp))));
606 606
 
607 607
 	$p->interdire_scripts = false;
608 608
 
@@ -697,7 +697,7 @@  discard block
 block discarded – undo
697 697
 	$nom = $p->id_boucle;
698 698
 
699 699
 	if ($nom and trouver_nom_serveur_distant($p)) {
700
-		spip_log($nom . ':' . $p->nom_champ . ' ' . _T('zbug_distant_interdit'));
700
+		spip_log($nom.':'.$p->nom_champ.' '._T('zbug_distant_interdit'));
701 701
 
702 702
 		return false;
703 703
 	}
@@ -766,7 +766,7 @@  discard block
 block discarded – undo
766 766
 			(strpos($ps, 'typo') !== false)
767 767
 		)
768 768
 	) {
769
-		$ps = 'traiter_doublons_documents($doublons, ' . $ps . ')';
769
+		$ps = 'traiter_doublons_documents($doublons, '.$ps.')';
770 770
 	}
771 771
 
772 772
 	// La protection des champs par |safehtml est assuree par les extensions
@@ -884,7 +884,7 @@  discard block
 block discarded – undo
884 884
 function compose_filtres_args($p, $args, $sep) {
885 885
 	$arglist = "";
886 886
 	foreach ($args as $arg) {
887
-		$arglist .= $sep .
887
+		$arglist .= $sep.
888 888
 			calculer_liste($arg, $p->descr, $p->boucles, $p->id_boucle);
889 889
 	}
890 890
 
@@ -935,7 +935,7 @@  discard block
 block discarded – undo
935 935
 	while ($b != '') {
936 936
 		foreach ($p->boucles[$b]->criteres as $critere) {
937 937
 			if ($critere->op == $motif) {
938
-				$p->code = '$Pile[$SP' . (($n == 0) ? "" : "-$n") .
938
+				$p->code = '$Pile[$SP'.(($n == 0) ? "" : "-$n").
939 939
 					"]['$champ']";
940 940
 				$b = '';
941 941
 				break 2;
@@ -963,6 +963,6 @@  discard block
 block discarded – undo
963 963
  */
964 964
 function zbug_presenter_champ($p, $champ = "") {
965 965
 	$balise = $champ ? $champ : $p->nom_champ;
966
-	$explicite = $explicite = $p->nom_boucle ? $p->nom_boucle . ':' : '';
966
+	$explicite = $explicite = $p->nom_boucle ? $p->nom_boucle.':' : '';
967 967
 	return "#{$explicite}{$balise}";
968 968
 }
969 969
\ No newline at end of file
Please login to merge, or discard this patch.
Doc Comments   +17 added lines, -3 removed lines patch added patch discarded remove patch
@@ -322,7 +322,7 @@  discard block
 block discarded – undo
322 322
  *           est dans une autre table et construit la jointure dessus
323 323
  *         - liste (table, champ, fonction) idem, mais en passant un
324 324
  *           nom de fonction qui s'occupera de créer la jointure.
325
- * @return array
325
+ * @return string[]
326 326
  *     Liste (nom du champ alias, nom du champ). Le nom du champ alias
327 327
  *     est une expression pour le SELECT de la boucle du style "mots.titre AS titre_mot"
328 328
  **/
@@ -500,7 +500,7 @@  discard block
 block discarded – undo
500 500
  *     Nom de la balise
501 501
  * @param Champ $p
502 502
  *     AST au niveau de la balise
503
- * @return string
503
+ * @return Champ
504 504
  *     Code PHP pour d'exécution de la balise et de ses filtres
505 505
  **/
506 506
 function calculer_balise_DEFAUT_dist($nom, $p) {
@@ -784,6 +784,9 @@  discard block
 block discarded – undo
784 784
 //  - deux etoiles => pas de securite non plus !
785 785
 //
786 786
 // https://code.spip.net/@applique_filtres
787
+/**
788
+ * @param Champ $p
789
+ */
787 790
 function applique_filtres($p) {
788 791
 
789 792
 	// Traitements standards (cf. supra)
@@ -858,6 +861,9 @@  discard block
 block discarded – undo
858 861
 
859 862
 // Filtres et,ou,oui,non,sinon,xou,xor,and,or,not,yes
860 863
 // et comparateurs
864
+/**
865
+ * @param string $arg
866
+ */
861 867
 function filtre_logique($fonc, $code, $arg) {
862 868
 
863 869
 	switch (true) {
@@ -881,6 +887,9 @@  discard block
 block discarded – undo
881 887
 }
882 888
 
883 889
 // https://code.spip.net/@compose_filtres_args
890
+/**
891
+ * @param string $sep
892
+ */
884 893
 function compose_filtres_args($p, $args, $sep) {
885 894
 	$arglist = "";
886 895
 	foreach ($args as $arg) {
@@ -928,6 +937,11 @@  discard block
 block discarded – undo
928 937
 //
929 938
 
930 939
 // https://code.spip.net/@rindex_pile
940
+/**
941
+ * @param Champ $p
942
+ * @param string $champ
943
+ * @param string $motif
944
+ */
931 945
 function rindex_pile($p, $champ, $motif) {
932 946
 	$n = 0;
933 947
 	$b = $p->id_boucle;
@@ -957,7 +971,7 @@  discard block
 block discarded – undo
957 971
 
958 972
 /** 
959 973
  * Retourne le nom de la balise indiquée pour les messages d’erreurs
960
- * @param Pile $p Description de la balise
974
+ * @param Champ $p Description de la balise
961 975
  * @param string $champ Nom du champ
962 976
  * @return string Nom de la balise, avec indication de boucle explicite si présent.
963 977
  */
Please login to merge, or discard this patch.
Indentation   +499 added lines, -499 removed lines patch added patch discarded remove patch
@@ -16,7 +16,7 @@  discard block
 block discarded – undo
16 16
  * @package SPIP\Core\Compilateur\References
17 17
  **/
18 18
 if (!defined('_ECRIRE_INC_VERSION')) {
19
-	return;
19
+    return;
20 20
 }
21 21
 
22 22
 /**
@@ -41,14 +41,14 @@  discard block
 block discarded – undo
41 41
  *     - '' si une référence explicite incorrecte est envoyée
42 42
  */
43 43
 function index_boucle($p) {
44
-	if (strlen($p->nom_boucle)) {
45
-		// retourne l’index explicite demandé s’il existe
46
-		if (!empty($p->boucles[$p->nom_boucle])) {
47
-			return $p->nom_boucle;
48
-		}
49
-		return '';
50
-	} 
51
-	return $p->id_boucle;
44
+    if (strlen($p->nom_boucle)) {
45
+        // retourne l’index explicite demandé s’il existe
46
+        if (!empty($p->boucles[$p->nom_boucle])) {
47
+            return $p->nom_boucle;
48
+        }
49
+        return '';
50
+    } 
51
+    return $p->id_boucle;
52 52
 }
53 53
 
54 54
 
@@ -71,17 +71,17 @@  discard block
 block discarded – undo
71 71
  *     - '' si une référence explicite incorrecte est envoyée
72 72
  */
73 73
 function index_boucle_mere($p) {
74
-	if (strlen($p->nom_boucle)) {
75
-		// retourne l’index explicite demandé s’il existe
76
-		if (!empty($p->boucles[$p->nom_boucle])) {
77
-			return $p->nom_boucle;
78
-		}
79
-		return '';
80
-	} 
81
-	if (!empty($p->descr['id_mere'])) {
82
-		return $p->descr['id_mere'];
83
-	}
84
-	return '';
74
+    if (strlen($p->nom_boucle)) {
75
+        // retourne l’index explicite demandé s’il existe
76
+        if (!empty($p->boucles[$p->nom_boucle])) {
77
+            return $p->nom_boucle;
78
+        }
79
+        return '';
80
+    } 
81
+    if (!empty($p->descr['id_mere'])) {
82
+        return $p->descr['id_mere'];
83
+    }
84
+    return '';
85 85
 }
86 86
 
87 87
 /**
@@ -115,69 +115,69 @@  discard block
 block discarded – undo
115 115
  *     Code PHP pour obtenir le champ SQL
116 116
  */
117 117
 function index_pile(
118
-	$idb,
119
-	$nom_champ,
120
-	&$boucles,
121
-	$explicite = '',
122
-	$defaut = null,
123
-	$remonte_pile = true,
124
-	$select = true
118
+    $idb,
119
+    $nom_champ,
120
+    &$boucles,
121
+    $explicite = '',
122
+    $defaut = null,
123
+    $remonte_pile = true,
124
+    $select = true
125 125
 ) {
126
-	if (!is_string($defaut)) {
127
-		$defaut = '@$Pile[0][\'' . strtolower($nom_champ) . '\']';
128
-	}
129
-
130
-	$i = 0;
131
-	if (strlen($explicite)) {
132
-		// Recherche d'un champ dans un etage superieur
133
-		while (($idb !== $explicite) && ($idb !== '')) {
134
-			#	spip_log("Cherchexpl: $nom_champ '$explicite' '$idb' '$i'");
135
-			$i++;
136
-			$idb = $boucles[$idb]->id_parent;
137
-		}
138
-	}
139
-
140
-	#	spip_log("Cherche: $nom_champ a partir de '$idb'");
141
-	$nom_champ = strtolower($nom_champ);
142
-	$conditionnel = array();
143
-	// attention: entre la boucle nommee 0, "" et le tableau vide,
144
-	// il y a incoherences qu'il vaut mieux eviter
145
-	while (isset($boucles[$idb])) {
146
-		$joker = true;
147
-		// modifie $joker si tous les champs sont autorisés.
148
-		// $t = le select pour le champ, si on l'a trouvé (ou si joker)
149
-		// $c = le nom du champ demandé
150
-		list($t, $c) = index_tables_en_pile($idb, $nom_champ, $boucles, $joker);
151
-		if ($t) {
152
-			if ($select and !in_array($t, $boucles[$idb]->select)) {
153
-				$boucles[$idb]->select[] = $t;
154
-			}
155
-			$champ = '$Pile[$SP' . ($i ? "-$i" : "") . '][\'' . $c . '\']';
156
-			if (!$joker) {
157
-				return index_compose($conditionnel, $champ);
158
-			}
159
-
160
-			// tant que l'on trouve des tables avec joker, on continue
161
-			// avec la boucle parente et on conditionne à l'exécution
162
-			// la présence du champ. Si le champ existe à l'exécution
163
-			// dans une boucle, il est pris, sinon on le cherche dans le parent...
164
-			$conditionnel[] = "isset($champ)?$champ";
165
-		}
166
-
167
-		if ($remonte_pile) {
168
-			#	spip_log("On remonte vers $i");
169
-			// Sinon on remonte d'un cran
170
-			$idb = $boucles[$idb]->id_parent;
171
-			$i++;
172
-		} else {
173
-			$idb = null;
174
-		}
175
-	}
176
-
177
-	#	spip_log("Pas vu $nom_champ");
178
-	// esperons qu'il y sera
179
-	// ou qu'on a fourni une valeur par "defaut" plus pertinent
180
-	return index_compose($conditionnel, $defaut);
126
+    if (!is_string($defaut)) {
127
+        $defaut = '@$Pile[0][\'' . strtolower($nom_champ) . '\']';
128
+    }
129
+
130
+    $i = 0;
131
+    if (strlen($explicite)) {
132
+        // Recherche d'un champ dans un etage superieur
133
+        while (($idb !== $explicite) && ($idb !== '')) {
134
+            #	spip_log("Cherchexpl: $nom_champ '$explicite' '$idb' '$i'");
135
+            $i++;
136
+            $idb = $boucles[$idb]->id_parent;
137
+        }
138
+    }
139
+
140
+    #	spip_log("Cherche: $nom_champ a partir de '$idb'");
141
+    $nom_champ = strtolower($nom_champ);
142
+    $conditionnel = array();
143
+    // attention: entre la boucle nommee 0, "" et le tableau vide,
144
+    // il y a incoherences qu'il vaut mieux eviter
145
+    while (isset($boucles[$idb])) {
146
+        $joker = true;
147
+        // modifie $joker si tous les champs sont autorisés.
148
+        // $t = le select pour le champ, si on l'a trouvé (ou si joker)
149
+        // $c = le nom du champ demandé
150
+        list($t, $c) = index_tables_en_pile($idb, $nom_champ, $boucles, $joker);
151
+        if ($t) {
152
+            if ($select and !in_array($t, $boucles[$idb]->select)) {
153
+                $boucles[$idb]->select[] = $t;
154
+            }
155
+            $champ = '$Pile[$SP' . ($i ? "-$i" : "") . '][\'' . $c . '\']';
156
+            if (!$joker) {
157
+                return index_compose($conditionnel, $champ);
158
+            }
159
+
160
+            // tant que l'on trouve des tables avec joker, on continue
161
+            // avec la boucle parente et on conditionne à l'exécution
162
+            // la présence du champ. Si le champ existe à l'exécution
163
+            // dans une boucle, il est pris, sinon on le cherche dans le parent...
164
+            $conditionnel[] = "isset($champ)?$champ";
165
+        }
166
+
167
+        if ($remonte_pile) {
168
+            #	spip_log("On remonte vers $i");
169
+            // Sinon on remonte d'un cran
170
+            $idb = $boucles[$idb]->id_parent;
171
+            $i++;
172
+        } else {
173
+            $idb = null;
174
+        }
175
+    }
176
+
177
+    #	spip_log("Pas vu $nom_champ");
178
+    // esperons qu'il y sera
179
+    // ou qu'on a fourni une valeur par "defaut" plus pertinent
180
+    return index_compose($conditionnel, $defaut);
181 181
 }
182 182
 
183 183
 /**
@@ -191,12 +191,12 @@  discard block
 block discarded – undo
191 191
  * @return string              Code PHP complet de recherche d'un champ
192 192
  */
193 193
 function index_compose($conditionnel, $defaut) {
194
-	while ($c = array_pop($conditionnel)) {
195
-		// si on passe defaut = '', ne pas générer d'erreur de compilation.
196
-		$defaut = "($c:(" . ($defaut ? $defaut : "''") . "))";
197
-	}
194
+    while ($c = array_pop($conditionnel)) {
195
+        // si on passe defaut = '', ne pas générer d'erreur de compilation.
196
+        $defaut = "($c:(" . ($defaut ? $defaut : "''") . "))";
197
+    }
198 198
 
199
-	return $defaut;
199
+    return $defaut;
200 200
 }
201 201
 
202 202
 /**
@@ -232,74 +232,74 @@  discard block
 block discarded – undo
232 232
  **/
233 233
 function index_tables_en_pile($idb, $nom_champ, &$boucles, &$joker) {
234 234
 
235
-	$r = $boucles[$idb]->type_requete;
236
-	// boucle recursive, c'est foutu...
237
-	if ($r == TYPE_RECURSIF) {
238
-		return array();
239
-	}
240
-	if (!$r) {
241
-		$joker = false; // indiquer a l'appelant
242
-		# continuer pour chercher l'erreur suivante
243
-		return array("'#" . $r . ':' . $nom_champ . "'", '');
244
-	}
245
-
246
-	$desc = $boucles[$idb]->show;
247
-	// le nom du champ est il une exception de la table ? un alias ?
248
-	$excep = isset($GLOBALS['exceptions_des_tables'][$r]) ? $GLOBALS['exceptions_des_tables'][$r] : '';
249
-	if ($excep) {
250
-		$excep = isset($excep[$nom_champ]) ? $excep[$nom_champ] : '';
251
-	}
252
-	if ($excep) {
253
-		$joker = false; // indiquer a l'appelant
254
-		return index_exception($boucles[$idb], $desc, $nom_champ, $excep);
255
-	} // pas d'alias. Le champ existe t'il ?
256
-	else {
257
-		// le champ est réellement présent, on le prend.
258
-		if (isset($desc['field'][$nom_champ])) {
259
-			$t = $boucles[$idb]->id_table;
260
-			$joker = false; // indiquer a l'appelant
261
-			return array("$t.$nom_champ", $nom_champ);
262
-		}
263
-		// Tous les champs sont-ils acceptés ?
264
-		// Si oui, on retourne le champ, et on lève le flag joker
265
-		// C'est le cas des itérateurs DATA qui acceptent tout
266
-		// et testent la présence du champ à l'exécution et non à la compilation
267
-		// car ils ne connaissent pas ici leurs contenus.
268
-		elseif (/*$joker AND */
269
-		isset($desc['field']['*'])
270
-		) {
271
-			$joker = true; // indiquer a l'appelant
272
-			return array($nom_champ, $nom_champ);
273
-		}
274
-		// pas d'alias, pas de champ, pas de joker...
275
-		// tenter via une jointure...
276
-		else {
277
-			$joker = false; // indiquer a l'appelant
278
-			// regarder si le champ est deja dans une jointure existante
279
-			// sinon, si il y a des joitures explicites, la construire
280
-			if (!$t = trouver_champ_exterieur($nom_champ, $boucles[$idb]->from, $boucles[$idb])) {
281
-				if ($boucles[$idb]->jointures_explicites) {
282
-					// [todo] Ne pas lancer que lorsque il y a des jointures explicites !!!!
283
-					// fonctionnel, il suffit d'utiliser $boucles[$idb]->jointures au lieu de jointures_explicites
284
-					// mais est-ce ce qu'on veut ?
285
-					$jointures = preg_split("/\s+/", $boucles[$idb]->jointures_explicites);
286
-					if ($cle = trouver_jointure_champ($nom_champ, $boucles[$idb], $jointures)) {
287
-						$t = trouver_champ_exterieur($nom_champ, $boucles[$idb]->from, $boucles[$idb]);
288
-					}
289
-				}
290
-			}
291
-			if ($t) {
292
-				// si on a trouvé une jointure possible, on fait comme
293
-				// si c'était une exception pour le champ demandé
294
-				return index_exception($boucles[$idb],
295
-					$desc,
296
-					$nom_champ,
297
-					array($t[1]['id_table'], reset($t[2])));
298
-			}
299
-
300
-			return array('', '');
301
-		}
302
-	}
235
+    $r = $boucles[$idb]->type_requete;
236
+    // boucle recursive, c'est foutu...
237
+    if ($r == TYPE_RECURSIF) {
238
+        return array();
239
+    }
240
+    if (!$r) {
241
+        $joker = false; // indiquer a l'appelant
242
+        # continuer pour chercher l'erreur suivante
243
+        return array("'#" . $r . ':' . $nom_champ . "'", '');
244
+    }
245
+
246
+    $desc = $boucles[$idb]->show;
247
+    // le nom du champ est il une exception de la table ? un alias ?
248
+    $excep = isset($GLOBALS['exceptions_des_tables'][$r]) ? $GLOBALS['exceptions_des_tables'][$r] : '';
249
+    if ($excep) {
250
+        $excep = isset($excep[$nom_champ]) ? $excep[$nom_champ] : '';
251
+    }
252
+    if ($excep) {
253
+        $joker = false; // indiquer a l'appelant
254
+        return index_exception($boucles[$idb], $desc, $nom_champ, $excep);
255
+    } // pas d'alias. Le champ existe t'il ?
256
+    else {
257
+        // le champ est réellement présent, on le prend.
258
+        if (isset($desc['field'][$nom_champ])) {
259
+            $t = $boucles[$idb]->id_table;
260
+            $joker = false; // indiquer a l'appelant
261
+            return array("$t.$nom_champ", $nom_champ);
262
+        }
263
+        // Tous les champs sont-ils acceptés ?
264
+        // Si oui, on retourne le champ, et on lève le flag joker
265
+        // C'est le cas des itérateurs DATA qui acceptent tout
266
+        // et testent la présence du champ à l'exécution et non à la compilation
267
+        // car ils ne connaissent pas ici leurs contenus.
268
+        elseif (/*$joker AND */
269
+        isset($desc['field']['*'])
270
+        ) {
271
+            $joker = true; // indiquer a l'appelant
272
+            return array($nom_champ, $nom_champ);
273
+        }
274
+        // pas d'alias, pas de champ, pas de joker...
275
+        // tenter via une jointure...
276
+        else {
277
+            $joker = false; // indiquer a l'appelant
278
+            // regarder si le champ est deja dans une jointure existante
279
+            // sinon, si il y a des joitures explicites, la construire
280
+            if (!$t = trouver_champ_exterieur($nom_champ, $boucles[$idb]->from, $boucles[$idb])) {
281
+                if ($boucles[$idb]->jointures_explicites) {
282
+                    // [todo] Ne pas lancer que lorsque il y a des jointures explicites !!!!
283
+                    // fonctionnel, il suffit d'utiliser $boucles[$idb]->jointures au lieu de jointures_explicites
284
+                    // mais est-ce ce qu'on veut ?
285
+                    $jointures = preg_split("/\s+/", $boucles[$idb]->jointures_explicites);
286
+                    if ($cle = trouver_jointure_champ($nom_champ, $boucles[$idb], $jointures)) {
287
+                        $t = trouver_champ_exterieur($nom_champ, $boucles[$idb]->from, $boucles[$idb]);
288
+                    }
289
+                }
290
+            }
291
+            if ($t) {
292
+                // si on a trouvé une jointure possible, on fait comme
293
+                // si c'était une exception pour le champ demandé
294
+                return index_exception($boucles[$idb],
295
+                    $desc,
296
+                    $nom_champ,
297
+                    array($t[1]['id_table'], reset($t[2])));
298
+            }
299
+
300
+            return array('', '');
301
+        }
302
+    }
303 303
 }
304 304
 
305 305
 
@@ -327,52 +327,52 @@  discard block
 block discarded – undo
327 327
  *     est une expression pour le SELECT de la boucle du style "mots.titre AS titre_mot"
328 328
  **/
329 329
 function index_exception(&$boucle, $desc, $nom_champ, $excep) {
330
-	static $trouver_table;
331
-	if (!$trouver_table) {
332
-		$trouver_table = charger_fonction('trouver_table', 'base');
333
-	}
334
-
335
-	if (is_array($excep)) {
336
-		// permettre aux plugins de gerer eux meme des jointures derogatoire ingerables
337
-		$t = null;
338
-		if (count($excep) == 3) {
339
-			$index_exception_derogatoire = array_pop($excep);
340
-			$t = $index_exception_derogatoire($boucle, $desc, $nom_champ, $excep);
341
-		}
342
-		if ($t == null) {
343
-			list($e, $x) = $excep;  #PHP4 affecte de gauche a droite
344
-			$excep = $x;    #PHP5 de droite a gauche !
345
-			$j = $trouver_table($e, $boucle->sql_serveur);
346
-			if (!$j) {
347
-				return array('', '');
348
-			}
349
-			$e = $j['table'];
350
-			if (!$t = array_search($e, $boucle->from)) {
351
-				$k = $j['key']['PRIMARY KEY'];
352
-				if (strpos($k, ',')) {
353
-					$l = (preg_split('/\s*,\s*/', $k));
354
-					$k = $desc['key']['PRIMARY KEY'];
355
-					if (!in_array($k, $l)) {
356
-						spip_log("jointure impossible $e " . join(',', $l));
357
-
358
-						return array('', '');
359
-					}
360
-				}
361
-				$k = array($boucle->id_table, array($e), $k);
362
-				fabrique_jointures($boucle, array($k));
363
-				$t = array_search($e, $boucle->from);
364
-			}
365
-		}
366
-	} else {
367
-		$t = $boucle->id_table;
368
-	}
369
-	// demander a SQL de gerer le synonyme
370
-	// ca permet que excep soit dynamique (Cedric, 2/3/06)
371
-	if ($excep != $nom_champ) {
372
-		$excep .= ' AS ' . $nom_champ;
373
-	}
374
-
375
-	return array("$t.$excep", $nom_champ);
330
+    static $trouver_table;
331
+    if (!$trouver_table) {
332
+        $trouver_table = charger_fonction('trouver_table', 'base');
333
+    }
334
+
335
+    if (is_array($excep)) {
336
+        // permettre aux plugins de gerer eux meme des jointures derogatoire ingerables
337
+        $t = null;
338
+        if (count($excep) == 3) {
339
+            $index_exception_derogatoire = array_pop($excep);
340
+            $t = $index_exception_derogatoire($boucle, $desc, $nom_champ, $excep);
341
+        }
342
+        if ($t == null) {
343
+            list($e, $x) = $excep;  #PHP4 affecte de gauche a droite
344
+            $excep = $x;    #PHP5 de droite a gauche !
345
+            $j = $trouver_table($e, $boucle->sql_serveur);
346
+            if (!$j) {
347
+                return array('', '');
348
+            }
349
+            $e = $j['table'];
350
+            if (!$t = array_search($e, $boucle->from)) {
351
+                $k = $j['key']['PRIMARY KEY'];
352
+                if (strpos($k, ',')) {
353
+                    $l = (preg_split('/\s*,\s*/', $k));
354
+                    $k = $desc['key']['PRIMARY KEY'];
355
+                    if (!in_array($k, $l)) {
356
+                        spip_log("jointure impossible $e " . join(',', $l));
357
+
358
+                        return array('', '');
359
+                    }
360
+                }
361
+                $k = array($boucle->id_table, array($e), $k);
362
+                fabrique_jointures($boucle, array($k));
363
+                $t = array_search($e, $boucle->from);
364
+            }
365
+        }
366
+    } else {
367
+        $t = $boucle->id_table;
368
+    }
369
+    // demander a SQL de gerer le synonyme
370
+    // ca permet que excep soit dynamique (Cedric, 2/3/06)
371
+    if ($excep != $nom_champ) {
372
+        $excep .= ' AS ' . $nom_champ;
373
+    }
374
+
375
+    return array("$t.$excep", $nom_champ);
376 376
 }
377 377
 
378 378
 /**
@@ -397,7 +397,7 @@  discard block
 block discarded – undo
397 397
  *     Code PHP pour retrouver le champ
398 398
  */
399 399
 function champ_sql($champ, $p, $defaut = null, $remonte_pile = true) {
400
-	return index_pile($p->id_boucle, $champ, $p->boucles, $p->nom_boucle, $defaut, $remonte_pile);
400
+    return index_pile($p->id_boucle, $champ, $p->boucles, $p->nom_boucle, $defaut, $remonte_pile);
401 401
 }
402 402
 
403 403
 
@@ -417,9 +417,9 @@  discard block
 block discarded – undo
417 417
  *     Code PHP pour d'exécution de la balise et de ses filtres
418 418
  **/
419 419
 function calculer_champ($p) {
420
-	$p = calculer_balise($p->nom_champ, $p);
420
+    $p = calculer_balise($p->nom_champ, $p);
421 421
 
422
-	return applique_filtres($p);
422
+    return applique_filtres($p);
423 423
 }
424 424
 
425 425
 
@@ -456,26 +456,26 @@  discard block
 block discarded – undo
456 456
  **/
457 457
 function calculer_balise($nom, $p) {
458 458
 
459
-	// S'agit-t-il d'une balise_XXXX[_dist]() ?
460
-	if ($f = charger_fonction($nom, 'balise', true)) {
461
-		$p->balise_calculee = true;
462
-		$res = $f($p);
463
-		if ($res !== null and is_object($res)) {
464
-			return $res;
465
-		}
466
-	}
467
-
468
-	// Certaines des balises comportant un _ sont generiques
469
-	if ($balise_generique = chercher_balise_generique($nom)) {
470
-		$res = $balise_generique['fonction_generique']($p);
471
-		if ($res !== null and is_object($res)) {
472
-			return $res;
473
-		}
474
-	}
475
-
476
-	$f = charger_fonction('DEFAUT', 'calculer_balise');
477
-
478
-	return $f($nom, $p);
459
+    // S'agit-t-il d'une balise_XXXX[_dist]() ?
460
+    if ($f = charger_fonction($nom, 'balise', true)) {
461
+        $p->balise_calculee = true;
462
+        $res = $f($p);
463
+        if ($res !== null and is_object($res)) {
464
+            return $res;
465
+        }
466
+    }
467
+
468
+    // Certaines des balises comportant un _ sont generiques
469
+    if ($balise_generique = chercher_balise_generique($nom)) {
470
+        $res = $balise_generique['fonction_generique']($p);
471
+        if ($res !== null and is_object($res)) {
472
+            return $res;
473
+        }
474
+    }
475
+
476
+    $f = charger_fonction('DEFAUT', 'calculer_balise');
477
+
478
+    return $f($nom, $p);
479 479
 }
480 480
 
481 481
 
@@ -503,36 +503,36 @@  discard block
 block discarded – undo
503 503
  **/
504 504
 function calculer_balise_DEFAUT_dist($nom, $p) {
505 505
 
506
-	// ca pourrait etre un champ SQL homonyme,
507
-	$p->code = index_pile($p->id_boucle, $nom, $p->boucles, $p->nom_boucle);
508
-
509
-	// compatibilite: depuis qu'on accepte #BALISE{ses_args} sans [(...)] autour
510
-	// il faut recracher {...} quand ce n'est finalement pas des args
511
-	if ($p->fonctions and (!$p->fonctions[0][0]) and $p->fonctions[0][1]) {
512
-		$code = addslashes($p->fonctions[0][1]);
513
-		$p->code .= " . '$code'";
514
-	}
515
-
516
-	// ne pas passer le filtre securite sur les id_xxx
517
-	if (strpos($nom, 'ID_') === 0) {
518
-		$p->interdire_scripts = false;
519
-	}
520
-
521
-	// Compatibilite ascendante avec les couleurs html (#FEFEFE) :
522
-	// SI le champ SQL n'est pas trouve
523
-	// ET si la balise a une forme de couleur
524
-	// ET s'il n'y a ni filtre ni etoile
525
-	// ALORS retourner la couleur.
526
-	// Ca permet si l'on veut vraiment de recuperer [(#ACCEDE*)]
527
-	if (preg_match("/^[A-F]{1,6}$/i", $nom)
528
-		and !$p->etoile
529
-		and !$p->fonctions
530
-	) {
531
-		$p->code = "'#$nom'";
532
-		$p->interdire_scripts = false;
533
-	}
534
-
535
-	return $p;
506
+    // ca pourrait etre un champ SQL homonyme,
507
+    $p->code = index_pile($p->id_boucle, $nom, $p->boucles, $p->nom_boucle);
508
+
509
+    // compatibilite: depuis qu'on accepte #BALISE{ses_args} sans [(...)] autour
510
+    // il faut recracher {...} quand ce n'est finalement pas des args
511
+    if ($p->fonctions and (!$p->fonctions[0][0]) and $p->fonctions[0][1]) {
512
+        $code = addslashes($p->fonctions[0][1]);
513
+        $p->code .= " . '$code'";
514
+    }
515
+
516
+    // ne pas passer le filtre securite sur les id_xxx
517
+    if (strpos($nom, 'ID_') === 0) {
518
+        $p->interdire_scripts = false;
519
+    }
520
+
521
+    // Compatibilite ascendante avec les couleurs html (#FEFEFE) :
522
+    // SI le champ SQL n'est pas trouve
523
+    // ET si la balise a une forme de couleur
524
+    // ET s'il n'y a ni filtre ni etoile
525
+    // ALORS retourner la couleur.
526
+    // Ca permet si l'on veut vraiment de recuperer [(#ACCEDE*)]
527
+    if (preg_match("/^[A-F]{1,6}$/i", $nom)
528
+        and !$p->etoile
529
+        and !$p->fonctions
530
+    ) {
531
+        $p->code = "'#$nom'";
532
+        $p->interdire_scripts = false;
533
+    }
534
+
535
+    return $p;
536 536
 }
537 537
 
538 538
 
@@ -575,36 +575,36 @@  discard block
 block discarded – undo
575 575
  **/
576 576
 function calculer_balise_dynamique($p, $nom, $l, $supp = array()) {
577 577
 
578
-	if (!balise_distante_interdite($p)) {
579
-		$p->code = "''";
580
-
581
-		return $p;
582
-	}
583
-	// compatibilite: depuis qu'on accepte #BALISE{ses_args} sans [(...)] autour
584
-	// il faut recracher {...} quand ce n'est finalement pas des args
585
-	if ($p->fonctions and (!$p->fonctions[0][0]) and $p->fonctions[0][1]) {
586
-		$p->fonctions = null;
587
-	}
588
-
589
-	if ($p->param and ($c = $p->param[0])) {
590
-		// liste d'arguments commence toujours par la chaine vide
591
-		array_shift($c);
592
-		// construire la liste d'arguments comme pour un filtre
593
-		$param = compose_filtres_args($p, $c, ',');
594
-	} else {
595
-		$param = "";
596
-	}
597
-	$collecte = collecter_balise_dynamique($l, $p, $nom);
598
-
599
-	$p->code = sprintf(CODE_EXECUTER_BALISE, $nom,
600
-		join(',', $collecte),
601
-		($collecte ? $param : substr($param, 1)), # virer la virgule
602
-		memoriser_contexte_compil($p),
603
-		(!$supp ? '' : (', ' . join(',', $supp))));
604
-
605
-	$p->interdire_scripts = false;
606
-
607
-	return $p;
578
+    if (!balise_distante_interdite($p)) {
579
+        $p->code = "''";
580
+
581
+        return $p;
582
+    }
583
+    // compatibilite: depuis qu'on accepte #BALISE{ses_args} sans [(...)] autour
584
+    // il faut recracher {...} quand ce n'est finalement pas des args
585
+    if ($p->fonctions and (!$p->fonctions[0][0]) and $p->fonctions[0][1]) {
586
+        $p->fonctions = null;
587
+    }
588
+
589
+    if ($p->param and ($c = $p->param[0])) {
590
+        // liste d'arguments commence toujours par la chaine vide
591
+        array_shift($c);
592
+        // construire la liste d'arguments comme pour un filtre
593
+        $param = compose_filtres_args($p, $c, ',');
594
+    } else {
595
+        $param = "";
596
+    }
597
+    $collecte = collecter_balise_dynamique($l, $p, $nom);
598
+
599
+    $p->code = sprintf(CODE_EXECUTER_BALISE, $nom,
600
+        join(',', $collecte),
601
+        ($collecte ? $param : substr($param, 1)), # virer la virgule
602
+        memoriser_contexte_compil($p),
603
+        (!$supp ? '' : (', ' . join(',', $supp))));
604
+
605
+    $p->interdire_scripts = false;
606
+
607
+    return $p;
608 608
 }
609 609
 
610 610
 
@@ -634,13 +634,13 @@  discard block
 block discarded – undo
634 634
  *     Liste des codes PHP d'éxecution des balises collectées
635 635
  **/
636 636
 function collecter_balise_dynamique($l, &$p, $nom) {
637
-	$args = array();
638
-	foreach ($l as $c) {
639
-		$x = calculer_balise($c, $p);
640
-		$args[] = $x->code;
641
-	}
637
+    $args = array();
638
+    foreach ($l as $c) {
639
+        $x = calculer_balise($c, $p);
640
+        $args[] = $x->code;
641
+    }
642 642
 
643
-	return $args;
643
+    return $args;
644 644
 }
645 645
 
646 646
 
@@ -655,20 +655,20 @@  discard block
 block discarded – undo
655 655
  *     Nom de la connexion
656 656
  **/
657 657
 function trouver_nom_serveur_distant($p) {
658
-	$nom = $p->id_boucle;
659
-	if ($nom
660
-		and isset($p->boucles[$nom])
661
-	) {
662
-		$s = $p->boucles[$nom]->sql_serveur;
663
-		if (strlen($s)
664
-			and strlen($serveur = strtolower($s))
665
-			and !in_array($serveur, $GLOBALS['exception_des_connect'])
666
-		) {
667
-			return $serveur;
668
-		}
669
-	}
670
-
671
-	return "";
658
+    $nom = $p->id_boucle;
659
+    if ($nom
660
+        and isset($p->boucles[$nom])
661
+    ) {
662
+        $s = $p->boucles[$nom]->sql_serveur;
663
+        if (strlen($s)
664
+            and strlen($serveur = strtolower($s))
665
+            and !in_array($serveur, $GLOBALS['exception_des_connect'])
666
+        ) {
667
+            return $serveur;
668
+        }
669
+    }
670
+
671
+    return "";
672 672
 }
673 673
 
674 674
 
@@ -692,15 +692,15 @@  discard block
 block discarded – undo
692 692
  *     - false : La balise est interdite car le serveur est distant
693 693
  **/
694 694
 function balise_distante_interdite($p) {
695
-	$nom = $p->id_boucle;
695
+    $nom = $p->id_boucle;
696 696
 
697
-	if ($nom and trouver_nom_serveur_distant($p)) {
698
-		spip_log($nom . ':' . $p->nom_champ . ' ' . _T('zbug_distant_interdit'));
697
+    if ($nom and trouver_nom_serveur_distant($p)) {
698
+        spip_log($nom . ':' . $p->nom_champ . ' ' . _T('zbug_distant_interdit'));
699 699
 
700
-		return false;
701
-	}
700
+        return false;
701
+    }
702 702
 
703
-	return true;
703
+    return true;
704 704
 }
705 705
 
706 706
 
@@ -711,78 +711,78 @@  discard block
 block discarded – undo
711 711
 // https://code.spip.net/@champs_traitements
712 712
 function champs_traitements($p) {
713 713
 
714
-	if (isset($GLOBALS['table_des_traitements'][$p->nom_champ])) {
715
-		$ps = $GLOBALS['table_des_traitements'][$p->nom_champ];
716
-	} else {
717
-		// quand on utilise un traitement catch-all *
718
-		// celui-ci ne s'applique pas sur les balises calculees qui peuvent gerer
719
-		// leur propre securite
720
-		if (!$p->balise_calculee) {
721
-			$ps = $GLOBALS['table_des_traitements']['*'];
722
-		} else {
723
-			$ps = false;
724
-		}
725
-	}
726
-
727
-	if (is_array($ps)) {
728
-		// Recuperer le type de boucle (articles, DATA) et la table SQL sur laquelle elle porte
729
-		$idb = index_boucle($p);
730
-		// mais on peut aussi etre hors boucle. Se mefier.
731
-		$type_requete = isset($p->boucles[$idb]->type_requete) ? $p->boucles[$idb]->type_requete : false;
732
-		$table_sql = isset($p->boucles[$idb]->show['table_sql']) ? $p->boucles[$idb]->show['table_sql'] : false;
733
-
734
-		// bien prendre en compte les alias de boucles (hierarchie => rubrique, syndication => syncdic, etc.)
735
-		if ($type_requete and isset($GLOBALS['table_des_tables'][$type_requete])) {
736
-			$type_alias = $type_requete;
737
-			$type_requete = $GLOBALS['table_des_tables'][$type_requete];
738
-		} else {
739
-			$type_alias = false;
740
-		}
741
-
742
-		// le traitement peut n'etre defini que pour une table en particulier "spip_articles"
743
-		if ($table_sql and isset($ps[$table_sql])) {
744
-			$ps = $ps[$table_sql];
745
-		} // ou pour une boucle en particulier "DATA","articles"
746
-		elseif ($type_requete and isset($ps[$type_requete])) {
747
-			$ps = $ps[$type_requete];
748
-		} // ou pour une boucle utilisant un alias ("hierarchie")
749
-		elseif ($type_alias and isset($ps[$type_alias])) {
750
-			$ps = $ps[$type_alias];
751
-		} // ou pour indifféremment quelle que soit la boucle
752
-		elseif (isset($ps[0])) {
753
-			$ps = $ps[0];
754
-		} else {
755
-			$ps = false;
756
-		}
757
-	}
758
-
759
-	if (!$ps) {
760
-		return $p->code;
761
-	}
762
-
763
-	// Si une boucle DOCUMENTS{doublons} est presente dans le squelette,
764
-	// ou si in INCLURE contient {doublons}
765
-	// on insere une fonction de remplissage du tableau des doublons 
766
-	// dans les filtres propre() ou typo()
767
-	// (qui traitent les raccourcis <docXX> referencant les docs)
768
-
769
-	if (isset($p->descr['documents'])
770
-		and
771
-		$p->descr['documents']
772
-		and (
773
-			(strpos($ps, 'propre') !== false)
774
-			or
775
-			(strpos($ps, 'typo') !== false)
776
-		)
777
-	) {
778
-		$ps = 'traiter_doublons_documents($doublons, ' . $ps . ')';
779
-	}
780
-
781
-	// La protection des champs par |safehtml est assuree par les extensions
782
-	// dans la declaration des traitements des champs sensibles
783
-
784
-	// Remplacer enfin le placeholder %s par le vrai code de la balise
785
-	return str_replace('%s', $p->code, $ps);
714
+    if (isset($GLOBALS['table_des_traitements'][$p->nom_champ])) {
715
+        $ps = $GLOBALS['table_des_traitements'][$p->nom_champ];
716
+    } else {
717
+        // quand on utilise un traitement catch-all *
718
+        // celui-ci ne s'applique pas sur les balises calculees qui peuvent gerer
719
+        // leur propre securite
720
+        if (!$p->balise_calculee) {
721
+            $ps = $GLOBALS['table_des_traitements']['*'];
722
+        } else {
723
+            $ps = false;
724
+        }
725
+    }
726
+
727
+    if (is_array($ps)) {
728
+        // Recuperer le type de boucle (articles, DATA) et la table SQL sur laquelle elle porte
729
+        $idb = index_boucle($p);
730
+        // mais on peut aussi etre hors boucle. Se mefier.
731
+        $type_requete = isset($p->boucles[$idb]->type_requete) ? $p->boucles[$idb]->type_requete : false;
732
+        $table_sql = isset($p->boucles[$idb]->show['table_sql']) ? $p->boucles[$idb]->show['table_sql'] : false;
733
+
734
+        // bien prendre en compte les alias de boucles (hierarchie => rubrique, syndication => syncdic, etc.)
735
+        if ($type_requete and isset($GLOBALS['table_des_tables'][$type_requete])) {
736
+            $type_alias = $type_requete;
737
+            $type_requete = $GLOBALS['table_des_tables'][$type_requete];
738
+        } else {
739
+            $type_alias = false;
740
+        }
741
+
742
+        // le traitement peut n'etre defini que pour une table en particulier "spip_articles"
743
+        if ($table_sql and isset($ps[$table_sql])) {
744
+            $ps = $ps[$table_sql];
745
+        } // ou pour une boucle en particulier "DATA","articles"
746
+        elseif ($type_requete and isset($ps[$type_requete])) {
747
+            $ps = $ps[$type_requete];
748
+        } // ou pour une boucle utilisant un alias ("hierarchie")
749
+        elseif ($type_alias and isset($ps[$type_alias])) {
750
+            $ps = $ps[$type_alias];
751
+        } // ou pour indifféremment quelle que soit la boucle
752
+        elseif (isset($ps[0])) {
753
+            $ps = $ps[0];
754
+        } else {
755
+            $ps = false;
756
+        }
757
+    }
758
+
759
+    if (!$ps) {
760
+        return $p->code;
761
+    }
762
+
763
+    // Si une boucle DOCUMENTS{doublons} est presente dans le squelette,
764
+    // ou si in INCLURE contient {doublons}
765
+    // on insere une fonction de remplissage du tableau des doublons 
766
+    // dans les filtres propre() ou typo()
767
+    // (qui traitent les raccourcis <docXX> referencant les docs)
768
+
769
+    if (isset($p->descr['documents'])
770
+        and
771
+        $p->descr['documents']
772
+        and (
773
+            (strpos($ps, 'propre') !== false)
774
+            or
775
+            (strpos($ps, 'typo') !== false)
776
+        )
777
+    ) {
778
+        $ps = 'traiter_doublons_documents($doublons, ' . $ps . ')';
779
+    }
780
+
781
+    // La protection des champs par |safehtml est assuree par les extensions
782
+    // dans la declaration des traitements des champs sensibles
783
+
784
+    // Remplacer enfin le placeholder %s par le vrai code de la balise
785
+    return str_replace('%s', $p->code, $ps);
786 786
 }
787 787
 
788 788
 
@@ -795,109 +795,109 @@  discard block
 block discarded – undo
795 795
 // https://code.spip.net/@applique_filtres
796 796
 function applique_filtres($p) {
797 797
 
798
-	// Traitements standards (cf. supra)
799
-	if ($p->etoile == '') {
800
-		$code = champs_traitements($p);
801
-	} else {
802
-		$code = $p->code;
803
-	}
798
+    // Traitements standards (cf. supra)
799
+    if ($p->etoile == '') {
800
+        $code = champs_traitements($p);
801
+    } else {
802
+        $code = $p->code;
803
+    }
804 804
 
805
-	// Appliquer les filtres perso
806
-	if ($p->param) {
807
-		$code = compose_filtres($p, $code);
808
-	}
805
+    // Appliquer les filtres perso
806
+    if ($p->param) {
807
+        $code = compose_filtres($p, $code);
808
+    }
809 809
 
810
-	// S'il y a un lien avec la session, ajouter un code qui levera
811
-	// un drapeau dans la structure d'invalidation $Cache
812
-	if (isset($p->descr['session'])) {
813
-		$code = "invalideur_session(\$Cache, $code)";
814
-	}
810
+    // S'il y a un lien avec la session, ajouter un code qui levera
811
+    // un drapeau dans la structure d'invalidation $Cache
812
+    if (isset($p->descr['session'])) {
813
+        $code = "invalideur_session(\$Cache, $code)";
814
+    }
815 815
 
816
-	$code = sandbox_composer_interdire_scripts($code, $p);
816
+    $code = sandbox_composer_interdire_scripts($code, $p);
817 817
 
818
-	return $code;
818
+    return $code;
819 819
 }
820 820
 
821 821
 // Cf. function pipeline dans ecrire/inc_utils.php
822 822
 // https://code.spip.net/@compose_filtres
823 823
 function compose_filtres(&$p, $code) {
824 824
 
825
-	$image_miette = false;
826
-	foreach ($p->param as $filtre) {
827
-		$fonc = array_shift($filtre);
828
-		if (!$fonc) {
829
-			continue;
830
-		} // normalement qu'au premier tour.
831
-		$is_filtre_image = ((substr($fonc, 0, 6) == 'image_') and $fonc != 'image_graver');
832
-		if ($image_miette and !$is_filtre_image) {
833
-			// il faut graver maintenant car apres le filtre en cours
834
-			// on est pas sur d'avoir encore le nom du fichier dans le pipe
835
-			$code = "filtrer('image_graver', $code)";
836
-			$image_miette = false;
837
-		}
838
-		// recuperer les arguments du filtre, 
839
-		// a separer par "," ou ":" dans le cas du filtre "?{a,b}"
840
-		if ($fonc !== '?') {
841
-			$sep = ',';
842
-		} else {
843
-			$sep = ':';
844
-			// |?{a,b} *doit* avoir exactement 2 arguments ; on les force
845
-			if (count($filtre) != 2) {
846
-				$filtre = array(isset($filtre[0]) ? $filtre[0] : "", isset($filtre[1]) ? $filtre[1] : "");
847
-			}
848
-		}
849
-		$arglist = compose_filtres_args($p, $filtre, $sep);
850
-		$logique = filtre_logique($fonc, $code, substr($arglist, 1));
851
-		if ($logique) {
852
-			$code = $logique;
853
-		} else {
854
-			$code = sandbox_composer_filtre($fonc, $code, $arglist, $p);
855
-			if ($is_filtre_image) {
856
-				$image_miette = true;
857
-			}
858
-		}
859
-	}
860
-	// ramasser les images intermediaires inutiles et graver l'image finale
861
-	if ($image_miette) {
862
-		$code = "filtrer('image_graver',$code)";
863
-	}
864
-
865
-	return $code;
825
+    $image_miette = false;
826
+    foreach ($p->param as $filtre) {
827
+        $fonc = array_shift($filtre);
828
+        if (!$fonc) {
829
+            continue;
830
+        } // normalement qu'au premier tour.
831
+        $is_filtre_image = ((substr($fonc, 0, 6) == 'image_') and $fonc != 'image_graver');
832
+        if ($image_miette and !$is_filtre_image) {
833
+            // il faut graver maintenant car apres le filtre en cours
834
+            // on est pas sur d'avoir encore le nom du fichier dans le pipe
835
+            $code = "filtrer('image_graver', $code)";
836
+            $image_miette = false;
837
+        }
838
+        // recuperer les arguments du filtre, 
839
+        // a separer par "," ou ":" dans le cas du filtre "?{a,b}"
840
+        if ($fonc !== '?') {
841
+            $sep = ',';
842
+        } else {
843
+            $sep = ':';
844
+            // |?{a,b} *doit* avoir exactement 2 arguments ; on les force
845
+            if (count($filtre) != 2) {
846
+                $filtre = array(isset($filtre[0]) ? $filtre[0] : "", isset($filtre[1]) ? $filtre[1] : "");
847
+            }
848
+        }
849
+        $arglist = compose_filtres_args($p, $filtre, $sep);
850
+        $logique = filtre_logique($fonc, $code, substr($arglist, 1));
851
+        if ($logique) {
852
+            $code = $logique;
853
+        } else {
854
+            $code = sandbox_composer_filtre($fonc, $code, $arglist, $p);
855
+            if ($is_filtre_image) {
856
+                $image_miette = true;
857
+            }
858
+        }
859
+    }
860
+    // ramasser les images intermediaires inutiles et graver l'image finale
861
+    if ($image_miette) {
862
+        $code = "filtrer('image_graver',$code)";
863
+    }
864
+
865
+    return $code;
866 866
 }
867 867
 
868 868
 // Filtres et,ou,oui,non,sinon,xou,xor,and,or,not,yes
869 869
 // et comparateurs
870 870
 function filtre_logique($fonc, $code, $arg) {
871 871
 
872
-	switch (true) {
873
-		case in_array($fonc, $GLOBALS['table_criteres_infixes']):
874
-			return "($code $fonc $arg)";
875
-		case ($fonc == 'and') or ($fonc == 'et'):
876
-			return "((($code) AND ($arg)) ?' ' :'')";
877
-		case ($fonc == 'or') or ($fonc == 'ou'):
878
-			return "((($code) OR ($arg)) ?' ' :'')";
879
-		case ($fonc == 'xor') or ($fonc == 'xou'):
880
-			return "((($code) XOR ($arg)) ?' ' :'')";
881
-		case ($fonc == 'sinon'):
882
-			return "(((\$a = $code) OR (is_string(\$a) AND strlen(\$a))) ? \$a : $arg)";
883
-		case ($fonc == 'not') or ($fonc == 'non'):
884
-			return "(($code) ?'' :' ')";
885
-		case ($fonc == 'yes') or ($fonc == 'oui'):
886
-			return "(($code) ?' ' :'')";
887
-	}
888
-
889
-	return '';
872
+    switch (true) {
873
+        case in_array($fonc, $GLOBALS['table_criteres_infixes']):
874
+            return "($code $fonc $arg)";
875
+        case ($fonc == 'and') or ($fonc == 'et'):
876
+            return "((($code) AND ($arg)) ?' ' :'')";
877
+        case ($fonc == 'or') or ($fonc == 'ou'):
878
+            return "((($code) OR ($arg)) ?' ' :'')";
879
+        case ($fonc == 'xor') or ($fonc == 'xou'):
880
+            return "((($code) XOR ($arg)) ?' ' :'')";
881
+        case ($fonc == 'sinon'):
882
+            return "(((\$a = $code) OR (is_string(\$a) AND strlen(\$a))) ? \$a : $arg)";
883
+        case ($fonc == 'not') or ($fonc == 'non'):
884
+            return "(($code) ?'' :' ')";
885
+        case ($fonc == 'yes') or ($fonc == 'oui'):
886
+            return "(($code) ?' ' :'')";
887
+    }
888
+
889
+    return '';
890 890
 }
891 891
 
892 892
 // https://code.spip.net/@compose_filtres_args
893 893
 function compose_filtres_args($p, $args, $sep) {
894
-	$arglist = "";
895
-	foreach ($args as $arg) {
896
-		$arglist .= $sep .
897
-			calculer_liste($arg, $p->descr, $p->boucles, $p->id_boucle);
898
-	}
894
+    $arglist = "";
895
+    foreach ($args as $arg) {
896
+        $arglist .= $sep .
897
+            calculer_liste($arg, $p->descr, $p->boucles, $p->id_boucle);
898
+    }
899 899
 
900
-	return $arglist;
900
+    return $arglist;
901 901
 }
902 902
 
903 903
 
@@ -915,15 +915,15 @@  discard block
 block discarded – undo
915 915
  **/
916 916
 function calculer_argument_precedent($idb, $nom_champ, &$boucles, $defaut = null) {
917 917
 
918
-	// si recursif, forcer l'extraction du champ SQL mais ignorer le code
919
-	if ($boucles[$idb]->externe) {
920
-		index_pile($idb, $nom_champ, $boucles, '', $defaut);
921
-		// retourner $Pile[$SP] et pas $Pile[0] si recursion en 1ere boucle
922
-		// on ignore le defaut fourni dans ce cas
923
-		$defaut = "@\$Pile[\$SP]['$nom_champ']";
924
-	}
918
+    // si recursif, forcer l'extraction du champ SQL mais ignorer le code
919
+    if ($boucles[$idb]->externe) {
920
+        index_pile($idb, $nom_champ, $boucles, '', $defaut);
921
+        // retourner $Pile[$SP] et pas $Pile[0] si recursion en 1ere boucle
922
+        // on ignore le defaut fourni dans ce cas
923
+        $defaut = "@\$Pile[\$SP]['$nom_champ']";
924
+    }
925 925
 
926
-	return index_pile($boucles[$idb]->id_parent, $nom_champ, $boucles, '', $defaut);
926
+    return index_pile($boucles[$idb]->id_parent, $nom_champ, $boucles, '', $defaut);
927 927
 }
928 928
 
929 929
 //
@@ -938,30 +938,30 @@  discard block
 block discarded – undo
938 938
 
939 939
 // https://code.spip.net/@rindex_pile
940 940
 function rindex_pile($p, $champ, $motif) {
941
-	$n = 0;
942
-	$b = $p->id_boucle;
943
-	$p->code = '';
944
-	while ($b != '') {
945
-		foreach ($p->boucles[$b]->criteres as $critere) {
946
-			if ($critere->op == $motif) {
947
-				$p->code = '$Pile[$SP' . (($n == 0) ? "" : "-$n") .
948
-					"]['$champ']";
949
-				$b = '';
950
-				break 2;
951
-			}
952
-		}
953
-		$n++;
954
-		$b = $p->boucles[$b]->id_parent;
955
-	}
956
-
957
-	// si on est hors d'une boucle de {recherche}, cette balise est vide
958
-	if (!$p->code) {
959
-		$p->code = "''";
960
-	}
961
-
962
-	$p->interdire_scripts = false;
963
-
964
-	return $p;
941
+    $n = 0;
942
+    $b = $p->id_boucle;
943
+    $p->code = '';
944
+    while ($b != '') {
945
+        foreach ($p->boucles[$b]->criteres as $critere) {
946
+            if ($critere->op == $motif) {
947
+                $p->code = '$Pile[$SP' . (($n == 0) ? "" : "-$n") .
948
+                    "]['$champ']";
949
+                $b = '';
950
+                break 2;
951
+            }
952
+        }
953
+        $n++;
954
+        $b = $p->boucles[$b]->id_parent;
955
+    }
956
+
957
+    // si on est hors d'une boucle de {recherche}, cette balise est vide
958
+    if (!$p->code) {
959
+        $p->code = "''";
960
+    }
961
+
962
+    $p->interdire_scripts = false;
963
+
964
+    return $p;
965 965
 }
966 966
 
967 967
 /** 
@@ -971,7 +971,7 @@  discard block
 block discarded – undo
971 971
  * @return string Nom de la balise, avec indication de boucle explicite si présent.
972 972
  */
973 973
 function zbug_presenter_champ($p, $champ = "") {
974
-	$balise = $champ ? $champ : $p->nom_champ;
975
-	$explicite = $explicite = $p->nom_boucle ? $p->nom_boucle . ':' : '';
976
-	return "#{$explicite}{$balise}";
974
+    $balise = $champ ? $champ : $p->nom_champ;
975
+    $explicite = $explicite = $p->nom_boucle ? $p->nom_boucle . ':' : '';
976
+    return "#{$explicite}{$balise}";
977 977
 }
978 978
\ No newline at end of file
Please login to merge, or discard this patch.
ecrire/public/compiler.php 4 patches
Braces   +1 added lines, -2 removed lines patch added patch discarded remove patch
@@ -890,8 +890,7 @@
 block discarded – undo
890 890
 			if (isset($boucles[$idb]->descr['sourcefile'])) {
891 891
 				$descr['sourcefile'] = $boucles[$idb]->descr['sourcefile'];
892 892
 			}
893
-		}
894
-		else {
893
+		} else {
895 894
 			$descr = array();
896 895
 		}
897 896
 	}
Please login to merge, or discard this patch.
Doc Comments   +11 added lines, -1 removed lines patch added patch discarded remove patch
@@ -59,6 +59,10 @@  discard block
 block discarded – undo
59 59
 
60 60
 
61 61
 // https://code.spip.net/@argumenter_inclure
62
+/**
63
+ * @param boolean $rejet_filtres
64
+ * @param string $id_boucle
65
+ */
62 66
 function argumenter_inclure(
63 67
 	$params,
64 68
 	$rejet_filtres,
@@ -751,7 +755,7 @@  discard block
 block discarded – undo
751 755
  *    Nom de la commande
752 756
  * @param string $val
753 757
  *    Code PHP décrivant la valeur à affecter
754
- * @return array
758
+ * @return string[]
755 759
  *
756 760
  *    - index 0 : Code pour une affectation statique. Si non rempli, la propriété devra
757 761
  *                être ré-affectée à chaque appel de la boucle.
@@ -859,6 +863,9 @@  discard block
 block discarded – undo
859 863
 }
860 864
 
861 865
 // https://code.spip.net/@calculer_order
866
+/**
867
+ * @param Boucle $boucle
868
+ */
862 869
 function calculer_order(&$boucle) {
863 870
 	if (!$order = $boucle->order
864 871
 		and !$order = $boucle->default_order
@@ -944,6 +951,9 @@  discard block
 block discarded – undo
944 951
 define('_REGEXP_CONCAT_NON_VIDE', "/^(.*)[.]\s*'[^']+'\s*$/");
945 952
 
946 953
 // https://code.spip.net/@compile_cas
954
+/**
955
+ * @param string $id_boucle
956
+ */
947 957
 function compile_cas($tableau, $descr, &$boucles, $id_boucle) {
948 958
 
949 959
 	$codes = array();
Please login to merge, or discard this patch.
Indentation   +1169 added lines, -1169 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
 /** Repérer un code ne calculant rien, meme avec commentaire */
@@ -60,91 +60,91 @@  discard block
 block discarded – undo
60 60
 
61 61
 // https://code.spip.net/@argumenter_inclure
62 62
 function argumenter_inclure(
63
-	$params,
64
-	$rejet_filtres,
65
-	$p,
66
-	&$boucles,
67
-	$id_boucle,
68
-	$echap = true,
69
-	$lang = '',
70
-	$fond1 = false
63
+    $params,
64
+    $rejet_filtres,
65
+    $p,
66
+    &$boucles,
67
+    $id_boucle,
68
+    $echap = true,
69
+    $lang = '',
70
+    $fond1 = false
71 71
 ) {
72
-	$l = array();
73
-	$erreur_p_i_i = '';
74
-	if (!is_array($params)) {
75
-		return $l;
76
-	}
77
-	foreach ($params as $k => $couple) {
78
-		// la liste d'arguments d'inclusion peut se terminer par un filtre
79
-		$filtre = array_shift($couple);
80
-		if ($filtre) {
81
-			break;
82
-		}
83
-		foreach ($couple as $n => $val) {
84
-			$var = $val[0];
85
-			if ($var->type != 'texte') {
86
-				if ($n or $k or $fond1) {
87
-					$erreur_p_i_i = array(
88
-						'zbug_parametres_inclus_incorrects',
89
-						array('param' => $var->nom_champ)
90
-					);
91
-					erreur_squelette($erreur_p_i_i, $p);
92
-					break;
93
-				} else {
94
-					$l[1] = calculer_liste($val, $p->descr, $boucles, $id_boucle);
95
-				}
96
-			} else {
97
-				preg_match(",^([^=]*)(=?)(.*)$,m", $var->texte, $m);
98
-				$m = array_pad($m, 3, null);
99
-				$var = $m[1];
100
-				$auto = false;;
101
-				if ($m[2]) {
102
-					$v = $m[3];
103
-					if (preg_match(',^[\'"](.*)[\'"]$,', $v, $m)) {
104
-						$v = $m[1];
105
-					}
106
-					$val[0] = new Texte;
107
-					$val[0]->texte = $v;
108
-				} elseif ($k or $n or $fond1) {
109
-					$auto = true;
110
-				} else {
111
-					$var = 1;
112
-				}
113
-
114
-				if ($var == 'lang') {
115
-					$lang = !$auto
116
-						? calculer_liste($val, $p->descr, $boucles, $id_boucle)
117
-						: '$GLOBALS["spip_lang"]';
118
-				} else {
119
-					$val = $auto
120
-						? index_pile($id_boucle, $var, $boucles)
121
-						: calculer_liste($val, $p->descr, $boucles, $id_boucle);
122
-					if ($var !== 1) {
123
-						$val = ($echap ? "\'$var\' => ' . argumenter_squelette(" : "'$var' => ")
124
-							. $val . ($echap ? ") . '" : " ");
125
-					} else {
126
-						$val = $echap ? "'.$val.'" : $val;
127
-					}
128
-					$l[$var] = $val;
129
-				}
130
-			}
131
-		}
132
-	}
133
-	if ($erreur_p_i_i) {
134
-		return false;
135
-	}
136
-	// Cas particulier de la langue : si {lang=xx} est definie, on
137
-	// la passe, sinon on passe la langue courante au moment du calcul
138
-	// sauf si on n'en veut pas 
139
-	if ($lang === false) {
140
-		return $l;
141
-	}
142
-	if (!$lang) {
143
-		$lang = '$GLOBALS["spip_lang"]';
144
-	}
145
-	$l['lang'] = ($echap ? "\'lang\' => ' . argumenter_squelette(" : "'lang' => ") . $lang . ($echap ? ") . '" : " ");
146
-
147
-	return $l;
72
+    $l = array();
73
+    $erreur_p_i_i = '';
74
+    if (!is_array($params)) {
75
+        return $l;
76
+    }
77
+    foreach ($params as $k => $couple) {
78
+        // la liste d'arguments d'inclusion peut se terminer par un filtre
79
+        $filtre = array_shift($couple);
80
+        if ($filtre) {
81
+            break;
82
+        }
83
+        foreach ($couple as $n => $val) {
84
+            $var = $val[0];
85
+            if ($var->type != 'texte') {
86
+                if ($n or $k or $fond1) {
87
+                    $erreur_p_i_i = array(
88
+                        'zbug_parametres_inclus_incorrects',
89
+                        array('param' => $var->nom_champ)
90
+                    );
91
+                    erreur_squelette($erreur_p_i_i, $p);
92
+                    break;
93
+                } else {
94
+                    $l[1] = calculer_liste($val, $p->descr, $boucles, $id_boucle);
95
+                }
96
+            } else {
97
+                preg_match(",^([^=]*)(=?)(.*)$,m", $var->texte, $m);
98
+                $m = array_pad($m, 3, null);
99
+                $var = $m[1];
100
+                $auto = false;;
101
+                if ($m[2]) {
102
+                    $v = $m[3];
103
+                    if (preg_match(',^[\'"](.*)[\'"]$,', $v, $m)) {
104
+                        $v = $m[1];
105
+                    }
106
+                    $val[0] = new Texte;
107
+                    $val[0]->texte = $v;
108
+                } elseif ($k or $n or $fond1) {
109
+                    $auto = true;
110
+                } else {
111
+                    $var = 1;
112
+                }
113
+
114
+                if ($var == 'lang') {
115
+                    $lang = !$auto
116
+                        ? calculer_liste($val, $p->descr, $boucles, $id_boucle)
117
+                        : '$GLOBALS["spip_lang"]';
118
+                } else {
119
+                    $val = $auto
120
+                        ? index_pile($id_boucle, $var, $boucles)
121
+                        : calculer_liste($val, $p->descr, $boucles, $id_boucle);
122
+                    if ($var !== 1) {
123
+                        $val = ($echap ? "\'$var\' => ' . argumenter_squelette(" : "'$var' => ")
124
+                            . $val . ($echap ? ") . '" : " ");
125
+                    } else {
126
+                        $val = $echap ? "'.$val.'" : $val;
127
+                    }
128
+                    $l[$var] = $val;
129
+                }
130
+            }
131
+        }
132
+    }
133
+    if ($erreur_p_i_i) {
134
+        return false;
135
+    }
136
+    // Cas particulier de la langue : si {lang=xx} est definie, on
137
+    // la passe, sinon on passe la langue courante au moment du calcul
138
+    // sauf si on n'en veut pas 
139
+    if ($lang === false) {
140
+        return $l;
141
+    }
142
+    if (!$lang) {
143
+        $lang = '$GLOBALS["spip_lang"]';
144
+    }
145
+    $l['lang'] = ($echap ? "\'lang\' => ' . argumenter_squelette(" : "'lang' => ") . $lang . ($echap ? ") . '" : " ");
146
+
147
+    return $l;
148 148
 }
149 149
 
150 150
 /**
@@ -168,77 +168,77 @@  discard block
 block discarded – undo
168 168
  **/
169 169
 function calculer_inclure($p, &$boucles, $id_boucle) {
170 170
 
171
-	$_contexte = argumenter_inclure($p->param, false, $p, $boucles, $id_boucle, true, '', true);
172
-	if (is_string($p->texte)) {
173
-		$fichier = $p->texte;
174
-		$code = "\"".str_replace('"','\"',$fichier)."\"";
175
-
176
-	} else {
177
-		$code = calculer_liste($p->texte, $p->descr, $boucles, $id_boucle);
178
-		if ($code and preg_match("/^'([^']*)'/s", $code, $r)) {
179
-			$fichier = $r[1];
180
-		} else {
181
-			$fichier = '';
182
-		}
183
-	}
184
-	if (!$code or $code === '""' or $code === "''") {
185
-		$trace = $p->fonctions;
186
-		while (is_array($trace)
187
-		  and $trace = array_filter($trace)
188
-			and count($trace)==1) {
189
-			$trace = reset($trace);
190
-		}
191
-		$erreur_p_i_i = array(
192
-			'zbug_parametres_inclus_incorrects',
193
-			array('param' => print_r($trace, true))
194
-		);
195
-		erreur_squelette($erreur_p_i_i, $p);
196
-
197
-		return "''";
198
-	}
199
-	$compil = texte_script(memoriser_contexte_compil($p));
200
-
201
-	if (is_array($_contexte)) {
202
-		// Critere d'inclusion {env} (et {self} pour compatibilite ascendante)
203
-		if ($env = (isset($_contexte['env']) || isset($_contexte['self']))) {
204
-			unset($_contexte['env']);
205
-		}
206
-
207
-		// noter les doublons dans l'appel a public.php
208
-		if (isset($_contexte['doublons'])) {
209
-			$_contexte['doublons'] = "\\'doublons\\' => '.var_export(\$doublons,true).'";
210
-		}
211
-
212
-		if ($ajax = isset($_contexte['ajax'])) {
213
-			$ajax = preg_replace(",=>(.*)$,ims", '=> ($v=(\\1))?$v:true', $_contexte['ajax']);
214
-			unset($_contexte['ajax']);
215
-		}
216
-
217
-		$_contexte = join(",\n\t", $_contexte);
218
-	} else {
219
-		return false;
220
-	} // j'aurais voulu toucher le fond ...
221
-
222
-	$contexte = 'array(' . $_contexte . ')';
223
-
224
-	if ($env) {
225
-		$contexte = "array_merge('.var_export(\$Pile[0],1).',$contexte)";
226
-	}
227
-
228
-	// s'il y a une extension .php, ce n'est pas un squelette
229
-	if ($fichier and preg_match('/^.+[.]php$/s', $fichier)) {
230
-		$code = sandbox_composer_inclure_php($fichier, $p, $contexte);
231
-	} else {
232
-		$_options[] = "\"compil\"=>array($compil)";
233
-		if ($ajax) {
234
-			$_options[] = $ajax;
235
-		}
236
-		$code = " ' . argumenter_squelette($code) . '";
237
-		$code = "echo " . sprintf(CODE_RECUPERER_FOND, $code, $contexte, implode(',', $_options),
238
-				"_request(\"connect\")") . ';';
239
-	}
240
-
241
-	return "\n'<'.'" . "?php " . $code . "\n?'." . "'>'";
171
+    $_contexte = argumenter_inclure($p->param, false, $p, $boucles, $id_boucle, true, '', true);
172
+    if (is_string($p->texte)) {
173
+        $fichier = $p->texte;
174
+        $code = "\"".str_replace('"','\"',$fichier)."\"";
175
+
176
+    } else {
177
+        $code = calculer_liste($p->texte, $p->descr, $boucles, $id_boucle);
178
+        if ($code and preg_match("/^'([^']*)'/s", $code, $r)) {
179
+            $fichier = $r[1];
180
+        } else {
181
+            $fichier = '';
182
+        }
183
+    }
184
+    if (!$code or $code === '""' or $code === "''") {
185
+        $trace = $p->fonctions;
186
+        while (is_array($trace)
187
+          and $trace = array_filter($trace)
188
+            and count($trace)==1) {
189
+            $trace = reset($trace);
190
+        }
191
+        $erreur_p_i_i = array(
192
+            'zbug_parametres_inclus_incorrects',
193
+            array('param' => print_r($trace, true))
194
+        );
195
+        erreur_squelette($erreur_p_i_i, $p);
196
+
197
+        return "''";
198
+    }
199
+    $compil = texte_script(memoriser_contexte_compil($p));
200
+
201
+    if (is_array($_contexte)) {
202
+        // Critere d'inclusion {env} (et {self} pour compatibilite ascendante)
203
+        if ($env = (isset($_contexte['env']) || isset($_contexte['self']))) {
204
+            unset($_contexte['env']);
205
+        }
206
+
207
+        // noter les doublons dans l'appel a public.php
208
+        if (isset($_contexte['doublons'])) {
209
+            $_contexte['doublons'] = "\\'doublons\\' => '.var_export(\$doublons,true).'";
210
+        }
211
+
212
+        if ($ajax = isset($_contexte['ajax'])) {
213
+            $ajax = preg_replace(",=>(.*)$,ims", '=> ($v=(\\1))?$v:true', $_contexte['ajax']);
214
+            unset($_contexte['ajax']);
215
+        }
216
+
217
+        $_contexte = join(",\n\t", $_contexte);
218
+    } else {
219
+        return false;
220
+    } // j'aurais voulu toucher le fond ...
221
+
222
+    $contexte = 'array(' . $_contexte . ')';
223
+
224
+    if ($env) {
225
+        $contexte = "array_merge('.var_export(\$Pile[0],1).',$contexte)";
226
+    }
227
+
228
+    // s'il y a une extension .php, ce n'est pas un squelette
229
+    if ($fichier and preg_match('/^.+[.]php$/s', $fichier)) {
230
+        $code = sandbox_composer_inclure_php($fichier, $p, $contexte);
231
+    } else {
232
+        $_options[] = "\"compil\"=>array($compil)";
233
+        if ($ajax) {
234
+            $_options[] = $ajax;
235
+        }
236
+        $code = " ' . argumenter_squelette($code) . '";
237
+        $code = "echo " . sprintf(CODE_RECUPERER_FOND, $code, $contexte, implode(',', $_options),
238
+                "_request(\"connect\")") . ';';
239
+    }
240
+
241
+    return "\n'<'.'" . "?php " . $code . "\n?'." . "'>'";
242 242
 }
243 243
 
244 244
 
@@ -256,7 +256,7 @@  discard block
 block discarded – undo
256 256
  *     true pour ne tester que le cas publie et ignorer l'eventuel var_mode=preview de la page
257 257
  */
258 258
 function instituer_boucle(&$boucle, $echapper = true, $ignore_previsu = false) {
259
-	/*
259
+    /*
260 260
 	$show['statut'][] = array(
261 261
 		'champ'=>'statut',  // champ de la table sur lequel porte le filtrage par le statut
262 262
 		'publie'=>'publie', // valeur ou liste de valeurs, qui definissent l'objet comme publie.
@@ -280,71 +280,71 @@  discard block
 block discarded – undo
280 280
 	champstatut est alors le champ statut sur la tablen
281 281
 	dans les jointures, clen peut etre un tableau pour une jointure complexe : array('id_objet','id_article','objet','article')
282 282
 */
283
-	$id_table = $boucle->id_table;
284
-	$show = $boucle->show;
285
-	if (isset($show['statut']) and $show['statut']) {
286
-		foreach ($show['statut'] as $k => $s) {
287
-			// Restreindre aux elements publies si pas de {statut} ou autre dans les criteres
288
-			$filtrer = true;
289
-			if (isset($s['exception'])) {
290
-				foreach (is_array($s['exception']) ? $s['exception'] : array($s['exception']) as $m) {
291
-					if (isset($boucle->modificateur[$m]) or isset($boucle->modificateur['criteres'][$m])) {
292
-						$filtrer = false;
293
-						break;
294
-					}
295
-				}
296
-			}
297
-
298
-			if ($filtrer) {
299
-				if (is_array($s['champ'])) {
300
-					$statut = preg_replace(',\W,', '', array_pop($s['champ'])); // securite
301
-					$jointures = array();
302
-					// indiquer la description de chaque table dans le tableau de jointures,
303
-					// ce qui permet d'eviter certains GROUP BY inutiles.
304
-					$trouver_table = charger_fonction('trouver_table', 'base');
305
-					foreach ($s['champ'] as $j) {
306
-						$id = reset($j);
307
-						$def = $trouver_table($id);
308
-						$jointures[] = array('', array($id, $def), end($j));
309
-					}
310
-					$jointures[0][0] = $id_table;
311
-					if (!array_search($id, $boucle->from)) {
312
-						include_spip('public/jointures');
313
-						fabrique_jointures($boucle, $jointures, true, $boucle->show, $id_table, '', $echapper);
314
-					}
315
-					// trouver l'alias de la table d'arrivee qui porte le statut
316
-					$id = array_search($id, $boucle->from);
317
-				} else {
318
-					$id = $id_table;
319
-					$statut = preg_replace(',\W,', '', $s['champ']); // securite
320
-				}
321
-				$mstatut = $id . '.' . $statut;
322
-
323
-				$arg_ignore_previsu = ($ignore_previsu ? ",true" : '');
324
-				include_spip('public/quete');
325
-				if (isset($s['post_date']) and $s['post_date']
326
-					and $GLOBALS['meta']["post_dates"] == 'non'
327
-				) {
328
-					$date = $id . '.' . preg_replace(',\W,', '', $s['post_date']); // securite
329
-					array_unshift($boucle->where,
330
-						$echapper ?
331
-							"\nquete_condition_postdates('$date'," . _q($boucle->sql_serveur) . "$arg_ignore_previsu)"
332
-							:
333
-							quete_condition_postdates($date, $boucle->sql_serveur, $ignore_previsu)
334
-					);
335
-				}
336
-				array_unshift($boucle->where,
337
-					$echapper ?
338
-						"\nquete_condition_statut('$mstatut',"
339
-						. _q($s['previsu']) . ","
340
-						. _q($s['publie']) . ","
341
-						. _q($boucle->sql_serveur) . "$arg_ignore_previsu)"
342
-						:
343
-						quete_condition_statut($mstatut, $s['previsu'], $s['publie'], $boucle->sql_serveur, $ignore_previsu)
344
-				);
345
-			}
346
-		}
347
-	}
283
+    $id_table = $boucle->id_table;
284
+    $show = $boucle->show;
285
+    if (isset($show['statut']) and $show['statut']) {
286
+        foreach ($show['statut'] as $k => $s) {
287
+            // Restreindre aux elements publies si pas de {statut} ou autre dans les criteres
288
+            $filtrer = true;
289
+            if (isset($s['exception'])) {
290
+                foreach (is_array($s['exception']) ? $s['exception'] : array($s['exception']) as $m) {
291
+                    if (isset($boucle->modificateur[$m]) or isset($boucle->modificateur['criteres'][$m])) {
292
+                        $filtrer = false;
293
+                        break;
294
+                    }
295
+                }
296
+            }
297
+
298
+            if ($filtrer) {
299
+                if (is_array($s['champ'])) {
300
+                    $statut = preg_replace(',\W,', '', array_pop($s['champ'])); // securite
301
+                    $jointures = array();
302
+                    // indiquer la description de chaque table dans le tableau de jointures,
303
+                    // ce qui permet d'eviter certains GROUP BY inutiles.
304
+                    $trouver_table = charger_fonction('trouver_table', 'base');
305
+                    foreach ($s['champ'] as $j) {
306
+                        $id = reset($j);
307
+                        $def = $trouver_table($id);
308
+                        $jointures[] = array('', array($id, $def), end($j));
309
+                    }
310
+                    $jointures[0][0] = $id_table;
311
+                    if (!array_search($id, $boucle->from)) {
312
+                        include_spip('public/jointures');
313
+                        fabrique_jointures($boucle, $jointures, true, $boucle->show, $id_table, '', $echapper);
314
+                    }
315
+                    // trouver l'alias de la table d'arrivee qui porte le statut
316
+                    $id = array_search($id, $boucle->from);
317
+                } else {
318
+                    $id = $id_table;
319
+                    $statut = preg_replace(',\W,', '', $s['champ']); // securite
320
+                }
321
+                $mstatut = $id . '.' . $statut;
322
+
323
+                $arg_ignore_previsu = ($ignore_previsu ? ",true" : '');
324
+                include_spip('public/quete');
325
+                if (isset($s['post_date']) and $s['post_date']
326
+                    and $GLOBALS['meta']["post_dates"] == 'non'
327
+                ) {
328
+                    $date = $id . '.' . preg_replace(',\W,', '', $s['post_date']); // securite
329
+                    array_unshift($boucle->where,
330
+                        $echapper ?
331
+                            "\nquete_condition_postdates('$date'," . _q($boucle->sql_serveur) . "$arg_ignore_previsu)"
332
+                            :
333
+                            quete_condition_postdates($date, $boucle->sql_serveur, $ignore_previsu)
334
+                    );
335
+                }
336
+                array_unshift($boucle->where,
337
+                    $echapper ?
338
+                        "\nquete_condition_statut('$mstatut',"
339
+                        . _q($s['previsu']) . ","
340
+                        . _q($s['publie']) . ","
341
+                        . _q($boucle->sql_serveur) . "$arg_ignore_previsu)"
342
+                        :
343
+                        quete_condition_statut($mstatut, $s['previsu'], $s['publie'], $boucle->sql_serveur, $ignore_previsu)
344
+                );
345
+            }
346
+        }
347
+    }
348 348
 }
349 349
 
350 350
 /**
@@ -363,29 +363,29 @@  discard block
 block discarded – undo
363 363
  */
364 364
 function calculer_boucle($id_boucle, &$boucles) {
365 365
 
366
-	$boucle = &$boucles[$id_boucle];
367
-	instituer_boucle($boucle);
368
-	$boucles[$id_boucle] = pipeline('post_boucle', $boucles[$id_boucle]);
369
-
370
-	// en mode debug memoriser les premiers passages dans la boucle,
371
-	// mais pas tous, sinon ca pete.
372
-	if (_request('var_mode_affiche') != 'resultat') {
373
-		$trace = '';
374
-	} else {
375
-		$_trace = $boucles[$id_boucle]->descr['nom'] . $id_boucle;
376
-		$_trace = "\$GLOBALS['debug_objets']['resultat']['$_trace']";
377
-		$trace = "
366
+    $boucle = &$boucles[$id_boucle];
367
+    instituer_boucle($boucle);
368
+    $boucles[$id_boucle] = pipeline('post_boucle', $boucles[$id_boucle]);
369
+
370
+    // en mode debug memoriser les premiers passages dans la boucle,
371
+    // mais pas tous, sinon ca pete.
372
+    if (_request('var_mode_affiche') != 'resultat') {
373
+        $trace = '';
374
+    } else {
375
+        $_trace = $boucles[$id_boucle]->descr['nom'] . $id_boucle;
376
+        $_trace = "\$GLOBALS['debug_objets']['resultat']['$_trace']";
377
+        $trace = "
378 378
 		if (empty($_trace)) { 
379 379
 			$_trace = []; 
380 380
 		}
381 381
 		if (count($_trace) < 3) { 
382 382
 			$_trace" . "[] = \$t0; 
383 383
 		}";
384
-	}
384
+    }
385 385
 
386
-	return ($boucles[$id_boucle]->type_requete == TYPE_RECURSIF)
387
-		? calculer_boucle_rec($id_boucle, $boucles, $trace)
388
-		: calculer_boucle_nonrec($id_boucle, $boucles, $trace);
386
+    return ($boucles[$id_boucle]->type_requete == TYPE_RECURSIF)
387
+        ? calculer_boucle_rec($id_boucle, $boucles, $trace)
388
+        : calculer_boucle_nonrec($id_boucle, $boucles, $trace);
389 389
 }
390 390
 
391 391
 
@@ -408,15 +408,15 @@  discard block
 block discarded – undo
408 408
  *    Code PHP compilé de la boucle récursive
409 409
  **/
410 410
 function calculer_boucle_rec($id_boucle, &$boucles, $trace) {
411
-	$nom = $boucles[$id_boucle]->param[0];
412
-
413
-	return
414
-		// Numrows[$nom] peut ne pas être encore defini
415
-		"\n\t\$save_numrows = (isset(\$Numrows['$nom']) ? \$Numrows['$nom'] : array());"
416
-		. "\n\t\$t0 = " . $boucles[$id_boucle]->return . ";"
417
-		. "\n\t\$Numrows['$nom'] = (\$save_numrows);"
418
-		. $trace
419
-		. "\n\treturn \$t0;";
411
+    $nom = $boucles[$id_boucle]->param[0];
412
+
413
+    return
414
+        // Numrows[$nom] peut ne pas être encore defini
415
+        "\n\t\$save_numrows = (isset(\$Numrows['$nom']) ? \$Numrows['$nom'] : array());"
416
+        . "\n\t\$t0 = " . $boucles[$id_boucle]->return . ";"
417
+        . "\n\t\$Numrows['$nom'] = (\$save_numrows);"
418
+        . $trace
419
+        . "\n\treturn \$t0;";
420 420
 }
421 421
 
422 422
 /**
@@ -470,170 +470,170 @@  discard block
 block discarded – undo
470 470
  **/
471 471
 function calculer_boucle_nonrec($id_boucle, &$boucles, $trace) {
472 472
 
473
-	$boucle = &$boucles[$id_boucle];
474
-	$return = $boucle->return;
475
-	$type_boucle = $boucle->type_requete;
476
-	$primary = $boucle->primary;
477
-	$constant = preg_match(CODE_MONOTONE, str_replace("\\'", '', $return));
478
-	$flag_cpt = $boucle->mode_partie || $boucle->cptrows;
479
-	$corps = '';
480
-
481
-	// faudrait expanser le foreach a la compil, car y en a souvent qu'un 
482
-	// et puis faire un [] plutot qu'un "','."
483
-	if ($boucle->doublons) {
484
-		$corps .= "\n\t\t\tforeach(" . $boucle->doublons . ' as $k) $doublons[$k] .= "," . ' .
485
-			index_pile($id_boucle, $primary, $boucles)
486
-			. "; // doublons\n";
487
-	}
488
-
489
-	// La boucle doit-elle selectionner la langue ?
490
-	// - par defaut, les boucles suivantes le font
491
-	//    (sauf si forcer_lang==true ou si le titre contient <multi>).
492
-	// - a moins d'une demande explicite via {!lang_select}
493
-	if (!$constant && $boucle->lang_select != 'non' &&
494
-		(($boucle->lang_select == 'oui') ||
495
-			in_array($type_boucle, array(
496
-				'articles',
497
-				'rubriques',
498
-				'hierarchie',
499
-				'breves'
500
-			)))
501
-	) {
502
-		// Memoriser la langue avant la boucle et la restituer apres
503
-		// afin que le corps de boucle affecte la globale directement
504
-		$init_lang = "lang_select(\$GLOBALS['spip_lang']);\n\t";
505
-		$fin_lang = "lang_select();\n\t";
506
-		$fin_lang_select_public = "\n\t\tlang_select();";
507
-
508
-		$corps .=
509
-			"\n\t\tlang_select_public("
510
-			. index_pile($id_boucle, 'lang', $boucles)
511
-			. ", '" . $boucle->lang_select . "'"
512
-			. (in_array($type_boucle, array(
513
-				'articles',
514
-				'rubriques',
515
-				'hierarchie',
516
-				'breves'
517
-			)) ? ', ' . index_pile($id_boucle, 'titre', $boucles) : '')
518
-			. ');';
519
-	} else {
520
-		$init_lang = '';
521
-		$fin_lang = '';
522
-		$fin_lang_select_public = '';
523
-		// sortir les appels au traducteur (invariants de boucle)
524
-		if (strpos($return, '?php') === false
525
-			and preg_match_all("/\W(_T[(]'[^']*'[)])/", $return, $r)
526
-		) {
527
-			$i = 1;
528
-			foreach ($r[1] as $t) {
529
-				$init_lang .= "\n\t\$l$i = $t;";
530
-				$return = str_replace($t, "\$l$i", $return);
531
-				$i++;
532
-			}
533
-		}
534
-	}
535
-
536
-	// gestion optimale des separateurs et des boucles constantes
537
-	if (count($boucle->separateur)) {
538
-		$code_sep = ("'" . str_replace("'", "\'", join('', $boucle->separateur)) . "'");
539
-	}
540
-
541
-	$corps .=
542
-		((!$boucle->separateur) ?
543
-			(($constant && !$corps && !$flag_cpt) ? $return :
544
-				(($return === "''") ? '' :
545
-					("\n\t\t" . '$t0 .= ' . $return . ";"))) :
546
-			("\n\t\t\$t1 " .
547
-				((strpos($return, '$t1.') === 0) ?
548
-					(".=" . substr($return, 4)) :
549
-					('= ' . $return)) .
550
-				";\n\t\t" .
551
-				'$t0 .= ((strlen($t1) && strlen($t0)) ? ' . $code_sep . " : '') . \$t1;"));
552
-
553
-	// Calculer les invalideurs si c'est une boucle non constante et si on
554
-	// souhaite invalider ces elements
555
-	if (!$constant and $primary) {
556
-		include_spip('inc/invalideur');
557
-		$corps = calcul_invalideurs($corps, $primary,$boucles, $id_boucle);
558
-	}
559
-
560
-	// gerer le compteur de boucle 
561
-	// avec ou sans son utilisation par les criteres {1/3} {1,4} {n-2,1}...
562
-
563
-	if ($boucle->partie or $boucle->cptrows) {
564
-		$corps = "\n\t\t\$Numrows['$id_boucle']['compteur_boucle']++;"
565
-			. $boucle->partie
566
-			. $corps;
567
-	}
568
-
569
-	// depiler la lang de la boucle si besoin
570
-	$corps .= $fin_lang_select_public;
571
-
572
-	// si le corps est une constante, ne pas appeler le serveur N fois!
573
-
574
-	if (preg_match(CODE_MONOTONE, str_replace("\\'", '', $corps), $r)) {
575
-		if (!isset($r[2]) or (!$r[2])) {
576
-			if (!$boucle->numrows) {
577
-				return "\n\t\$t0 = '';";
578
-			} else {
579
-				$corps = "";
580
-			}
581
-		} else {
582
-			$boucle->numrows = true;
583
-			$corps = "\n\t\$t0 = str_repeat($corps, \$Numrows['$id_boucle']['total']);";
584
-		}
585
-	} else {
586
-		$corps = "while (\$Pile[\$SP]=\$iter->fetch()) {\n$corps\n	}";
587
-	}
588
-
589
-	$count = '';
590
-	if (!$boucle->select) {
591
-		if (!$boucle->numrows or $boucle->limit or $boucle->mode_partie or $boucle->group) {
592
-			$count = '1';
593
-		} else {
594
-			$count = 'count(*)';
595
-		}
596
-		$boucles[$id_boucle]->select[] = $count;
597
-	}
598
-
599
-	if ($flag_cpt) {
600
-		$nums = "\n\t// COMPTEUR\n\t"
601
-			. "\$Numrows['$id_boucle']['compteur_boucle'] = 0;\n\t";
602
-	} else {
603
-		$nums = '';
604
-	}
605
-
606
-	if ($boucle->numrows or $boucle->mode_partie) {
607
-		$nums .= "\$Numrows['$id_boucle']['command'] = \$command;\n\t"
608
-			. "\$Numrows['$id_boucle']['total'] = @intval(\$iter->count());"
609
-			. $boucle->mode_partie
610
-			. "\n\t";
611
-	}
612
-
613
-	// Ne calculer la requete que maintenant
614
-	// car ce qui precede appelle index_pile qui influe dessus
615
-
616
-	$init = (($init = $boucles[$id_boucle]->doublons)
617
-			? ("\n\t$init = array();") : '')
618
-		. calculer_requete_sql($boucles[$id_boucle]);
619
-
620
-	$contexte = memoriser_contexte_compil($boucle);
621
-
622
-	$a = sprintf(CODE_CORPS_BOUCLE,
623
-		$init,
624
-		$boucle->iterateur,
625
-		"\$command",
626
-		$contexte,
627
-		$nums,
628
-		$init_lang,
629
-		$corps,
630
-		$fin_lang,
631
-		$trace,
632
-		'BOUCLE' . $id_boucle . ' @ ' . ($boucle->descr['sourcefile'])
633
-	);
473
+    $boucle = &$boucles[$id_boucle];
474
+    $return = $boucle->return;
475
+    $type_boucle = $boucle->type_requete;
476
+    $primary = $boucle->primary;
477
+    $constant = preg_match(CODE_MONOTONE, str_replace("\\'", '', $return));
478
+    $flag_cpt = $boucle->mode_partie || $boucle->cptrows;
479
+    $corps = '';
480
+
481
+    // faudrait expanser le foreach a la compil, car y en a souvent qu'un 
482
+    // et puis faire un [] plutot qu'un "','."
483
+    if ($boucle->doublons) {
484
+        $corps .= "\n\t\t\tforeach(" . $boucle->doublons . ' as $k) $doublons[$k] .= "," . ' .
485
+            index_pile($id_boucle, $primary, $boucles)
486
+            . "; // doublons\n";
487
+    }
488
+
489
+    // La boucle doit-elle selectionner la langue ?
490
+    // - par defaut, les boucles suivantes le font
491
+    //    (sauf si forcer_lang==true ou si le titre contient <multi>).
492
+    // - a moins d'une demande explicite via {!lang_select}
493
+    if (!$constant && $boucle->lang_select != 'non' &&
494
+        (($boucle->lang_select == 'oui') ||
495
+            in_array($type_boucle, array(
496
+                'articles',
497
+                'rubriques',
498
+                'hierarchie',
499
+                'breves'
500
+            )))
501
+    ) {
502
+        // Memoriser la langue avant la boucle et la restituer apres
503
+        // afin que le corps de boucle affecte la globale directement
504
+        $init_lang = "lang_select(\$GLOBALS['spip_lang']);\n\t";
505
+        $fin_lang = "lang_select();\n\t";
506
+        $fin_lang_select_public = "\n\t\tlang_select();";
507
+
508
+        $corps .=
509
+            "\n\t\tlang_select_public("
510
+            . index_pile($id_boucle, 'lang', $boucles)
511
+            . ", '" . $boucle->lang_select . "'"
512
+            . (in_array($type_boucle, array(
513
+                'articles',
514
+                'rubriques',
515
+                'hierarchie',
516
+                'breves'
517
+            )) ? ', ' . index_pile($id_boucle, 'titre', $boucles) : '')
518
+            . ');';
519
+    } else {
520
+        $init_lang = '';
521
+        $fin_lang = '';
522
+        $fin_lang_select_public = '';
523
+        // sortir les appels au traducteur (invariants de boucle)
524
+        if (strpos($return, '?php') === false
525
+            and preg_match_all("/\W(_T[(]'[^']*'[)])/", $return, $r)
526
+        ) {
527
+            $i = 1;
528
+            foreach ($r[1] as $t) {
529
+                $init_lang .= "\n\t\$l$i = $t;";
530
+                $return = str_replace($t, "\$l$i", $return);
531
+                $i++;
532
+            }
533
+        }
534
+    }
535
+
536
+    // gestion optimale des separateurs et des boucles constantes
537
+    if (count($boucle->separateur)) {
538
+        $code_sep = ("'" . str_replace("'", "\'", join('', $boucle->separateur)) . "'");
539
+    }
540
+
541
+    $corps .=
542
+        ((!$boucle->separateur) ?
543
+            (($constant && !$corps && !$flag_cpt) ? $return :
544
+                (($return === "''") ? '' :
545
+                    ("\n\t\t" . '$t0 .= ' . $return . ";"))) :
546
+            ("\n\t\t\$t1 " .
547
+                ((strpos($return, '$t1.') === 0) ?
548
+                    (".=" . substr($return, 4)) :
549
+                    ('= ' . $return)) .
550
+                ";\n\t\t" .
551
+                '$t0 .= ((strlen($t1) && strlen($t0)) ? ' . $code_sep . " : '') . \$t1;"));
552
+
553
+    // Calculer les invalideurs si c'est une boucle non constante et si on
554
+    // souhaite invalider ces elements
555
+    if (!$constant and $primary) {
556
+        include_spip('inc/invalideur');
557
+        $corps = calcul_invalideurs($corps, $primary,$boucles, $id_boucle);
558
+    }
559
+
560
+    // gerer le compteur de boucle 
561
+    // avec ou sans son utilisation par les criteres {1/3} {1,4} {n-2,1}...
562
+
563
+    if ($boucle->partie or $boucle->cptrows) {
564
+        $corps = "\n\t\t\$Numrows['$id_boucle']['compteur_boucle']++;"
565
+            . $boucle->partie
566
+            . $corps;
567
+    }
568
+
569
+    // depiler la lang de la boucle si besoin
570
+    $corps .= $fin_lang_select_public;
571
+
572
+    // si le corps est une constante, ne pas appeler le serveur N fois!
573
+
574
+    if (preg_match(CODE_MONOTONE, str_replace("\\'", '', $corps), $r)) {
575
+        if (!isset($r[2]) or (!$r[2])) {
576
+            if (!$boucle->numrows) {
577
+                return "\n\t\$t0 = '';";
578
+            } else {
579
+                $corps = "";
580
+            }
581
+        } else {
582
+            $boucle->numrows = true;
583
+            $corps = "\n\t\$t0 = str_repeat($corps, \$Numrows['$id_boucle']['total']);";
584
+        }
585
+    } else {
586
+        $corps = "while (\$Pile[\$SP]=\$iter->fetch()) {\n$corps\n	}";
587
+    }
588
+
589
+    $count = '';
590
+    if (!$boucle->select) {
591
+        if (!$boucle->numrows or $boucle->limit or $boucle->mode_partie or $boucle->group) {
592
+            $count = '1';
593
+        } else {
594
+            $count = 'count(*)';
595
+        }
596
+        $boucles[$id_boucle]->select[] = $count;
597
+    }
598
+
599
+    if ($flag_cpt) {
600
+        $nums = "\n\t// COMPTEUR\n\t"
601
+            . "\$Numrows['$id_boucle']['compteur_boucle'] = 0;\n\t";
602
+    } else {
603
+        $nums = '';
604
+    }
605
+
606
+    if ($boucle->numrows or $boucle->mode_partie) {
607
+        $nums .= "\$Numrows['$id_boucle']['command'] = \$command;\n\t"
608
+            . "\$Numrows['$id_boucle']['total'] = @intval(\$iter->count());"
609
+            . $boucle->mode_partie
610
+            . "\n\t";
611
+    }
612
+
613
+    // Ne calculer la requete que maintenant
614
+    // car ce qui precede appelle index_pile qui influe dessus
615
+
616
+    $init = (($init = $boucles[$id_boucle]->doublons)
617
+            ? ("\n\t$init = array();") : '')
618
+        . calculer_requete_sql($boucles[$id_boucle]);
619
+
620
+    $contexte = memoriser_contexte_compil($boucle);
621
+
622
+    $a = sprintf(CODE_CORPS_BOUCLE,
623
+        $init,
624
+        $boucle->iterateur,
625
+        "\$command",
626
+        $contexte,
627
+        $nums,
628
+        $init_lang,
629
+        $corps,
630
+        $fin_lang,
631
+        $trace,
632
+        'BOUCLE' . $id_boucle . ' @ ' . ($boucle->descr['sourcefile'])
633
+    );
634 634
 
635 635
 #	var_dump($a);exit;
636
-	return $a;
636
+    return $a;
637 637
 }
638 638
 
639 639
 
@@ -649,43 +649,43 @@  discard block
 block discarded – undo
649 649
  *     Code PHP compilé définissant les informations de requête
650 650
  **/
651 651
 function calculer_requete_sql($boucle) {
652
-	$init = array();
653
-	$init[] = calculer_dec('table', "'" . $boucle->id_table . "'");
654
-	$init[] = calculer_dec('id', "'" . $boucle->id_boucle . "'");
655
-	# En absence de champ c'est un decompte :
656
-	$init[] = calculer_dec('from', calculer_from($boucle));
657
-	$init[] = calculer_dec('type', calculer_from_type($boucle));
658
-	$init[] = calculer_dec('groupby',
659
-		'array(' . (($g = join("\",\n\t\t\"", $boucle->group)) ? '"' . $g . '"' : '') . ")");
660
-	$init[] = calculer_dec('select', 'array("' . join("\",\n\t\t\"", $boucle->select) . "\")");
661
-	$init[] = calculer_dec('orderby', 'array(' . calculer_order($boucle) . ")");
662
-	$init[] = calculer_dec('where', calculer_dump_array($boucle->where));
663
-	$init[] = calculer_dec('join', calculer_dump_join($boucle->join));
664
-	$init[] = calculer_dec('limit',
665
-		(strpos($boucle->limit, 'intval') === false ?
666
-			"'" . $boucle->limit . "'"
667
-			:
668
-			$boucle->limit));
669
-	$init[] = calculer_dec('having', calculer_dump_array($boucle->having));
670
-	$s = $d = "";
671
-	// l'index 0 de $i indique si l'affectation est statique (contenu)
672
-	// ou recalculée à chaque passage (vide)
673
-	foreach ($init as $i) {
674
-		if (reset($i)) {
675
-			$s .= "\n\t\t" . end($i);
676
-		} # statique
677
-		else {
678
-			$d .= "\n\t" . end($i);
679
-		} # dynamique
680
-	}
681
-
682
-	return ($boucle->hierarchie ? "\n\t$boucle->hierarchie" : '')
683
-	. $boucle->in
684
-	. $boucle->hash
685
-	. "\n\t" . 'if (!isset($command[\'table\'])) {'
686
-	. $s
687
-	. "\n\t}"
688
-	. $d;
652
+    $init = array();
653
+    $init[] = calculer_dec('table', "'" . $boucle->id_table . "'");
654
+    $init[] = calculer_dec('id', "'" . $boucle->id_boucle . "'");
655
+    # En absence de champ c'est un decompte :
656
+    $init[] = calculer_dec('from', calculer_from($boucle));
657
+    $init[] = calculer_dec('type', calculer_from_type($boucle));
658
+    $init[] = calculer_dec('groupby',
659
+        'array(' . (($g = join("\",\n\t\t\"", $boucle->group)) ? '"' . $g . '"' : '') . ")");
660
+    $init[] = calculer_dec('select', 'array("' . join("\",\n\t\t\"", $boucle->select) . "\")");
661
+    $init[] = calculer_dec('orderby', 'array(' . calculer_order($boucle) . ")");
662
+    $init[] = calculer_dec('where', calculer_dump_array($boucle->where));
663
+    $init[] = calculer_dec('join', calculer_dump_join($boucle->join));
664
+    $init[] = calculer_dec('limit',
665
+        (strpos($boucle->limit, 'intval') === false ?
666
+            "'" . $boucle->limit . "'"
667
+            :
668
+            $boucle->limit));
669
+    $init[] = calculer_dec('having', calculer_dump_array($boucle->having));
670
+    $s = $d = "";
671
+    // l'index 0 de $i indique si l'affectation est statique (contenu)
672
+    // ou recalculée à chaque passage (vide)
673
+    foreach ($init as $i) {
674
+        if (reset($i)) {
675
+            $s .= "\n\t\t" . end($i);
676
+        } # statique
677
+        else {
678
+            $d .= "\n\t" . end($i);
679
+        } # dynamique
680
+    }
681
+
682
+    return ($boucle->hierarchie ? "\n\t$boucle->hierarchie" : '')
683
+    . $boucle->in
684
+    . $boucle->hash
685
+    . "\n\t" . 'if (!isset($command[\'table\'])) {'
686
+    . $s
687
+    . "\n\t}"
688
+    . $d;
689 689
 }
690 690
 
691 691
 /**
@@ -703,13 +703,13 @@  discard block
 block discarded – undo
703 703
  *     qui peut être utilisé pour la production d'un tableau array()
704 704
  **/
705 705
 function memoriser_contexte_compil($p) {
706
-	return join(',', array(
707
-		_q(isset($p->descr['sourcefile']) ? $p->descr['sourcefile'] : ''),
708
-		_q(isset($p->descr['nom']) ? $p->descr['nom'] : ''),
709
-		_q(isset($p->id_boucle) ? $p->id_boucle : null),
710
-		intval($p->ligne),
711
-		'$GLOBALS[\'spip_lang\']'
712
-	));
706
+    return join(',', array(
707
+        _q(isset($p->descr['sourcefile']) ? $p->descr['sourcefile'] : ''),
708
+        _q(isset($p->descr['nom']) ? $p->descr['nom'] : ''),
709
+        _q(isset($p->id_boucle) ? $p->id_boucle : null),
710
+        intval($p->ligne),
711
+        '$GLOBALS[\'spip_lang\']'
712
+    ));
713 713
 }
714 714
 
715 715
 /**
@@ -727,19 +727,19 @@  discard block
 block discarded – undo
727 727
  *     Objet Contexte
728 728
  **/
729 729
 function reconstruire_contexte_compil($context_compil) {
730
-	if (!is_array($context_compil)) {
731
-		return $context_compil;
732
-	}
733
-	$p = new Contexte;
734
-	$p->descr = array(
735
-		'sourcefile' => $context_compil[0],
736
-		'nom' => $context_compil[1]
737
-	);
738
-	$p->id_boucle = $context_compil[2];
739
-	$p->ligne = $context_compil[3];
740
-	$p->lang = $context_compil[4];
741
-
742
-	return $p;
730
+    if (!is_array($context_compil)) {
731
+        return $context_compil;
732
+    }
733
+    $p = new Contexte;
734
+    $p->descr = array(
735
+        'sourcefile' => $context_compil[0],
736
+        'nom' => $context_compil[1]
737
+    );
738
+    $p->id_boucle = $context_compil[2];
739
+    $p->ligne = $context_compil[3];
740
+    $p->lang = $context_compil[4];
741
+
742
+    return $p;
743 743
 }
744 744
 
745 745
 /**
@@ -765,12 +765,12 @@  discard block
 block discarded – undo
765 765
  *    - index 1 : Code de l'affectation
766 766
  **/
767 767
 function calculer_dec($nom, $val) {
768
-	$static = 'if (!isset($command[\'' . $nom . '\'])) ';
769
-	// si une variable apparait dans le calcul de la clause
770
-	// il faut la re-evaluer a chaque passage
771
-	if (
772
-		strpos($val, '$') !== false
773
-		/*
768
+    $static = 'if (!isset($command[\'' . $nom . '\'])) ';
769
+    // si une variable apparait dans le calcul de la clause
770
+    // il faut la re-evaluer a chaque passage
771
+    if (
772
+        strpos($val, '$') !== false
773
+        /*
774 774
 		OR strpos($val, 'sql_') !== false
775 775
 		OR (
776 776
 			$test = str_replace(array("array(",'\"',"\'"),array("","",""),$val) // supprimer les array( et les echappements de guillemets
@@ -778,11 +778,11 @@  discard block
 block discarded – undo
778 778
 			AND $test = preg_replace(",'[^']*',UimsS","",$test) // supprimer les chaines qui peuvent contenir des fonctions SQL qui ne genent pas
779 779
 			AND preg_match(",\w+\s*\(,UimsS",$test,$regs) // tester la presence de fonctions restantes
780 780
 		)*/
781
-	) {
782
-		$static = "";
783
-	}
781
+    ) {
782
+        $static = "";
783
+    }
784 784
 
785
-	return array($static, '$command[\'' . $nom . '\'] = ' . $val . ';');
785
+    return array($static, '$command[\'' . $nom . '\'] = ' . $val . ';');
786 786
 }
787 787
 
788 788
 /**
@@ -802,33 +802,33 @@  discard block
 block discarded – undo
802 802
  *     Expression PHP décrivant un texte ou un tableau
803 803
  **/
804 804
 function calculer_dump_array($a) {
805
-	if (!is_array($a)) {
806
-		return $a;
807
-	}
808
-	$res = "";
809
-	if ($a and $a[0] == "'?'") {
810
-		return ("(" . calculer_dump_array($a[1]) .
811
-			" ? " . calculer_dump_array($a[2]) .
812
-			" : " . calculer_dump_array($a[3]) .
813
-			")");
814
-	} else {
815
-		foreach ($a as $k => $v) {
816
-			$showk = (is_numeric($k) ? '' : sql_quote($k) . ' => ');
817
-			$res .= ", " . $showk . calculer_dump_array($v);
818
-		}
819
-
820
-		return "\n\t\t\tarray(" . substr($res, 2) . ')';
821
-	}
805
+    if (!is_array($a)) {
806
+        return $a;
807
+    }
808
+    $res = "";
809
+    if ($a and $a[0] == "'?'") {
810
+        return ("(" . calculer_dump_array($a[1]) .
811
+            " ? " . calculer_dump_array($a[2]) .
812
+            " : " . calculer_dump_array($a[3]) .
813
+            ")");
814
+    } else {
815
+        foreach ($a as $k => $v) {
816
+            $showk = (is_numeric($k) ? '' : sql_quote($k) . ' => ');
817
+            $res .= ", " . $showk . calculer_dump_array($v);
818
+        }
819
+
820
+        return "\n\t\t\tarray(" . substr($res, 2) . ')';
821
+    }
822 822
 }
823 823
 
824 824
 // https://code.spip.net/@calculer_dump_join
825 825
 function calculer_dump_join($a) {
826
-	$res = "";
827
-	foreach ($a as $k => $v) {
828
-		$res .= ", '$k' => array(" . implode(',', $v) . ")";
829
-	}
826
+    $res = "";
827
+    foreach ($a as $k => $v) {
828
+        $res .= ", '$k' => array(" . implode(',', $v) . ")";
829
+    }
830 830
 
831
-	return 'array(' . substr($res, 2) . ')';
831
+    return 'array(' . substr($res, 2) . ')';
832 832
 }
833 833
 
834 834
 /**
@@ -840,12 +840,12 @@  discard block
 block discarded – undo
840 840
  *     Code PHP construisant un tableau des alias et noms des tables du FROM
841 841
  **/
842 842
 function calculer_from(&$boucle) {
843
-	$res = "";
844
-	foreach ($boucle->from as $k => $v) {
845
-		$res .= ",'$k' => '$v'";
846
-	}
843
+    $res = "";
844
+    foreach ($boucle->from as $k => $v) {
845
+        $res .= ",'$k' => '$v'";
846
+    }
847 847
 
848
-	return 'array(' . substr($res, 1) . ')';
848
+    return 'array(' . substr($res, 1) . ')';
849 849
 }
850 850
 
851 851
 /**
@@ -858,30 +858,30 @@  discard block
 block discarded – undo
858 858
  *     Code PHP construisant un tableau des alias et type de jointure du FROM
859 859
  **/
860 860
 function calculer_from_type(&$boucle) {
861
-	$res = "";
862
-	foreach ($boucle->from_type as $k => $v) {
863
-		$res .= ",'$k' => '$v'";
864
-	}
861
+    $res = "";
862
+    foreach ($boucle->from_type as $k => $v) {
863
+        $res .= ",'$k' => '$v'";
864
+    }
865 865
 
866
-	return 'array(' . substr($res, 1) . ')';
866
+    return 'array(' . substr($res, 1) . ')';
867 867
 }
868 868
 
869 869
 // https://code.spip.net/@calculer_order
870 870
 function calculer_order(&$boucle) {
871
-	if (!$order = $boucle->order
872
-		and !$order = $boucle->default_order
873
-	) {
874
-		$order = array();
875
-	}
871
+    if (!$order = $boucle->order
872
+        and !$order = $boucle->default_order
873
+    ) {
874
+        $order = array();
875
+    }
876 876
 
877
-	/*if (isset($boucle->modificateur['collate'])){
877
+    /*if (isset($boucle->modificateur['collate'])){
878 878
 		$col = "." . $boucle->modificateur['collate'];
879 879
 		foreach($order as $k=>$o)
880 880
 			if (strpos($order[$k],'COLLATE')===false)
881 881
 				$order[$k].= $col;
882 882
 	}*/
883 883
 
884
-	return join(', ', $order);
884
+    return join(', ', $order);
885 885
 }
886 886
 
887 887
 // Production du code PHP a partir de la sequence livree par le phraseur
@@ -891,59 +891,59 @@  discard block
 block discarded – undo
891 891
 
892 892
 // https://code.spip.net/@calculer_liste
893 893
 function calculer_liste($tableau, $descr, &$boucles, $id_boucle = '') {
894
-	if (!$tableau) {
895
-		return "''";
896
-	}
897
-	if (is_string($descr)) {
898
-		if (isset($boucles[$descr])) {
899
-			$idb = $descr;
900
-			$descr = [];
901
-			if (isset($boucles[$idb]->descr['id_mere_contexte'])) {
902
-				$descr['id_mere'] = $boucles[$idb]->descr['id_mere_contexte'];
903
-			}
904
-			if (isset($boucles[$idb]->descr['sourcefile'])) {
905
-				$descr['sourcefile'] = $boucles[$idb]->descr['sourcefile'];
906
-			}
907
-		}
908
-		else {
909
-			$descr = array();
910
-		}
911
-	}
912
-	if (!isset($descr['niv'])) {
913
-		$descr['niv'] = 0;
914
-	}
915
-	$codes = compile_cas($tableau, $descr, $boucles, $id_boucle);
916
-	if ($codes === false) {
917
-		return false;
918
-	}
919
-	$n = count($codes);
920
-	if (!$n) {
921
-		return "''";
922
-	}
923
-	$tab = str_repeat("\t", $descr['niv']);
924
-	if (_request('var_mode_affiche') != 'validation') {
925
-		if ($n == 1) {
926
-			return $codes[0];
927
-		} else {
928
-			$res = '';
929
-			foreach ($codes as $code) {
930
-				if (!preg_match("/^'[^']*'$/", $code)
931
-					or substr($res, -1, 1) !== "'"
932
-				) {
933
-					$res .= " .\n$tab$code";
934
-				} else {
935
-					$res = substr($res, 0, -1) . substr($code, 1);
936
-				}
937
-			}
938
-
939
-			return '(' . substr($res, 2 + $descr['niv']) . ')';
940
-		}
941
-	} else {
942
-		$nom = $descr['nom'] . $id_boucle . ($descr['niv'] ? $descr['niv'] : '');
943
-
944
-		return "join('', array_map('array_shift', \$GLOBALS['debug_objets']['sequence']['$nom'] = array(" . join(" ,\n$tab",
945
-			$codes) . ")))";
946
-	}
894
+    if (!$tableau) {
895
+        return "''";
896
+    }
897
+    if (is_string($descr)) {
898
+        if (isset($boucles[$descr])) {
899
+            $idb = $descr;
900
+            $descr = [];
901
+            if (isset($boucles[$idb]->descr['id_mere_contexte'])) {
902
+                $descr['id_mere'] = $boucles[$idb]->descr['id_mere_contexte'];
903
+            }
904
+            if (isset($boucles[$idb]->descr['sourcefile'])) {
905
+                $descr['sourcefile'] = $boucles[$idb]->descr['sourcefile'];
906
+            }
907
+        }
908
+        else {
909
+            $descr = array();
910
+        }
911
+    }
912
+    if (!isset($descr['niv'])) {
913
+        $descr['niv'] = 0;
914
+    }
915
+    $codes = compile_cas($tableau, $descr, $boucles, $id_boucle);
916
+    if ($codes === false) {
917
+        return false;
918
+    }
919
+    $n = count($codes);
920
+    if (!$n) {
921
+        return "''";
922
+    }
923
+    $tab = str_repeat("\t", $descr['niv']);
924
+    if (_request('var_mode_affiche') != 'validation') {
925
+        if ($n == 1) {
926
+            return $codes[0];
927
+        } else {
928
+            $res = '';
929
+            foreach ($codes as $code) {
930
+                if (!preg_match("/^'[^']*'$/", $code)
931
+                    or substr($res, -1, 1) !== "'"
932
+                ) {
933
+                    $res .= " .\n$tab$code";
934
+                } else {
935
+                    $res = substr($res, 0, -1) . substr($code, 1);
936
+                }
937
+            }
938
+
939
+            return '(' . substr($res, 2 + $descr['niv']) . ')';
940
+        }
941
+    } else {
942
+        $nom = $descr['nom'] . $id_boucle . ($descr['niv'] ? $descr['niv'] : '');
943
+
944
+        return "join('', array_map('array_shift', \$GLOBALS['debug_objets']['sequence']['$nom'] = array(" . join(" ,\n$tab",
945
+            $codes) . ")))";
946
+    }
947 947
 }
948 948
 
949 949
 
@@ -954,203 +954,203 @@  discard block
 block discarded – undo
954 954
 // https://code.spip.net/@compile_cas
955 955
 function compile_cas($tableau, $descr, &$boucles, $id_boucle) {
956 956
 
957
-	$codes = array();
958
-	// cas de la boucle recursive
959
-	if (is_array($id_boucle)) {
960
-		$id_boucle = $id_boucle[0];
961
-	}
962
-	$type = !$id_boucle ? '' : $boucles[$id_boucle]->type_requete;
963
-	$tab = str_repeat("\t", ++$descr['niv']);
964
-	$mode = _request('var_mode_affiche');
965
-	$err_e_c = '';
966
-	// chaque commentaire introduit dans le code doit commencer
967
-	// par un caractere distinguant le cas, pour exploitation par debug.
968
-	foreach ($tableau as $p) {
969
-
970
-		switch ($p->type) {
971
-			// texte seul
972
-			case 'texte':
973
-				$code = sandbox_composer_texte($p->texte, $p);
974
-				$commentaire = strlen($p->texte) . " signes";
975
-				$avant = '';
976
-				$apres = '';
977
-				$altern = "''";
978
-				break;
979
-
980
-			case 'polyglotte':
981
-				$code = "";
982
-				foreach ($p->traductions as $k => $v) {
983
-					$code .= ",'" .
984
-						str_replace(array("\\", "'"), array("\\\\", "\\'"), $k) .
985
-						"' => '" .
986
-						str_replace(array("\\", "'"), array("\\\\", "\\'"), $v) .
987
-						"'";
988
-				}
989
-				$code = "choisir_traduction(array(" .
990
-					substr($code, 1) .
991
-					"))";
992
-				$commentaire = '&';
993
-				$avant = '';
994
-				$apres = '';
995
-				$altern = "''";
996
-				break;
997
-
998
-			// inclure
999
-			case 'include':
1000
-				$p->descr = $descr;
1001
-				$code = calculer_inclure($p, $boucles, $id_boucle);
1002
-				if ($code === false) {
1003
-					$err_e_c = true;
1004
-					$code = "''";
1005
-				} else {
1006
-					$commentaire = '<INCLURE ' . addslashes(str_replace("\n", ' ', $code)) . '>';
1007
-					$avant = '';
1008
-					$apres = '';
1009
-					$altern = "''";
1010
-				}
1011
-				break;
1012
-
1013
-			// boucle
1014
-			case TYPE_RECURSIF:
1015
-				$nom = $p->id_boucle;
1016
-				$newdescr = $descr;
1017
-				$newdescr['id_mere'] = $nom;
1018
-				$newdescr['niv']++;
1019
-				$preaff = calculer_liste($p->preaff, $newdescr, $boucles, $id_boucle);
1020
-				$avant = calculer_liste($p->avant, $newdescr, $boucles, $id_boucle);
1021
-				$apres = calculer_liste($p->apres, $newdescr, $boucles, $id_boucle);
1022
-				$postaff = calculer_liste($p->postaff, $newdescr, $boucles, $id_boucle);
1023
-				$newdescr['niv']--;
1024
-				$altern = calculer_liste($p->altern, $newdescr, $boucles, $id_boucle);
1025
-				if ($preaff === false
1026
-					or $avant === false
1027
-					or $apres === false
1028
-					or $altern === false
1029
-					or $postaff === false) {
1030
-					$err_e_c = true;
1031
-					$code = "''";
1032
-				} else {
1033
-					$code = 'BOUCLE' .
1034
-						str_replace("-", "_", $nom) . $descr['nom'] .
1035
-						'($Cache, $Pile, $doublons, $Numrows, $SP)';
1036
-					$commentaire = "?$nom";
1037
-					if (!$boucles[$nom]->milieu
1038
-						and $boucles[$nom]->type_requete <> TYPE_RECURSIF
1039
-					) {
1040
-						if ($preaff != "''") {
1041
-							$code .= "\n. $preaff";
1042
-						}
1043
-						if ($altern != "''") {
1044
-							$code .= "\n. $altern";
1045
-						}
1046
-						if ($postaff != "''") {
1047
-							$code .= "\n. $postaff";
1048
-						}
1049
-						if ($avant <> "''" or $apres <> "''") {
1050
-							spip_log("boucle $nom toujours vide, code superflu dans $descr[sourcefile]");
1051
-						}
1052
-						$avant = $apres = $altern = "''";
1053
-					} else {
1054
-						if ($preaff != "''") {
1055
-							$avant = compile_concatene_parties_codes($preaff, $avant);
1056
-							$altern = compile_concatene_parties_codes($preaff, $altern);
1057
-						}
1058
-						if ($postaff != "''") {
1059
-							$apres = compile_concatene_parties_codes($apres, $postaff);
1060
-							$altern = compile_concatene_parties_codes($altern, $postaff);
1061
-						}
1062
-						if ($altern != "''") {
1063
-							$altern = "($altern)";
1064
-						}
1065
-					}
1066
-				}
1067
-				break;
1068
-
1069
-			case 'idiome':
1070
-				$l = array();
1071
-				$code = '';
1072
-				foreach ($p->arg as $k => $v) {
1073
-					$_v = calculer_liste($v, $descr, $boucles, $id_boucle);
1074
-					if ($k) {
1075
-						$l[] = _q($k) . ' => ' . $_v;
1076
-					} else {
1077
-						$code = $_v;
1078
-					}
1079
-				}
1080
-				// Si le module n'est pas fourni, l'expliciter sauf si calculé
1081
-				if ($p->module) {
1082
-					$m = $p->module . ':' . $p->nom_champ;
1083
-				} elseif ($p->nom_champ) {
1084
-					$m = MODULES_IDIOMES . ':' . $p->nom_champ;
1085
-				} else {
1086
-					$m = '';
1087
-				}
1088
-
1089
-				$code = (!$code ? "'$m'" :
1090
-						($m ? "'$m' . $code" :
1091
-							("(strpos(\$x=$code, ':') ? \$x : ('" . MODULES_IDIOMES . ":' . \$x))")))
1092
-					. (!$l ? '' : (", array(" . implode(",\n", $l) . ")"));
1093
-				$code = "_T($code)";
1094
-				if ($p->param) {
1095
-					$p->id_boucle = $id_boucle;
1096
-					$p->boucles = &$boucles;
1097
-					$code = compose_filtres($p, $code);
1098
-				}
1099
-				$commentaire = ":";
1100
-				$avant = '';
1101
-				$apres = '';
1102
-				$altern = "''";
1103
-				break;
1104
-
1105
-			case 'champ':
1106
-
1107
-				// cette structure pourrait etre completee des le phrase' (a faire)
1108
-				$p->id_boucle = $id_boucle;
1109
-				$p->boucles = &$boucles;
1110
-				$p->descr = $descr;
1111
-				#$p->interdire_scripts = true;
1112
-				$p->type_requete = $type;
1113
-
1114
-				$code = calculer_champ($p);
1115
-				$commentaire = '#' . $p->nom_champ . $p->etoile;
1116
-				$avant = calculer_liste($p->avant,
1117
-					$descr, $boucles, $id_boucle);
1118
-				$apres = calculer_liste($p->apres,
1119
-					$descr, $boucles, $id_boucle);
1120
-				$altern = "''";
1121
-				// Si la valeur est destinee a une comparaison a ''
1122
-				// forcer la conversion en une chaine par strval
1123
-				// si ca peut etre autre chose qu'une chaine
1124
-				if (($avant != "''" or $apres != "''")
1125
-					and $code[0] != "'"
957
+    $codes = array();
958
+    // cas de la boucle recursive
959
+    if (is_array($id_boucle)) {
960
+        $id_boucle = $id_boucle[0];
961
+    }
962
+    $type = !$id_boucle ? '' : $boucles[$id_boucle]->type_requete;
963
+    $tab = str_repeat("\t", ++$descr['niv']);
964
+    $mode = _request('var_mode_affiche');
965
+    $err_e_c = '';
966
+    // chaque commentaire introduit dans le code doit commencer
967
+    // par un caractere distinguant le cas, pour exploitation par debug.
968
+    foreach ($tableau as $p) {
969
+
970
+        switch ($p->type) {
971
+            // texte seul
972
+            case 'texte':
973
+                $code = sandbox_composer_texte($p->texte, $p);
974
+                $commentaire = strlen($p->texte) . " signes";
975
+                $avant = '';
976
+                $apres = '';
977
+                $altern = "''";
978
+                break;
979
+
980
+            case 'polyglotte':
981
+                $code = "";
982
+                foreach ($p->traductions as $k => $v) {
983
+                    $code .= ",'" .
984
+                        str_replace(array("\\", "'"), array("\\\\", "\\'"), $k) .
985
+                        "' => '" .
986
+                        str_replace(array("\\", "'"), array("\\\\", "\\'"), $v) .
987
+                        "'";
988
+                }
989
+                $code = "choisir_traduction(array(" .
990
+                    substr($code, 1) .
991
+                    "))";
992
+                $commentaire = '&';
993
+                $avant = '';
994
+                $apres = '';
995
+                $altern = "''";
996
+                break;
997
+
998
+            // inclure
999
+            case 'include':
1000
+                $p->descr = $descr;
1001
+                $code = calculer_inclure($p, $boucles, $id_boucle);
1002
+                if ($code === false) {
1003
+                    $err_e_c = true;
1004
+                    $code = "''";
1005
+                } else {
1006
+                    $commentaire = '<INCLURE ' . addslashes(str_replace("\n", ' ', $code)) . '>';
1007
+                    $avant = '';
1008
+                    $apres = '';
1009
+                    $altern = "''";
1010
+                }
1011
+                break;
1012
+
1013
+            // boucle
1014
+            case TYPE_RECURSIF:
1015
+                $nom = $p->id_boucle;
1016
+                $newdescr = $descr;
1017
+                $newdescr['id_mere'] = $nom;
1018
+                $newdescr['niv']++;
1019
+                $preaff = calculer_liste($p->preaff, $newdescr, $boucles, $id_boucle);
1020
+                $avant = calculer_liste($p->avant, $newdescr, $boucles, $id_boucle);
1021
+                $apres = calculer_liste($p->apres, $newdescr, $boucles, $id_boucle);
1022
+                $postaff = calculer_liste($p->postaff, $newdescr, $boucles, $id_boucle);
1023
+                $newdescr['niv']--;
1024
+                $altern = calculer_liste($p->altern, $newdescr, $boucles, $id_boucle);
1025
+                if ($preaff === false
1026
+                    or $avant === false
1027
+                    or $apres === false
1028
+                    or $altern === false
1029
+                    or $postaff === false) {
1030
+                    $err_e_c = true;
1031
+                    $code = "''";
1032
+                } else {
1033
+                    $code = 'BOUCLE' .
1034
+                        str_replace("-", "_", $nom) . $descr['nom'] .
1035
+                        '($Cache, $Pile, $doublons, $Numrows, $SP)';
1036
+                    $commentaire = "?$nom";
1037
+                    if (!$boucles[$nom]->milieu
1038
+                        and $boucles[$nom]->type_requete <> TYPE_RECURSIF
1039
+                    ) {
1040
+                        if ($preaff != "''") {
1041
+                            $code .= "\n. $preaff";
1042
+                        }
1043
+                        if ($altern != "''") {
1044
+                            $code .= "\n. $altern";
1045
+                        }
1046
+                        if ($postaff != "''") {
1047
+                            $code .= "\n. $postaff";
1048
+                        }
1049
+                        if ($avant <> "''" or $apres <> "''") {
1050
+                            spip_log("boucle $nom toujours vide, code superflu dans $descr[sourcefile]");
1051
+                        }
1052
+                        $avant = $apres = $altern = "''";
1053
+                    } else {
1054
+                        if ($preaff != "''") {
1055
+                            $avant = compile_concatene_parties_codes($preaff, $avant);
1056
+                            $altern = compile_concatene_parties_codes($preaff, $altern);
1057
+                        }
1058
+                        if ($postaff != "''") {
1059
+                            $apres = compile_concatene_parties_codes($apres, $postaff);
1060
+                            $altern = compile_concatene_parties_codes($altern, $postaff);
1061
+                        }
1062
+                        if ($altern != "''") {
1063
+                            $altern = "($altern)";
1064
+                        }
1065
+                    }
1066
+                }
1067
+                break;
1068
+
1069
+            case 'idiome':
1070
+                $l = array();
1071
+                $code = '';
1072
+                foreach ($p->arg as $k => $v) {
1073
+                    $_v = calculer_liste($v, $descr, $boucles, $id_boucle);
1074
+                    if ($k) {
1075
+                        $l[] = _q($k) . ' => ' . $_v;
1076
+                    } else {
1077
+                        $code = $_v;
1078
+                    }
1079
+                }
1080
+                // Si le module n'est pas fourni, l'expliciter sauf si calculé
1081
+                if ($p->module) {
1082
+                    $m = $p->module . ':' . $p->nom_champ;
1083
+                } elseif ($p->nom_champ) {
1084
+                    $m = MODULES_IDIOMES . ':' . $p->nom_champ;
1085
+                } else {
1086
+                    $m = '';
1087
+                }
1088
+
1089
+                $code = (!$code ? "'$m'" :
1090
+                        ($m ? "'$m' . $code" :
1091
+                            ("(strpos(\$x=$code, ':') ? \$x : ('" . MODULES_IDIOMES . ":' . \$x))")))
1092
+                    . (!$l ? '' : (", array(" . implode(",\n", $l) . ")"));
1093
+                $code = "_T($code)";
1094
+                if ($p->param) {
1095
+                    $p->id_boucle = $id_boucle;
1096
+                    $p->boucles = &$boucles;
1097
+                    $code = compose_filtres($p, $code);
1098
+                }
1099
+                $commentaire = ":";
1100
+                $avant = '';
1101
+                $apres = '';
1102
+                $altern = "''";
1103
+                break;
1104
+
1105
+            case 'champ':
1106
+
1107
+                // cette structure pourrait etre completee des le phrase' (a faire)
1108
+                $p->id_boucle = $id_boucle;
1109
+                $p->boucles = &$boucles;
1110
+                $p->descr = $descr;
1111
+                #$p->interdire_scripts = true;
1112
+                $p->type_requete = $type;
1113
+
1114
+                $code = calculer_champ($p);
1115
+                $commentaire = '#' . $p->nom_champ . $p->etoile;
1116
+                $avant = calculer_liste($p->avant,
1117
+                    $descr, $boucles, $id_boucle);
1118
+                $apres = calculer_liste($p->apres,
1119
+                    $descr, $boucles, $id_boucle);
1120
+                $altern = "''";
1121
+                // Si la valeur est destinee a une comparaison a ''
1122
+                // forcer la conversion en une chaine par strval
1123
+                // si ca peut etre autre chose qu'une chaine
1124
+                if (($avant != "''" or $apres != "''")
1125
+                    and $code[0] != "'"
1126 1126
 #			AND (strpos($code,'interdire_scripts') !== 0)
1127
-					and !preg_match(_REGEXP_COND_VIDE_NONVIDE, $code)
1128
-					and !preg_match(_REGEXP_COND_NONVIDE_VIDE, $code)
1129
-					and !preg_match(_REGEXP_CONCAT_NON_VIDE, $code)
1130
-				) {
1131
-					$code = "strval($code)";
1132
-				}
1133
-				break;
1134
-
1135
-			default:
1136
-				// Erreur de construction de l'arbre de syntaxe abstraite
1137
-				$code = "''";
1138
-				$p->descr = $descr;
1139
-				$err_e_c = _T('zbug_erreur_compilation');
1140
-				erreur_squelette($err_e_c, $p);
1141
-		} // switch
1142
-
1143
-		if ($code != "''") {
1144
-			$code = compile_retour($code, $avant, $apres, $altern, $tab, $descr['niv']);
1145
-			$codes[] = (($mode == 'validation') ?
1146
-				"array($code, '$commentaire', " . $p->ligne . ")"
1147
-				: (($mode == 'code') ?
1148
-					"\n// $commentaire\n$code" :
1149
-					$code));
1150
-		}
1151
-	} // foreach
1152
-
1153
-	return $err_e_c ? false : $codes;
1127
+                    and !preg_match(_REGEXP_COND_VIDE_NONVIDE, $code)
1128
+                    and !preg_match(_REGEXP_COND_NONVIDE_VIDE, $code)
1129
+                    and !preg_match(_REGEXP_CONCAT_NON_VIDE, $code)
1130
+                ) {
1131
+                    $code = "strval($code)";
1132
+                }
1133
+                break;
1134
+
1135
+            default:
1136
+                // Erreur de construction de l'arbre de syntaxe abstraite
1137
+                $code = "''";
1138
+                $p->descr = $descr;
1139
+                $err_e_c = _T('zbug_erreur_compilation');
1140
+                erreur_squelette($err_e_c, $p);
1141
+        } // switch
1142
+
1143
+        if ($code != "''") {
1144
+            $code = compile_retour($code, $avant, $apres, $altern, $tab, $descr['niv']);
1145
+            $codes[] = (($mode == 'validation') ?
1146
+                "array($code, '$commentaire', " . $p->ligne . ")"
1147
+                : (($mode == 'code') ?
1148
+                    "\n// $commentaire\n$code" :
1149
+                    $code));
1150
+        }
1151
+    } // foreach
1152
+
1153
+    return $err_e_c ? false : $codes;
1154 1154
 }
1155 1155
 
1156 1156
 /**
@@ -1160,13 +1160,13 @@  discard block
 block discarded – undo
1160 1160
  * @return string
1161 1161
  */
1162 1162
 function compile_concatene_parties_codes($partie1, $partie2) {
1163
-	if ($partie1 === "''") {
1164
-		return $partie2;
1165
-	}
1166
-	if ($partie2 === "''") {
1167
-		return $partie1;
1168
-	}
1169
-	return "$partie1\n. $partie2";
1163
+    if ($partie1 === "''") {
1164
+        return $partie2;
1165
+    }
1166
+    if ($partie2 === "''") {
1167
+        return $partie1;
1168
+    }
1169
+    return "$partie1\n. $partie2";
1170 1170
 }
1171 1171
 
1172 1172
 
@@ -1191,57 +1191,57 @@  discard block
 block discarded – undo
1191 1191
  * @return mixed|string
1192 1192
  */
1193 1193
 function compile_retour($code, $avant, $apres, $altern, $tab, $n) {
1194
-	if ($avant === "''") {
1195
-		$avant = '';
1196
-	}
1197
-	if ($apres === "''") {
1198
-		$apres = '';
1199
-	}
1200
-	if ($avant or $apres or ($altern !== "''")){
1201
-		if (preg_match(_REGEXP_CONCAT_NON_VIDE, $code)){
1202
-			$t = $code;
1203
-			$cond = '';
1204
-		} elseif (preg_match(_REGEXP_COND_VIDE_NONVIDE, $code, $r)) {
1205
-			$t = $r[2];
1206
-			$cond = '!' . $r[1];
1207
-		} else {
1208
-			if (preg_match(_REGEXP_COND_NONVIDE_VIDE, $code, $r)){
1209
-				$t = $r[2];
1210
-				$cond = $r[1];
1211
-			} else {
1212
-				$t = '$t' . $n;
1213
-				$cond = "($t = $code)!==''";
1214
-			}
1215
-		}
1216
-
1217
-		$res = (!$avant ? "" : "$avant . ") .
1218
-			$t .
1219
-			(!$apres ? "" : " . $apres");
1220
-
1221
-		if ($res!==$t){
1222
-			$res = "($res)";
1223
-		}
1224
-
1225
-		$code = (!$cond ? $res : "($cond ?\n\t$tab$res :\n\t$tab$altern)");
1226
-	}
1227
-
1228
-	return $code;
1194
+    if ($avant === "''") {
1195
+        $avant = '';
1196
+    }
1197
+    if ($apres === "''") {
1198
+        $apres = '';
1199
+    }
1200
+    if ($avant or $apres or ($altern !== "''")){
1201
+        if (preg_match(_REGEXP_CONCAT_NON_VIDE, $code)){
1202
+            $t = $code;
1203
+            $cond = '';
1204
+        } elseif (preg_match(_REGEXP_COND_VIDE_NONVIDE, $code, $r)) {
1205
+            $t = $r[2];
1206
+            $cond = '!' . $r[1];
1207
+        } else {
1208
+            if (preg_match(_REGEXP_COND_NONVIDE_VIDE, $code, $r)){
1209
+                $t = $r[2];
1210
+                $cond = $r[1];
1211
+            } else {
1212
+                $t = '$t' . $n;
1213
+                $cond = "($t = $code)!==''";
1214
+            }
1215
+        }
1216
+
1217
+        $res = (!$avant ? "" : "$avant . ") .
1218
+            $t .
1219
+            (!$apres ? "" : " . $apres");
1220
+
1221
+        if ($res!==$t){
1222
+            $res = "($res)";
1223
+        }
1224
+
1225
+        $code = (!$cond ? $res : "($cond ?\n\t$tab$res :\n\t$tab$altern)");
1226
+    }
1227
+
1228
+    return $code;
1229 1229
 
1230 1230
 }
1231 1231
 
1232 1232
 
1233 1233
 function compile_inclure_doublons($lexemes) {
1234
-	foreach ($lexemes as $v) {
1235
-		if ($v->type === 'include' and $v->param) {
1236
-			foreach ($v->param as $r) {
1237
-				if (trim($r[0]) === 'doublons') {
1238
-					return true;
1239
-				}
1240
-			}
1241
-		}
1242
-	}
1243
-
1244
-	return false;
1234
+    foreach ($lexemes as $v) {
1235
+        if ($v->type === 'include' and $v->param) {
1236
+            foreach ($v->param as $r) {
1237
+                if (trim($r[0]) === 'doublons') {
1238
+                    return true;
1239
+                }
1240
+            }
1241
+        }
1242
+    }
1243
+
1244
+    return false;
1245 1245
 }
1246 1246
 
1247 1247
 // Prend en argument le texte d'un squelette, le nom de son fichier d'origine,
@@ -1261,348 +1261,348 @@  discard block
 block discarded – undo
1261 1261
 
1262 1262
 // https://code.spip.net/@public_compiler_dist
1263 1263
 function public_compiler_dist($squelette, $nom, $gram, $sourcefile, $connect = '') {
1264
-	// Pre-traitement : reperer le charset du squelette, et le convertir
1265
-	// Bonus : supprime le BOM
1266
-	include_spip('inc/charsets');
1267
-	$squelette = transcoder_page($squelette);
1268
-
1269
-	// rendre inertes les echappements de #[](){}<>
1270
-	$i = 0;
1271
-	while (false !== strpos($squelette, $inerte = '-INERTE' . $i)) {
1272
-		$i++;
1273
-	}
1274
-	$squelette = preg_replace_callback(',\\\\([#[()\]{}<>]),',
1275
-		function($a) use ($inerte) {
1276
-			return "$inerte-" . ord($a[1]) . '-';
1277
-		},
1278
-		$squelette,
1279
-		-1,
1280
-		$esc
1281
-	);
1282
-
1283
-	$descr = array(
1284
-		'nom' => $nom,
1285
-		'gram' => $gram,
1286
-		'sourcefile' => $sourcefile,
1287
-		'squelette' => $squelette
1288
-	);
1289
-
1290
-	// Phraser le squelette, selon sa grammaire
1291
-
1292
-	$boucles = array();
1293
-	$f = charger_fonction('phraser_' . $gram, 'public');
1294
-
1295
-	$squelette = $f($squelette, '', $boucles, $descr);
1296
-
1297
-	$boucles = compiler_squelette($squelette, $boucles, $nom, $descr, $sourcefile, $connect);
1298
-
1299
-	// restituer les echappements
1300
-	if ($esc) {
1301
-		foreach ($boucles as $i => $boucle) {
1302
-			$boucles[$i]->return = preg_replace_callback(
1303
-				",$inerte-(\d+)-,",
1304
-				function($a) {
1305
-					return chr($a[1]);
1306
-				},
1307
-				$boucle->return
1308
-			);
1309
-			$boucles[$i]->descr['squelette'] = preg_replace_callback(
1310
-				",$inerte-(\d+)-,",
1311
-				function($a) {
1312
-					return "\\\\" . chr($a[1]);
1313
-				},
1314
-				$boucle->descr['squelette']
1315
-			);
1316
-		}
1317
-	}
1318
-
1319
-	$debug = ($boucles and defined('_VAR_MODE') and _VAR_MODE == 'debug');
1320
-	if ($debug) {
1321
-		include_spip('public/decompiler');
1322
-		foreach ($boucles as $id => $boucle) {
1323
-			if ($id) {
1324
-				$decomp = "\n/* BOUCLE " .
1325
-					$boucle->type_requete .
1326
-					" " .
1327
-					str_replace('*/', '* /', public_decompiler($boucle, $gram, 0, 'criteres')) .
1328
-					($boucle->debug ? "\n *\n * " . implode("\n * ", $boucle->debug) . "\n" : '') .
1329
-					" */\n";
1330
-			} else {
1331
-				$decomp = ("\n/*\n" .
1332
-					str_replace('*/', '* /', public_decompiler($squelette, $gram))
1333
-					. "\n*/");
1334
-			}
1335
-			$boucles[$id]->return = $decomp . $boucle->return;
1336
-			$GLOBALS['debug_objets']['code'][$nom . $id] = $boucle->return;
1337
-		}
1338
-	}
1339
-
1340
-	return $boucles;
1264
+    // Pre-traitement : reperer le charset du squelette, et le convertir
1265
+    // Bonus : supprime le BOM
1266
+    include_spip('inc/charsets');
1267
+    $squelette = transcoder_page($squelette);
1268
+
1269
+    // rendre inertes les echappements de #[](){}<>
1270
+    $i = 0;
1271
+    while (false !== strpos($squelette, $inerte = '-INERTE' . $i)) {
1272
+        $i++;
1273
+    }
1274
+    $squelette = preg_replace_callback(',\\\\([#[()\]{}<>]),',
1275
+        function($a) use ($inerte) {
1276
+            return "$inerte-" . ord($a[1]) . '-';
1277
+        },
1278
+        $squelette,
1279
+        -1,
1280
+        $esc
1281
+    );
1282
+
1283
+    $descr = array(
1284
+        'nom' => $nom,
1285
+        'gram' => $gram,
1286
+        'sourcefile' => $sourcefile,
1287
+        'squelette' => $squelette
1288
+    );
1289
+
1290
+    // Phraser le squelette, selon sa grammaire
1291
+
1292
+    $boucles = array();
1293
+    $f = charger_fonction('phraser_' . $gram, 'public');
1294
+
1295
+    $squelette = $f($squelette, '', $boucles, $descr);
1296
+
1297
+    $boucles = compiler_squelette($squelette, $boucles, $nom, $descr, $sourcefile, $connect);
1298
+
1299
+    // restituer les echappements
1300
+    if ($esc) {
1301
+        foreach ($boucles as $i => $boucle) {
1302
+            $boucles[$i]->return = preg_replace_callback(
1303
+                ",$inerte-(\d+)-,",
1304
+                function($a) {
1305
+                    return chr($a[1]);
1306
+                },
1307
+                $boucle->return
1308
+            );
1309
+            $boucles[$i]->descr['squelette'] = preg_replace_callback(
1310
+                ",$inerte-(\d+)-,",
1311
+                function($a) {
1312
+                    return "\\\\" . chr($a[1]);
1313
+                },
1314
+                $boucle->descr['squelette']
1315
+            );
1316
+        }
1317
+    }
1318
+
1319
+    $debug = ($boucles and defined('_VAR_MODE') and _VAR_MODE == 'debug');
1320
+    if ($debug) {
1321
+        include_spip('public/decompiler');
1322
+        foreach ($boucles as $id => $boucle) {
1323
+            if ($id) {
1324
+                $decomp = "\n/* BOUCLE " .
1325
+                    $boucle->type_requete .
1326
+                    " " .
1327
+                    str_replace('*/', '* /', public_decompiler($boucle, $gram, 0, 'criteres')) .
1328
+                    ($boucle->debug ? "\n *\n * " . implode("\n * ", $boucle->debug) . "\n" : '') .
1329
+                    " */\n";
1330
+            } else {
1331
+                $decomp = ("\n/*\n" .
1332
+                    str_replace('*/', '* /', public_decompiler($squelette, $gram))
1333
+                    . "\n*/");
1334
+            }
1335
+            $boucles[$id]->return = $decomp . $boucle->return;
1336
+            $GLOBALS['debug_objets']['code'][$nom . $id] = $boucle->return;
1337
+        }
1338
+    }
1339
+
1340
+    return $boucles;
1341 1341
 }
1342 1342
 
1343 1343
 // Point d'entree pour arbre de syntaxe abstraite fourni en premier argument
1344 1344
 // Autres specifications comme ci-dessus
1345 1345
 
1346 1346
 function compiler_squelette($squelette, $boucles, $nom, $descr, $sourcefile, $connect = '') {
1347
-	static $trouver_table;
1348
-	spip_timer('calcul_skel');
1349
-
1350
-	if (defined('_VAR_MODE') and _VAR_MODE == 'debug') {
1351
-		$GLOBALS['debug_objets']['squelette'][$nom] = $descr['squelette'];
1352
-		$GLOBALS['debug_objets']['sourcefile'][$nom] = $sourcefile;
1353
-
1354
-		if (!isset($GLOBALS['debug_objets']['principal'])) {
1355
-			$GLOBALS['debug_objets']['principal'] = $nom;
1356
-		}
1357
-	}
1358
-	foreach ($boucles as $id => $boucle) {
1359
-		$GLOBALS['debug_objets']['boucle'][$nom . $id] = $boucle;
1360
-	}
1361
-	$descr['documents'] = compile_inclure_doublons($squelette);
1362
-
1363
-	// Demander la description des tables une fois pour toutes
1364
-	if (!$trouver_table) {
1365
-		$trouver_table = charger_fonction('trouver_table', 'base');
1366
-	}
1367
-
1368
-	// reperer si les doublons sont demandes
1369
-	// pour un inclure ou une boucle document
1370
-	// c'est utile a la fonction champs_traitements
1371
-	foreach ($boucles as $id => $boucle) {
1372
-		if (!($type = $boucle->type_requete)) {
1373
-			continue;
1374
-		}
1375
-		if (!$descr['documents'] and (
1376
-				(($type == 'documents') and $boucle->doublons) or
1377
-				compile_inclure_doublons($boucle->avant) or
1378
-				compile_inclure_doublons($boucle->apres) or
1379
-				compile_inclure_doublons($boucle->milieu) or
1380
-				compile_inclure_doublons($boucle->altern))
1381
-		) {
1382
-			$descr['documents'] = true;
1383
-		}
1384
-		if ($type != TYPE_RECURSIF) {
1385
-			if (!$boucles[$id]->sql_serveur and $connect) {
1386
-				$boucles[$id]->sql_serveur = $connect;
1387
-			}
1388
-
1389
-			// chercher dans les iterateurs du repertoire iterateur/
1390
-			if ($g = charger_fonction(
1391
-				preg_replace('/\W/', '_', $boucle->type_requete), 'iterateur', true)
1392
-			) {
1393
-				$boucles[$id] = $g($boucle);
1394
-
1395
-				// sinon, en cas de requeteur d'un type predefini,
1396
-				// utiliser les informations donnees par le requeteur
1397
-				// cas "php:xx" et "data:xx".
1398
-			} else {
1399
-				if ($boucle->sql_serveur and $requeteur = charger_fonction($boucle->sql_serveur, 'requeteur', true)) {
1400
-					$requeteur($boucles, $boucle, $id);
1401
-
1402
-					// utiliser la description des champs transmis
1403
-				} else {
1404
-					$show = $trouver_table($type, $boucles[$id]->sql_serveur);
1405
-					// si la table n'existe pas avec le connecteur par defaut,
1406
-					// c'est peut etre une table qui necessite son connecteur dedie fourni
1407
-					// permet une ecriture allegee (GEO) -> (geo:GEO)
1408
-					if (!$show
1409
-						and $show = $trouver_table($type, strtolower($type))
1410
-					) {
1411
-						$boucles[$id]->sql_serveur = strtolower($type);
1412
-					}
1413
-					if ($show) {
1414
-						$boucles[$id]->show = $show;
1415
-						// recopie les infos les plus importantes
1416
-						$boucles[$id]->primary = isset($show['key']["PRIMARY KEY"]) ? $show['key']["PRIMARY KEY"] : '';
1417
-						$boucles[$id]->id_table = $x = preg_replace(",^spip_,", "", $show['id_table']);
1418
-						$boucles[$id]->from[$x] = $nom_table = $show['table'];
1419
-						$boucles[$id]->iterateur = 'SQL';
1420
-
1421
-						if (empty($boucles[$id]->descr)) {
1422
-							$boucles[$id]->descr = &$descr;
1423
-						}
1424
-						if ((!$boucles[$id]->jointures)
1425
-							and is_array($show['tables_jointures'])
1426
-							and count($x = $show['tables_jointures'])
1427
-						) {
1428
-							$boucles[$id]->jointures = $x;
1429
-						}
1430
-						if ($boucles[$id]->jointures_explicites) {
1431
-							$jointures = preg_split("/\s+/", $boucles[$id]->jointures_explicites);
1432
-							while ($j = array_pop($jointures)) {
1433
-								array_unshift($boucles[$id]->jointures, $j);
1434
-							}
1435
-						}
1436
-					} else {
1437
-						// Pas une erreur si la table est optionnelle
1438
-						if ($boucles[$id]->table_optionnelle) {
1439
-							$boucles[$id]->type_requete = '';
1440
-						} else {
1441
-							$boucles[$id]->type_requete = false;
1442
-							$boucle = $boucles[$id];
1443
-							$x = (!$boucle->sql_serveur ? '' :
1444
-									($boucle->sql_serveur . ":")) .
1445
-								$type;
1446
-							$msg = array(
1447
-								'zbug_table_inconnue',
1448
-								array('table' => $x)
1449
-							);
1450
-							erreur_squelette($msg, $boucle);
1451
-						}
1452
-					}
1453
-				}
1454
-			}
1455
-		}
1456
-	}
1457
-
1458
-	// Commencer par reperer les boucles appelees explicitement 
1459
-	// car elles indexent les arguments de maniere derogatoire
1460
-	foreach ($boucles as $id => $boucle) {
1461
-		if ($boucle->type_requete == TYPE_RECURSIF and $boucle->param) {
1462
-			$boucles[$id]->descr = &$descr;
1463
-			$rec = &$boucles[$boucle->param[0]];
1464
-			if (!$rec) {
1465
-				$msg = array(
1466
-					'zbug_boucle_recursive_undef',
1467
-					array('nom' => $boucle->param[0])
1468
-				);
1469
-				erreur_squelette($msg, $boucle);
1470
-				$boucles[$id]->type_requete = false;
1471
-			} else {
1472
-				$rec->externe = $id;
1473
-				$descr['id_mere'] = $id;
1474
-				$boucles[$id]->return =
1475
-					calculer_liste(array($rec),
1476
-						$descr,
1477
-						$boucles,
1478
-						$boucle->param);
1479
-			}
1480
-		}
1481
-	}
1482
-	foreach ($boucles as $id => $boucle) {
1483
-		$id = strval($id); // attention au type dans index_pile
1484
-		$type = $boucle->type_requete;
1485
-		if ($type and $type != TYPE_RECURSIF) {
1486
-			$res = '';
1487
-			if ($boucle->param) {
1488
-				// retourne un tableau en cas d'erreur
1489
-				$res = calculer_criteres($id, $boucles);
1490
-			}
1491
-			$descr['id_mere'] = $id;
1492
-			$boucles[$id]->return =
1493
-				calculer_liste($boucle->milieu,
1494
-					$descr,
1495
-					$boucles,
1496
-					$id);
1497
-			// Si les criteres se sont mal compiles
1498
-			// ne pas tenter d'assembler le code final
1499
-			// (mais compiler le corps pour detection d'erreurs)
1500
-			if (is_array($res)) {
1501
-				$boucles[$id]->type_requete = false;
1502
-			}
1503
-		}
1504
-	}
1505
-
1506
-	// idem pour la racine
1507
-	$descr['id_mere'] = '';
1508
-	$corps = calculer_liste($squelette, $descr, $boucles);
1509
-
1510
-
1511
-	// Calcul du corps de toutes les fonctions PHP,
1512
-	// en particulier les requetes SQL et TOTAL_BOUCLE
1513
-	// de'terminables seulement maintenant
1514
-
1515
-	foreach ($boucles as $id => $boucle) {
1516
-		$boucle = $boucles[$id] = pipeline('pre_boucle', $boucle);
1517
-		if ($boucle->return === false) {
1518
-			$corps = false;
1519
-			continue;
1520
-		}
1521
-		// appeler la fonction de definition de la boucle
1522
-
1523
-		if ($req = $boucle->type_requete) {
1524
-			// boucle personnalisée ?
1525
-			$table = strtoupper($boucle->type_requete);
1526
-			$serveur = strtolower($boucle->sql_serveur);
1527
-			if (
1528
-				// fonction de boucle avec serveur & table
1529
-				(!$serveur or
1530
-					((!function_exists($f = "boucle_" . $serveur . "_" . $table))
1531
-						and (!function_exists($f = $f . "_dist"))
1532
-					)
1533
-				)
1534
-				// fonction de boucle avec table
1535
-				and (!function_exists($f = "boucle_" . $table))
1536
-				and (!function_exists($f = $f . "_dist"))
1537
-			) {
1538
-				// fonction de boucle standard 
1539
-				if (!function_exists($f = 'boucle_DEFAUT')) {
1540
-					$f = 'boucle_DEFAUT_dist';
1541
-				}
1542
-			}
1543
-
1544
-			$req = "\n\n\tstatic \$command = array();\n\t" .
1545
-				"static \$connect;\n\t" .
1546
-				"\$command['connect'] = \$connect = " .
1547
-				_q($boucle->sql_serveur) .
1548
-				";" .
1549
-				$f($id, $boucles);
1550
-		} else {
1551
-			$req = ("\n\treturn '';");
1552
-		}
1553
-
1554
-		$boucles[$id]->return =
1555
-			"\n\nfunction BOUCLE" . strtr($id, "-", "_") . $nom .
1556
-			'(&$Cache, &$Pile, &$doublons, &$Numrows, $SP) {' .
1557
-			$req .
1558
-			"\n}\n";
1559
-	}
1560
-
1561
-	// Au final, si le corps ou un critere au moins s'est mal compile
1562
-	// retourner False, sinon inserer leur decompilation
1563
-	if (is_bool($corps)) {
1564
-		return false;
1565
-	}
1566
-
1567
-	$principal = "\nfunction " . $nom . '($Cache, $Pile, $doublons = array(), $Numrows = array(), $SP = 0) {
1347
+    static $trouver_table;
1348
+    spip_timer('calcul_skel');
1349
+
1350
+    if (defined('_VAR_MODE') and _VAR_MODE == 'debug') {
1351
+        $GLOBALS['debug_objets']['squelette'][$nom] = $descr['squelette'];
1352
+        $GLOBALS['debug_objets']['sourcefile'][$nom] = $sourcefile;
1353
+
1354
+        if (!isset($GLOBALS['debug_objets']['principal'])) {
1355
+            $GLOBALS['debug_objets']['principal'] = $nom;
1356
+        }
1357
+    }
1358
+    foreach ($boucles as $id => $boucle) {
1359
+        $GLOBALS['debug_objets']['boucle'][$nom . $id] = $boucle;
1360
+    }
1361
+    $descr['documents'] = compile_inclure_doublons($squelette);
1362
+
1363
+    // Demander la description des tables une fois pour toutes
1364
+    if (!$trouver_table) {
1365
+        $trouver_table = charger_fonction('trouver_table', 'base');
1366
+    }
1367
+
1368
+    // reperer si les doublons sont demandes
1369
+    // pour un inclure ou une boucle document
1370
+    // c'est utile a la fonction champs_traitements
1371
+    foreach ($boucles as $id => $boucle) {
1372
+        if (!($type = $boucle->type_requete)) {
1373
+            continue;
1374
+        }
1375
+        if (!$descr['documents'] and (
1376
+                (($type == 'documents') and $boucle->doublons) or
1377
+                compile_inclure_doublons($boucle->avant) or
1378
+                compile_inclure_doublons($boucle->apres) or
1379
+                compile_inclure_doublons($boucle->milieu) or
1380
+                compile_inclure_doublons($boucle->altern))
1381
+        ) {
1382
+            $descr['documents'] = true;
1383
+        }
1384
+        if ($type != TYPE_RECURSIF) {
1385
+            if (!$boucles[$id]->sql_serveur and $connect) {
1386
+                $boucles[$id]->sql_serveur = $connect;
1387
+            }
1388
+
1389
+            // chercher dans les iterateurs du repertoire iterateur/
1390
+            if ($g = charger_fonction(
1391
+                preg_replace('/\W/', '_', $boucle->type_requete), 'iterateur', true)
1392
+            ) {
1393
+                $boucles[$id] = $g($boucle);
1394
+
1395
+                // sinon, en cas de requeteur d'un type predefini,
1396
+                // utiliser les informations donnees par le requeteur
1397
+                // cas "php:xx" et "data:xx".
1398
+            } else {
1399
+                if ($boucle->sql_serveur and $requeteur = charger_fonction($boucle->sql_serveur, 'requeteur', true)) {
1400
+                    $requeteur($boucles, $boucle, $id);
1401
+
1402
+                    // utiliser la description des champs transmis
1403
+                } else {
1404
+                    $show = $trouver_table($type, $boucles[$id]->sql_serveur);
1405
+                    // si la table n'existe pas avec le connecteur par defaut,
1406
+                    // c'est peut etre une table qui necessite son connecteur dedie fourni
1407
+                    // permet une ecriture allegee (GEO) -> (geo:GEO)
1408
+                    if (!$show
1409
+                        and $show = $trouver_table($type, strtolower($type))
1410
+                    ) {
1411
+                        $boucles[$id]->sql_serveur = strtolower($type);
1412
+                    }
1413
+                    if ($show) {
1414
+                        $boucles[$id]->show = $show;
1415
+                        // recopie les infos les plus importantes
1416
+                        $boucles[$id]->primary = isset($show['key']["PRIMARY KEY"]) ? $show['key']["PRIMARY KEY"] : '';
1417
+                        $boucles[$id]->id_table = $x = preg_replace(",^spip_,", "", $show['id_table']);
1418
+                        $boucles[$id]->from[$x] = $nom_table = $show['table'];
1419
+                        $boucles[$id]->iterateur = 'SQL';
1420
+
1421
+                        if (empty($boucles[$id]->descr)) {
1422
+                            $boucles[$id]->descr = &$descr;
1423
+                        }
1424
+                        if ((!$boucles[$id]->jointures)
1425
+                            and is_array($show['tables_jointures'])
1426
+                            and count($x = $show['tables_jointures'])
1427
+                        ) {
1428
+                            $boucles[$id]->jointures = $x;
1429
+                        }
1430
+                        if ($boucles[$id]->jointures_explicites) {
1431
+                            $jointures = preg_split("/\s+/", $boucles[$id]->jointures_explicites);
1432
+                            while ($j = array_pop($jointures)) {
1433
+                                array_unshift($boucles[$id]->jointures, $j);
1434
+                            }
1435
+                        }
1436
+                    } else {
1437
+                        // Pas une erreur si la table est optionnelle
1438
+                        if ($boucles[$id]->table_optionnelle) {
1439
+                            $boucles[$id]->type_requete = '';
1440
+                        } else {
1441
+                            $boucles[$id]->type_requete = false;
1442
+                            $boucle = $boucles[$id];
1443
+                            $x = (!$boucle->sql_serveur ? '' :
1444
+                                    ($boucle->sql_serveur . ":")) .
1445
+                                $type;
1446
+                            $msg = array(
1447
+                                'zbug_table_inconnue',
1448
+                                array('table' => $x)
1449
+                            );
1450
+                            erreur_squelette($msg, $boucle);
1451
+                        }
1452
+                    }
1453
+                }
1454
+            }
1455
+        }
1456
+    }
1457
+
1458
+    // Commencer par reperer les boucles appelees explicitement 
1459
+    // car elles indexent les arguments de maniere derogatoire
1460
+    foreach ($boucles as $id => $boucle) {
1461
+        if ($boucle->type_requete == TYPE_RECURSIF and $boucle->param) {
1462
+            $boucles[$id]->descr = &$descr;
1463
+            $rec = &$boucles[$boucle->param[0]];
1464
+            if (!$rec) {
1465
+                $msg = array(
1466
+                    'zbug_boucle_recursive_undef',
1467
+                    array('nom' => $boucle->param[0])
1468
+                );
1469
+                erreur_squelette($msg, $boucle);
1470
+                $boucles[$id]->type_requete = false;
1471
+            } else {
1472
+                $rec->externe = $id;
1473
+                $descr['id_mere'] = $id;
1474
+                $boucles[$id]->return =
1475
+                    calculer_liste(array($rec),
1476
+                        $descr,
1477
+                        $boucles,
1478
+                        $boucle->param);
1479
+            }
1480
+        }
1481
+    }
1482
+    foreach ($boucles as $id => $boucle) {
1483
+        $id = strval($id); // attention au type dans index_pile
1484
+        $type = $boucle->type_requete;
1485
+        if ($type and $type != TYPE_RECURSIF) {
1486
+            $res = '';
1487
+            if ($boucle->param) {
1488
+                // retourne un tableau en cas d'erreur
1489
+                $res = calculer_criteres($id, $boucles);
1490
+            }
1491
+            $descr['id_mere'] = $id;
1492
+            $boucles[$id]->return =
1493
+                calculer_liste($boucle->milieu,
1494
+                    $descr,
1495
+                    $boucles,
1496
+                    $id);
1497
+            // Si les criteres se sont mal compiles
1498
+            // ne pas tenter d'assembler le code final
1499
+            // (mais compiler le corps pour detection d'erreurs)
1500
+            if (is_array($res)) {
1501
+                $boucles[$id]->type_requete = false;
1502
+            }
1503
+        }
1504
+    }
1505
+
1506
+    // idem pour la racine
1507
+    $descr['id_mere'] = '';
1508
+    $corps = calculer_liste($squelette, $descr, $boucles);
1509
+
1510
+
1511
+    // Calcul du corps de toutes les fonctions PHP,
1512
+    // en particulier les requetes SQL et TOTAL_BOUCLE
1513
+    // de'terminables seulement maintenant
1514
+
1515
+    foreach ($boucles as $id => $boucle) {
1516
+        $boucle = $boucles[$id] = pipeline('pre_boucle', $boucle);
1517
+        if ($boucle->return === false) {
1518
+            $corps = false;
1519
+            continue;
1520
+        }
1521
+        // appeler la fonction de definition de la boucle
1522
+
1523
+        if ($req = $boucle->type_requete) {
1524
+            // boucle personnalisée ?
1525
+            $table = strtoupper($boucle->type_requete);
1526
+            $serveur = strtolower($boucle->sql_serveur);
1527
+            if (
1528
+                // fonction de boucle avec serveur & table
1529
+                (!$serveur or
1530
+                    ((!function_exists($f = "boucle_" . $serveur . "_" . $table))
1531
+                        and (!function_exists($f = $f . "_dist"))
1532
+                    )
1533
+                )
1534
+                // fonction de boucle avec table
1535
+                and (!function_exists($f = "boucle_" . $table))
1536
+                and (!function_exists($f = $f . "_dist"))
1537
+            ) {
1538
+                // fonction de boucle standard 
1539
+                if (!function_exists($f = 'boucle_DEFAUT')) {
1540
+                    $f = 'boucle_DEFAUT_dist';
1541
+                }
1542
+            }
1543
+
1544
+            $req = "\n\n\tstatic \$command = array();\n\t" .
1545
+                "static \$connect;\n\t" .
1546
+                "\$command['connect'] = \$connect = " .
1547
+                _q($boucle->sql_serveur) .
1548
+                ";" .
1549
+                $f($id, $boucles);
1550
+        } else {
1551
+            $req = ("\n\treturn '';");
1552
+        }
1553
+
1554
+        $boucles[$id]->return =
1555
+            "\n\nfunction BOUCLE" . strtr($id, "-", "_") . $nom .
1556
+            '(&$Cache, &$Pile, &$doublons, &$Numrows, $SP) {' .
1557
+            $req .
1558
+            "\n}\n";
1559
+    }
1560
+
1561
+    // Au final, si le corps ou un critere au moins s'est mal compile
1562
+    // retourner False, sinon inserer leur decompilation
1563
+    if (is_bool($corps)) {
1564
+        return false;
1565
+    }
1566
+
1567
+    $principal = "\nfunction " . $nom . '($Cache, $Pile, $doublons = array(), $Numrows = array(), $SP = 0) {
1568 1568
 '
1569
-		// reporter de maniere securisee les doublons inclus
1570
-		. '
1569
+        // reporter de maniere securisee les doublons inclus
1570
+        . '
1571 1571
 	if (isset($Pile[0]["doublons"]) AND is_array($Pile[0]["doublons"]))
1572 1572
 		$doublons = nettoyer_env_doublons($Pile[0]["doublons"]);
1573 1573
 
1574 1574
 	$connect = ' .
1575
-		_q($connect) . ';
1575
+        _q($connect) . ';
1576 1576
 	$page = ' .
1577
-		// ATTENTION, le calcul de l'expression $corps affectera $Cache
1578
-		// c'est pourquoi on l'affecte a la variable auxiliaire $page.
1579
-		// avant de referencer $Cache
1580
-		$corps . ";
1577
+        // ATTENTION, le calcul de l'expression $corps affectera $Cache
1578
+        // c'est pourquoi on l'affecte a la variable auxiliaire $page.
1579
+        // avant de referencer $Cache
1580
+        $corps . ";
1581 1581
 
1582 1582
 	return analyse_resultat_skel(" . var_export($nom, true)
1583
-		. ", \$Cache, \$page, " . var_export($sourcefile, true) . ");
1583
+        . ", \$Cache, \$page, " . var_export($sourcefile, true) . ");
1584 1584
 }";
1585 1585
 
1586
-	$secondes = spip_timer('calcul_skel');
1587
-	spip_log("COMPIL ($secondes) [$sourcefile] $nom.php");
1588
-	// $connect n'est pas sûr : on nettoie
1589
-	$connect = preg_replace(',[^\w],', '', $connect);
1586
+    $secondes = spip_timer('calcul_skel');
1587
+    spip_log("COMPIL ($secondes) [$sourcefile] $nom.php");
1588
+    // $connect n'est pas sûr : on nettoie
1589
+    $connect = preg_replace(',[^\w],', '', $connect);
1590 1590
 
1591
-	// Assimiler la fct principale a une boucle anonyme, pour retourner un resultat simple
1592
-	$code = new Boucle;
1593
-	$code->descr = $descr;
1594
-	$code->return = '
1591
+    // Assimiler la fct principale a une boucle anonyme, pour retourner un resultat simple
1592
+    $code = new Boucle;
1593
+    $code->descr = $descr;
1594
+    $code->return = '
1595 1595
 //
1596 1596
 // Fonction principale du squelette ' .
1597
-		$sourcefile .
1598
-		($connect ? " pour $connect" : '') .
1599
-		(!CODE_COMMENTE ? '' : "\n// Temps de compilation total: $secondes") .
1600
-		"\n//\n" .
1601
-		$principal;
1597
+        $sourcefile .
1598
+        ($connect ? " pour $connect" : '') .
1599
+        (!CODE_COMMENTE ? '' : "\n// Temps de compilation total: $secondes") .
1600
+        "\n//\n" .
1601
+        $principal;
1602 1602
 
1603
-	$boucles[''] = $code;
1603
+    $boucles[''] = $code;
1604 1604
 
1605
-	return $boucles;
1605
+    return $boucles;
1606 1606
 }
1607 1607
 
1608 1608
 
@@ -1619,18 +1619,18 @@  discard block
 block discarded – undo
1619 1619
  *
1620 1620
  **/
1621 1621
 function requeteur_php_dist(&$boucles, &$boucle, &$id) {
1622
-	if (class_exists($boucle->type_requete)) {
1623
-		$g = charger_fonction('php', 'iterateur');
1624
-		$boucles[$id] = $g($boucle, $boucle->type_requete);
1625
-	} else {
1626
-		$x = $boucle->type_requete;
1627
-		$boucle->type_requete = false;
1628
-		$msg = array(
1629
-			'zbug_iterateur_inconnu',
1630
-			array('iterateur' => $x)
1631
-		);
1632
-		erreur_squelette($msg, $boucle);
1633
-	}
1622
+    if (class_exists($boucle->type_requete)) {
1623
+        $g = charger_fonction('php', 'iterateur');
1624
+        $boucles[$id] = $g($boucle, $boucle->type_requete);
1625
+    } else {
1626
+        $x = $boucle->type_requete;
1627
+        $boucle->type_requete = false;
1628
+        $msg = array(
1629
+            'zbug_iterateur_inconnu',
1630
+            array('iterateur' => $x)
1631
+        );
1632
+        erreur_squelette($msg, $boucle);
1633
+    }
1634 1634
 }
1635 1635
 
1636 1636
 
@@ -1648,23 +1648,23 @@  discard block
 block discarded – undo
1648 1648
  *
1649 1649
  **/
1650 1650
 function requeteur_data_dist(&$boucles, &$boucle, &$id) {
1651
-	include_spip('iterateur/data');
1652
-	if ($h = charger_fonction($boucle->type_requete . '_to_array', 'inc', true)) {
1653
-		$g = charger_fonction('data', 'iterateur');
1654
-		$boucles[$id] = $g($boucle);
1655
-		// from[0] stocke le type de data (rss, yql, ...)
1656
-		$boucles[$id]->from[] = $boucle->type_requete;
1657
-
1658
-	} else {
1659
-		$x = $boucle->type_requete;
1660
-		$boucle->type_requete = false;
1661
-		$msg = array(
1662
-			'zbug_requeteur_inconnu',
1663
-			array(
1664
-				'requeteur' => 'data',
1665
-				'type' => $x
1666
-			)
1667
-		);
1668
-		erreur_squelette($msg, $boucle);
1669
-	}
1651
+    include_spip('iterateur/data');
1652
+    if ($h = charger_fonction($boucle->type_requete . '_to_array', 'inc', true)) {
1653
+        $g = charger_fonction('data', 'iterateur');
1654
+        $boucles[$id] = $g($boucle);
1655
+        // from[0] stocke le type de data (rss, yql, ...)
1656
+        $boucles[$id]->from[] = $boucle->type_requete;
1657
+
1658
+    } else {
1659
+        $x = $boucle->type_requete;
1660
+        $boucle->type_requete = false;
1661
+        $msg = array(
1662
+            'zbug_requeteur_inconnu',
1663
+            array(
1664
+                'requeteur' => 'data',
1665
+                'type' => $x
1666
+            )
1667
+        );
1668
+        erreur_squelette($msg, $boucle);
1669
+    }
1670 1670
 }
Please login to merge, or discard this patch.
Spacing   +115 added lines, -123 removed lines patch added patch discarded remove patch
@@ -97,7 +97,7 @@  discard block
 block discarded – undo
97 97
 				preg_match(",^([^=]*)(=?)(.*)$,m", $var->texte, $m);
98 98
 				$m = array_pad($m, 3, null);
99 99
 				$var = $m[1];
100
-				$auto = false;;
100
+				$auto = false; ;
101 101
 				if ($m[2]) {
102 102
 					$v = $m[3];
103 103
 					if (preg_match(',^[\'"](.*)[\'"]$,', $v, $m)) {
@@ -121,7 +121,7 @@  discard block
 block discarded – undo
121 121
 						: calculer_liste($val, $p->descr, $boucles, $id_boucle);
122 122
 					if ($var !== 1) {
123 123
 						$val = ($echap ? "\'$var\' => ' . argumenter_squelette(" : "'$var' => ")
124
-							. $val . ($echap ? ") . '" : " ");
124
+							. $val.($echap ? ") . '" : " ");
125 125
 					} else {
126 126
 						$val = $echap ? "'.$val.'" : $val;
127 127
 					}
@@ -142,7 +142,7 @@  discard block
 block discarded – undo
142 142
 	if (!$lang) {
143 143
 		$lang = '$GLOBALS["spip_lang"]';
144 144
 	}
145
-	$l['lang'] = ($echap ? "\'lang\' => ' . argumenter_squelette(" : "'lang' => ") . $lang . ($echap ? ") . '" : " ");
145
+	$l['lang'] = ($echap ? "\'lang\' => ' . argumenter_squelette(" : "'lang' => ").$lang.($echap ? ") . '" : " ");
146 146
 
147 147
 	return $l;
148 148
 }
@@ -171,7 +171,7 @@  discard block
 block discarded – undo
171 171
 	$_contexte = argumenter_inclure($p->param, false, $p, $boucles, $id_boucle, true, '', true);
172 172
 	if (is_string($p->texte)) {
173 173
 		$fichier = $p->texte;
174
-		$code = "\"".str_replace('"','\"',$fichier)."\"";
174
+		$code = "\"".str_replace('"', '\"', $fichier)."\"";
175 175
 
176 176
 	} else {
177 177
 		$code = calculer_liste($p->texte, $p->descr, $boucles, $id_boucle);
@@ -185,7 +185,7 @@  discard block
 block discarded – undo
185 185
 		$trace = $p->fonctions;
186 186
 		while (is_array($trace)
187 187
 		  and $trace = array_filter($trace)
188
-			and count($trace)==1) {
188
+			and count($trace) == 1) {
189 189
 			$trace = reset($trace);
190 190
 		}
191 191
 		$erreur_p_i_i = array(
@@ -219,7 +219,7 @@  discard block
 block discarded – undo
219 219
 		return false;
220 220
 	} // j'aurais voulu toucher le fond ...
221 221
 
222
-	$contexte = 'array(' . $_contexte . ')';
222
+	$contexte = 'array('.$_contexte.')';
223 223
 
224 224
 	if ($env) {
225 225
 		$contexte = "array_merge('.var_export(\$Pile[0],1).',$contexte)";
@@ -234,11 +234,11 @@  discard block
 block discarded – undo
234 234
 			$_options[] = $ajax;
235 235
 		}
236 236
 		$code = " ' . argumenter_squelette($code) . '";
237
-		$code = "echo " . sprintf(CODE_RECUPERER_FOND, $code, $contexte, implode(',', $_options),
238
-				"_request(\"connect\")") . ';';
237
+		$code = "echo ".sprintf(CODE_RECUPERER_FOND, $code, $contexte, implode(',', $_options),
238
+				"_request(\"connect\")").';';
239 239
 	}
240 240
 
241
-	return "\n'<'.'" . "?php " . $code . "\n?'." . "'>'";
241
+	return "\n'<'.'"."?php ".$code."\n?'."."'>'";
242 242
 }
243 243
 
244 244
 
@@ -318,17 +318,17 @@  discard block
 block discarded – undo
318 318
 					$id = $id_table;
319 319
 					$statut = preg_replace(',\W,', '', $s['champ']); // securite
320 320
 				}
321
-				$mstatut = $id . '.' . $statut;
321
+				$mstatut = $id.'.'.$statut;
322 322
 
323 323
 				$arg_ignore_previsu = ($ignore_previsu ? ",true" : '');
324 324
 				include_spip('public/quete');
325 325
 				if (isset($s['post_date']) and $s['post_date']
326 326
 					and $GLOBALS['meta']["post_dates"] == 'non'
327 327
 				) {
328
-					$date = $id . '.' . preg_replace(',\W,', '', $s['post_date']); // securite
328
+					$date = $id.'.'.preg_replace(',\W,', '', $s['post_date']); // securite
329 329
 					array_unshift($boucle->where,
330 330
 						$echapper ?
331
-							"\nquete_condition_postdates('$date'," . _q($boucle->sql_serveur) . "$arg_ignore_previsu)"
331
+							"\nquete_condition_postdates('$date',"._q($boucle->sql_serveur)."$arg_ignore_previsu)"
332 332
 							:
333 333
 							quete_condition_postdates($date, $boucle->sql_serveur, $ignore_previsu)
334 334
 					);
@@ -336,9 +336,9 @@  discard block
 block discarded – undo
336 336
 				array_unshift($boucle->where,
337 337
 					$echapper ?
338 338
 						"\nquete_condition_statut('$mstatut',"
339
-						. _q($s['previsu']) . ","
340
-						. _q($s['publie']) . ","
341
-						. _q($boucle->sql_serveur) . "$arg_ignore_previsu)"
339
+						. _q($s['previsu']).","
340
+						. _q($s['publie']).","
341
+						. _q($boucle->sql_serveur)."$arg_ignore_previsu)"
342 342
 						:
343 343
 						quete_condition_statut($mstatut, $s['previsu'], $s['publie'], $boucle->sql_serveur, $ignore_previsu)
344 344
 				);
@@ -372,14 +372,14 @@  discard block
 block discarded – undo
372 372
 	if (_request('var_mode_affiche') != 'resultat') {
373 373
 		$trace = '';
374 374
 	} else {
375
-		$_trace = $boucles[$id_boucle]->descr['nom'] . $id_boucle;
375
+		$_trace = $boucles[$id_boucle]->descr['nom'].$id_boucle;
376 376
 		$_trace = "\$GLOBALS['debug_objets']['resultat']['$_trace']";
377 377
 		$trace = "
378 378
 		if (empty($_trace)) { 
379 379
 			$_trace = []; 
380 380
 		}
381 381
 		if (count($_trace) < 3) { 
382
-			$_trace" . "[] = \$t0; 
382
+			$_trace"."[] = \$t0; 
383 383
 		}";
384 384
 	}
385 385
 
@@ -413,7 +413,7 @@  discard block
 block discarded – undo
413 413
 	return
414 414
 		// Numrows[$nom] peut ne pas être encore defini
415 415
 		"\n\t\$save_numrows = (isset(\$Numrows['$nom']) ? \$Numrows['$nom'] : array());"
416
-		. "\n\t\$t0 = " . $boucles[$id_boucle]->return . ";"
416
+		. "\n\t\$t0 = ".$boucles[$id_boucle]->return.";"
417 417
 		. "\n\t\$Numrows['$nom'] = (\$save_numrows);"
418 418
 		. $trace
419 419
 		. "\n\treturn \$t0;";
@@ -481,7 +481,7 @@  discard block
 block discarded – undo
481 481
 	// faudrait expanser le foreach a la compil, car y en a souvent qu'un 
482 482
 	// et puis faire un [] plutot qu'un "','."
483 483
 	if ($boucle->doublons) {
484
-		$corps .= "\n\t\t\tforeach(" . $boucle->doublons . ' as $k) $doublons[$k] .= "," . ' .
484
+		$corps .= "\n\t\t\tforeach(".$boucle->doublons.' as $k) $doublons[$k] .= "," . '.
485 485
 			index_pile($id_boucle, $primary, $boucles)
486 486
 			. "; // doublons\n";
487 487
 	}
@@ -508,13 +508,13 @@  discard block
 block discarded – undo
508 508
 		$corps .=
509 509
 			"\n\t\tlang_select_public("
510 510
 			. index_pile($id_boucle, 'lang', $boucles)
511
-			. ", '" . $boucle->lang_select . "'"
511
+			. ", '".$boucle->lang_select."'"
512 512
 			. (in_array($type_boucle, array(
513 513
 				'articles',
514 514
 				'rubriques',
515 515
 				'hierarchie',
516 516
 				'breves'
517
-			)) ? ', ' . index_pile($id_boucle, 'titre', $boucles) : '')
517
+			)) ? ', '.index_pile($id_boucle, 'titre', $boucles) : '')
518 518
 			. ');';
519 519
 	} else {
520 520
 		$init_lang = '';
@@ -535,26 +535,22 @@  discard block
 block discarded – undo
535 535
 
536 536
 	// gestion optimale des separateurs et des boucles constantes
537 537
 	if (count($boucle->separateur)) {
538
-		$code_sep = ("'" . str_replace("'", "\'", join('', $boucle->separateur)) . "'");
538
+		$code_sep = ("'".str_replace("'", "\'", join('', $boucle->separateur))."'");
539 539
 	}
540 540
 
541 541
 	$corps .=
542 542
 		((!$boucle->separateur) ?
543
-			(($constant && !$corps && !$flag_cpt) ? $return :
544
-				(($return === "''") ? '' :
545
-					("\n\t\t" . '$t0 .= ' . $return . ";"))) :
546
-			("\n\t\t\$t1 " .
543
+			(($constant && !$corps && !$flag_cpt) ? $return : (($return === "''") ? '' : ("\n\t\t".'$t0 .= '.$return.";"))) : ("\n\t\t\$t1 ".
547 544
 				((strpos($return, '$t1.') === 0) ?
548
-					(".=" . substr($return, 4)) :
549
-					('= ' . $return)) .
550
-				";\n\t\t" .
551
-				'$t0 .= ((strlen($t1) && strlen($t0)) ? ' . $code_sep . " : '') . \$t1;"));
545
+					(".=".substr($return, 4)) : ('= '.$return)).
546
+				";\n\t\t".
547
+				'$t0 .= ((strlen($t1) && strlen($t0)) ? '.$code_sep." : '') . \$t1;"));
552 548
 
553 549
 	// Calculer les invalideurs si c'est une boucle non constante et si on
554 550
 	// souhaite invalider ces elements
555 551
 	if (!$constant and $primary) {
556 552
 		include_spip('inc/invalideur');
557
-		$corps = calcul_invalideurs($corps, $primary,$boucles, $id_boucle);
553
+		$corps = calcul_invalideurs($corps, $primary, $boucles, $id_boucle);
558 554
 	}
559 555
 
560 556
 	// gerer le compteur de boucle 
@@ -629,7 +625,7 @@  discard block
 block discarded – undo
629 625
 		$corps,
630 626
 		$fin_lang,
631 627
 		$trace,
632
-		'BOUCLE' . $id_boucle . ' @ ' . ($boucle->descr['sourcefile'])
628
+		'BOUCLE'.$id_boucle.' @ '.($boucle->descr['sourcefile'])
633 629
 	);
634 630
 
635 631
 #	var_dump($a);exit;
@@ -650,20 +646,20 @@  discard block
 block discarded – undo
650 646
  **/
651 647
 function calculer_requete_sql($boucle) {
652 648
 	$init = array();
653
-	$init[] = calculer_dec('table', "'" . $boucle->id_table . "'");
654
-	$init[] = calculer_dec('id', "'" . $boucle->id_boucle . "'");
649
+	$init[] = calculer_dec('table', "'".$boucle->id_table."'");
650
+	$init[] = calculer_dec('id', "'".$boucle->id_boucle."'");
655 651
 	# En absence de champ c'est un decompte :
656 652
 	$init[] = calculer_dec('from', calculer_from($boucle));
657 653
 	$init[] = calculer_dec('type', calculer_from_type($boucle));
658 654
 	$init[] = calculer_dec('groupby',
659
-		'array(' . (($g = join("\",\n\t\t\"", $boucle->group)) ? '"' . $g . '"' : '') . ")");
660
-	$init[] = calculer_dec('select', 'array("' . join("\",\n\t\t\"", $boucle->select) . "\")");
661
-	$init[] = calculer_dec('orderby', 'array(' . calculer_order($boucle) . ")");
655
+		'array('.(($g = join("\",\n\t\t\"", $boucle->group)) ? '"'.$g.'"' : '').")");
656
+	$init[] = calculer_dec('select', 'array("'.join("\",\n\t\t\"", $boucle->select)."\")");
657
+	$init[] = calculer_dec('orderby', 'array('.calculer_order($boucle).")");
662 658
 	$init[] = calculer_dec('where', calculer_dump_array($boucle->where));
663 659
 	$init[] = calculer_dec('join', calculer_dump_join($boucle->join));
664 660
 	$init[] = calculer_dec('limit',
665 661
 		(strpos($boucle->limit, 'intval') === false ?
666
-			"'" . $boucle->limit . "'"
662
+			"'".$boucle->limit."'"
667 663
 			:
668 664
 			$boucle->limit));
669 665
 	$init[] = calculer_dec('having', calculer_dump_array($boucle->having));
@@ -672,17 +668,17 @@  discard block
 block discarded – undo
672 668
 	// ou recalculée à chaque passage (vide)
673 669
 	foreach ($init as $i) {
674 670
 		if (reset($i)) {
675
-			$s .= "\n\t\t" . end($i);
671
+			$s .= "\n\t\t".end($i);
676 672
 		} # statique
677 673
 		else {
678
-			$d .= "\n\t" . end($i);
674
+			$d .= "\n\t".end($i);
679 675
 		} # dynamique
680 676
 	}
681 677
 
682 678
 	return ($boucle->hierarchie ? "\n\t$boucle->hierarchie" : '')
683 679
 	. $boucle->in
684 680
 	. $boucle->hash
685
-	. "\n\t" . 'if (!isset($command[\'table\'])) {'
681
+	. "\n\t".'if (!isset($command[\'table\'])) {'
686 682
 	. $s
687 683
 	. "\n\t}"
688 684
 	. $d;
@@ -765,7 +761,7 @@  discard block
 block discarded – undo
765 761
  *    - index 1 : Code de l'affectation
766 762
  **/
767 763
 function calculer_dec($nom, $val) {
768
-	$static = 'if (!isset($command[\'' . $nom . '\'])) ';
764
+	$static = 'if (!isset($command[\''.$nom.'\'])) ';
769 765
 	// si une variable apparait dans le calcul de la clause
770 766
 	// il faut la re-evaluer a chaque passage
771 767
 	if (
@@ -782,7 +778,7 @@  discard block
 block discarded – undo
782 778
 		$static = "";
783 779
 	}
784 780
 
785
-	return array($static, '$command[\'' . $nom . '\'] = ' . $val . ';');
781
+	return array($static, '$command[\''.$nom.'\'] = '.$val.';');
786 782
 }
787 783
 
788 784
 /**
@@ -807,17 +803,17 @@  discard block
 block discarded – undo
807 803
 	}
808 804
 	$res = "";
809 805
 	if ($a and $a[0] == "'?'") {
810
-		return ("(" . calculer_dump_array($a[1]) .
811
-			" ? " . calculer_dump_array($a[2]) .
812
-			" : " . calculer_dump_array($a[3]) .
806
+		return ("(".calculer_dump_array($a[1]).
807
+			" ? ".calculer_dump_array($a[2]).
808
+			" : ".calculer_dump_array($a[3]).
813 809
 			")");
814 810
 	} else {
815 811
 		foreach ($a as $k => $v) {
816
-			$showk = (is_numeric($k) ? '' : sql_quote($k) . ' => ');
817
-			$res .= ", " . $showk . calculer_dump_array($v);
812
+			$showk = (is_numeric($k) ? '' : sql_quote($k).' => ');
813
+			$res .= ", ".$showk.calculer_dump_array($v);
818 814
 		}
819 815
 
820
-		return "\n\t\t\tarray(" . substr($res, 2) . ')';
816
+		return "\n\t\t\tarray(".substr($res, 2).')';
821 817
 	}
822 818
 }
823 819
 
@@ -825,10 +821,10 @@  discard block
 block discarded – undo
825 821
 function calculer_dump_join($a) {
826 822
 	$res = "";
827 823
 	foreach ($a as $k => $v) {
828
-		$res .= ", '$k' => array(" . implode(',', $v) . ")";
824
+		$res .= ", '$k' => array(".implode(',', $v).")";
829 825
 	}
830 826
 
831
-	return 'array(' . substr($res, 2) . ')';
827
+	return 'array('.substr($res, 2).')';
832 828
 }
833 829
 
834 830
 /**
@@ -845,7 +841,7 @@  discard block
 block discarded – undo
845 841
 		$res .= ",'$k' => '$v'";
846 842
 	}
847 843
 
848
-	return 'array(' . substr($res, 1) . ')';
844
+	return 'array('.substr($res, 1).')';
849 845
 }
850 846
 
851 847
 /**
@@ -863,7 +859,7 @@  discard block
 block discarded – undo
863 859
 		$res .= ",'$k' => '$v'";
864 860
 	}
865 861
 
866
-	return 'array(' . substr($res, 1) . ')';
862
+	return 'array('.substr($res, 1).')';
867 863
 }
868 864
 
869 865
 // https://code.spip.net/@calculer_order
@@ -932,17 +928,17 @@  discard block
 block discarded – undo
932 928
 				) {
933 929
 					$res .= " .\n$tab$code";
934 930
 				} else {
935
-					$res = substr($res, 0, -1) . substr($code, 1);
931
+					$res = substr($res, 0, -1).substr($code, 1);
936 932
 				}
937 933
 			}
938 934
 
939
-			return '(' . substr($res, 2 + $descr['niv']) . ')';
935
+			return '('.substr($res, 2 + $descr['niv']).')';
940 936
 		}
941 937
 	} else {
942
-		$nom = $descr['nom'] . $id_boucle . ($descr['niv'] ? $descr['niv'] : '');
938
+		$nom = $descr['nom'].$id_boucle.($descr['niv'] ? $descr['niv'] : '');
943 939
 
944
-		return "join('', array_map('array_shift', \$GLOBALS['debug_objets']['sequence']['$nom'] = array(" . join(" ,\n$tab",
945
-			$codes) . ")))";
940
+		return "join('', array_map('array_shift', \$GLOBALS['debug_objets']['sequence']['$nom'] = array(".join(" ,\n$tab",
941
+			$codes).")))";
946 942
 	}
947 943
 }
948 944
 
@@ -971,7 +967,7 @@  discard block
 block discarded – undo
971 967
 			// texte seul
972 968
 			case 'texte':
973 969
 				$code = sandbox_composer_texte($p->texte, $p);
974
-				$commentaire = strlen($p->texte) . " signes";
970
+				$commentaire = strlen($p->texte)." signes";
975 971
 				$avant = '';
976 972
 				$apres = '';
977 973
 				$altern = "''";
@@ -980,14 +976,14 @@  discard block
 block discarded – undo
980 976
 			case 'polyglotte':
981 977
 				$code = "";
982 978
 				foreach ($p->traductions as $k => $v) {
983
-					$code .= ",'" .
984
-						str_replace(array("\\", "'"), array("\\\\", "\\'"), $k) .
985
-						"' => '" .
986
-						str_replace(array("\\", "'"), array("\\\\", "\\'"), $v) .
979
+					$code .= ",'".
980
+						str_replace(array("\\", "'"), array("\\\\", "\\'"), $k).
981
+						"' => '".
982
+						str_replace(array("\\", "'"), array("\\\\", "\\'"), $v).
987 983
 						"'";
988 984
 				}
989
-				$code = "choisir_traduction(array(" .
990
-					substr($code, 1) .
985
+				$code = "choisir_traduction(array(".
986
+					substr($code, 1).
991 987
 					"))";
992 988
 				$commentaire = '&';
993 989
 				$avant = '';
@@ -1003,7 +999,7 @@  discard block
 block discarded – undo
1003 999
 					$err_e_c = true;
1004 1000
 					$code = "''";
1005 1001
 				} else {
1006
-					$commentaire = '<INCLURE ' . addslashes(str_replace("\n", ' ', $code)) . '>';
1002
+					$commentaire = '<INCLURE '.addslashes(str_replace("\n", ' ', $code)).'>';
1007 1003
 					$avant = '';
1008 1004
 					$apres = '';
1009 1005
 					$altern = "''";
@@ -1030,8 +1026,8 @@  discard block
 block discarded – undo
1030 1026
 					$err_e_c = true;
1031 1027
 					$code = "''";
1032 1028
 				} else {
1033
-					$code = 'BOUCLE' .
1034
-						str_replace("-", "_", $nom) . $descr['nom'] .
1029
+					$code = 'BOUCLE'.
1030
+						str_replace("-", "_", $nom).$descr['nom'].
1035 1031
 						'($Cache, $Pile, $doublons, $Numrows, $SP)';
1036 1032
 					$commentaire = "?$nom";
1037 1033
 					if (!$boucles[$nom]->milieu
@@ -1072,24 +1068,22 @@  discard block
 block discarded – undo
1072 1068
 				foreach ($p->arg as $k => $v) {
1073 1069
 					$_v = calculer_liste($v, $descr, $boucles, $id_boucle);
1074 1070
 					if ($k) {
1075
-						$l[] = _q($k) . ' => ' . $_v;
1071
+						$l[] = _q($k).' => '.$_v;
1076 1072
 					} else {
1077 1073
 						$code = $_v;
1078 1074
 					}
1079 1075
 				}
1080 1076
 				// Si le module n'est pas fourni, l'expliciter sauf si calculé
1081 1077
 				if ($p->module) {
1082
-					$m = $p->module . ':' . $p->nom_champ;
1078
+					$m = $p->module.':'.$p->nom_champ;
1083 1079
 				} elseif ($p->nom_champ) {
1084
-					$m = MODULES_IDIOMES . ':' . $p->nom_champ;
1080
+					$m = MODULES_IDIOMES.':'.$p->nom_champ;
1085 1081
 				} else {
1086 1082
 					$m = '';
1087 1083
 				}
1088 1084
 
1089
-				$code = (!$code ? "'$m'" :
1090
-						($m ? "'$m' . $code" :
1091
-							("(strpos(\$x=$code, ':') ? \$x : ('" . MODULES_IDIOMES . ":' . \$x))")))
1092
-					. (!$l ? '' : (", array(" . implode(",\n", $l) . ")"));
1085
+				$code = (!$code ? "'$m'" : ($m ? "'$m' . $code" : ("(strpos(\$x=$code, ':') ? \$x : ('".MODULES_IDIOMES.":' . \$x))")))
1086
+					. (!$l ? '' : (", array(".implode(",\n", $l).")"));
1093 1087
 				$code = "_T($code)";
1094 1088
 				if ($p->param) {
1095 1089
 					$p->id_boucle = $id_boucle;
@@ -1112,7 +1106,7 @@  discard block
 block discarded – undo
1112 1106
 				$p->type_requete = $type;
1113 1107
 
1114 1108
 				$code = calculer_champ($p);
1115
-				$commentaire = '#' . $p->nom_champ . $p->etoile;
1109
+				$commentaire = '#'.$p->nom_champ.$p->etoile;
1116 1110
 				$avant = calculer_liste($p->avant,
1117 1111
 					$descr, $boucles, $id_boucle);
1118 1112
 				$apres = calculer_liste($p->apres,
@@ -1143,10 +1137,9 @@  discard block
 block discarded – undo
1143 1137
 		if ($code != "''") {
1144 1138
 			$code = compile_retour($code, $avant, $apres, $altern, $tab, $descr['niv']);
1145 1139
 			$codes[] = (($mode == 'validation') ?
1146
-				"array($code, '$commentaire', " . $p->ligne . ")"
1140
+				"array($code, '$commentaire', ".$p->ligne.")"
1147 1141
 				: (($mode == 'code') ?
1148
-					"\n// $commentaire\n$code" :
1149
-					$code));
1142
+					"\n// $commentaire\n$code" : $code));
1150 1143
 		}
1151 1144
 	} // foreach
1152 1145
 
@@ -1197,28 +1190,28 @@  discard block
 block discarded – undo
1197 1190
 	if ($apres === "''") {
1198 1191
 		$apres = '';
1199 1192
 	}
1200
-	if ($avant or $apres or ($altern !== "''")){
1201
-		if (preg_match(_REGEXP_CONCAT_NON_VIDE, $code)){
1193
+	if ($avant or $apres or ($altern !== "''")) {
1194
+		if (preg_match(_REGEXP_CONCAT_NON_VIDE, $code)) {
1202 1195
 			$t = $code;
1203 1196
 			$cond = '';
1204 1197
 		} elseif (preg_match(_REGEXP_COND_VIDE_NONVIDE, $code, $r)) {
1205 1198
 			$t = $r[2];
1206
-			$cond = '!' . $r[1];
1199
+			$cond = '!'.$r[1];
1207 1200
 		} else {
1208
-			if (preg_match(_REGEXP_COND_NONVIDE_VIDE, $code, $r)){
1201
+			if (preg_match(_REGEXP_COND_NONVIDE_VIDE, $code, $r)) {
1209 1202
 				$t = $r[2];
1210 1203
 				$cond = $r[1];
1211 1204
 			} else {
1212
-				$t = '$t' . $n;
1205
+				$t = '$t'.$n;
1213 1206
 				$cond = "($t = $code)!==''";
1214 1207
 			}
1215 1208
 		}
1216 1209
 
1217
-		$res = (!$avant ? "" : "$avant . ") .
1218
-			$t .
1210
+		$res = (!$avant ? "" : "$avant . ").
1211
+			$t.
1219 1212
 			(!$apres ? "" : " . $apres");
1220 1213
 
1221
-		if ($res!==$t){
1214
+		if ($res !== $t) {
1222 1215
 			$res = "($res)";
1223 1216
 		}
1224 1217
 
@@ -1268,12 +1261,12 @@  discard block
 block discarded – undo
1268 1261
 
1269 1262
 	// rendre inertes les echappements de #[](){}<>
1270 1263
 	$i = 0;
1271
-	while (false !== strpos($squelette, $inerte = '-INERTE' . $i)) {
1264
+	while (false !== strpos($squelette, $inerte = '-INERTE'.$i)) {
1272 1265
 		$i++;
1273 1266
 	}
1274 1267
 	$squelette = preg_replace_callback(',\\\\([#[()\]{}<>]),',
1275 1268
 		function($a) use ($inerte) {
1276
-			return "$inerte-" . ord($a[1]) . '-';
1269
+			return "$inerte-".ord($a[1]).'-';
1277 1270
 		},
1278 1271
 		$squelette,
1279 1272
 		-1,
@@ -1290,7 +1283,7 @@  discard block
 block discarded – undo
1290 1283
 	// Phraser le squelette, selon sa grammaire
1291 1284
 
1292 1285
 	$boucles = array();
1293
-	$f = charger_fonction('phraser_' . $gram, 'public');
1286
+	$f = charger_fonction('phraser_'.$gram, 'public');
1294 1287
 
1295 1288
 	$squelette = $f($squelette, '', $boucles, $descr);
1296 1289
 
@@ -1309,7 +1302,7 @@  discard block
 block discarded – undo
1309 1302
 			$boucles[$i]->descr['squelette'] = preg_replace_callback(
1310 1303
 				",$inerte-(\d+)-,",
1311 1304
 				function($a) {
1312
-					return "\\\\" . chr($a[1]);
1305
+					return "\\\\".chr($a[1]);
1313 1306
 				},
1314 1307
 				$boucle->descr['squelette']
1315 1308
 			);
@@ -1321,19 +1314,19 @@  discard block
 block discarded – undo
1321 1314
 		include_spip('public/decompiler');
1322 1315
 		foreach ($boucles as $id => $boucle) {
1323 1316
 			if ($id) {
1324
-				$decomp = "\n/* BOUCLE " .
1325
-					$boucle->type_requete .
1326
-					" " .
1327
-					str_replace('*/', '* /', public_decompiler($boucle, $gram, 0, 'criteres')) .
1328
-					($boucle->debug ? "\n *\n * " . implode("\n * ", $boucle->debug) . "\n" : '') .
1317
+				$decomp = "\n/* BOUCLE ".
1318
+					$boucle->type_requete.
1319
+					" ".
1320
+					str_replace('*/', '* /', public_decompiler($boucle, $gram, 0, 'criteres')).
1321
+					($boucle->debug ? "\n *\n * ".implode("\n * ", $boucle->debug)."\n" : '').
1329 1322
 					" */\n";
1330 1323
 			} else {
1331
-				$decomp = ("\n/*\n" .
1324
+				$decomp = ("\n/*\n".
1332 1325
 					str_replace('*/', '* /', public_decompiler($squelette, $gram))
1333 1326
 					. "\n*/");
1334 1327
 			}
1335
-			$boucles[$id]->return = $decomp . $boucle->return;
1336
-			$GLOBALS['debug_objets']['code'][$nom . $id] = $boucle->return;
1328
+			$boucles[$id]->return = $decomp.$boucle->return;
1329
+			$GLOBALS['debug_objets']['code'][$nom.$id] = $boucle->return;
1337 1330
 		}
1338 1331
 	}
1339 1332
 
@@ -1356,7 +1349,7 @@  discard block
 block discarded – undo
1356 1349
 		}
1357 1350
 	}
1358 1351
 	foreach ($boucles as $id => $boucle) {
1359
-		$GLOBALS['debug_objets']['boucle'][$nom . $id] = $boucle;
1352
+		$GLOBALS['debug_objets']['boucle'][$nom.$id] = $boucle;
1360 1353
 	}
1361 1354
 	$descr['documents'] = compile_inclure_doublons($squelette);
1362 1355
 
@@ -1440,8 +1433,7 @@  discard block
 block discarded – undo
1440 1433
 						} else {
1441 1434
 							$boucles[$id]->type_requete = false;
1442 1435
 							$boucle = $boucles[$id];
1443
-							$x = (!$boucle->sql_serveur ? '' :
1444
-									($boucle->sql_serveur . ":")) .
1436
+							$x = (!$boucle->sql_serveur ? '' : ($boucle->sql_serveur.":")).
1445 1437
 								$type;
1446 1438
 							$msg = array(
1447 1439
 								'zbug_table_inconnue',
@@ -1527,13 +1519,13 @@  discard block
 block discarded – undo
1527 1519
 			if (
1528 1520
 				// fonction de boucle avec serveur & table
1529 1521
 				(!$serveur or
1530
-					((!function_exists($f = "boucle_" . $serveur . "_" . $table))
1531
-						and (!function_exists($f = $f . "_dist"))
1522
+					((!function_exists($f = "boucle_".$serveur."_".$table))
1523
+						and (!function_exists($f = $f."_dist"))
1532 1524
 					)
1533 1525
 				)
1534 1526
 				// fonction de boucle avec table
1535
-				and (!function_exists($f = "boucle_" . $table))
1536
-				and (!function_exists($f = $f . "_dist"))
1527
+				and (!function_exists($f = "boucle_".$table))
1528
+				and (!function_exists($f = $f."_dist"))
1537 1529
 			) {
1538 1530
 				// fonction de boucle standard 
1539 1531
 				if (!function_exists($f = 'boucle_DEFAUT')) {
@@ -1541,20 +1533,20 @@  discard block
 block discarded – undo
1541 1533
 				}
1542 1534
 			}
1543 1535
 
1544
-			$req = "\n\n\tstatic \$command = array();\n\t" .
1545
-				"static \$connect;\n\t" .
1546
-				"\$command['connect'] = \$connect = " .
1547
-				_q($boucle->sql_serveur) .
1548
-				";" .
1536
+			$req = "\n\n\tstatic \$command = array();\n\t".
1537
+				"static \$connect;\n\t".
1538
+				"\$command['connect'] = \$connect = ".
1539
+				_q($boucle->sql_serveur).
1540
+				";".
1549 1541
 				$f($id, $boucles);
1550 1542
 		} else {
1551 1543
 			$req = ("\n\treturn '';");
1552 1544
 		}
1553 1545
 
1554 1546
 		$boucles[$id]->return =
1555
-			"\n\nfunction BOUCLE" . strtr($id, "-", "_") . $nom .
1556
-			'(&$Cache, &$Pile, &$doublons, &$Numrows, $SP) {' .
1557
-			$req .
1547
+			"\n\nfunction BOUCLE".strtr($id, "-", "_").$nom.
1548
+			'(&$Cache, &$Pile, &$doublons, &$Numrows, $SP) {'.
1549
+			$req.
1558 1550
 			"\n}\n";
1559 1551
 	}
1560 1552
 
@@ -1564,7 +1556,7 @@  discard block
 block discarded – undo
1564 1556
 		return false;
1565 1557
 	}
1566 1558
 
1567
-	$principal = "\nfunction " . $nom . '($Cache, $Pile, $doublons = array(), $Numrows = array(), $SP = 0) {
1559
+	$principal = "\nfunction ".$nom.'($Cache, $Pile, $doublons = array(), $Numrows = array(), $SP = 0) {
1568 1560
 '
1569 1561
 		// reporter de maniere securisee les doublons inclus
1570 1562
 		. '
@@ -1572,15 +1564,15 @@  discard block
 block discarded – undo
1572 1564
 		$doublons = nettoyer_env_doublons($Pile[0]["doublons"]);
1573 1565
 
1574 1566
 	$connect = ' .
1575
-		_q($connect) . ';
1567
+		_q($connect).';
1576 1568
 	$page = ' .
1577 1569
 		// ATTENTION, le calcul de l'expression $corps affectera $Cache
1578 1570
 		// c'est pourquoi on l'affecte a la variable auxiliaire $page.
1579 1571
 		// avant de referencer $Cache
1580
-		$corps . ";
1572
+		$corps.";
1581 1573
 
1582 1574
 	return analyse_resultat_skel(" . var_export($nom, true)
1583
-		. ", \$Cache, \$page, " . var_export($sourcefile, true) . ");
1575
+		. ", \$Cache, \$page, ".var_export($sourcefile, true).");
1584 1576
 }";
1585 1577
 
1586 1578
 	$secondes = spip_timer('calcul_skel');
@@ -1594,10 +1586,10 @@  discard block
 block discarded – undo
1594 1586
 	$code->return = '
1595 1587
 //
1596 1588
 // Fonction principale du squelette ' .
1597
-		$sourcefile .
1598
-		($connect ? " pour $connect" : '') .
1599
-		(!CODE_COMMENTE ? '' : "\n// Temps de compilation total: $secondes") .
1600
-		"\n//\n" .
1589
+		$sourcefile.
1590
+		($connect ? " pour $connect" : '').
1591
+		(!CODE_COMMENTE ? '' : "\n// Temps de compilation total: $secondes").
1592
+		"\n//\n".
1601 1593
 		$principal;
1602 1594
 
1603 1595
 	$boucles[''] = $code;
@@ -1649,7 +1641,7 @@  discard block
 block discarded – undo
1649 1641
  **/
1650 1642
 function requeteur_data_dist(&$boucles, &$boucle, &$id) {
1651 1643
 	include_spip('iterateur/data');
1652
-	if ($h = charger_fonction($boucle->type_requete . '_to_array', 'inc', true)) {
1644
+	if ($h = charger_fonction($boucle->type_requete.'_to_array', 'inc', true)) {
1653 1645
 		$g = charger_fonction('data', 'iterateur');
1654 1646
 		$boucles[$id] = $g($boucle);
1655 1647
 		// from[0] stocke le type de data (rss, yql, ...)
Please login to merge, or discard this patch.