Completed
Push — master ( 2056af...6c9939 )
by cam
01:09
created
ecrire/public/boucles.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -82,7 +82,7 @@  discard block
 block discarded – undo
82 82
  **/
83 83
 function boucle_HIERARCHIE_dist($id_boucle, &$boucles) {
84 84
 	$boucle = &$boucles[$id_boucle];
85
-	$id_table = $boucle->id_table . '.id_rubrique';
85
+	$id_table = $boucle->id_table.'.id_rubrique';
86 86
 
87 87
 	// Si la boucle mere est une boucle RUBRIQUES il faut ignorer la feuille
88 88
 	// sauf en presence du critere {tout} (vu par phraser_html)
@@ -95,7 +95,7 @@  discard block
 block discarded – undo
95 95
 		. '$hierarchie = calcul_hierarchie_in($id_rubrique,'
96 96
 		. (isset($boucle->modificateur['tout']) ? 'true' : 'false')
97 97
 		. ");\n\t"
98
-		. 'if (!$hierarchie) return "";' . "\n\t";
98
+		. 'if (!$hierarchie) return "";'."\n\t";
99 99
 
100 100
 	$boucle->where[] = ["'IN'", "'$id_table'", '"($hierarchie)"'];
101 101
 
Please login to merge, or discard this patch.
ecrire/maj/2021.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -23,6 +23,6 @@
 block discarded – undo
23 23
 }
24 24
 
25 25
 $GLOBALS['maj'][2021021800] = [
26
-	['sql_alter', "TABLE spip_auteurs CHANGE imessage imessage VARCHAR(3) DEFAULT '' NOT NULL" ],
27
-	['sql_updateq', 'spip_auteurs', ['imessage' => 'oui'], "imessage != 'non' OR imessage IS NULL" ],
26
+	['sql_alter', "TABLE spip_auteurs CHANGE imessage imessage VARCHAR(3) DEFAULT '' NOT NULL"],
27
+	['sql_updateq', 'spip_auteurs', ['imessage' => 'oui'], "imessage != 'non' OR imessage IS NULL"],
28 28
 ];
Please login to merge, or discard this patch.
ecrire/maj/legacy/v31.php 1 patch
Spacing   +4 added lines, -4 removed lines patch added patch discarded remove patch
@@ -33,18 +33,18 @@
 block discarded – undo
33 33
  */
34 34
 function ranger_cache_gd2() {
35 35
 	spip_log('ranger_cache_gd2');
36
-	$base = _DIR_VAR . 'cache-gd2/';
36
+	$base = _DIR_VAR.'cache-gd2/';
37 37
 	if (is_dir($base) and is_readable($base)) {
38 38
 		if ($dir = opendir($base)) {
39 39
 			while (($f = readdir($dir)) !== false) {
40 40
 				if (
41
-					!is_dir($base . $f) and strncmp($f, '.', 1) !== 0
41
+					!is_dir($base.$f) and strncmp($f, '.', 1) !== 0
42 42
 					and preg_match(',[0-9a-f]{32}\.\w+,', $f)
43 43
 				) {
44 44
 					$sub = substr($f, 0, 2);
45 45
 					$sub = sous_repertoire($base, $sub);
46
-					@rename($base . $f, $sub . substr($f, 2));
47
-					@unlink($base . $f); // au cas ou le rename a foire (collision)
46
+					@rename($base.$f, $sub.substr($f, 2));
47
+					@unlink($base.$f); // au cas ou le rename a foire (collision)
48 48
 				}
49 49
 				if (time() >= _TIME_OUT) {
50 50
 					return;
Please login to merge, or discard this patch.
ecrire/maj/legacy/v30.php 1 patch
Spacing   +20 added lines, -20 removed lines patch added patch discarded remove patch
@@ -60,9 +60,9 @@  discard block
 block discarded – undo
60 60
 	$exceptions_pluriel = ['forum' => 'forum', 'syndic' => 'syndic'];
61 61
 
62 62
 	$pivot = preg_replace(',[^\w],', '', $pivot); // securite
63
-	$pivots = (isset($exceptions_pluriel[$pivot]) ? $exceptions_pluriel[$pivot] : $pivot . 's');
64
-	$liens = 'spip_' . $pivots . '_liens';
65
-	$id_pivot = 'id_' . $pivot;
63
+	$pivots = (isset($exceptions_pluriel[$pivot]) ? $exceptions_pluriel[$pivot] : $pivot.'s');
64
+	$liens = 'spip_'.$pivots.'_liens';
65
+	$id_pivot = 'id_'.$pivot;
66 66
 	// Creer spip_auteurs_liens
67 67
 	global $tables_auxiliaires;
68 68
 	if (!$l) {
@@ -74,8 +74,8 @@  discard block
 block discarded – undo
74 74
 		$l = preg_replace(',[^\w],', '', $l); // securite
75 75
 		$primary = "id_$l";
76 76
 		$objet = ($l == 'syndic' ? 'site' : $l);
77
-		$ls = (isset($exceptions_pluriel[$l]) ? $exceptions_pluriel[$l] : $l . 's');
78
-		$ancienne_table = 'spip_' . $pivots . '_' . $ls;
77
+		$ls = (isset($exceptions_pluriel[$l]) ? $exceptions_pluriel[$l] : $l.'s');
78
+		$ancienne_table = 'spip_'.$pivots.'_'.$ls;
79 79
 		$pool = 400;
80 80
 
81 81
 		$trouver_table = charger_fonction('trouver_table', 'base');
@@ -111,12 +111,12 @@  discard block
 block discarded – undo
111 111
 		while ($ids = array_map('reset', sql_allfetsel("$primary", $ancienne_table, '', '', '', "0,$sub_pool"))) {
112 112
 			$insert = [];
113 113
 			foreach ($ids as $id) {
114
-				$n = sql_countsel($liens, "objet='$objet' AND id_objet=" . intval($id));
115
-				while ($t = sql_allfetsel($champs, $ancienne_table, "$primary=" . intval($id), '', $id_pivot, "$n,$pool")) {
114
+				$n = sql_countsel($liens, "objet='$objet' AND id_objet=".intval($id));
115
+				while ($t = sql_allfetsel($champs, $ancienne_table, "$primary=".intval($id), '', $id_pivot, "$n,$pool")) {
116 116
 					$n += count($t);
117 117
 					// empiler en s'assurant a minima de l'unicite
118 118
 					while ($r = array_shift($t)) {
119
-						$insert[$r[$id_pivot] . ':' . $r['id_objet']] = $r;
119
+						$insert[$r[$id_pivot].':'.$r['id_objet']] = $r;
120 120
 					}
121 121
 					if (count($insert) >= $sub_pool) {
122 122
 						maj_liens_insertq_multi_check($liens, $insert, $tables_auxiliaires[$liens]);
@@ -267,13 +267,13 @@  discard block
 block discarded – undo
267 267
 
268 268
 	// cas particulier spip_auteurs : retablir le collate binary sur le login
269 269
 	$desc = $trouver_table('spip_auteurs');
270
-	spip_log('spip_auteurs : ' . var_export($desc['field'], true), 'maj.' . _LOG_INFO_IMPORTANTE);
270
+	spip_log('spip_auteurs : '.var_export($desc['field'], true), 'maj.'._LOG_INFO_IMPORTANTE);
271 271
 	if (stripos($desc['field']['login'], 'BINARY') === false) {
272 272
 		spip_log('Retablir champ login BINARY sur table spip_auteurs', 'maj');
273 273
 		sql_alter('table spip_auteurs change login login VARCHAR(255) BINARY');
274 274
 		$trouver_table('');
275 275
 		$new_desc = $trouver_table('spip_auteurs');
276
-		spip_log('Apres conversion spip_auteurs : ' . var_export($new_desc['field'], true), 'maj.' . _LOG_INFO_IMPORTANTE);
276
+		spip_log('Apres conversion spip_auteurs : '.var_export($new_desc['field'], true), 'maj.'._LOG_INFO_IMPORTANTE);
277 277
 	}
278 278
 
279 279
 	foreach ($tables as $table) {
@@ -292,27 +292,27 @@  discard block
 block discarded – undo
292 292
 					$data = sql_allfetsel('*', 'spip_urls', '', '', 'date DESC');
293 293
 					$urls = [];
294 294
 					foreach ($data as $d) {
295
-						$key = $d['id_parent'] . '::' . strtolower($d['url']);
295
+						$key = $d['id_parent'].'::'.strtolower($d['url']);
296 296
 						if (!isset($urls[$key])) {
297 297
 							$urls[$key] = true;
298 298
 						} else {
299 299
 							spip_log(
300
-								'Suppression doublon dans spip_urls avant conversion : ' . serialize($d),
301
-								'maj.' . _LOG_INFO_IMPORTANTE
300
+								'Suppression doublon dans spip_urls avant conversion : '.serialize($d),
301
+								'maj.'._LOG_INFO_IMPORTANTE
302 302
 							);
303
-							sql_delete('spip_urls', 'id_parent=' . sql_quote($d['id_parent']) . ' AND url=' . sql_quote($d['url']));
303
+							sql_delete('spip_urls', 'id_parent='.sql_quote($d['id_parent']).' AND url='.sql_quote($d['url']));
304 304
 						}
305 305
 					}
306 306
 				}
307 307
 				foreach ($desc['field'] as $field => $type) {
308 308
 					if ($desc['field'][$field] !== $desc_collate[$field]) {
309
-						spip_log("Conversion COLLATE table $table", 'maj.' . _LOG_INFO_IMPORTANTE);
310
-						sql_alter("table $table change $field $field " . $desc_collate[$field]);
309
+						spip_log("Conversion COLLATE table $table", 'maj.'._LOG_INFO_IMPORTANTE);
310
+						sql_alter("table $table change $field $field ".$desc_collate[$field]);
311 311
 						$trouver_table('');
312 312
 						$new_desc = $trouver_table($table);
313 313
 						spip_log(
314
-							"Apres conversion $table : " . var_export($new_desc['field'], true),
315
-							'maj.' . _LOG_INFO_IMPORTANTE
314
+							"Apres conversion $table : ".var_export($new_desc['field'], true),
315
+							'maj.'._LOG_INFO_IMPORTANTE
316 316
 						);
317 317
 						continue 2; // inutile de continuer pour cette table : un seul alter remet tout a jour en sqlite
318 318
 					}
@@ -328,7 +328,7 @@  discard block
 block discarded – undo
328 328
 
329 329
 $GLOBALS['maj'][19236] = [
330 330
 	['sql_updateq', 'spip_meta', ['impt' => 'oui'], "nom='version_installee'"], // version base principale
331
-	['sql_updateq', 'spip_meta', ['impt' => 'oui'], "nom LIKE '%_base_version'"],  // version base plugins
331
+	['sql_updateq', 'spip_meta', ['impt' => 'oui'], "nom LIKE '%_base_version'"], // version base plugins
332 332
 	['maj_collation_sqlite'],
333 333
 ];
334 334
 
@@ -345,7 +345,7 @@  discard block
 block discarded – undo
345 345
 	spip_log('supprimer sessions auteur');
346 346
 	if ($dir = opendir(_DIR_SESSIONS)) {
347 347
 		while (($f = readdir($dir)) !== false) {
348
-			spip_unlink(_DIR_SESSIONS . $f);
348
+			spip_unlink(_DIR_SESSIONS.$f);
349 349
 			if (time() >= _TIME_OUT) {
350 350
 				return;
351 351
 			}
Please login to merge, or discard this patch.
ecrire/maj/legacy/v40.php 1 patch
Spacing   +4 added lines, -4 removed lines patch added patch discarded remove patch
@@ -64,13 +64,13 @@
 block discarded – undo
64 64
 				spip_log("Table $table TIMESTAMP incorrect", 'maj');
65 65
 				foreach ($desc['field'] as $field => $type) {
66 66
 					if ($desc['field'][$field] !== $fields_corrected[$field]) {
67
-						spip_log("Adaptation TIMESTAMP table $table", 'maj.' . _LOG_INFO_IMPORTANTE);
68
-						sql_alter("table $table change $field $field " . $fields_corrected[$field]);
67
+						spip_log("Adaptation TIMESTAMP table $table", 'maj.'._LOG_INFO_IMPORTANTE);
68
+						sql_alter("table $table change $field $field ".$fields_corrected[$field]);
69 69
 						$trouver_table('');
70 70
 						$new_desc = $trouver_table($table);
71 71
 						spip_log(
72
-							"Apres conversion $table : " . var_export($new_desc['field'], true),
73
-							'maj.' . _LOG_INFO_IMPORTANTE
72
+							"Apres conversion $table : ".var_export($new_desc['field'], true),
73
+							'maj.'._LOG_INFO_IMPORTANTE
74 74
 						);
75 75
 					}
76 76
 				}
Please login to merge, or discard this patch.
ecrire/base/create.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -85,7 +85,7 @@  discard block
 block discarded – undo
85 85
 			#if (!$sql_desc) $sql_desc = false;
86 86
 			#spip_log("Resultat table=$table sql_desc:$sql_desc","dbinstall"._LOG_INFO_IMPORTANTE);
87 87
 			if (!$sql_desc) {
88
-				spip_log("Echec creation table $table", 'maj' . _LOG_CRITIQUE);
88
+				spip_log("Echec creation table $table", 'maj'._LOG_CRITIQUE);
89 89
 			}
90 90
 		}
91 91
 	} else {
@@ -97,7 +97,7 @@  discard block
 block discarded – undo
97 97
 		if (isset($desc['field'])) {
98 98
 			foreach ($desc['field'] as $field => $type) {
99 99
 				if (!isset($sql_desc['field'][$field])) {
100
-					sql_alter("TABLE $table ADD $field $type" . ($last ? " AFTER $last" : ''), $serveur);
100
+					sql_alter("TABLE $table ADD $field $type".($last ? " AFTER $last" : ''), $serveur);
101 101
 				}
102 102
 				$last = $field;
103 103
 			}
Please login to merge, or discard this patch.
ecrire/base/repair.php 1 patch
Spacing   +8 added lines, -8 removed lines patch added patch discarded remove patch
@@ -38,7 +38,7 @@  discard block
 block discarded – undo
38 38
 
39 39
 	$res = admin_repair_tables();
40 40
 	if (!$res) {
41
-		$res = "<div class='error'>" . _T('avis_erreur_mysql') . ' ' . sql_errno() . ': ' . sql_error() . "</div>\n";
41
+		$res = "<div class='error'>"._T('avis_erreur_mysql').' '.sql_errno().': '.sql_error()."</div>\n";
42 42
 	} else {
43 43
 		include_spip('inc/rubriques');
44 44
 		calculer_rubriques();
@@ -48,7 +48,7 @@  discard block
 block discarded – undo
48 48
 	$res .= pipeline('base_admin_repair', $res);
49 49
 	echo minipres(
50 50
 		_T('texte_tentative_recuperation'),
51
-		$res . generer_form_ecrire('accueil', '', '', _T('public:accueil_site'))
51
+		$res.generer_form_ecrire('accueil', '', '', _T('public:accueil_site'))
52 52
 	);
53 53
 }
54 54
 
@@ -91,12 +91,12 @@  discard block
 block discarded – undo
91 91
 		$count = sql_countsel($tab);
92 92
 
93 93
 		if ($count > 1) {
94
-			$m .= '(' . _T('texte_compte_elements', ['count' => $count]) . ")\n";
94
+			$m .= '('._T('texte_compte_elements', ['count' => $count]).")\n";
95 95
 		} else {
96 96
 			if ($count == 1) {
97
-				$m .= '(' . _T('texte_compte_element', ['count' => $count]) . ")\n";
97
+				$m .= '('._T('texte_compte_element', ['count' => $count]).")\n";
98 98
 			} else {
99
-				$m .= '(' . _T('texte_vide') . ")\n";
99
+				$m .= '('._T('texte_vide').")\n";
100 100
 			}
101 101
 		}
102 102
 
@@ -105,13 +105,13 @@  discard block
 block discarded – undo
105 105
 			and $msg = join(
106 106
 				' ',
107 107
 				(is_resource($result_repair) or is_object($result_repair)) ? sql_fetch($result_repair) : $result_repair
108
-			) . ' '
108
+			).' '
109 109
 			and strpos($msg, ' OK ') === false
110 110
 		) {
111 111
 			$class = " class='notice'";
112
-			$m .= '<br /><tt>' . spip_htmlentities($msg) . "</tt>\n";
112
+			$m .= '<br /><tt>'.spip_htmlentities($msg)."</tt>\n";
113 113
 		} else {
114
-			$m .= ' ' . _T('texte_table_ok');
114
+			$m .= ' '._T('texte_table_ok');
115 115
 		}
116 116
 
117 117
 		$res .= "<div$class>$m</div>";
Please login to merge, or discard this patch.
ecrire/base/upgrade.php 1 patch
Spacing   +17 added lines, -17 removed lines patch added patch discarded remove patch
@@ -56,7 +56,7 @@  discard block
 block discarded – undo
56 56
 	if ($GLOBALS['spip_version_base'] != $GLOBALS['meta']['version_installee']) {
57 57
 		if (!is_numeric(_request('reinstall'))) {
58 58
 			include_spip('base/create');
59
-			spip_log('recree les tables eventuellement disparues', 'maj.' . _LOG_INFO_IMPORTANTE);
59
+			spip_log('recree les tables eventuellement disparues', 'maj.'._LOG_INFO_IMPORTANTE);
60 60
 			creer_base();
61 61
 		}
62 62
 
@@ -69,7 +69,7 @@  discard block
 block discarded – undo
69 69
 			exit;
70 70
 		}
71 71
 	}
72
-	spip_log('Fin de mise a jour SQL. Debut m-a-j acces et config', 'maj.' . _LOG_INFO_IMPORTANTE);
72
+	spip_log('Fin de mise a jour SQL. Debut m-a-j acces et config', 'maj.'._LOG_INFO_IMPORTANTE);
73 73
 
74 74
 	// supprimer quelques fichiers temporaires qui peuvent se retrouver invalides
75 75
 	@spip_unlink(_CACHE_RUBRIQUES);
@@ -78,7 +78,7 @@  discard block
 block discarded – undo
78 78
 	@spip_unlink(_CACHE_PLUGINS_OPT);
79 79
 	@spip_unlink(_CACHE_PLUGINS_FCT);
80 80
 	@spip_unlink(_CACHE_CHEMIN);
81
-	@spip_unlink(_DIR_TMP . 'plugin_xml_cache.gz');
81
+	@spip_unlink(_DIR_TMP.'plugin_xml_cache.gz');
82 82
 
83 83
 	include_spip('inc/auth');
84 84
 	auth_synchroniser_distant();
@@ -117,8 +117,8 @@  discard block
 block discarded – undo
117 117
 	$version_installee = $GLOBALS['meta']['version_installee'] ?? null;
118 118
 
119 119
 	spip_log(
120
-		"Version anterieure: $version_installee. Courante: " . $GLOBALS['spip_version_base'],
121
-		'maj.' . _LOG_INFO_IMPORTANTE
120
+		"Version anterieure: $version_installee. Courante: ".$GLOBALS['spip_version_base'],
121
+		'maj.'._LOG_INFO_IMPORTANTE
122 122
 	);
123 123
 	if (!$version_installee or ($GLOBALS['spip_version_base'] < $version_installee)) {
124 124
 		sql_replace(
@@ -151,9 +151,9 @@  discard block
 block discarded – undo
151 151
 	$res = maj_while($version_installee, $cible, $GLOBALS['maj'], 'version_installee', 'meta', $redirect, $debut_page);
152 152
 	if ($res) {
153 153
 		if (!is_array($res)) {
154
-			spip_log("Pb d'acces SQL a la mise a jour", 'maj.' . _LOG_INFO_ERREUR);
154
+			spip_log("Pb d'acces SQL a la mise a jour", 'maj.'._LOG_INFO_ERREUR);
155 155
 		} else {
156
-			echo _T('avis_operation_echec') . ' ' . join(' ', $res);
156
+			echo _T('avis_operation_echec').' '.join(' ', $res);
157 157
 			echo install_fin_html();
158 158
 		}
159 159
 	}
@@ -241,9 +241,9 @@  discard block
 block discarded – undo
241 241
 		$res = maj_while($current_version, $version_cible, $maj, $nom_meta_base_version, $table_meta, $redirect);
242 242
 		if ($res) {
243 243
 			if (!is_array($res)) {
244
-				spip_log("Pb d'acces SQL a la mise a jour", 'maj.' . _LOG_INFO_ERREUR);
244
+				spip_log("Pb d'acces SQL a la mise a jour", 'maj.'._LOG_INFO_ERREUR);
245 245
 			} else {
246
-				echo '<p>' . _T('avis_operation_echec') . ' ' . join(' ', $res) . '</p>';
246
+				echo '<p>'._T('avis_operation_echec').' '.join(' ', $res).'</p>';
247 247
 			}
248 248
 		}
249 249
 	}
@@ -299,7 +299,7 @@  discard block
 block discarded – undo
299 299
 	echo(install_debut_html($titre));
300 300
 	// script de rechargement auto sur timeout
301 301
 	$redirect = generer_url_ecrire('upgrade', "reinstall=$installee&meta=$meta&table=$table", true);
302
-	echo http_script("window.setTimeout('location.href=\"" . $redirect . "\";'," . ($timeout * 1000) . ')');
302
+	echo http_script("window.setTimeout('location.href=\"".$redirect."\";',".($timeout * 1000).')');
303 303
 	echo "<div style='text-align: left'>\n";
304 304
 	if (ob_get_level()) {
305 305
 		ob_flush();
@@ -388,7 +388,7 @@  discard block
 block discarded – undo
388 388
 				return [$v, $etape];
389 389
 			}
390 390
 			$n = time() - $time;
391
-			spip_log("$table $meta: $v en $n secondes", 'maj.' . _LOG_INFO_IMPORTANTE);
391
+			spip_log("$table $meta: $v en $n secondes", 'maj.'._LOG_INFO_IMPORTANTE);
392 392
 			if ($meta) {
393 393
 				ecrire_meta($meta, $installee = $v, 'oui', $table);
394 394
 			}
@@ -404,7 +404,7 @@  discard block
 block discarded – undo
404 404
 	if ($meta) {
405 405
 		ecrire_meta($meta, $cible, 'oui', $table);
406 406
 	}
407
-	spip_log("MAJ terminee. $meta: $installee", 'maj.' . _LOG_INFO_IMPORTANTE);
407
+	spip_log("MAJ terminee. $meta: $installee", 'maj.'._LOG_INFO_IMPORTANTE);
408 408
 
409 409
 	return [];
410 410
 }
@@ -429,7 +429,7 @@  discard block
 block discarded – undo
429 429
  * @return int
430 430
  */
431 431
 function serie_alter($serie, $q = [], $meta = '', $table = 'meta', $redirect = '') {
432
-	$meta2 = $meta . '_maj_' . $serie;
432
+	$meta2 = $meta.'_maj_'.$serie;
433 433
 	$etape = 0;
434 434
 	if (isset($GLOBALS[$table][$meta2])) {
435 435
 		$etape = intval($GLOBALS[$table][$meta2]);
@@ -442,7 +442,7 @@  discard block
 block discarded – undo
442 442
 				and function_exists($f = array_shift($r))
443 443
 			) {
444 444
 				// note: $r (arguments de la fonction $f) peut avoir des données tabulaires
445
-				spip_log("$msg: $f " . @join(',', $r), 'maj.' . _LOG_INFO_IMPORTANTE);
445
+				spip_log("$msg: $f ".@join(',', $r), 'maj.'._LOG_INFO_IMPORTANTE);
446 446
 				// pour les fonctions atomiques sql_xx
447 447
 				// on enregistre le meta avant de lancer la fonction,
448 448
 				// de maniere a eviter de boucler sur timeout
@@ -460,12 +460,12 @@  discard block
 block discarded – undo
460 460
 					relance_maj($meta, $table, $redirect);
461 461
 				}
462 462
 				ecrire_meta($meta2, $i + 1, 'non', $table);
463
-				spip_log("$meta2: ok", 'maj.' . _LOG_INFO_IMPORTANTE);
463
+				spip_log("$meta2: ok", 'maj.'._LOG_INFO_IMPORTANTE);
464 464
 			} else {
465 465
 				if (!is_array($r)) {
466
-					spip_log("maj $i format incorrect", 'maj.' . _LOG_ERREUR);
466
+					spip_log("maj $i format incorrect", 'maj.'._LOG_ERREUR);
467 467
 				} else {
468
-					spip_log("maj $i fonction $f non definie", 'maj.' . _LOG_ERREUR);
468
+					spip_log("maj $i fonction $f non definie", 'maj.'._LOG_ERREUR);
469 469
 				}
470 470
 				// en cas d'erreur serieuse, on s'arrete
471 471
 				// mais on permet de passer par dessus en rechargeant la page.
Please login to merge, or discard this patch.
ecrire/base/objets.php 1 patch
Spacing   +23 added lines, -23 removed lines patch added patch discarded remove patch
@@ -703,7 +703,7 @@  discard block
 block discarded – undo
703 703
 		$infos['url_voir'] = $infos['type'];
704 704
 	}
705 705
 	if (!isset($infos['url_edit'])) {
706
-		$infos['url_edit'] = $infos['url_voir'] . ($infos['editable'] ? '_edit' : '');
706
+		$infos['url_edit'] = $infos['url_voir'].($infos['editable'] ? '_edit' : '');
707 707
 	}
708 708
 	if (!isset($infos['icone_objet'])) {
709 709
 		$infos['icone_objet'] = $infos['type'];
@@ -715,48 +715,48 @@  discard block
 block discarded – undo
715 715
 		$infos['texte_retour'] = 'icone_retour';
716 716
 	}
717 717
 	if (!isset($infos['texte_modifier'])) {
718
-		$infos['texte_modifier'] = $infos['type'] . ':' . 'icone_modifier_' . $infos['type'];
718
+		$infos['texte_modifier'] = $infos['type'].':'.'icone_modifier_'.$infos['type'];
719 719
 	}
720 720
 	if (!isset($infos['texte_creer'])) {
721
-		$infos['texte_creer'] = $infos['type'] . ':' . 'icone_creer_' . $infos['type'];
721
+		$infos['texte_creer'] = $infos['type'].':'.'icone_creer_'.$infos['type'];
722 722
 	}
723 723
 	if (!isset($infos['texte_creer_associer'])) {
724
-		$infos['texte_creer_associer'] = $infos['type'] . ':' . 'texte_creer_associer_' . $infos['type'];
724
+		$infos['texte_creer_associer'] = $infos['type'].':'.'texte_creer_associer_'.$infos['type'];
725 725
 	}
726 726
 	if (!isset($infos['texte_ajouter'])) {
727 727
 		// Ajouter un X
728
-		$infos['texte_ajouter'] = $infos['type'] . ':' . 'texte_ajouter_' . $infos['type'];
728
+		$infos['texte_ajouter'] = $infos['type'].':'.'texte_ajouter_'.$infos['type'];
729 729
 	}
730 730
 	if (!isset($infos['texte_objets'])) {
731
-		$infos['texte_objets'] = $infos['type'] . ':' . 'titre_' . $infos['table_objet'];
731
+		$infos['texte_objets'] = $infos['type'].':'.'titre_'.$infos['table_objet'];
732 732
 	}
733 733
 	if (!isset($infos['texte_objet'])) {
734
-		$infos['texte_objet'] = $infos['type'] . ':' . 'titre_' . $infos['type'];
734
+		$infos['texte_objet'] = $infos['type'].':'.'titre_'.$infos['type'];
735 735
 	}
736 736
 	if (!isset($infos['texte_logo_objet'])) {
737 737
 		// objet:titre_logo_objet "Logo de ce X"
738
-		$infos['texte_logo_objet'] = $infos['type'] . ':' . 'titre_logo_' . $infos['type'];
738
+		$infos['texte_logo_objet'] = $infos['type'].':'.'titre_logo_'.$infos['type'];
739 739
 	}
740 740
 	if (!isset($infos['texte_langue_objet'])) {
741 741
 		// objet:texte_langue_objet "Langue de ce X"
742
-		$infos['texte_langue_objet'] = $infos['type'] . ':' . 'titre_langue_' . $infos['type'];
742
+		$infos['texte_langue_objet'] = $infos['type'].':'.'titre_langue_'.$infos['type'];
743 743
 	}
744 744
 	if (!isset($infos['texte_definir_comme_traduction_objet'])) {
745 745
 		// "Ce X est une traduction du X numéro :"
746
-		$infos['texte_definir_comme_traduction_objet'] = $infos['type'] . ':' . 'texte_definir_comme_traduction_' . $infos['type'];
746
+		$infos['texte_definir_comme_traduction_objet'] = $infos['type'].':'.'texte_definir_comme_traduction_'.$infos['type'];
747 747
 	}
748 748
 
749 749
 	// objet:info_aucun_objet
750 750
 	if (!isset($infos['info_aucun_objet'])) {
751
-		$infos['info_aucun_objet'] = $infos['type'] . ':' . 'info_aucun_' . $infos['type'];
751
+		$infos['info_aucun_objet'] = $infos['type'].':'.'info_aucun_'.$infos['type'];
752 752
 	}
753 753
 	// objet:info_1_objet
754 754
 	if (!isset($infos['info_1_objet'])) {
755
-		$infos['info_1_objet'] = $infos['type'] . ':' . 'info_1_' . $infos['type'];
755
+		$infos['info_1_objet'] = $infos['type'].':'.'info_1_'.$infos['type'];
756 756
 	}
757 757
 	// objet:info_nb_objets
758 758
 	if (!isset($infos['info_nb_objets'])) {
759
-		$infos['info_nb_objets'] = $infos['type'] . ':' . 'info_nb_' . $infos['table_objet'];
759
+		$infos['info_nb_objets'] = $infos['type'].':'.'info_nb_'.$infos['table_objet'];
760 760
 	}
761 761
 
762 762
 	if (!isset($infos['champs_editables'])) {
@@ -958,7 +958,7 @@  discard block
 block discarded – undo
958 958
 		}
959 959
 		$ts = sql_alltable(null, $serveur); // toutes les tables "spip_" (ou prefixe perso)
960 960
 		$connexion = $GLOBALS['connexions'][$serveur ? $serveur : 0];
961
-		$spip = $connexion['prefixe'] . '_';
961
+		$spip = $connexion['prefixe'].'_';
962 962
 		foreach ($ts as $t) {
963 963
 			$t = substr($t, strlen($spip));
964 964
 			$tables[$serveur]["spip_$t"] = $t;
@@ -1023,10 +1023,10 @@  discard block
 block discarded – undo
1023 1023
 	if ($serveur !== false) {
1024 1024
 		$t = lister_tables_spip($serveur);
1025 1025
 		$trouver_table = charger_fonction('trouver_table', 'base');
1026
-		$typetrim = rtrim($type, 's') . 's';
1026
+		$typetrim = rtrim($type, 's').'s';
1027 1027
 		if (
1028 1028
 			(isset($t[$typetrim]) or in_array($typetrim, $t))
1029
-			and ($desc = $trouver_table(rtrim($type, 's') . 's', $serveur))
1029
+			and ($desc = $trouver_table(rtrim($type, 's').'s', $serveur))
1030 1030
 		) {
1031 1031
 			return $desc['id_table'];
1032 1032
 		} elseif (
@@ -1036,11 +1036,11 @@  discard block
 block discarded – undo
1036 1036
 			return $desc['id_table'];
1037 1037
 		}
1038 1038
 
1039
-		spip_log('table_objet(' . $type . ') calculee sans verification');
1039
+		spip_log('table_objet('.$type.') calculee sans verification');
1040 1040
 		#spip_log(debug_backtrace(),'db');
1041 1041
 	}
1042 1042
 
1043
-	return rtrim($type, 's') . 's'; # cas historique ne devant plus servir, sauf si $serveur=false
1043
+	return rtrim($type, 's').'s'; # cas historique ne devant plus servir, sauf si $serveur=false
1044 1044
 }
1045 1045
 
1046 1046
 /**
@@ -1221,7 +1221,7 @@  discard block
 block discarded – undo
1221 1221
 function objet_test_si_publie($objet, $id_objet, $serveur = '') {
1222 1222
 	// voir si une fonction est definie pour faire le boulot
1223 1223
 	// elle a la priorite dans ce cas
1224
-	if ($f = charger_fonction($objet . '_test_si_publie', 'base', true)) {
1224
+	if ($f = charger_fonction($objet.'_test_si_publie', 'base', true)) {
1225 1225
 		return $f($objet, $id_objet, $serveur);
1226 1226
 	}
1227 1227
 
@@ -1243,7 +1243,7 @@  discard block
 block discarded – undo
1243 1243
 		$boucle->sql_serveur = $serveur;
1244 1244
 		$boucle->select[] = $id_table_objet;
1245 1245
 		$boucle->from[$table_objet] = table_objet_sql($objet, $serveur);
1246
-		$boucle->where[] = $id_table . '.' . $id_table_objet . '=' . intval($id_objet);
1246
+		$boucle->where[] = $id_table.'.'.$id_table_objet.'='.intval($id_objet);
1247 1247
 
1248 1248
 		$boucle->descr['nom'] = 'objet_test_si_publie'; // eviter notice php
1249 1249
 		$boucle->descr['sourcefile'] = 'internal';
@@ -1370,7 +1370,7 @@  discard block
 block discarded – undo
1370 1370
 						? "{$parent_methode['source_champ']} = $id_objet"
1371 1371
 						: "${cle_objet} = $id_objet";
1372 1372
 					if (isset($parent_methode['source_champ_type'])) {
1373
-						$where[] = "{$parent_methode['source_champ_type']} = " . sql_quote($objet);
1373
+						$where[] = "{$parent_methode['source_champ_type']} = ".sql_quote($objet);
1374 1374
 					}
1375 1375
 					// -- Condition supplémentaire sur la détection du parent
1376 1376
 					if (isset($parent_methode['table_condition'])) {
@@ -1494,11 +1494,11 @@  discard block
 block discarded – undo
1494 1494
 			$where = [];
1495 1495
 			// -- L'identifiant du parent
1496 1496
 			if (isset($_methode_parent['champ'])) {
1497
-				$where[] = $_methode_parent['champ'] . ' = ' . $id_objet;
1497
+				$where[] = $_methode_parent['champ'].' = '.$id_objet;
1498 1498
 			}
1499 1499
 			// -- Si le parent est variable
1500 1500
 			if (isset($_methode_parent['champ_type'])) {
1501
-				$where[] = $_methode_parent['champ_type'] . ' = ' . sql_quote($objet);
1501
+				$where[] = $_methode_parent['champ_type'].' = '.sql_quote($objet);
1502 1502
 			}
1503 1503
 
1504 1504
 			// On détermine la table, le champ id des enfants et on complète éventuellement les conditions
Please login to merge, or discard this patch.