Completed
Push — master ( 012705...9a8729 )
by cam
01:11
created
ecrire/plugins/afficher_plugin.php 1 patch
Spacing   +35 added lines, -36 removed lines patch added patch discarded remove patch
@@ -57,18 +57,18 @@  discard block
 block discarded – undo
57 57
 		$class_li .= " error";
58 58
 		$erreur = http_img_pack("plugin-err-32.png", _T('plugin_info_erreur_xml'), " class='picto_err'",
59 59
 				_T('plugin_info_erreur_xml'))
60
-			. "<div class='erreur'>" . join('<br >', $info['erreur']) . "</div>";
60
+			. "<div class='erreur'>".join('<br >', $info['erreur'])."</div>";
61 61
 		$checkable = false;
62 62
 
63
-	} elseif (isset($GLOBALS['erreurs_activation_raw'][$dir_plugins . $plug_file])) {
63
+	} elseif (isset($GLOBALS['erreurs_activation_raw'][$dir_plugins.$plug_file])) {
64 64
 		$class_li .= " error";
65 65
 		$erreur = http_img_pack("plugin-err-32.png", _T('plugin_impossible_activer', array('plugin' => $nom)),
66 66
 				" class='picto_err'", _T('plugin_impossible_activer', array('plugin' => $nom)))
67
-			. "<div class='erreur'>" . implode("<br />",
68
-				$GLOBALS['erreurs_activation_raw'][$dir_plugins . $plug_file]) . "</div>";
67
+			. "<div class='erreur'>".implode("<br />",
68
+				$GLOBALS['erreurs_activation_raw'][$dir_plugins.$plug_file])."</div>";
69 69
 	} else {
70 70
 		$cfg = $actif ? plugin_bouton_config($plug_file, $info, $dir_plugins) : "";
71
-		if (defined('_DEV_VERSION_SPIP_COMPAT') and !plugin_version_compatible($info['compatibilite'], $GLOBALS['spip_version_branche'])){
71
+		if (defined('_DEV_VERSION_SPIP_COMPAT') and !plugin_version_compatible($info['compatibilite'], $GLOBALS['spip_version_branche'])) {
72 72
 			//$info['slogan'] = _T('plugin_info_non_compatible_spip');
73 73
 			$erreur = http_img_pack("plugin-dis-32.png", _T('plugin_info_non_compatible_spip'), " class='picto_err picto_compat_forcee'",
74 74
 				_L('Version incompatible : compatibilité forcée'));
@@ -78,11 +78,11 @@  discard block
 block discarded – undo
78 78
 	// numerotons les occurrences d'un meme prefix
79 79
 	$versions[$prefix] = $id = isset($versions[$prefix]) ? intval($versions[$prefix]) + 1 : '';
80 80
 
81
-	$class_li .= ($actif ? " actif" : "") . ($expose ? " on" : "");
81
+	$class_li .= ($actif ? " actif" : "").($expose ? " on" : "");
82 82
 
83 83
 	return "<li id='$prefix$id' class='$class_li'>"
84 84
 	. ((!$checkable and !$checked)
85
-		? '' : plugin_checkbox(++$id_input, $dir_plugins . $plug_file, $checked))
85
+		? '' : plugin_checkbox(++$id_input, $dir_plugins.$plug_file, $checked))
86 86
 	. plugin_resume($info, $dir_plugins, $plug_file, $url_page)
87 87
 	. $cfg
88 88
 	. $erreur
@@ -100,9 +100,9 @@  discard block
 block discarded – undo
100 100
 	$prefix = strtolower($infos['prefix']);
101 101
 	// si paquet.xml fournit un squelette, le prendre
102 102
 	if (isset($infos['config']) and $infos['config']) {
103
-		return recuperer_fond("$dir$nom/" . $infos['config'],
103
+		return recuperer_fond("$dir$nom/".$infos['config'],
104 104
 			array(
105
-				'script' => 'configurer_' . $prefix,
105
+				'script' => 'configurer_'.$prefix,
106 106
 				'nom' => $nom
107 107
 			));
108 108
 	}
@@ -120,7 +120,7 @@  discard block
 block discarded – undo
120 120
 	// sinon prendre le squelette std sur le nom std
121 121
 	return recuperer_fond("prive/squelettes/inclure/cfg",
122 122
 		array(
123
-			'script' => 'configurer_' . $prefix,
123
+			'script' => 'configurer_'.$prefix,
124 124
 			'nom' => $nom
125 125
 		));
126 126
 }
@@ -135,7 +135,7 @@  discard block
 block discarded – undo
135 135
 	. "<input type='checkbox' name='s$name' id='label_$id_input'"
136 136
 	. ($actif ? " checked='checked'" : "")
137 137
 	. " class='checkbox'  value='O' />"
138
-	. "\n<label for='label_$id_input'>" . _T('activer_plugin') . "</label>"
138
+	. "\n<label for='label_$id_input'>"._T('activer_plugin')."</label>"
139 139
 	. "</div>";
140 140
 }
141 141
 
@@ -190,11 +190,11 @@  discard block
 block discarded – undo
190 190
 	. "<h3><a href='$url' rel='info'>"
191 191
 	. $nom
192 192
 	. "</a></h3>"
193
-	. " <span class='version'>" . $info['version'] . "</span>"
193
+	. " <span class='version'>".$info['version']."</span>"
194 194
 	. " <span class='etat'> - "
195 195
 	. plugin_etat_en_clair($info['etat'])
196 196
 	. "</span>"
197
-	. "<div class='short'>" . $slogan . "</div>"
197
+	. "<div class='short'>".$slogan."</div>"
198 198
 	. $i
199 199
 	. "</div>";
200 200
 }
@@ -209,7 +209,7 @@  discard block
 block discarded – undo
209 209
 	$text2 = _T('info_desinstaller_plugin');
210 210
 	$file = basename($plug_file);
211 211
 
212
-	return "<div class='actions'>[" .
212
+	return "<div class='actions'>[".
213 213
 	"<a href='$action'
214 214
 		onclick='return confirm(\"$text $nom ?\\n$text2\")'>"
215 215
 	. $text
@@ -231,17 +231,17 @@  discard block
 block discarded – undo
231 231
 		$etat = 'developpement';
232 232
 	}
233 233
 
234
-	return _T('plugin_etat_' . $etat);
234
+	return _T('plugin_etat_'.$etat);
235 235
 }
236 236
 
237 237
 // https://code.spip.net/@plugin_propre
238
-function plugin_propre($texte, $module = '',$propre='propre') {
238
+function plugin_propre($texte, $module = '', $propre = 'propre') {
239 239
 	// retirer le retour a la racine du module, car le find_in_path se fait depuis la racine
240 240
 	if (_DIR_RACINE and strncmp($module, _DIR_RACINE, strlen(_DIR_RACINE)) == 0) {
241 241
 		$module = substr($module, strlen(_DIR_RACINE));
242 242
 	}
243 243
 	if (preg_match("|^\w+_[\w_]+$|", $texte)) {
244
-		$texte = _T(($module ? "$module:" : '') . $texte, array(), array('force' => false));
244
+		$texte = _T(($module ? "$module:" : '').$texte, array(), array('force' => false));
245 245
 	}
246 246
 
247 247
 	return $propre($texte);
@@ -273,9 +273,9 @@  discard block
 block discarded – undo
273 273
 	if (isset($info['documentation'])
274 274
 		and $lien = $info['documentation']
275 275
 	) {
276
-		$description .= "<p><em class='site'><a href='$lien' class='spip_out'>" . _T('en_savoir_plus') . '</a></em></p>';
276
+		$description .= "<p><em class='site'><a href='$lien' class='spip_out'>"._T('en_savoir_plus').'</a></em></p>';
277 277
 	}
278
-	$s .= "<dd class='desc'>" . $description . "</dd>\n";
278
+	$s .= "<dd class='desc'>".$description."</dd>\n";
279 279
 
280 280
 	if (isset($info['auteur'])) {
281 281
 		if (is_array($info['auteur'])) {
@@ -285,15 +285,15 @@  discard block
 block discarded – undo
285 285
 			$a = trim($info['auteur']);
286 286
 		}
287 287
 		if ($a) {
288
-			$s .= "<dt class='auteurs'>" . _T('public:par_auteur') . "</dt><dd class='auteurs'>" . PtoBR(propre($a,
289
-					$dir)) . "</dd>\n";
288
+			$s .= "<dt class='auteurs'>"._T('public:par_auteur')."</dt><dd class='auteurs'>".PtoBR(propre($a,
289
+					$dir))."</dd>\n";
290 290
 		}
291 291
 	}
292 292
 
293 293
 	if (isset($info['credit'])) {
294 294
 		if ($a = formater_credits($info['credit'], ', ')) {
295
-			$s .= "<dt class='credits'>" . _T('plugin_info_credit') . "</dt><dd class='credits'>" . PtoBR(propre($a,
296
-					$dir)) . "</dd>\n";
295
+			$s .= "<dt class='credits'>"._T('plugin_info_credit')."</dt><dd class='credits'>".PtoBR(propre($a,
296
+					$dir))."</dd>\n";
297 297
 		}
298 298
 	}
299 299
 
@@ -305,8 +305,8 @@  discard block
 block discarded – undo
305 305
 			$a = trim($info['licence']);
306 306
 		}
307 307
 		if ($a) {
308
-			$s .= "<dt class='licence'>" . _T('intitule_licence') . "</dt><dd class='licence'>" . PtoBR(propre($a,
309
-					$dir)) . "</dd>\n";
308
+			$s .= "<dt class='licence'>"._T('intitule_licence')."</dt><dd class='licence'>".PtoBR(propre($a,
309
+					$dir))."</dd>\n";
310 310
 		}
311 311
 	}
312 312
 
@@ -317,23 +317,22 @@  discard block
 block discarded – undo
317 317
 	//
318 318
 	$infotech = array();
319 319
 
320
-	$version = "<dt>" . _T('version') . "</dt><dd>" . $info['version'];
320
+	$version = "<dt>"._T('version')."</dt><dd>".$info['version'];
321 321
 	// Version VCS
322
-	if ($vcs = version_vcs_courante($dir_plugins . $plug_file)) {
323
-		$version .= ' ' . $vcs;
322
+	if ($vcs = version_vcs_courante($dir_plugins.$plug_file)) {
323
+		$version .= ' '.$vcs;
324 324
 	}
325 325
 	$version .= "</dd>";
326 326
 	$infotech[] = $version;
327
-	$infotech[] = "<dt>" . _T('repertoire_plugins') . "</dt><dd>" . joli_repertoire("$dir_plugins$plug_file") . "</dd>";
327
+	$infotech[] = "<dt>"._T('repertoire_plugins')."</dt><dd>".joli_repertoire("$dir_plugins$plug_file")."</dd>";
328 328
 	// source zip le cas echeant
329
-	$infotech[] = (lire_fichier($dir_plugins . $plug_file . '/install.log', $log)
329
+	$infotech[] = (lire_fichier($dir_plugins.$plug_file.'/install.log', $log)
330 330
 		and preg_match(',^source:(.*)$,m', $log, $r))
331
-		? '<dt>' . _T('plugin_source') . '</dt><dd>' . trim($r[1]) . "</dd>"
331
+		? '<dt>'._T('plugin_source').'</dt><dd>'.trim($r[1])."</dd>"
332 332
 		: '';
333 333
 
334
-	$infotech[] = !$info['necessite'] ? '' :
335
-		('<dt>' . _T('plugin_info_necessite') . '</dt><dd>' . join(' ',
336
-				array_map('array_shift', $info['necessite'])) . '</dd>');
334
+	$infotech[] = !$info['necessite'] ? '' : ('<dt>'._T('plugin_info_necessite').'</dt><dd>'.join(' ',
335
+				array_map('array_shift', $info['necessite'])).'</dd>');
337 336
 
338 337
 	$s .= "<dl class='tech'>"
339 338
 		. join('', $infotech)
@@ -354,8 +353,8 @@  discard block
 block discarded – undo
354 353
 		$texte .=
355 354
 			(!is_array($_credit))
356 355
 				? PtoBR(propre($_credit))
357
-				: ($_credit['url'] ? '<a href="' . $_credit['url'] . '">' : '') .
358
-				$_credit['nom'] .
356
+				: ($_credit['url'] ? '<a href="'.$_credit['url'].'">' : '').
357
+				$_credit['nom'].
359 358
 				($_credit['url'] ? '</a>' : '');
360 359
 	}
361 360
 
Please login to merge, or discard this patch.