Changeset 5812 in spip-zone
- Timestamp:
- Oct 1, 2006, 4:19:39 PM (15 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
_plugins_/_dev_/rangement_plugs/exec/rangement_plugin.php
r5790 r5812 139 139 140 140 echo "<ul>"; 141 141 142 142 # Ecrire les plugins deja actives. 143 143 $meta_plugin = isset($GLOBALS['meta']['plugin'])?$GLOBALS['meta']['plugin']:''; … … 201 201 } 202 202 203 else {204 echo "<tr><td bgcolor='$couleur_foncee' background='' colspan='4'><b>";203 else if (_request('famille')!='' && _request('Valider')!='Valider') { 204 echo "<tr><td bgcolor='$couleur_foncee' background='' colspan='4'><b>"; 205 205 echo "<font face='Verdana,Arial,Sans,sans-serif' size='3' color='#ffffff'>"; 206 206 echo _T('rangement:plugins_liste_famille')."</font></b></td></tr>"; … … 216 216 echo generer_url_post_ecrire("rangement_plugin", 'famille='._request('famille')); 217 217 } 218 218 219 219 echo "<ul>"; 220 220 … … 233 233 $recherche_nom = eregi(_DIR_PLUGINS.'(.*)', $chemin_dossier, $nom_chemin); 234 234 $dossier_plugin = $nom_chemin[1]; 235 $nom_plugin = $nom_chemin[1]; 235 236 } 236 237 else if ($xml_racine) { 237 238 $recherche_nom = eregi(_DIR_PLUGINS.'(.*)\/(.*)', $chemin_dossier, $nom_chemin); 238 239 $dossier_plugin = $nom_chemin[1]."/".$nom_chemin[2]; 240 $nom_plugin = $nom_chemin[2]; 239 241 } 240 242 241 243 $fichiers_plugin=array(); 242 244 $fichiers_plugin[]=substr(dirname($fichier), strlen(_DIR_PLUGINS)); 245 246 lire_fichier($fichier, $texte); 247 $arbre = parse_plugin_xml($texte); 248 $arbre = $arbre['plugin'][0]; 249 250 $nom_plugin = applatit_arbre($arbre['nom']); 251 $auteur_plugin = applatit_arbre($arbre['auteur']); 252 $etat_plugin = applatit_arbre($arbre['etat']); 253 $version_plugin = applatit_arbre($arbre['version']); 254 $description_plugin = applatit_arbre($arbre['description']); 255 $fonctions_plugin = trim(applatit_arbre($arbre['fonctions'])); 256 $options_plugin = trim(applatit_arbre($arbre['options'])); 257 $prefix_plugin = trim(applatit_arbre($arbre['prefix'])); 258 259 if (isset($etat_plugin)) 260 $etat = trim($etat_plugin); 261 switch ($etat) { 262 case 'experimental': 263 $couleur_txt = "CA2F2F"; 264 $titre_etat = _T('rangement:plugin_etat_experimental'); 265 break; 266 case 'test': 267 $couleur_txt = "E85600"; 268 $titre_etat = _T('rangement:plugin_etat_test'); 269 break; 270 case 'stable': 271 $couleur_txt = "149E06"; 272 $titre_etat = _T('rangement:plugin_etat_stable'); 273 break; 274 default: 275 $couleur_txt = "900B06"; 276 $titre_etat = _T('rangement:plugin_etat_developpement'); 277 break; 278 } 279 280 $plug_actif = ""; 281 $meta_plugin = isset($GLOBALS['meta']['plugin'])?$GLOBALS['meta']['plugin']:''; 282 $plugin_actif = eregi($dossier_plugin, $meta_plugin, $plug_actif); 283 284 if ($plug_actif[0] != "") { 285 $checked = " value='O' checked='checked'"; 286 } 287 else { 288 $checked = " value='O'"; 289 } 290 291 debut_boite_info(); 292 echo "<input type='checkbox' name='statusplug_$dossier_plugin'$checked>"; 293 echo "<strong>".$nom_plugin."</strong>(version ".$version_plugin.")<label for='label_$id_input' style='display:none'>"._T('activer_plugin')."</label>"; 294 echo "<br /><hr>"; 295 echo "<small>".propre($description_plugin)."</small><br /><hr>"; 296 echo propre($auteur_plugin)."<br /><hr>"; 297 echo "<img src='"._DIR_PLUGIN_RANGEMENT_PLUGS."/../img_pack/".$etat.".png' />"; 298 echo " <small><strong><font COLOR='#".$couleur_txt."'>".$titre_etat."</font></strong></small><br />"; 299 fin_boite_info(); 300 } 301 302 echo "</ul>"; 303 304 } 305 306 else { 307 echo "<tr><td bgcolor='$couleur_foncee' background='' colspan='4'><b>"; 308 echo "<font face='Verdana,Arial,Sans,sans-serif' size='3' color='#ffffff'>"; 309 echo _T('rangement:plugins_liste_famille')."</font></b></td></tr>"; 310 311 echo "<tr><td class='serif' colspan=4>"; 312 echo _T('rangement:texte_presente_plugin_famille'); 313 314 if (_request('famille')=='') { 315 echo generer_url_post_ecrire("rangement_plugin"); 316 } 317 318 else if (_request('famille')!='') { 319 echo generer_url_post_ecrire("rangement_plugin", 'famille='._request('famille')); 320 } 321 322 echo "<ul>"; 323 324 # Ecrire les plugins de la meme famille. Decouper tout ca en fonctions. 325 326 if ($xml_encours) { 327 $xml = $xml_encours; 328 } 329 else if ($xml_racine) { 330 $xml = $xml_racine; 331 } 332 333 foreach ($xml as $fichier){ 334 $chemin_dossier = dirname ($fichier); 335 if ($xml_encours) { 336 $recherche_nom = eregi(_DIR_PLUGINS.'(.*)', $chemin_dossier, $nom_chemin); 337 $dossier_plugin = $nom_chemin[1]; 338 $nom_plugin = $nom_chemin[1]; 339 } 340 else if ($xml_racine) { 341 $recherche_nom = eregi(_DIR_PLUGINS.'(.*)\/(.*)', $chemin_dossier, $nom_chemin); 342 $dossier_plugin = $nom_chemin[1]."/".$nom_chemin[2]; 343 $nom_plugin = $nom_chemin[2]; 344 } 345 346 $fichiers_plugin=array(); 347 $fichiers_plugin[]=substr(dirname($fichier), strlen(_DIR_PLUGINS)); 348 349 lire_fichier($fichier, $texte); 350 $arbre = parse_plugin_xml($texte); 351 $arbre = $arbre['plugin'][0]; 352 353 $nom_plugin = applatit_arbre($arbre['nom']); 354 $auteur_plugin = applatit_arbre($arbre['auteur']); 355 $etat_plugin = applatit_arbre($arbre['etat']); 356 $version_plugin = applatit_arbre($arbre['version']); 357 $description_plugin = applatit_arbre($arbre['description']); 358 $fonctions_plugin = trim(applatit_arbre($arbre['fonctions'])); 359 $options_plugin = trim(applatit_arbre($arbre['options'])); 360 $prefix_plugin = trim(applatit_arbre($arbre['prefix'])); 243 361 244 362 $testo = array(); … … 262 380 effacer_meta('plugin',$filo); 263 381 ecrire_metas(); 382 echo "efface !"; 264 383 } 265 384 … … 274 393 ecrire_meta('plugin',$lire_meta_plugin.','.$plugin[0]); 275 394 ecrire_metas(); 395 396 $fichier_options = _DIR_TMP."charger_plugins_options.php"; 397 $lire_fichier = file_get_contents($fichier_options); 398 $plugin_deja_active = eregi($prefix_plugin, $lire_fichier, $plugin_present); 399 400 if (!isset($plugin_present[0])){ 401 echo "le plugin devrait secrire dans charger options"; 402 $prefix = strtoupper($prefix_plugin); 403 $splugs .= '$GLOBALS[\'plugins\'][]=\''.trim($prefix_plugin).'\';'; 404 $splugs .= "define(_DIR_PLUGINS_$prefix,_DIR_PLUGINS.'$plugin[0]/');"; 405 if ($options_plugin){ 406 $splugs .= "\n@include_once _DIR_PLUGINS.'$plugin[0]/".trim($options_plugin)."';\n"; 407 } 408 $splugs .= "\n\n?>"; 409 $contenu_modifie = str_replace ('?>', $splugs, $lire_fichier); 410 ecrire_fichier(_DIR_TMP."charger_plugins_options.php", $contenu_modifie); 411 echo $fonctions_plugin; 412 413 if (isset($fonctions_plugin)){ 414 echo "les fonctions doivent secrire"; 415 $fichier_fonctions = _DIR_TMP."charger_plugins_fonctions.php"; 416 $lire_fichier_fonctions = file_get_contents($fichier_fonctions); 417 $plugin_deja_active_fonctions = eregi($prefix_plugin, $lire_fichier_fonctions, $plugin_present_fonctions); 418 $splugsfct .= "\n@include_once _DIR_PLUGINS.'$plugin[0]/".trim($fonctions_plugin)."';\n"; 419 $splugsfct .= "\n\n?>"; 420 421 if (!isset($plugin_present_fonctions[0])) { 422 $contenu_modifie_fonctions = str_replace ('?>', $splugsfct, $lire_fichier_fonctions); 423 ecrire_fichier(_DIR_TMP."charger_plugins_fonctions.php", $contenu_modifie_fonctions); 424 } 425 } 426 } 427 276 428 } 429 } 277 430 } 278 } 279 } 280 281 282 lire_fichier($fichier, $texte); 283 $arbre = parse_plugin_xml($texte); 284 $arbre = $arbre['plugin'][0]; 285 286 $nom_plugin = applatit_arbre($arbre['nom']); 287 $auteur_plugin = applatit_arbre($arbre['auteur']); 288 $etat_plugin = applatit_arbre($arbre['etat']); 289 $version_plugin = applatit_arbre($arbre['version']); 290 $description_plugin = applatit_arbre($arbre['description']); 431 } 291 432 292 433
Note: See TracChangeset
for help on using the changeset viewer.