Completed
Push — master ( 62ef8d...9fae39 )
by cam
04:05
created
ecrire/inc/filtres_dates.php 1 patch
Spacing   +36 added lines, -36 removed lines patch added patch discarded remove patch
@@ -38,7 +38,7 @@  discard block
 block discarded – undo
38 38
 function extraire_date($texte) {
39 39
 	// format = 2001-08
40 40
 	if (preg_match(",([1-2][0-9]{3})[^0-9]*(1[0-2]|0?[1-9]),", $texte, $regs)) {
41
-		return $regs[1] . "-" . sprintf("%02d", $regs[2]) . "-01";
41
+		return $regs[1]."-".sprintf("%02d", $regs[2])."-01";
42 42
 	}
43 43
 }
44 44
 
@@ -68,11 +68,11 @@  discard block
 block discarded – undo
68 68
 		}
69 69
 		if (preg_match("#^([12][0-9]{3})([-/]00)?( [-0-9:]+)?$#", $date, $regs)) {
70 70
 			$regs = array_pad($regs, 4, null); // eviter notice php
71
-			$date = $regs[1] . "-00-00" . $regs[3];
71
+			$date = $regs[1]."-00-00".$regs[3];
72 72
 		} else {
73 73
 			if (preg_match("#^([12][0-9]{3}[-/][01]?[0-9])([-/]00)?( [-0-9:]+)?$#", $date, $regs)) {
74 74
 				$regs = array_pad($regs, 4, null); // eviter notice php
75
-				$date = preg_replace("@/@", "-", $regs[1]) . "-00" . $regs[3];
75
+				$date = preg_replace("@/@", "-", $regs[1])."-00".$regs[3];
76 76
 			} else {
77 77
 				$date = date("Y-m-d H:i:s", strtotime($date));
78 78
 			}
@@ -97,7 +97,7 @@  discard block
 block discarded – undo
97 97
  **/
98 98
 function vider_date($letexte, $verif_format_date = false) {
99 99
 	if (!$verif_format_date
100
-	  or (in_array(strlen($letexte), [10,19]) and
100
+	  or (in_array(strlen($letexte), [10, 19]) and
101 101
 			  preg_match("/^[0-9]{4}-[0-9]{2}-[0-9]{2}(\s[0-9]{2}:[0-9]{2}:[0-9]{2})?$/", $letexte))) {
102 102
 
103 103
 		if (strncmp("0000-00-00", $letexte, 10) == 0) {
@@ -208,8 +208,8 @@  discard block
 block discarded – undo
208 208
  *	- si 'abbr' ne précise pas l'unité des minutes : 12h10
209 209
  * @return string L'heure formatée dans la langue en cours.
210 210
  **/
211
-function heures_minutes($numdate, $forme='') {
212
-	if ($forme !='abbr') {
211
+function heures_minutes($numdate, $forme = '') {
212
+	if ($forme != 'abbr') {
213 213
 		return _T('date_fmt_heures_minutes', array('h' => heures($numdate), 'm' => minutes($numdate)));
214 214
 	}
215 215
 	else {
@@ -381,17 +381,17 @@  discard block
 block discarded – undo
381 381
 	if ($decal > 3600 * 24 * 30) {
382 382
 		$mois = floor($decal / (3600 * 24 * 30));
383 383
 		if ($mois < 2) {
384
-			$delai = "$mois " . _T("date_un_mois");
384
+			$delai = "$mois "._T("date_un_mois");
385 385
 		} else {
386
-			$delai = "$mois " . _T("date_mois");
386
+			$delai = "$mois "._T("date_mois");
387 387
 		}
388 388
 	} else {
389 389
 		if ($decal > 3600 * 24 * 7) {
390 390
 			$semaines = floor($decal / (3600 * 24 * 7));
391 391
 			if ($semaines < 2) {
392
-				$delai = "$semaines " . _T("date_une_semaine");
392
+				$delai = "$semaines "._T("date_une_semaine");
393 393
 			} else {
394
-				$delai = "$semaines " . _T("date_semaines");
394
+				$delai = "$semaines "._T("date_semaines");
395 395
 			}
396 396
 		} else {
397 397
 			if ($decal > 3600 * 24) {
@@ -399,30 +399,30 @@  discard block
 block discarded – undo
399 399
 				if ($jours < 2) {
400 400
 					return $il_y_a == "date_dans" ? _T("date_demain") : _T("date_hier");
401 401
 				} else {
402
-					$delai = "$jours " . _T("date_jours");
402
+					$delai = "$jours "._T("date_jours");
403 403
 				}
404 404
 			} else {
405 405
 				if ($decal >= 3600) {
406 406
 					$heures = floor($decal / 3600);
407 407
 					if ($heures < 2) {
408
-						$delai = "$heures " . _T("date_une_heure");
408
+						$delai = "$heures "._T("date_une_heure");
409 409
 					} else {
410
-						$delai = "$heures " . _T("date_heures");
410
+						$delai = "$heures "._T("date_heures");
411 411
 					}
412 412
 				} else {
413 413
 					if ($decal >= 60) {
414 414
 						$minutes = floor($decal / 60);
415 415
 						if ($minutes < 2) {
416
-							$delai = "$minutes " . _T("date_une_minute");
416
+							$delai = "$minutes "._T("date_une_minute");
417 417
 						} else {
418
-							$delai = "$minutes " . _T("date_minutes");
418
+							$delai = "$minutes "._T("date_minutes");
419 419
 						}
420 420
 					} else {
421 421
 						$secondes = ceil($decal);
422 422
 						if ($secondes < 2) {
423
-							$delai = "$secondes " . _T("date_une_seconde");
423
+							$delai = "$secondes "._T("date_une_seconde");
424 424
 						} else {
425
-							$delai = "$secondes " . _T("date_secondes");
425
+							$delai = "$secondes "._T("date_secondes");
426 426
 						}
427 427
 					}
428 428
 				}
@@ -517,16 +517,16 @@  discard block
 block discarded – undo
517 517
 		$njour = 0;
518 518
 	} else {
519 519
 		$njour = intval($jour);
520
-		if ($jourth = _T('date_jnum' . $jour)) {
520
+		if ($jourth = _T('date_jnum'.$jour)) {
521 521
 			$jour = $jourth;
522 522
 		}
523 523
 	}
524 524
 
525 525
 	$mois = intval($mois);
526 526
 	if ($mois > 0 and $mois < 13) {
527
-		$nommois = _T('date_mois_' . $mois);
527
+		$nommois = _T('date_mois_'.$mois);
528 528
 		if ($jour) {
529
-			$jourmois = _T('date_de_mois_' . $mois, array('j' => $jour, 'nommois' => $nommois));
529
+			$jourmois = _T('date_de_mois_'.$mois, array('j' => $jour, 'nommois' => $nommois));
530 530
 		} else {
531 531
 			$jourmois = $nommois;
532 532
 		}
@@ -536,7 +536,7 @@  discard block
 block discarded – undo
536 536
 	}
537 537
 
538 538
 	if ($annee < 0) {
539
-		$annee = -$annee . " " . _T('date_avant_jc');
539
+		$annee = -$annee." "._T('date_avant_jc');
540 540
 		$avjc = true;
541 541
 	} else {
542 542
 		$avjc = false;
@@ -562,10 +562,10 @@  discard block
 block discarded – undo
562 562
 				}
563 563
 			}
564 564
 			if ($vue == 'saison') {
565
-				return $saison ? _T('date_saison_' . $saison) : '';
565
+				return $saison ? _T('date_saison_'.$saison) : '';
566 566
 			} else {
567 567
 				return $saison ? trim(_T('date_fmt_saison_annee',
568
-					array('saison' => _T('date_saison_' . $saison), 'annee' => $annee))) : '';
568
+					array('saison' => _T('date_saison_'.$saison), 'annee' => $annee))) : '';
569 569
 			}
570 570
 
571 571
 		case 'court':
@@ -614,9 +614,9 @@  discard block
 block discarded – undo
614 614
 			}
615 615
 
616 616
 		case 'nom_mois':
617
-			$param = ((isset($options['param']) and $options['param']) ? '_' . $options['param'] : '');
617
+			$param = ((isset($options['param']) and $options['param']) ? '_'.$options['param'] : '');
618 618
 			if ($param and $mois) {
619
-				return _T('date_mois_' . $mois . $param);
619
+				return _T('date_mois_'.$mois.$param);
620 620
 			}
621 621
 
622 622
 			return $nommois;
@@ -636,9 +636,9 @@  discard block
 block discarded – undo
636 636
 			}
637 637
 			$nom = mktime(1, 1, 1, $mois, $njour, $annee);
638 638
 			$nom = 1 + date('w', $nom);
639
-			$param = ((isset($options['param']) and $options['param']) ? '_' . $options['param'] : '');
639
+			$param = ((isset($options['param']) and $options['param']) ? '_'.$options['param'] : '');
640 640
 
641
-			return _T('date_jour_' . $nom . $param);
641
+			return _T('date_jour_'.$nom.$param);
642 642
 
643 643
 		case 'mois_annee':
644 644
 			if ($avjc) {
@@ -1033,8 +1033,8 @@  discard block
 block discarded – undo
1033 1033
 
1034 1034
 	$dtstart = $dtend = $dtabbr = "";
1035 1035
 	if (strpos($forme, 'hcal') !== false) {
1036
-		$dtstart = "<abbr class='dtstart' title='" . date_iso($date_debut) . "'>";
1037
-		$dtend = "<abbr class='dtend' title='" . date_iso($date_fin) . "'>";
1036
+		$dtstart = "<abbr class='dtstart' title='".date_iso($date_debut)."'>";
1037
+		$dtend = "<abbr class='dtend' title='".date_iso($date_fin)."'>";
1038 1038
 		$dtabbr = "</abbr>";
1039 1039
 	}
1040 1040
 
@@ -1078,7 +1078,7 @@  discard block
 block discarded – undo
1078 1078
 			}
1079 1079
 		} else {
1080 1080
 			if ($dtabbr && $dtstart) {
1081
-				$s = $dtstart . spip_ucfirst($s) . $dtabbr;
1081
+				$s = $dtstart.spip_ucfirst($s).$dtabbr;
1082 1082
 			} else {
1083 1083
 				$s = spip_ucfirst($s);
1084 1084
 			}
@@ -1101,8 +1101,8 @@  discard block
 block discarded – undo
1101 1101
 				$date_debut = _T('date_fmt_jour_heure', array('jour' => $date_debut, 'heure' => $hd));
1102 1102
 				$date_fin = _T('date_fmt_jour_heure', array('jour' => $date_fin, 'heure' => $hf));
1103 1103
 			}
1104
-			$date_debut = $dtstart . $date_debut . $dtabbr;
1105
-			$date_fin = $dtend . $date_fin . $dtabbr;
1104
+			$date_debut = $dtstart.$date_debut.$dtabbr;
1105
+			$date_fin = $dtend.$date_fin.$dtabbr;
1106 1106
 
1107 1107
 			$s = _T('date_fmt_periode', array('date_debut' => $date_debut, 'date_fin' => $date_fin));
1108 1108
 		} else {
@@ -1119,8 +1119,8 @@  discard block
 block discarded – undo
1119 1119
 				$date_fin = _T('date_fmt_jour_heure', array('jour' => $date_fin, 'heure' => $hf));
1120 1120
 			}
1121 1121
 
1122
-			$date_debut = $dtstart . $date_debut . $dtabbr;
1123
-			$date_fin = $dtend . $date_fin . $dtabbr;
1122
+			$date_debut = $dtstart.$date_debut.$dtabbr;
1123
+			$date_fin = $dtend.$date_fin.$dtabbr;
1124 1124
 			$s = _T('date_fmt_periode', array('date_debut' => $date_debut, 'date_fin' => $date_fin));
1125 1125
 
1126 1126
 		}
@@ -1225,7 +1225,7 @@  discard block
 block discarded – undo
1225 1225
 		$d = date("Y-m-d");
1226 1226
 	}
1227 1227
 
1228
-	return substr($d, 0, 4) . substr($d, 5, 2) . substr($d, 8, 2);
1228
+	return substr($d, 0, 4).substr($d, 5, 2).substr($d, 8, 2);
1229 1229
 }
1230 1230
 
1231 1231
 /**
@@ -1245,7 +1245,7 @@  discard block
 block discarded – undo
1245 1245
 		$d = date("Y-m-d");
1246 1246
 	}
1247 1247
 
1248
-	return substr($d, 0, 4) . substr($d, 5, 2);
1248
+	return substr($d, 0, 4).substr($d, 5, 2);
1249 1249
 }
1250 1250
 
1251 1251
 /**
Please login to merge, or discard this patch.
ecrire/inc/editer.php 1 patch
Spacing   +37 added lines, -38 removed lines patch added patch discarded remove patch
@@ -100,7 +100,7 @@  discard block
 block discarded – undo
100 100
 		$res['message_ok'] = _T('info_modification_enregistree');
101 101
 		if ($retour) {
102 102
 			if (strncmp($retour, 'javascript:', 11) == 0) {
103
-				$res['message_ok'] .= '<script type="text/javascript">/*<![CDATA[*/' . substr($retour, 11) . '/*]]>*/</script>';
103
+				$res['message_ok'] .= '<script type="text/javascript">/*<![CDATA[*/'.substr($retour, 11).'/*]]>*/</script>';
104 104
 				$res['editable'] = true;
105 105
 			} else {
106 106
 				$res['redirect'] = parametre_url($retour, $id_table_objet, $id);
@@ -140,7 +140,7 @@  discard block
 block discarded – undo
140 140
 				if (!isset($erreurs[$champ])) {
141 141
 					$erreurs[$champ] = '';
142 142
 				}
143
-				$erreurs[$champ] .= _T('alerte_modif_info_concourante') . "<br /><textarea readonly='readonly' class='forml'>" . entites_html($conflit['base']) . '</textarea>';
143
+				$erreurs[$champ] .= _T('alerte_modif_info_concourante')."<br /><textarea readonly='readonly' class='forml'>".entites_html($conflit['base']).'</textarea>';
144 144
 			}
145 145
 		}
146 146
 	}
@@ -215,7 +215,7 @@  discard block
 block discarded – undo
215 215
 	// on accepte pas une fonction de config inconnue si elle vient d'un modele
216 216
 	if ($config_fonc
217 217
 	  and !in_array($config_fonc, ['articles_edit_config', 'rubriques_edit_config', 'auteurs_edit_config'])
218
-	  and $config_fonc !== $table_objet . '_edit_config') {
218
+	  and $config_fonc !== $table_objet.'_edit_config') {
219 219
 		if ($args = test_formulaire_inclus_par_modele()
220 220
 		  and in_array($config_fonc, $args)) {
221 221
 			$config_fonc = '';
@@ -227,12 +227,12 @@  discard block
 block discarded – undo
227 227
 	// Appel direct dans un squelette
228 228
 	if (!$row) {
229 229
 		if (!$new or $lier_trad) {
230
-			if ($select = charger_fonction('precharger_' . $type, 'inc', true)) {
230
+			if ($select = charger_fonction('precharger_'.$type, 'inc', true)) {
231 231
 				$row = $select($id, $id_parent, $lier_trad);
232 232
 				// si on a une fonction precharger, elle pu faire un reglage de langue
233 233
 				$lang_default = (!empty($row['lang']) ? $row['lang'] : null);
234 234
 			} else {
235
-				$row = sql_fetsel('*', $table_objet_sql, $id_table_objet . '=' . intval($id));
235
+				$row = sql_fetsel('*', $table_objet_sql, $id_table_objet.'='.intval($id));
236 236
 			}
237 237
 			if (!$new) {
238 238
 				$md5 = controles_md5($row);
@@ -281,7 +281,7 @@  discard block
 block discarded – undo
281 281
 	if ($config_fonc) {
282 282
 		$contexte['config'] = $config = $config_fonc($contexte);
283 283
 		if (!$lang_default) {
284
-			$lang_default = $config['langue'] ?? session_get('lang') ;
284
+			$lang_default = $config['langue'] ?? session_get('lang');
285 285
 		}
286 286
 	}
287 287
 	$config = $config + array(
@@ -305,13 +305,12 @@  discard block
 block discarded – undo
305 305
 		unset($contexte['lang']);
306 306
 	}
307 307
 
308
-	$contexte['_hidden'] = "<input type='hidden' name='editer_$type' value='oui' />\n" .
309
-		(!$lier_trad ? '' :
310
-			("\n<input type='hidden' name='lier_trad' value='" .
311
-				$lier_trad .
312
-				"' />" .
313
-				"\n<input type='hidden' name='changer_lang' value='" .
314
-				$lang_default .
308
+	$contexte['_hidden'] = "<input type='hidden' name='editer_$type' value='oui' />\n".
309
+		(!$lier_trad ? '' : ("\n<input type='hidden' name='lier_trad' value='".
310
+				$lier_trad.
311
+				"' />".
312
+				"\n<input type='hidden' name='changer_lang' value='".
313
+				$lang_default.
315 314
 				"' />"))
316 315
 		. $hidden
317 316
 		. (isset($md5) ? $md5 : '');
@@ -325,8 +324,8 @@  discard block
 block discarded – undo
325 324
 	$contexte['_action'] = array("editer_$type", $id);
326 325
 
327 326
 	// et in fine placer l'autorisation
328
-	if (intval($id)){
329
-		if (!autoriser('modifier', $type, intval($id))){
327
+	if (intval($id)) {
328
+		if (!autoriser('modifier', $type, intval($id))) {
330 329
 			$valeurs['editable'] = '';
331 330
 		}
332 331
 	}
@@ -350,14 +349,14 @@  discard block
 block discarded – undo
350 349
 	$aider = charger_fonction('aider', 'inc');
351 350
 	if (strlen($texte) > 28 * 1024) {
352 351
 		$texte = str_replace("\r\n", "\n", $texte);
353
-		$pos = strpos($texte, "\n\n", 28 * 1024);  // coupe para > 28 ko
352
+		$pos = strpos($texte, "\n\n", 28 * 1024); // coupe para > 28 ko
354 353
 		if ($pos > 0 and $pos < 32 * 1024) {
355
-			$debut = substr($texte, 0, $pos) . "\n\n<!--SPIP-->\n";
354
+			$debut = substr($texte, 0, $pos)."\n\n<!--SPIP-->\n";
356 355
 			$suite = substr($texte, $pos + 2);
357 356
 		} else {
358
-			$pos = strpos($texte, ' ', 28 * 1024);  // sinon coupe espace
357
+			$pos = strpos($texte, ' ', 28 * 1024); // sinon coupe espace
359 358
 			if (!($pos > 0 and $pos < 32 * 1024)) {
360
-				$pos = 28 * 1024;  // au pire (pas d'espace trouv'e)
359
+				$pos = 28 * 1024; // au pire (pas d'espace trouv'e)
361 360
 				$decalage = 0; // si y'a pas d'espace, il ne faut pas perdre le caract`ere
362 361
 			} else {
363 362
 				$decalage = 1;
@@ -387,13 +386,13 @@  discard block
 block discarded – undo
387 386
 	}
388 387
 
389 388
 	include_spip('inc/barre');
390
-	$textes_supplement = "<br /><span style='color: red'>" . _T('info_texte_long') . "</span>\n";
389
+	$textes_supplement = "<br /><span style='color: red'>"._T('info_texte_long')."</span>\n";
391 390
 	$nombre = 0;
392 391
 
393 392
 	while (strlen($texte) > 29 * 1024) {
394 393
 		$nombre++;
395 394
 		list($texte1, $texte) = coupe_trop_long($texte);
396
-		$textes_supplement .= '<br />' .
395
+		$textes_supplement .= '<br />'.
397 396
 			"<textarea id='texte$nombre' name='texte_plus[$nombre]'$att_text>$texte1</textarea>\n";
398 397
 	}
399 398
 
@@ -481,7 +480,7 @@  discard block
 block discarded – undo
481 480
 	$ctr = array();
482 481
 	foreach ($data as $key => $val) {
483 482
 		$m = md5($val);
484
-		$k = $prefixe . $key;
483
+		$k = $prefixe.$key;
485 484
 
486 485
 		switch ($format) {
487 486
 			case 'html':
@@ -494,7 +493,7 @@  discard block
 block discarded – undo
494 493
 	}
495 494
 
496 495
 	if ($format == 'html') {
497
-		return "\n\n<!-- controles md5 -->\n" . join("\n", $ctr) . "\n\n";
496
+		return "\n\n<!-- controles md5 -->\n".join("\n", $ctr)."\n\n";
498 497
 	} else {
499 498
 		return $ctr;
500 499
 	}
@@ -645,7 +644,7 @@  discard block
 block discarded – undo
645 644
 	// On elimine les donnees non modifiees par le formulaire (mais
646 645
 	// potentiellement modifiees entre temps par un autre utilisateur)
647 646
 	foreach ($champs as $key => $val) {
648
-		if (isset($ctr[$prefix . $key]) and $m = $ctr[$prefix . $key]) {
647
+		if (isset($ctr[$prefix.$key]) and $m = $ctr[$prefix.$key]) {
649 648
 			if (is_scalar($val) and $m == md5($val)) {
650 649
 				unset($champs[$key]);
651 650
 			}
@@ -674,7 +673,7 @@  discard block
 block discarded – undo
674 673
 	// de conflit.
675 674
 	$ctrh = $ctrq = $conflits = array();
676 675
 	foreach (array_keys($champs) as $key) {
677
-		if (isset($ctr[$prefix . $key]) and $m = $ctr[$prefix . $key]) {
676
+		if (isset($ctr[$prefix.$key]) and $m = $ctr[$prefix.$key]) {
678 677
 			$ctrh[$key] = $m;
679 678
 			$ctrq[] = $key;
680 679
 		}
@@ -707,9 +706,9 @@  discard block
 block discarded – undo
707 706
  */
708 707
 function display_conflit_champ($x) {
709 708
 	if (strstr($x, "\n") or strlen($x) > 80) {
710
-		return "<textarea style='width:99%; height:10em;'>" . entites_html($x) . "</textarea>\n";
709
+		return "<textarea style='width:99%; height:10em;'>".entites_html($x)."</textarea>\n";
711 710
 	} else {
712
-		return "<input type='text' size='40' style='width:99%' value=\"" . entites_html($x) . "\" />\n";
711
+		return "<input type='text' size='40' style='width:99%' value=\"".entites_html($x)."\" />\n";
713 712
 	}
714 713
 }
715 714
 
@@ -749,11 +748,11 @@  discard block
 block discarded – undo
749 748
 		) : $champ;
750 749
 
751 750
 		$diffs[] = "<h2>$titre</h2>\n"
752
-			. '<h3>' . _T('info_conflit_edition_differences') . "</h3>\n"
753
-			. "<div style='max-height:8em; overflow: auto; width:99%;'>" . $d . "</div>\n"
754
-			. '<h4>' . _T('info_conflit_edition_votre_version') . '</h4>'
751
+			. '<h3>'._T('info_conflit_edition_differences')."</h3>\n"
752
+			. "<div style='max-height:8em; overflow: auto; width:99%;'>".$d."</div>\n"
753
+			. '<h4>'._T('info_conflit_edition_votre_version').'</h4>'
755 754
 			. display_conflit_champ($a['post'])
756
-			. '<h4>' . _T('info_conflit_edition_version_enregistree') . '</h4>'
755
+			. '<h4>'._T('info_conflit_edition_version_enregistree').'</h4>'
757 756
 			. display_conflit_champ($base);
758 757
 	}
759 758
 
@@ -761,16 +760,16 @@  discard block
 block discarded – undo
761 760
 		$id = uniqid(rand());
762 761
 		$redirect = "<form action='$redirect' method='get'
763 762
 			id='$id'
764
-			style='float:" . $GLOBALS['spip_lang_right'] . "; margin-top:2em;'>\n"
763
+			style='float:".$GLOBALS['spip_lang_right']."; margin-top:2em;'>\n"
765 764
 			. form_hidden($redirect)
766
-			. "<input type='submit' value='" . _T('icone_retour') . "' />
765
+			. "<input type='submit' value='"._T('icone_retour')."' />
767 766
 		</form>\n";
768 767
 
769 768
 		// pour les documents, on est probablement en ajax : il faut ajaxer
770 769
 		if (_AJAX) {
771 770
 			$redirect .= '<script type="text/javascript">'
772
-				. 'setTimeout(function(){$("#' . $id . '")
773
-			.ajaxForm({target:$("#' . $id . '").parent()});
771
+				. 'setTimeout(function(){$("#'.$id.'")
772
+			.ajaxForm({target:$("#' . $id.'").parent()});
774 773
 			}, 200);'
775 774
 				. "</script>\n";
776 775
 		}
@@ -789,9 +788,9 @@  discard block
 block discarded – undo
789 788
 .diff-para-deplace .diff-supprime { background: #ffb8b8; border: 1px solid #808080; }
790 789
 .diff-para-deplace .diff-deplace { background: #b8b8ff; border: 1px solid #808080; }
791 790
 </style>'
792
-		. '<p>' . _T('info_conflit_edition_avis_non_sauvegarde') . '</p>'
793
-		. '<p>' . _T('texte_conflit_edition_correction') . '</p>'
794
-		. "<div style='text-align:" . $GLOBALS['spip_lang_left'] . ";'>"
791
+		. '<p>'._T('info_conflit_edition_avis_non_sauvegarde').'</p>'
792
+		. '<p>'._T('texte_conflit_edition_correction').'</p>'
793
+		. "<div style='text-align:".$GLOBALS['spip_lang_left'].";'>"
795 794
 		. join("\n", $diffs)
796 795
 		. "</div>\n"
797 796
 
Please login to merge, or discard this patch.
ecrire/inc/cvt_multietapes.php 1 patch
Spacing   +4 added lines, -4 removed lines patch added patch discarded remove patch
@@ -229,7 +229,7 @@  discard block
 block discarded – undo
229 229
 		$erreurs_etapes = array();
230 230
 		$derniere_etape_ok = 0;
231 231
 		$e = 0;
232
-		while ($e < max($etape, $etape_demandee -1) and $e < $etapes) {
232
+		while ($e < max($etape, $etape_demandee - 1) and $e < $etapes) {
233 233
 			$e++;
234 234
 			$erreurs_etapes[$e] = array();
235 235
 			if ($verifier = charger_fonction("verifier_$e", "formulaires/$form/", true)) {
@@ -267,7 +267,7 @@  discard block
 block discarded – undo
267 267
 		// si la derniere etape OK etait la derniere
268 268
 		// on renvoie le flux inchange et ca declenche traiter
269 269
 		if ($derniere_etape_ok == $etapes
270
-			and (!$etape_demandee or $etape_demandee>=$etapes)) {
270
+			and (!$etape_demandee or $etape_demandee >= $etapes)) {
271 271
 			return $erreurs;
272 272
 		} else {
273 273
 			$etape = $derniere_etape_ok + 1;
@@ -309,9 +309,9 @@  discard block
 block discarded – undo
309 309
 		and ($e = $flux['args']['contexte']['_etape']) > 1
310 310
 		and $ext = $flux['args']['ext']
311 311
 		and $f = $flux['data']
312
-		and file_exists($f . "_$e.$ext")
312
+		and file_exists($f."_$e.$ext")
313 313
 	) {
314
-		$flux['data'] = $f . "_$e";
314
+		$flux['data'] = $f."_$e";
315 315
 	}
316 316
 
317 317
 	return $flux;
Please login to merge, or discard this patch.
ecrire/public/fonctions.php 1 patch
Spacing   +9 added lines, -9 removed lines patch added patch discarded remove patch
@@ -83,7 +83,7 @@  discard block
 block discarded – undo
83 83
 	if (strlen($intro)) {
84 84
 		$texte = $intro;
85 85
 	} else {
86
-		if (strpos("\n" . $texte, "\n|") === false
86
+		if (strpos("\n".$texte, "\n|") === false
87 87
 			and strlen($texte) > 2.5 * $longueur
88 88
 		) {
89 89
 			if (strpos($texte, "<multi") !== false) {
@@ -168,12 +168,12 @@  discard block
 block discarded – undo
168 168
 	if ($pas < 1) {
169 169
 		return '';
170 170
 	}
171
-	$ancre = 'pagination' . $nom; // #pagination_articles
172
-	$debut = 'debut' . $nom; // 'debut_articles'
171
+	$ancre = 'pagination'.$nom; // #pagination_articles
172
+	$debut = 'debut'.$nom; // 'debut_articles'
173 173
 
174 174
 	// n'afficher l'ancre qu'une fois
175 175
 	if (!isset($ancres[$ancre])) {
176
-		$bloc_ancre = $ancres[$ancre] = "<a id='" . $ancre . "' class='pagination_ancre'></a>";
176
+		$bloc_ancre = $ancres[$ancre] = "<a id='".$ancre."' class='pagination_ancre'></a>";
177 177
 	} else {
178 178
 		$bloc_ancre = '';
179 179
 	}
@@ -206,7 +206,7 @@  discard block
 block discarded – undo
206 206
 	if ($modele) {
207 207
 		$pagination['type_pagination'] = $modele;
208 208
 		if (trouver_fond('pagination_'.$modele, 'modeles')) {
209
-			$modele = '_' . $modele;
209
+			$modele = '_'.$modele;
210 210
 		}
211 211
 		else {
212 212
 			$modele = '';
@@ -337,7 +337,7 @@  discard block
 block discarded – undo
337 337
  * @param $objet_lien
338 338
  * @return string
339 339
  */
340
-function retrouver_rang_lien($objet_source, $ids, $objet_lie, $idl, $objet_lien){
340
+function retrouver_rang_lien($objet_source, $ids, $objet_lie, $idl, $objet_lien) {
341 341
 	$res = lister_objets_liens($objet_source, $objet_lie, $idl, $objet_lien);
342 342
 	$res = array_column($res, 'rang_lien', $objet_source);
343 343
 
@@ -492,12 +492,12 @@  discard block
 block discarded – undo
492 492
  * @param string $serveur
493 493
  * @return string
494 494
  */
495
-function formate_liste_critere_par_ordre_liste($valeurs, $serveur = ''){
496
-	if (!is_array($valeurs)){
495
+function formate_liste_critere_par_ordre_liste($valeurs, $serveur = '') {
496
+	if (!is_array($valeurs)) {
497 497
 		return '';
498 498
 	}
499 499
 	$f = sql_serveur('quote', $serveur, true);
500
-	if (!is_string($f) or !$f){
500
+	if (!is_string($f) or !$f) {
501 501
 		return '';
502 502
 	}
503 503
 	$valeurs = implode(',', array_map($f, array_unique($valeurs)));
Please login to merge, or discard this patch.
ecrire/public/jointures.php 1 patch
Spacing   +4 added lines, -4 removed lines patch added patch discarded remove patch
@@ -176,14 +176,14 @@  discard block
 block discarded – undo
176 176
 			// sache qu'il peut enlever ce where si il enleve la jointure
177 177
 			$boucle->where["JOIN-L$n"] =
178 178
 				$echap ?
179
-					array("'='","'$obj'","sql_quote('$type')")
179
+					array("'='", "'$obj'", "sql_quote('$type')")
180 180
 					:
181
-					array("=","$obj",sql_quote($type));
181
+					array("=", "$obj", sql_quote($type));
182 182
 			$boucle->join["L$n"] =
183 183
 				$echap ?
184 184
 					array("'$id_table'", "'$j2'", "'$j1'", "'$obj='.sql_quote('$type')")
185 185
 					:
186
-					array($id_table, $j2, $j1, "$obj=" . sql_quote($type));
186
+					array($id_table, $j2, $j1, "$obj=".sql_quote($type));
187 187
 		} else {
188 188
 			$boucle->join["L$n"] = $echap ? array("'$id_table'", "'$j'") : array($id_table, $j);
189 189
 		}
@@ -216,7 +216,7 @@  discard block
 block discarded – undo
216 216
 	$groups = liste_champs_jointures($nom, $desc, true);
217 217
 	if (!$pk) {
218 218
 		foreach ($groups as $id_prim) {
219
-			$id_field = $nom . '.' . $id_prim;
219
+			$id_field = $nom.'.'.$id_prim;
220 220
 			if (!in_array($id_field, $boucle->group)) {
221 221
 				$boucle->group[] = $id_field;
222 222
 			}
Please login to merge, or discard this patch.
ecrire/public/parametrer.php 1 patch
Spacing   +13 added lines, -13 removed lines patch added patch discarded remove patch
@@ -81,7 +81,7 @@  discard block
 block discarded – undo
81 81
 	} else {
82 82
 		// Preparer l'appel de la fonction principale du squelette 
83 83
 
84
-		spip_timer($a = 'calcul page ' . rand(0, 1000));
84
+		spip_timer($a = 'calcul page '.rand(0, 1000));
85 85
 
86 86
 		// On cree un marqueur de notes unique lie a cette composition
87 87
 		// et on enregistre l'etat courant des globales de notes...
@@ -113,8 +113,8 @@  discard block
 block discarded – undo
113 113
 		try {
114 114
 			$page = $fonc(array('cache' => $cache), array($contexte));
115 115
 		} catch (Throwable $e) {
116
-			$msg = _T('zbug_erreur_execution_page') . " $sourcefile";
117
-			$full_msg = $msg . ' | File ' . $e->getFile() . ' Line ' . $e->getLine() . ' : ' . $e->getMessage();
116
+			$msg = _T('zbug_erreur_execution_page')." $sourcefile";
117
+			$full_msg = $msg.' | File '.$e->getFile().' Line '.$e->getLine().' : '.$e->getMessage();
118 118
 			$full_msg = str_replace(_ROOT_RACINE, '[…]/', $full_msg);
119 119
 			$corps = "<pre>$msg</pre>";
120 120
 			$page = analyse_resultat_skel($fond, array('cache' => $cache), $corps, $sourcefile);
@@ -145,17 +145,17 @@  discard block
 block discarded – undo
145 145
 
146 146
 		$profile = spip_timer($a);
147 147
 		spip_log("calcul ($profile) [$skel] $infos"
148
-			. ' (' . strlen($page['texte']) . ' octets)');
148
+			. ' ('.strlen($page['texte']).' octets)');
149 149
 
150
-		if (defined('_CALCUL_PROFILER') AND intval($profile)>_CALCUL_PROFILER){
150
+		if (defined('_CALCUL_PROFILER') AND intval($profile) > _CALCUL_PROFILER) {
151 151
 			spip_log("calcul ($profile) [$skel] $infos"
152
-				.' ('.strlen($page['texte']).' octets) | '.$_SERVER['REQUEST_URI'],"profiler"._LOG_AVERTISSEMENT);
152
+				.' ('.strlen($page['texte']).' octets) | '.$_SERVER['REQUEST_URI'], "profiler"._LOG_AVERTISSEMENT);
153 153
 		}
154 154
 
155 155
 		if ($debug) {
156 156
 			// si c'est ce que demande le debusqueur, lui passer la main
157 157
 			$t = strlen($page['texte']) ? $page['texte'] : " ";
158
-			$GLOBALS['debug_objets']['resultat'][$fonc . 'tout'] = $t;
158
+			$GLOBALS['debug_objets']['resultat'][$fonc.'tout'] = $t;
159 159
 			$GLOBALS['debug_objets']['courant'] = $courant;
160 160
 			$GLOBALS['debug_objets']['profile'][$sourcefile] = $profile;
161 161
 			if ($GLOBALS['debug_objets']['sourcefile']
@@ -185,7 +185,7 @@  discard block
 block discarded – undo
185 185
 		if (defined('_VAR_INCLURE') and _VAR_INCLURE) {
186 186
 			$page['sourcefile'] = $sourcefile;
187 187
 			$page['texte'] =
188
-				"<div class='inclure_blocs'><h6>" . $page['sourcefile'] . "</h6>" . $page['texte'] . "</div>"
188
+				"<div class='inclure_blocs'><h6>".$page['sourcefile']."</h6>".$page['texte']."</div>"
189 189
 				. ($js_inclus ? "" : "<script type='text/javascript'>jQuery(function(){jQuery('.inclure_blocs > h6:first-child').hover(function(){jQuery(this).parent().addClass('hover')},function(){jQuery(this).parent().removeClass('hover')})});</script>");
190 190
 			$js_inclus = true;
191 191
 		}
@@ -220,21 +220,21 @@  discard block
 block discarded – undo
220 220
 		}
221 221
 		if (is_array($val)) {
222 222
 			if ($profondeur_max > 0) {
223
-				$val = 'array:' . count($val) . '(' . presenter_contexte($val, $profondeur_max - 1, 3) . ')';
223
+				$val = 'array:'.count($val).'('.presenter_contexte($val, $profondeur_max - 1, 3).')';
224 224
 			} else {
225
-				$val = 'array:' . count($val);
225
+				$val = 'array:'.count($val);
226 226
 			}
227 227
 		} elseif (is_object($val)) {
228 228
 			$val = get_class($val);
229 229
 		} elseif (strlen("$val") > 30) {
230
-			$val = substr("$val", 0, 29) . '…';
230
+			$val = substr("$val", 0, 29).'…';
231 231
 			if (strstr($val, ' ')) {
232 232
 				$val = "'$val'";
233 233
 			}
234 234
 		} elseif (strstr($val, ' ')) {
235 235
 			$val = "'$val'";
236 236
 		}
237
-		$infos[] = $var . '=' . $val;
237
+		$infos[] = $var.'='.$val;
238 238
 	}
239 239
 	return join(', ', $infos);
240 240
 }
@@ -301,7 +301,7 @@  discard block
 block discarded – undo
301 301
 						. "?php include_spip('inc/headers');redirige_par_entete('"
302 302
 						. texte_script($url)
303 303
 						. "','',$status);"
304
-						. "?" . ">",
304
+						. "?".">",
305 305
 					'process_ins' => 'php',
306 306
 					'status' => $status
307 307
 				);
Please login to merge, or discard this patch.
ecrire/public/composer.php 1 patch
Spacing   +43 added lines, -43 removed lines patch added patch discarded remove patch
@@ -54,7 +54,7 @@  discard block
 block discarded – undo
54 54
 		$GLOBALS['debug_objets']['courant'] = $nom;
55 55
 	}
56 56
 
57
-	$phpfile = sous_repertoire(_DIR_SKELS, '', false, true) . $nom . '.php';
57
+	$phpfile = sous_repertoire(_DIR_SKELS, '', false, true).$nom.'.php';
58 58
 
59 59
 	// si squelette est deja compile et perenne, le charger
60 60
 	if (!squelette_obsolete($phpfile, $source)) {
@@ -67,7 +67,7 @@  discard block
 block discarded – undo
67 67
 		#}
68 68
 	}
69 69
 
70
-	if (file_exists($lib = $squelette . '_fonctions' . '.php')) {
70
+	if (file_exists($lib = $squelette.'_fonctions'.'.php')) {
71 71
 		include_once $lib;
72 72
 	}
73 73
 
@@ -95,7 +95,7 @@  discard block
 block discarded – undo
95 95
 			eval("return true; $f ;");
96 96
 		} catch (\ParseError $e) {
97 97
 			// Code syntaxiquement faux (critere etc mal programme')
98
-			$msg = _T('zbug_erreur_compilation') . ' | Line ' . $e->getLine() . ' : ' . $e->getMessage();
98
+			$msg = _T('zbug_erreur_compilation').' | Line '.$e->getLine().' : '.$e->getMessage();
99 99
 			erreur_squelette($msg, $boucle);
100 100
 			// continuer pour trouver d'autres fautes eventuelles
101 101
 			// mais prevenir que c'est mort
@@ -124,7 +124,7 @@  discard block
 block discarded – undo
124 124
 	if (defined('_VAR_MODE') and _VAR_MODE == 'debug') {
125 125
 
126 126
 		// Tracer ce qui vient d'etre compile
127
-		$GLOBALS['debug_objets']['code'][$nom . 'tout'] = $code;
127
+		$GLOBALS['debug_objets']['code'][$nom.'tout'] = $code;
128 128
 
129 129
 		// si c'est ce que demande le debusqueur, lui passer la main
130 130
 		if ($GLOBALS['debug_objets']['sourcefile']
@@ -146,13 +146,13 @@  discard block
 block discarded – undo
146 146
 		$code = "
147 147
 /*
148 148
  * Squelette : $sourcefile
149
- * Date :      " . gmdate("D, d M Y H:i:s", @filemtime($sourcefile)) . " GMT
150
- * Compile :   " . gmdate("D, d M Y H:i:s", time()) . " GMT
151
- * " . (!$boucles ? "Pas de boucle" : ("Boucles :   " . $noms)) . "
149
+ * Date :      ".gmdate("D, d M Y H:i:s", @filemtime($sourcefile))." GMT
150
+ * Compile :   " . gmdate("D, d M Y H:i:s", time())." GMT
151
+ * " . (!$boucles ? "Pas de boucle" : ("Boucles :   ".$noms))."
152 152
  */ ";
153 153
 	}
154 154
 
155
-	$code = '<' . "?php\n" . $code . join('', $boucles) . "\n?" . '>';
155
+	$code = '<'."?php\n".$code.join('', $boucles)."\n?".'>';
156 156
 	if (!defined('_VAR_NOCACHE') or !_VAR_NOCACHE) {
157 157
 		ecrire_fichier($phpfile, $code);
158 158
 	}
@@ -212,7 +212,7 @@  discard block
 block discarded – undo
212 212
 			$j = join('-', array_map('ucwords', explode('-', strtolower($r[2]))));
213 213
 
214 214
 			if ($j == 'X-Spip-Filtre' and isset($headers[$j])) {
215
-				$headers[$j] .= "|" . $r[3];
215
+				$headers[$j] .= "|".$r[3];
216 216
 			} else {
217 217
 				$headers[$j] = $r[3];
218 218
 			}
@@ -220,10 +220,10 @@  discard block
 block discarded – undo
220 220
 	}
221 221
 	// S'agit-il d'un resultat constant ou contenant du code php
222 222
 	$process_ins = (
223
-		strpos($corps, '<' . '?') === false
223
+		strpos($corps, '<'.'?') === false
224 224
 		or
225
-		(strpos($corps, '<' . '?xml') !== false and
226
-			strpos(str_replace('<' . '?xml', '', $corps), '<' . '?') === false)
225
+		(strpos($corps, '<'.'?xml') !== false and
226
+			strpos(str_replace('<'.'?xml', '', $corps), '<'.'?') === false)
227 227
 	)
228 228
 		? 'html'
229 229
 		: 'php';
@@ -252,10 +252,10 @@  discard block
 block discarded – undo
252 252
 
253 253
 		if ($process_ins == 'html') {
254 254
 			$skel['process_ins'] = (
255
-				strpos($corps, '<' . '?') === false
255
+				strpos($corps, '<'.'?') === false
256 256
 				or
257
-				(strpos($corps, '<' . '?xml') !== false and
258
-					strpos(str_replace('<' . '?xml', '', $corps), '<' . '?') === false)
257
+				(strpos($corps, '<'.'?xml') !== false and
258
+					strpos(str_replace('<'.'?xml', '', $corps), '<'.'?') === false)
259 259
 			)
260 260
 				? 'html'
261 261
 				: 'php';
@@ -273,7 +273,7 @@  discard block
 block discarded – undo
273 273
 //
274 274
 
275 275
 /** Code PHP pour inclure une balise dynamique à l'exécution d'une page */
276
-define('CODE_INCLURE_BALISE', '<' . '?php 
276
+define('CODE_INCLURE_BALISE', '<'.'?php 
277 277
 include_once("%s");
278 278
 if ($lang_select = "%s") $lang_select = lang_select($lang_select);
279 279
 inserer_balise_dynamique(balise_%s_dyn(%s), array(%s));
@@ -304,7 +304,7 @@  discard block
 block discarded – undo
304 304
 		// pas de lien symbolique sous Windows
305 305
 		and !(stristr(PHP_OS, 'WIN') and strpos($file, ':') !== false)
306 306
 	) {
307
-		$file = './" . _DIR_RACINE . "' . $file;
307
+		$file = './" . _DIR_RACINE . "'.$file;
308 308
 	}
309 309
 
310 310
 	$lang = $context_compil[4];
@@ -346,14 +346,14 @@  discard block
 block discarded – undo
346 346
 	if (is_object($v)) {
347 347
 		return var_export($v, true);
348 348
 	} elseif (!is_array($v)) {
349
-		return "'" . texte_script($v) . "'";
349
+		return "'".texte_script($v)."'";
350 350
 	} else {
351 351
 		$out = array();
352 352
 		foreach ($v as $k => $val) {
353
-			$out [] = argumenter_squelette($k) . '=>' . argumenter_squelette($val);
353
+			$out [] = argumenter_squelette($k).'=>'.argumenter_squelette($val);
354 354
 		}
355 355
 
356
-		return 'array(' . join(", ", $out) . ')';
356
+		return 'array('.join(", ", $out).')';
357 357
 	}
358 358
 }
359 359
 
@@ -429,7 +429,7 @@  discard block
 block discarded – undo
429 429
 	}
430 430
 
431 431
 	// Y a-t-il une fonction de traitement des arguments ?
432
-	$f = 'balise_' . $nom_balise . '_stat';
432
+	$f = 'balise_'.$nom_balise.'_stat';
433 433
 
434 434
 	$r = !function_exists($f) ? $args : $f($args, $context_compil);
435 435
 
@@ -439,18 +439,18 @@  discard block
 block discarded – undo
439 439
 
440 440
 	// verifier que la fonction dyn est la, 
441 441
 	// sinon se replier sur la generique si elle existe
442
-	if (!function_exists('balise_' . $nom_balise . '_dyn')) {
442
+	if (!function_exists('balise_'.$nom_balise.'_dyn')) {
443 443
 		if (
444 444
 			$balise_generique = chercher_balise_generique($nom)
445 445
 			and $nom_balise_generique = $balise_generique['nom_generique']
446
-			and $file = include_spip("balise/" . strtolower($nom_balise_generique))
447
-			and function_exists('balise_' . $nom_balise_generique . '_dyn')
446
+			and $file = include_spip("balise/".strtolower($nom_balise_generique))
447
+			and function_exists('balise_'.$nom_balise_generique.'_dyn')
448 448
 		) {
449 449
 			// et lui injecter en premier arg le nom de la balise 
450 450
 			array_unshift($r, $nom);
451 451
 			$nom_balise = $nom_balise_generique;
452 452
 			if (!_DIR_RESTREINT) {
453
-				$file = _DIR_RESTREINT_ABS . $file;
453
+				$file = _DIR_RESTREINT_ABS.$file;
454 454
 			}
455 455
 		} else {
456 456
 			$msg = array('zbug_balise_inexistante', array('from' => 'CVT', 'balise' => $nom));
@@ -551,7 +551,7 @@  discard block
 block discarded – undo
551 551
 		$n = '';
552 552
 		foreach (explode(',', $liste) as $val) {
553 553
 			if ($a = intval($val) and $val === strval($a)) {
554
-				$n .= ',' . $val;
554
+				$n .= ','.$val;
555 555
 			}
556 556
 		}
557 557
 		if (strlen($n)) {
@@ -730,14 +730,14 @@  discard block
 block discarded – undo
730 730
 			// on construit le where une fois, puis on ajoute les where complentaires si besoin, et on reconstruit le where en fonction
731 731
 			$i = 0;
732 732
 			do {
733
-				$where[$k] = remplace_sous_requete($w, "(" . calculer_select(
734
-						array($sous[1] . " AS id"),
733
+				$where[$k] = remplace_sous_requete($w, "(".calculer_select(
734
+						array($sous[1]." AS id"),
735 735
 						$from,
736 736
 						$from_type,
737 737
 						$wheresub,
738 738
 						$jsub,
739 739
 						array(), array(), '',
740
-						$having, $table, $id, $serveur, false) . ")");
740
+						$having, $table, $id, $serveur, false).")");
741 741
 				if (!$i) {
742 742
 					$i = 1;
743 743
 					$wherestring = calculer_where_to_string($where[$k]);
@@ -756,7 +756,7 @@  discard block
 block discarded – undo
756 756
 		if ($sous[0] == 'SUBSELECT') {
757 757
 			// c'est une sous requete explicite sous la forme identique a sql_select : (SUBSELECT,$select,$from,$where,$groupby,$orderby,$limit,$having)
758 758
 			array_push($where_simples, $sous[3]); // est-ce utile dans ce cas ?
759
-			$where[$k] = remplace_sous_requete($w, "(" . calculer_select(
759
+			$where[$k] = remplace_sous_requete($w, "(".calculer_select(
760 760
 					$sous[1], # select
761 761
 					$sous[2], #from
762 762
 					array(), #from_type
@@ -768,7 +768,7 @@  discard block
 block discarded – undo
768 768
 					$sous[6], #limit
769 769
 					$sous[7] ? $sous[7] : array(), #having
770 770
 					$table, $id, $serveur, false
771
-				) . ")");
771
+				).")");
772 772
 		}
773 773
 		array_pop($where_simples);
774 774
 	}
@@ -830,15 +830,15 @@  discard block
 block discarded – undo
830 830
 			// sans recours a preg_match
831 831
 			// un implode(' ',..) est fait dans reinjecte_joint un peu plus bas
832 832
 			$afrom[$t][$cle] = array(
833
-				"\n" .
834
-				(isset($from_type[$cle]) ? $from_type[$cle] : "INNER") . " JOIN",
833
+				"\n".
834
+				(isset($from_type[$cle]) ? $from_type[$cle] : "INNER")." JOIN",
835 835
 				$from[$cle],
836 836
 				"AS $cle",
837 837
 				"ON (",
838 838
 				"$cle.$c",
839 839
 				"=",
840 840
 				"$t.$carr",
841
-				($and ? "AND " . $and : "") .
841
+				($and ? "AND ".$and : "").
842 842
 				")"
843 843
 			);
844 844
 			if (isset($afrom[$cle])) {
@@ -876,7 +876,7 @@  discard block
 block discarded – undo
876 876
 		$t = key($from);
877 877
 		$c = current($from);
878 878
 		reset($from);
879
-		$e = '/\b(' . "$t\\." . join("|" . $t . '\.', $equiv) . ')\b/';
879
+		$e = '/\b('."$t\\.".join("|".$t.'\.', $equiv).')\b/';
880 880
 		if (!(strpos($t, ' ') or // jointure des le depart cf boucle_doc
881 881
 				calculer_jointnul($t, $select, $e) or
882 882
 				calculer_jointnul($t, $join, $e) or
@@ -893,7 +893,7 @@  discard block
 block discarded – undo
893 893
 			unset($afrom[$t][$nt]);
894 894
 			$afrom[$nt] = $afrom[$t];
895 895
 			unset($afrom[$t]);
896
-			$e = '/\b' . preg_quote($nfrom[6]) . '\b/';
896
+			$e = '/\b'.preg_quote($nfrom[6]).'\b/';
897 897
 			$t = $nfrom[4];
898 898
 			$alias = "";
899 899
 			// verifier que les deux cles sont homonymes, sinon installer un alias dans le select
@@ -904,14 +904,14 @@  discard block
 block discarded – undo
904 904
 			if ($newcle != $oldcle) {
905 905
 				// si l'ancienne cle etait deja dans le select avec un AS
906 906
 				// reprendre simplement ce AS
907
-				$as = '/\b' . preg_quote($nfrom[6]) . '\s+(AS\s+\w+)\b/';
907
+				$as = '/\b'.preg_quote($nfrom[6]).'\s+(AS\s+\w+)\b/';
908 908
 				if (preg_match($as, implode(',', $select), $m)) {
909 909
 					$alias = "";
910 910
 				} else {
911
-					$alias = ", " . $nfrom[4] . " AS $oldcle";
911
+					$alias = ", ".$nfrom[4]." AS $oldcle";
912 912
 				}
913 913
 			}
914
-			$select = remplacer_jointnul($t . $alias, $select, $e);
914
+			$select = remplacer_jointnul($t.$alias, $select, $e);
915 915
 			$join = remplacer_jointnul($t, $join, $e);
916 916
 			$where = remplacer_jointnul($t, $where, $e);
917 917
 			$having = remplacer_jointnul($t, $having, $e);
@@ -952,9 +952,9 @@  discard block
 block discarded – undo
952 952
 	} else {
953 953
 		$exp = "";
954 954
 		if (strtoupper($join) === 'AND') {
955
-			return $exp . join(" $join ", array_map('calculer_where_to_string', $v));
955
+			return $exp.join(" $join ", array_map('calculer_where_to_string', $v));
956 956
 		} else {
957
-			return $exp . join($join, $v);
957
+			return $exp.join($join, $v);
958 958
 		}
959 959
 	}
960 960
 }
@@ -1020,6 +1020,6 @@  discard block
 block discarded – undo
1020 1020
 	}
1021 1021
 
1022 1022
 	return $mime_type
1023
-	. (!$connect ? '' : preg_replace('/\W/', "_", $connect)) . '_'
1024
-	. md5($GLOBALS['spip_version_code'] . ' * ' . $skel . (isset($GLOBALS['marqueur_skel']) ? '*' . $GLOBALS['marqueur_skel'] : ''));
1023
+	. (!$connect ? '' : preg_replace('/\W/', "_", $connect)).'_'
1024
+	. md5($GLOBALS['spip_version_code'].' * '.$skel.(isset($GLOBALS['marqueur_skel']) ? '*'.$GLOBALS['marqueur_skel'] : ''));
1025 1025
 }
Please login to merge, or discard this patch.
ecrire/plugins/infos_paquet.php 1 patch
Spacing   +7 added lines, -7 removed lines patch added patch discarded remove patch
@@ -47,8 +47,8 @@  discard block
 block discarded – undo
47 47
 			unset($tree['']);
48 48
 		}
49 49
 
50
-		$tree['slogan'] = $tree['prefix'] . "_slogan";
51
-		$tree['description'] = $tree['prefix'] . "_description";
50
+		$tree['slogan'] = $tree['prefix']."_slogan";
51
+		$tree['description'] = $tree['prefix']."_description";
52 52
 		paquet_readable_files($tree, "$dir_plugins$plug/");
53 53
 		if (!$tree['chemin']) {
54 54
 			$tree['chemin'] = array();
@@ -79,7 +79,7 @@  discard block
 block discarded – undo
79 79
 	// Prendre les messages d'erreur sans les numeros de lignes
80 80
 	$msg = array_column($vxml->err, 0);
81 81
 	$t = _T('plugins_erreur', array('plugins' => $plug));
82
-	array_unshift($msg, $t . " <ul class='erreur_xml'><li>" . reset($msg) . "</li></ul>");
82
+	array_unshift($msg, $t." <ul class='erreur_xml'><li>".reset($msg)."</li></ul>");
83 83
 
84 84
 	return array('erreur' => $msg);
85 85
 }
@@ -95,9 +95,9 @@  discard block
 block discarded – undo
95 95
 function paquet_readable_files(&$tree, $dir) {
96 96
 	$prefix = strtolower($tree['prefix']);
97 97
 
98
-	$tree['options'] = (is_readable($dir . $f = ($prefix . '_options.php'))) ? array($f) : array();
99
-	$tree['fonctions'] = (is_readable($dir . $f = ($prefix . '_fonctions.php'))) ? array($f) : array();
100
-	$tree['install'] = (is_readable($dir . $f = ($prefix . '_administrations.php'))) ? array($f) : array();
98
+	$tree['options'] = (is_readable($dir.$f = ($prefix.'_options.php'))) ? array($f) : array();
99
+	$tree['fonctions'] = (is_readable($dir.$f = ($prefix.'_fonctions.php'))) ? array($f) : array();
100
+	$tree['install'] = (is_readable($dir.$f = ($prefix.'_administrations.php'))) ? array($f) : array();
101 101
 }
102 102
 
103 103
 /**
@@ -185,7 +185,7 @@  discard block
 block discarded – undo
185 185
 	$texte = trim($phraseur->versions[$n]['']);
186 186
 	$phraseur->versions[$n][''] = '';
187 187
 
188
-	$f = 'info_paquet_' . $name;
188
+	$f = 'info_paquet_'.$name;
189 189
 	if (function_exists($f)) {
190 190
 		$f($phraseur, $attrs, $texte);
191 191
 	} elseif (!$attrs) {
Please login to merge, or discard this patch.
ecrire/inc/informer.php 1 patch
Spacing   +8 added lines, -8 removed lines patch added patch discarded remove patch
@@ -21,7 +21,7 @@  discard block
 block discarded – undo
21 21
 	include_spip('inc/texte');
22 22
 	$titre = $descriptif = '';
23 23
 	if ($type == "rubrique") {
24
-		$row = sql_fetsel("titre, descriptif", "spip_rubriques", "id_rubrique = " . intval($id));
24
+		$row = sql_fetsel("titre, descriptif", "spip_rubriques", "id_rubrique = ".intval($id));
25 25
 		if ($row) {
26 26
 			$titre = typo($row["titre"]);
27 27
 			$descriptif = propre($row["descriptif"]);
@@ -39,7 +39,7 @@  discard block
 block discarded – undo
39 39
 				include_spip('inc/filtres_images_mini');
40 40
 				$res = image_reduire("<img src='$fid' alt='' />", 100, 48);
41 41
 				if ($res) {
42
-					$res = "<div class='informer__media' style='float: " . $GLOBALS['spip_lang_right'] . "; margin-" . $GLOBALS['spip_lang_right'] . ": -5px; margin-top: -5px;'>$res</div>";
42
+					$res = "<div class='informer__media' style='float: ".$GLOBALS['spip_lang_right']."; margin-".$GLOBALS['spip_lang_right'].": -5px; margin-top: -5px;'>$res</div>";
43 43
 				}
44 44
 			}
45 45
 		}
@@ -55,21 +55,21 @@  discard block
 block discarded – undo
55 55
 		str_replace('"', "&#34;", textebrut($titre))),
56 56
 		"\n\r", "  ");
57 57
 
58
-	$js_func = $do . '_selection_titre';
58
+	$js_func = $do.'_selection_titre';
59 59
 
60 60
 	return "<div style='display: none;'>"
61
-	. "<input type='text' id='" . $rac . "_sel' value='$id' />"
62
-	. "<input type='text' id='" . $rac . "_sel2' value=\""
61
+	. "<input type='text' id='".$rac."_sel' value='$id' />"
62
+	. "<input type='text' id='".$rac."_sel2' value=\""
63 63
 	. entites_html($titre)
64 64
 	. "\" />"
65 65
 	. "</div>"
66 66
 	. "<div class='informer' style='padding: 5px; border-top: 0px;'>"
67 67
 	. '<div class="informer__item">'
68 68
 	. (!$res ? '' : $res)
69
-	. "<p class='informer__titre'><b>" . safehtml($titre) . "</b></p>"
70
-	. (!$descriptif ? '' : "<div class='informer__descriptif'>" . safehtml($descriptif) . "</div>")
69
+	. "<p class='informer__titre'><b>".safehtml($titre)."</b></p>"
70
+	. (!$descriptif ? '' : "<div class='informer__descriptif'>".safehtml($descriptif)."</div>")
71 71
 	. '</div>'
72
-	. "<div class='informer__action' style='clear:both; text-align: " . $GLOBALS['spip_lang_right'] . ";'>"
72
+	. "<div class='informer__action' style='clear:both; text-align: ".$GLOBALS['spip_lang_right'].";'>"
73 73
 	. "<input type='submit' class='fondo btn submit' value='"
74 74
 	. _T('bouton_choisir')
75 75
 	. "'\nonclick=\"$js_func('$titre',$id,'selection_rubrique','id_parent'); return false;\" />"
Please login to merge, or discard this patch.