Completed
Push — spip-3.0 ( cd2822...016705 )
by cam
08:31
created
ecrire/exec/puce_statut.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -17,7 +17,7 @@  discard block
 block discarded – undo
17 17
 // http://doc.spip.org/@exec_puce_statut_dist
18 18
 function exec_puce_statut_dist()
19 19
 {
20
-	exec_puce_statut_args(_request('id'),  _request('type'));
20
+	exec_puce_statut_args(_request('id'), _request('type'));
21 21
 }
22 22
 
23 23
 // http://doc.spip.org/@exec_puce_statut_args
@@ -42,6 +42,6 @@  discard block
 block discarded – undo
42 42
 		$statut = 'prop'; // arbitraire
43 43
 	}
44 44
 	$puce_statut = charger_fonction('puce_statut', 'inc');
45
-	ajax_retour($puce_statut($id,$statut,$id_rubrique,$type, true));
45
+	ajax_retour($puce_statut($id, $statut, $id_rubrique, $type, true));
46 46
 }
47 47
 ?>
Please login to merge, or discard this patch.
ecrire/exec/fond_monobloc.php 1 patch
Spacing   +19 added lines, -19 removed lines patch added patch discarded remove patch
@@ -20,13 +20,13 @@  discard block
 block discarded – undo
20 20
  * deprecie, ne plus utiliser
21 21
  *
22 22
  */
23
-function exec_fond_monobloc_dist(){
23
+function exec_fond_monobloc_dist() {
24 24
 
25 25
 	// pas d'autorisation
26 26
 	// c'est au fond de les gerer avec #AUTORISER, et de renvoyer un fond vide le cas echeant
27 27
 	// qui declenchera un minipres acces interdit
28 28
 	$exec = _request('exec');
29
-	$fond = trim(recuperer_fond("prive/exec/$exec",$_REQUEST));
29
+	$fond = trim(recuperer_fond("prive/exec/$exec", $_REQUEST));
30 30
 	if (!$fond) {
31 31
 		include_spip('inc/minipres');
32 32
 		echo minipres();
@@ -38,33 +38,33 @@  discard block
 block discarded – undo
38 38
 	$extra = "";
39 39
 
40 40
 	// recuperer le titre dans le premier hn de la page
41
-	if (preg_match(",<h[1-6][^>]*>(.+)</h[1-6]>,Uims",$fond,$match)){
41
+	if (preg_match(",<h[1-6][^>]*>(.+)</h[1-6]>,Uims", $fond, $match)) {
42 42
 		$titre = $match[1];
43 43
 	}
44 44
 
45 45
 	// recuperer la hierarchie (au-dessus du contenu)
46
-	if (preg_match(",<!--#hierarchie-->.+<!--/#hierarchie-->,Uims",$fond,$match)){
46
+	if (preg_match(",<!--#hierarchie-->.+<!--/#hierarchie-->,Uims", $fond, $match)) {
47 47
 		$hierarchie = $match[0];
48
-		$fond = str_replace($hierarchie,"",$fond);
48
+		$fond = str_replace($hierarchie, "", $fond);
49 49
 	}
50 50
 
51 51
 	// recuperer la navigation (colonne de gauche)
52
-	if (preg_match(",<!--#navigation-->.+<!--/#navigation-->,Uims",$fond,$match)){
52
+	if (preg_match(",<!--#navigation-->.+<!--/#navigation-->,Uims", $fond, $match)) {
53 53
 		$navigation = $match[0];
54
-		$fond = str_replace($navigation,"",$fond);
54
+		$fond = str_replace($navigation, "", $fond);
55 55
 	}
56 56
 
57 57
 	// recuperer les extras (colonne de droite)
58
-	if (preg_match(",<!--#extra-->.+<!--/#extra-->,Uims",$fond,$match)){
58
+	if (preg_match(",<!--#extra-->.+<!--/#extra-->,Uims", $fond, $match)) {
59 59
 		$extra = $match[0];
60
-		$fond = str_replace($extra,"",$fond);
60
+		$fond = str_replace($extra, "", $fond);
61 61
 	}
62 62
 
63 63
 	include_spip('inc/presentation'); // alleger les inclusions avec un inc/presentation_mini
64
-	$commencer_page = charger_fonction('commencer_page','inc');
64
+	$commencer_page = charger_fonction('commencer_page', 'inc');
65 65
 	echo $commencer_page($titre);
66 66
 
67
-	if ($hierarchie){
67
+	if ($hierarchie) {
68 68
 		echo debut_grand_cadre(true);
69 69
 		echo pipeline(
70 70
 			'affiche_hierarchie',
@@ -78,27 +78,27 @@  discard block
 block discarded – undo
78 78
 		echo fin_grand_cadre(true);
79 79
 	}
80 80
 
81
-	echo debut_gauche("exec_$exec",true);
81
+	echo debut_gauche("exec_$exec", true);
82 82
 
83 83
 	$contexte = array('exec'=>$exec);
84
-	if ($objet_exec = trouver_objet_exec($exec)){
84
+	if ($objet_exec = trouver_objet_exec($exec)) {
85 85
 		$id = $objet_exec['id_table_objet'];
86 86
 		if (_request($id))
87 87
 			$contexte[$id] = _request($id);
88 88
 	}
89 89
 
90 90
 	echo $navigation;
91
-	echo pipeline('affiche_gauche',array('args'=>$contexte,'data'=>''));
91
+	echo pipeline('affiche_gauche', array('args'=>$contexte, 'data'=>''));
92 92
 
93
-	echo creer_colonne_droite("exec_$exec",true);
93
+	echo creer_colonne_droite("exec_$exec", true);
94 94
 	echo $extra;
95
-	echo pipeline('affiche_droite',array('args'=>$contexte,'data'=>''));
95
+	echo pipeline('affiche_droite', array('args'=>$contexte, 'data'=>''));
96 96
 
97
-	echo debut_droite("exec_$exec",true);
97
+	echo debut_droite("exec_$exec", true);
98 98
 	echo $fond;
99
-	echo pipeline('affiche_milieu',array('args'=>$contexte,'data'=>''));
99
+	echo pipeline('affiche_milieu', array('args'=>$contexte, 'data'=>''));
100 100
 
101
-	echo fin_gauche(),fin_page();
101
+	echo fin_gauche(), fin_page();
102 102
 	}
103 103
 }
104 104
 
Please login to merge, or discard this patch.
ecrire/exec/rechercher.php 1 patch
Spacing   +21 added lines, -21 removed lines patch added patch discarded remove patch
@@ -15,7 +15,7 @@  discard block
 block discarded – undo
15 15
 include_spip('inc/texte');
16 16
 
17 17
 // http://doc.spip.org/@exec_rechercher_dist
18
-function exec_rechercher_dist(){
18
+function exec_rechercher_dist() {
19 19
 	$id = intval(_request('id'));
20 20
 	$exclus = intval(_request('exclus'));
21 21
 	$rac = spip_htmlentities(_request('rac'));
@@ -28,41 +28,41 @@  discard block
 block discarded – undo
28 28
 }
29 29
 
30 30
 // http://doc.spip.org/@exec_rechercher_args
31
-function exec_rechercher_args($id, $type, $exclus, $rac, $do){
31
+function exec_rechercher_args($id, $type, $exclus, $rac, $do) {
32 32
 	if (!$do) $do = 'aff';
33 33
 
34 34
 	$where = preg_split(",\s+,", $type);
35
-	if ($where){
36
-		foreach ($where as $k => $v){
37
-			$where[$k] = "'%" . substr(str_replace("%", "\%", sql_quote($v,'','string')), 1, -1) . "%'";
35
+	if ($where) {
36
+		foreach ($where as $k => $v) {
37
+			$where[$k] = "'%".substr(str_replace("%", "\%", sql_quote($v, '', 'string')), 1, -1)."%'";
38 38
 		}
39
-		$where_titre = ("(titre LIKE " . join(" AND titre LIKE ", $where) . ")");
40
-		$where_desc = ("(descriptif LIKE " . join(" AND descriptif LIKE ", $where) . ")");
41
-		$where_id = ("(id_rubrique = " . intval($type) . ")");
39
+		$where_titre = ("(titre LIKE ".join(" AND titre LIKE ", $where).")");
40
+		$where_desc = ("(descriptif LIKE ".join(" AND descriptif LIKE ", $where).")");
41
+		$where_id = ("(id_rubrique = ".intval($type).")");
42 42
 	} else {
43 43
 		$where_titre = " 1=2";
44 44
 		$where_desc = " 1=2";
45 45
 		$where_id = " 1=2";
46 46
 	}
47 47
 
48
-	if ($exclus){
48
+	if ($exclus) {
49 49
 		include_spip('inc/rubriques');
50
-		$where_exclus = " AND " . sql_in('id_rubrique', calcul_branche_in($exclus), 'NOT');
50
+		$where_exclus = " AND ".sql_in('id_rubrique', calcul_branche_in($exclus), 'NOT');
51 51
 	} else  $where_exclus = '';
52 52
 
53 53
 	$res = sql_select("id_rubrique, id_parent, titre", "spip_rubriques", "$where_id$where_exclus");
54 54
 
55 55
 	$points = $rub = array();
56 56
 
57
-	while ($row = sql_fetch($res)){
57
+	while ($row = sql_fetch($res)) {
58 58
 		$id_rubrique = $row["id_rubrique"];
59 59
 		$rub[$id_rubrique]["titre"] = typo($row["titre"]);
60 60
 		$rub[$id_rubrique]["id_parent"] = $row["id_parent"];
61
-		$points[$id_rubrique] = $points[$id_rubrique]+3;
61
+		$points[$id_rubrique] = $points[$id_rubrique] + 3;
62 62
 	}
63 63
 	$res = sql_select("id_rubrique, id_parent, titre", "spip_rubriques", "$where_titre$where_exclus");
64 64
 
65
-	while ($row = sql_fetch($res)){
65
+	while ($row = sql_fetch($res)) {
66 66
 		$id_rubrique = $row["id_rubrique"];
67 67
 		$rub[$id_rubrique]["titre"] = typo($row["titre"]);
68 68
 		$rub[$id_rubrique]["id_parent"] = $row["id_parent"];
@@ -72,7 +72,7 @@  discard block
 block discarded – undo
72 72
 	}
73 73
 	$res = sql_select("id_rubrique, id_parent, titre", "spip_rubriques", "$where_desc$where_exclus");
74 74
 
75
-	while ($row = sql_fetch($res)){
75
+	while ($row = sql_fetch($res)) {
76 76
 		$id_rubrique = $row["id_rubrique"];
77 77
 		$rub[$id_rubrique]["titre"] = typo($row["titre"]);
78 78
 		$rub[$id_rubrique]["id_parent"] = $row["id_parent"];
@@ -81,10 +81,10 @@  discard block
 block discarded – undo
81 81
 		else $points[$id_rubrique] = 0;
82 82
 	}
83 83
 
84
-	if ($points){
84
+	if ($points) {
85 85
 		arsort($points);
86
-		$style = " style='background-image: url(" . chemin_image('secteur-12.png') . ")'";
87
-		foreach ($rub as $k => $v){
86
+		$style = " style='background-image: url(".chemin_image('secteur-12.png').")'";
87
+		foreach ($rub as $k => $v) {
88 88
 			$rub[$k]['atts'] = ($v["id_parent"] ? $style : '')
89 89
 				. " class='petite-rubrique'";
90 90
 		}
@@ -99,21 +99,21 @@  discard block
 block discarded – undo
99 99
 // ==> attention a composer le message d'erreur avec au moins 2 balises
100 100
 
101 101
 // http://doc.spip.org/@proposer_item
102
-function proposer_item($ids, $titles, $rac, $type, $do){
102
+function proposer_item($ids, $titles, $rac, $type, $do) {
103 103
 
104 104
 	if (!$ids)
105 105
 		return "<br /><br /><div style='padding: 5px; color: red;'><b>"
106 106
 		. spip_htmlentities($type)
107
-		. "</b> :  " . _T('avis_aucun_resultat') . "</div>";
107
+		. "</b> :  "._T('avis_aucun_resultat')."</div>";
108 108
 
109 109
 	$ret = '';
110 110
 	$info = generer_url_ecrire('informer', "type=rubrique&rac=$rac&id=");
111 111
 
112
-	$onClick = "aff_selection(this.firstChild.title,'$rac" . "_selection','$info', event)";
112
+	$onClick = "aff_selection(this.firstChild.title,'$rac"."_selection','$info', event)";
113 113
 
114 114
 	$ondbClick = "$do(this.firstChild.firstChild.nodeValue,this.firstChild.title,'selection_rubrique', 'id_parent');";
115 115
 
116
-	foreach ($ids as $id => $bof){
116
+	foreach ($ids as $id => $bof) {
117 117
 
118 118
 		$titre = strtr(str_replace("'", "&#8217;", str_replace('"', "&#34;", textebrut($titles[$id]["titre"]))), "\n\r", "  ");
119 119
 
Please login to merge, or discard this patch.
ecrire/exec/fond.php 1 patch
Spacing   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -14,7 +14,7 @@  discard block
 block discarded – undo
14 14
 
15 15
 
16 16
 $fond = _request('exec');
17
-$GLOBALS['delais'] = 0;// pas de cache !
17
+$GLOBALS['delais'] = 0; // pas de cache !
18 18
 // Securite
19 19
 if (strstr($fond, '/')) {
20 20
 	if (!include_spip('inc/autoriser')
@@ -30,7 +30,7 @@  discard block
 block discarded – undo
30 30
 // quelques inclusions et ini prealables
31 31
 include_spip('inc/commencer_page');
32 32
 
33
-function shutdown_error(){
33
+function shutdown_error() {
34 34
 
35 35
 	// si on arrive ici avec un tampon non ferme : erreur fatale
36 36
 /*	if (ob_get_level()){
@@ -61,7 +61,7 @@  discard block
 block discarded – undo
61 61
  * La fonction ne fait rien, c'est l'inclusion du fichier qui declenche le traitement
62 62
  *
63 63
  */
64
-function exec_fond_dist(){
64
+function exec_fond_dist() {
65 65
 
66 66
 }
67 67
 
Please login to merge, or discard this patch.
ecrire/exec/demande_mise_a_jour.php 1 patch
Spacing   +4 added lines, -4 removed lines patch added patch discarded remove patch
@@ -20,7 +20,7 @@  discard block
 block discarded – undo
20 20
 	// si jamais la liste des plugins actifs change, il faut faire un refresh du hit
21 21
 	// pour etre sur que les bons fichiers seront charges lors de l'install
22 22
 	include_spip('inc/plugin');
23
-	if (actualise_plugins_actifs()){
23
+	if (actualise_plugins_actifs()) {
24 24
 		include_spip('inc/headers');
25 25
 		redirige_par_entete(self());
26 26
 	}
@@ -28,13 +28,13 @@  discard block
 block discarded – undo
28 28
 	include_spip('inc/presentation');
29 29
 	include_spip('inc/filtres_boites');
30 30
 	$commencer_page = charger_fonction('commencer_page', 'inc');
31
-	echo $commencer_page('','','','',true,false,false);
31
+	echo $commencer_page('', '', '', '', true, false, false);
32 32
 
33 33
 	echo debut_grand_cadre(true);
34
-	echo boite_ouvrir(_T('info_message_technique'),'notice');
34
+	echo boite_ouvrir(_T('info_message_technique'), 'notice');
35 35
 	echo "<p>"._T('info_procedure_maj_version')."</p>",
36 36
 	     "<p>"._T('info_administrateur_site_01')."</p>";
37
-	echo bouton_action(_T('bouton_mettre_a_jour_base'),generer_url_ecrire("upgrade","reinstall=non"));
37
+	echo bouton_action(_T('bouton_mettre_a_jour_base'), generer_url_ecrire("upgrade", "reinstall=non"));
38 38
 	echo boite_fermer();
39 39
 	// masquer les erreurs sql sur cette page car proviennent de la base pas a jour !
40 40
 	echo '<style type="text/css">#debug-nav {display: none;}</style>';
Please login to merge, or discard this patch.
ecrire/exec/selectionner.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -29,7 +29,7 @@
 block discarded – undo
29 29
 
30 30
 		$selectionner = charger_fonction('selectionner', 'inc');
31 31
 
32
-		$r = $selectionner($id, "choix_parent", $exclus, $rac, $type!='breve', $do);
32
+		$r = $selectionner($id, "choix_parent", $exclus, $rac, $type != 'breve', $do);
33 33
 	} else $r = '';
34 34
 	ajax_retour($r);
35 35
 }
Please login to merge, or discard this patch.
ecrire/exec/admin_plugin.php 1 patch
Spacing   +23 added lines, -23 removed lines patch added patch discarded remove patch
@@ -20,7 +20,7 @@  discard block
 block discarded – undo
20 20
 include_spip('inc/securiser_action');
21 21
 
22 22
 // http://doc.spip.org/@exec_admin_plugin_dist
23
-function exec_admin_plugin_dist($retour='') {
23
+function exec_admin_plugin_dist($retour = '') {
24 24
 
25 25
 	if (!autoriser('configurer', '_plugins')) {
26 26
 		include_spip('inc/minipres');
@@ -31,9 +31,9 @@  discard block
 block discarded – undo
31 31
 	// si jamais la liste des plugins actifs change, il faut faire un refresh du hit
32 32
 	// pour etre sur que les bons fichiers seront charges lors de l'install
33 33
 		$new = actualise_plugins_actifs();
34
-		if ($new AND _request('actualise')<2) {
34
+		if ($new AND _request('actualise') < 2) {
35 35
 			include_spip('inc/headers');
36
-			redirige_par_entete(parametre_url(self(),'actualise',_request('actualise')+1,'&'));
36
+			redirige_par_entete(parametre_url(self(), 'actualise', _request('actualise') + 1, '&'));
37 37
 		}
38 38
 		else {
39 39
 			admin_plug_args(_request('voir'), _request('erreur'), _request('format'));
@@ -52,8 +52,8 @@  discard block
 block discarded – undo
52 52
 	$commencer_page = charger_fonction('commencer_page', 'inc');
53 53
 	echo $commencer_page(_T('icone_admin_plugin'), "configuration", "plugin");
54 54
 
55
-	echo debut_gauche('plugin',true);
56
-	echo recuperer_fond('prive/squelettes/navigation/configurer',array('exec'=>'admin_plugin'));
55
+	echo debut_gauche('plugin', true);
56
+	echo recuperer_fond('prive/squelettes/navigation/configurer', array('exec'=>'admin_plugin'));
57 57
 
58 58
 	echo pipeline('affiche_gauche',
59 59
 		array(
@@ -63,12 +63,12 @@  discard block
 block discarded – undo
63 63
 	);
64 64
 
65 65
 	echo debut_droite('plugin', true);
66
-	echo gros_titre(_T('icone_admin_plugin'),'',false);
66
+	echo gros_titre(_T('icone_admin_plugin'), '', false);
67 67
 
68 68
 	// Barre d'onglets de premier niveau
69 69
 	echo barre_onglets("plugins", "plugins_actifs");
70 70
 	// Barre d'onglets de second niveau
71
-	$onglet2 = $quoi=='actifs' ? 'plugins_actifs' : 'admin_plugin';
71
+	$onglet2 = $quoi == 'actifs' ? 'plugins_actifs' : 'admin_plugin';
72 72
 	echo debut_onglet('onglets_simple second');
73 73
 	echo onglet(_T('plugins_tous_liste'), generer_url_ecrire("admin_plugin", "voir=tous"), 'admin_plugin', $onglet2);
74 74
 	echo onglet(_T('plugins_actifs_liste'), generer_url_ecrire("admin_plugin"), 'plugins_actifs', $onglet2);
@@ -77,7 +77,7 @@  discard block
 block discarded – undo
77 77
 	// message d'erreur au retour d'une operation
78 78
 	if ($erreur)
79 79
 		echo "<div class='error'>$erreur</div>";
80
-	if ($erreur_activation){
80
+	if ($erreur_activation) {
81 81
 		echo "<div class='error'>$erreur_activation</div>";
82 82
 	}
83 83
 
@@ -88,7 +88,7 @@  discard block
 block discarded – undo
88 88
 	// Les affichages se basent sur le repertoire, pas sur le nom
89 89
 	$actifs = liste_chemin_plugin($actifs, '');
90 90
 	if (defined('_DIR_PLUGINS_SUPPL'))
91
-		$lcpas = liste_chemin_plugin($lcpa,_DIR_PLUGINS_SUPPL);
91
+		$lcpas = liste_chemin_plugin($lcpa, _DIR_PLUGINS_SUPPL);
92 92
 	$lcpa = liste_chemin_plugin($lcpa);
93 93
 	
94 94
 	// on installe les plugins maintenant,
@@ -96,15 +96,15 @@  discard block
 block discarded – undo
96 96
 	plugin_installes_meta();
97 97
 
98 98
 	echo "<div class='liste-plugins formulaire_spip'>";
99
-	echo debut_cadre_trait_couleur('plugin-24.png',true,'',_T('plugins_liste'), 'plugins');
99
+	echo debut_cadre_trait_couleur('plugin-24.png', true, '', _T('plugins_liste'), 'plugins');
100 100
 
101
-	if ($quoi!=='actifs'){
101
+	if ($quoi !== 'actifs') {
102 102
 		$lpf = liste_plugin_files();
103 103
 		if ($lpf)
104 104
 			echo "<p>"._T('texte_presente_plugin')."</p>";
105 105
 		else {
106 106
 			if (!@is_dir(_DIR_PLUGINS))
107
-				echo  "<p>"._T('plugin_info_automatique_ftp',array('rep'=>joli_repertoire(_DIR_PLUGINS)))
107
+				echo  "<p>"._T('plugin_info_automatique_ftp', array('rep'=>joli_repertoire(_DIR_PLUGINS)))
108 108
 							. " &mdash; "._T('plugin_info_automatique_creer')."</p>";
109 109
 		}
110 110
 		$lcpaffiche = $lpf;
@@ -119,7 +119,7 @@  discard block
 block discarded – undo
119 119
 			$lcpaffichesup = $lcpas;
120 120
 	}
121 121
 
122
-	if ($quoi=='actifs' OR $lpf){
122
+	if ($quoi == 'actifs' OR $lpf) {
123 123
 		$nb = count($lcpa);
124 124
 		if (defined('_DIR_PLUGINS_SUPPL'))
125 125
 			$nb += count($lcpas);
@@ -128,13 +128,13 @@  discard block
 block discarded – undo
128 128
 
129 129
 	if (empty($format))
130 130
 	  $format = 'liste';
131
-	elseif (!in_array($format,array('liste','repertoires')))
131
+	elseif (!in_array($format, array('liste', 'repertoires')))
132 132
 		$format = 'repertoires';
133 133
 
134
-	$afficher = charger_fonction("afficher_$format",'plugins');
135
-	$corps = $afficher(self(),$lcpaffiche, $lcpa, $actifs);
134
+	$afficher = charger_fonction("afficher_$format", 'plugins');
135
+	$corps = $afficher(self(), $lcpaffiche, $lcpa, $actifs);
136 136
 	if (defined('_DIR_PLUGINS_SUPPL'))
137
-		$corps .= $afficher(self(),$lcpaffichesup, $lcpas, $actifs, _DIR_PLUGINS_SUPPL);
137
+		$corps .= $afficher(self(), $lcpaffichesup, $lcpas, $actifs, _DIR_PLUGINS_SUPPL);
138 138
 
139 139
 	if ($corps)
140 140
 	  $corps .= "\n<div class='boutons' style='display:none;'>"
@@ -142,11 +142,11 @@  discard block
 block discarded – undo
142 142
 	    ."' />"
143 143
 	    . "</div>";
144 144
 
145
-	echo redirige_action_post('activer_plugins','activer','admin_plugin','', $corps);
145
+	echo redirige_action_post('activer_plugins', 'activer', 'admin_plugin', '', $corps);
146 146
 
147 147
 	echo fin_cadre_trait_couleur(true);
148 148
 
149
-	if ($quoi=='actifs')
149
+	if ($quoi == 'actifs')
150 150
 		echo affiche_les_plugins_verrouilles($actifs);
151 151
 	echo "</div>";
152 152
 	
@@ -190,15 +190,15 @@  discard block
 block discarded – undo
190 190
 {
191 191
 	if ((!$liste = liste_plugin_files(_DIR_PLUGINS_DIST))) return '';
192 192
 
193
-	$afficher = charger_fonction("afficher_liste",'plugins');
193
+	$afficher = charger_fonction("afficher_liste", 'plugins');
194 194
 	$liste = $afficher(self(), $liste, array(), $actifs, _DIR_PLUGINS_DIST);
195 195
 
196 196
 	return 
197 197
 		"<div id='plugins_dist'>"
198
-		. debut_cadre_trait_couleur('',true,'',_T('plugins_liste_dist'), 'liste_plugins_dist')
198
+		. debut_cadre_trait_couleur('', true, '', _T('plugins_liste_dist'), 'liste_plugins_dist')
199 199
 		. "<p>"
200 200
 		. _T('plugin_info_plugins_dist_1', array('plugins_dist' => joli_repertoire(_DIR_PLUGINS_DIST)))
201
-		. '<br />'. _T('plugin_info_plugins_dist_2')
201
+		. '<br />'._T('plugin_info_plugins_dist_2')
202 202
 		. "</p>"
203 203
 		. $liste
204 204
 		. fin_cadre_trait_couleur(true)
@@ -210,7 +210,7 @@  discard block
 block discarded – undo
210 210
  *
211 211
  * @return <type>
212 212
  */
213
-function afficher_librairies(){
213
+function afficher_librairies() {
214 214
 
215 215
 	if (!$libs = liste_librairies()) return '';
216 216
 	ksort($libs);
Please login to merge, or discard this patch.
ecrire/xml/indenter.php 1 patch
Spacing   +9 added lines, -9 removed lines patch added patch discarded remove patch
@@ -16,22 +16,22 @@  discard block
 block discarded – undo
16 16
 
17 17
 // http://doc.spip.org/@debutElement
18 18
 function debutElement($phraseur, $name, $attrs)
19
-{ xml_debutElement($this, $name, $attrs);}
19
+{ xml_debutElement($this, $name, $attrs); }
20 20
 
21 21
 // http://doc.spip.org/@finElement
22 22
 function finElement($phraseur, $name)
23
-{ xml_finElement($this, $name);}
23
+{ xml_finElement($this, $name); }
24 24
 
25 25
 // http://doc.spip.org/@textElement
26 26
 function textElement($phraseur, $data)
27
-{ xml_textElement($this, $data);}
27
+{ xml_textElement($this, $data); }
28 28
 
29 29
 function piElement($phraseur, $target, $data)
30
-{ xml_PiElement($this, $target, $data);}
30
+{ xml_PiElement($this, $target, $data); }
31 31
 
32 32
 // http://doc.spip.org/@defautElement
33 33
 function defaultElement($phraseur, $data)
34
-{  xml_defaultElement($this, $data);}
34
+{  xml_defaultElement($this, $data); }
35 35
 
36 36
 // http://doc.spip.org/@phraserTout
37 37
 function phraserTout($phraseur, $data)
@@ -52,14 +52,14 @@  discard block
 block discarded – undo
52 52
 }
53 53
 
54 54
 // http://doc.spip.org/@xml_indenter_dist
55
-function xml_indenter_dist($page, $apply=false)
55
+function xml_indenter_dist($page, $apply = false)
56 56
 {
57 57
 	$sax = charger_fonction('sax', 'xml');
58 58
 	$f = new IndenteurXML();
59 59
 	$sax($page, $apply, $f);
60
-	if (!$f->err) return $f->entete . $f->res;
61
-	spip_log("indentation impossible " . count($f->err) . " erreurs de validation");
62
-	return $f->entete . $f->page;
60
+	if (!$f->err) return $f->entete.$f->res;
61
+	spip_log("indentation impossible ".count($f->err)." erreurs de validation");
62
+	return $f->entete.$f->page;
63 63
 }
64 64
 
65 65
 ?>
Please login to merge, or discard this patch.
ecrire/xml/sax.php 1 patch
Spacing   +37 added lines, -38 removed lines patch added patch discarded remove patch
@@ -20,14 +20,14 @@  discard block
 block discarded – undo
20 20
  * @param string $texte
21 21
  * @return string
22 22
  */
23
-function xml_entites_html($texte){
23
+function xml_entites_html($texte) {
24 24
 	if (!is_string($texte) OR !$texte
25
-	OR strpbrk($texte, "&\"'<>")==false
25
+	OR strpbrk($texte, "&\"'<>") == false
26 26
 	) return $texte;
27 27
 
28 28
 	if (!function_exists('spip_htmlspecialchars'))
29 29
 		include_spip("inc/filtres_mini");
30
-	$texte = spip_htmlspecialchars($texte,ENT_QUOTES);
30
+	$texte = spip_htmlspecialchars($texte, ENT_QUOTES);
31 31
 	return $texte;
32 32
 }
33 33
 
@@ -40,40 +40,40 @@  discard block
 block discarded – undo
40 40
 	// espace initial signifie: deja integree au resultat
41 41
 	if ($t[0] != ' ')
42 42
 	  {
43
-	    $phraseur->res .= '<' . $t . '>';
44
-	    $phraseur->ouvrant[$depth] = ' ' . $t;
43
+	    $phraseur->res .= '<'.$t.'>';
44
+	    $phraseur->ouvrant[$depth] = ' '.$t;
45 45
 	  }
46 46
 	$t = $phraseur->contenu[$depth];
47 47
 	// n'indenter que s'il y a un separateur avant
48
-	$phraseur->res .= preg_replace("/[\n\t ]+$/",  "\n$depth", $t);
48
+	$phraseur->res .= preg_replace("/[\n\t ]+$/", "\n$depth", $t);
49 49
 	$phraseur->contenu[$depth] = "";
50 50
 	$att = '';
51 51
 	$sep = ' ';
52 52
 	foreach ($attrs as $k => $v) {
53 53
 	  $delim = strpos($v, "'") === false ? "'" : '"';
54 54
 	  $val = xml_entites_html($v);
55
-	  $att .= $sep .  $k . "=" . $delim
55
+	  $att .= $sep.$k."=".$delim
56 56
 	    . ($delim !== '"' ? str_replace('&quot;', '"', $val) : $val)
57 57
 	    . $delim;
58 58
 	  $sep = "\n $depth";
59 59
 	}
60 60
 	$phraseur->depth .= '  ';
61 61
 	$phraseur->contenu[$phraseur->depth] = "";
62
-	$phraseur->ouvrant[$phraseur->depth] = $name . $att;
62
+	$phraseur->ouvrant[$phraseur->depth] = $name.$att;
63 63
 	$phraseur->reperes[$phraseur->depth] = xml_get_current_line_number($phraseur->sax);
64 64
 }
65 65
 
66 66
 // http://doc.spip.org/@xml_finElement
67
-function xml_finElement($phraseur, $name, $fusion_bal=false)
67
+function xml_finElement($phraseur, $name, $fusion_bal = false)
68 68
 {
69 69
 	$ouv = $phraseur->ouvrant[$phraseur->depth];
70 70
 
71 71
 	if ($ouv[0] != ' ')
72
-		$phraseur->ouvrant[$phraseur->depth] = ' ' . $ouv;
73
-	else $ouv= "";
72
+		$phraseur->ouvrant[$phraseur->depth] = ' '.$ouv;
73
+	else $ouv = "";
74 74
 	$t = $phraseur->contenu[$phraseur->depth];
75 75
 	$phraseur->depth = substr($phraseur->depth, 2);
76
-	$t = preg_replace("/[\n\t ]+$/", "\n" . $phraseur->depth, $t);
76
+	$t = preg_replace("/[\n\t ]+$/", "\n".$phraseur->depth, $t);
77 77
 
78 78
   // fusion <balise></balise> en <balise />.
79 79
   // ATTENTION,  certains clients http croient que fusion ==> pas d'atttributs
@@ -82,16 +82,16 @@  discard block
 block discarded – undo
82 82
   // (param fusion_bal)
83 83
 
84 84
 	if ($t || (($ouv != $name) AND !$fusion_bal))
85
-	  $phraseur->res .= ($ouv ? ('<' . $ouv . '>') : '') . $t . "</" . $name . ">";
85
+	  $phraseur->res .= ($ouv ? ('<'.$ouv.'>') : '').$t."</".$name.">";
86 86
 	else
87
-	  $phraseur->res .= ($ouv ? ('<' . $ouv  . ' />') : ("</" .  $name . ">"));
87
+	  $phraseur->res .= ($ouv ? ('<'.$ouv.' />') : ("</".$name.">"));
88 88
 }
89 89
 
90 90
 // http://doc.spip.org/@xml_textElement
91 91
 function xml_textElement($phraseur, $data)
92 92
 {
93 93
 	$depth = $phraseur->depth;
94
-	$phraseur->contenu[$depth] .= preg_match('/^script/',$phraseur->ouvrant[$depth])
94
+	$phraseur->contenu[$depth] .= preg_match('/^script/', $phraseur->ouvrant[$depth])
95 95
 	  ? $data
96 96
 	  : xml_entites_html($data);
97 97
 }
@@ -117,43 +117,42 @@  discard block
 block discarded – undo
117 117
 {
118 118
 	$depth = $phraseur->depth;
119 119
 
120
-	if (!isset($phraseur->contenu[$depth])) $phraseur->contenu[$depth]='';
120
+	if (!isset($phraseur->contenu[$depth])) $phraseur->contenu[$depth] = '';
121 121
 	$phraseur->contenu[$depth] .= $data;
122 122
 }
123 123
 
124 124
 // http://doc.spip.org/@xml_parsestring
125 125
 function xml_parsestring($phraseur, $data)
126 126
 {
127
-	$phraseur->contenu[$phraseur->depth] ='';
127
+	$phraseur->contenu[$phraseur->depth] = '';
128 128
 
129 129
 	if (!xml_parse($phraseur->sax, $data, true)) {
130 130
 		coordonnees_erreur($phraseur,
131 131
 			xml_error_string(xml_get_error_code($phraseur->sax))
132
-			. "<br />\n" .
133
-			(!$phraseur->depth ? '' :
134
-			 ('(' .
135
-			  _T('erreur_balise_non_fermee') .
136
-			  " <tt>" .
137
-			  $phraseur->ouvrant[$phraseur->depth] .
138
-			  "</tt> " .
139
-			  _T('ligne') .
140
-			  " " .
141
-			  $phraseur->reperes[$phraseur->depth] .
142
-			  ") <br />\n" )));
132
+			. "<br />\n".
133
+			(!$phraseur->depth ? '' : ('('.
134
+			  _T('erreur_balise_non_fermee').
135
+			  " <tt>".
136
+			  $phraseur->ouvrant[$phraseur->depth].
137
+			  "</tt> ".
138
+			  _T('ligne').
139
+			  " ".
140
+			  $phraseur->reperes[$phraseur->depth].
141
+			  ") <br />\n")));
143 142
 	}
144 143
 }
145 144
 
146 145
 // http://doc.spip.org/@coordonnees_erreur
147 146
 function coordonnees_erreur($phraseur, $msg)
148 147
 {
149
-	$entete_length = substr_count($phraseur->entete,"\n");
148
+	$entete_length = substr_count($phraseur->entete, "\n");
150 149
 	$phraseur->err[] = array($msg,
151 150
 		xml_get_current_line_number($phraseur->sax) + $entete_length,
152 151
 		xml_get_current_column_number($phraseur->sax));
153 152
 }
154 153
 
155 154
 // http://doc.spip.org/@xml_sax_dist
156
-function xml_sax_dist($page, $apply=false, $phraseur=NULL, $doctype='', $charset=null)
155
+function xml_sax_dist($page, $apply = false, $phraseur = NULL, $doctype = '', $charset = null)
157 156
 {
158 157
 	if (is_null($charset))
159 158
 		$charset = $GLOBALS['meta']['charset'];
@@ -173,12 +172,12 @@  discard block
 block discarded – undo
173 172
 	// et escamoter le doctype que sax mange en php5 mais pas en  php4
174 173
 	if (!$doctype) {
175 174
 		if (!$r = analyser_doctype($page)) {
176
-			$page = _MESSAGE_DOCTYPE . _DOCTYPE_ECRIRE
175
+			$page = _MESSAGE_DOCTYPE._DOCTYPE_ECRIRE
177 176
 			  . preg_replace(_REGEXP_DOCTYPE, '', $page);
178
-			$r =  analyser_doctype($page);
177
+			$r = analyser_doctype($page);
179 178
 		}
180 179
 		list($entete, $avail, $grammaire, $rotlvl) = array_pad($r, 4, null);
181
-		$page = substr($page,strlen($entete));
180
+		$page = substr($page, strlen($entete));
182 181
 	} else {
183 182
 		$avail = 'SYSTEM';
184 183
 		$grammaire = $doctype;
@@ -232,7 +231,7 @@  discard block
 block discarded – undo
232 231
 // sinon on se rabat sur ce qu'en connait SPIP en standard.
233 232
 
234 233
 // http://doc.spip.org/@sax_bug
235
-function sax_bug($data, $dtc, $charset=null)
234
+function sax_bug($data, $dtc, $charset = null)
236 235
 {
237 236
 	if (is_null($charset))
238 237
 		$charset = $GLOBALS['meta']['charset'];
@@ -240,7 +239,7 @@  discard block
 block discarded – undo
240 239
 	if ($dtc) {
241 240
 		$trans = array();
242 241
 		
243
-		foreach($dtc->entites as $k => $v) {
242
+		foreach ($dtc->entites as $k => $v) {
244 243
 			if (!strpos(" amp lt gt quot ", $k))
245 244
 			    $trans["&$k;"] = $v;
246 245
 		}
@@ -268,16 +267,16 @@  discard block
 block discarded – undo
268 267
 				       _DOCTYPE_RSS,
269 268
 					     'rss-0.91.dtd');
270 269
 			else {
271
-				$dtd = $topelement . '.dtd';
270
+				$dtd = $topelement.'.dtd';
272 271
 				$f = find_in_path($dtd);
273 272
 				if (file_exists($f))
274 273
 				  return array($entete, 'SYSTEM', $f, $dtd);
275 274
 			}
276 275
 		}
277
-		spip_log("Dtd pas vu pour " . substr($data, 0, 100));
276
+		spip_log("Dtd pas vu pour ".substr($data, 0, 100));
278 277
 		return array();
279 278
 	}
280
-	list($entete,, $topelement, $avail,$suite) = $page;
279
+	list($entete,, $topelement, $avail, $suite) = $page;
281 280
 
282 281
 	if (!preg_match('/^"([^"]*)"\s*(.*)$/', $suite, $r))
283 282
 		if (!preg_match("/^'([^']*)'\s*(.*)$/", $suite, $r))
Please login to merge, or discard this patch.