Changeset 3559 for extensions/music_player/admin/admin.php
- Timestamp:
- Jul 9, 2009, 6:54:57 PM (15 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
extensions/music_player/admin/admin.php
r3557 r3559 361 361 if ($_POST['envoi_config']=='lecteur') 362 362 { 363 363 if ($_POST['style']=='NULL') 364 { 365 $style=$conf_lecteur['9']; 366 } 367 else 368 { 369 $style=$_POST['style']; 370 } 364 371 365 372 if ($_POST['mp_miniature']=="true") … … 375 382 $_POST['mp_autostart'], 376 383 $_POST['mp_autoscroll'], 377 $ _POST['style'],384 $style, 378 385 $_POST['various_style'], 379 386 ); … … 392 399 $_POST['mp_autostart'], 393 400 $_POST['mp_autoscroll'], 394 $ _POST['style'],401 $style, 395 402 $_POST['various_style'], 396 403 ); … … 430 437 431 438 $check='checked="checked"'; 432 if ($conf_lecteur[3]=='true') $miniature=$check;433 if ($conf_lecteur[5]=='true') $shuffle=$check;434 if ($conf_lecteur[6]=='true') $repeat=$check;435 if ($conf_lecteur[8]=='true') $autoscroll=$check;436 if ($conf_lecteur[10]=='true') $various_style=$check;439 if ($conf_lecteur[3]=='true') { $miniature=$check; } else { $miniature=NULL; } 440 if ($conf_lecteur[5]=='true') { $shuffle=$check; } else { $shuffle=NULL; } 441 if ($conf_lecteur[6]=='true') { $repeat=$check; } else { $repeat=NULL; } 442 if ($conf_lecteur[8]=='true') { $autoscroll=$check; } else { $autoscroll=NULL; } 443 if ($conf_lecteur[10]=='true') { $various_style=$check; } else { $various_style=NULL; } 437 444 438 445 if ($conf_lecteur[7]!='0') … … 444 451 else {$txt="Defaut"; } 445 452 446 if ($conf_plugin[0]=='true') $evidence=$check;447 if ($conf_plugin[1]=='true') $head=$check;448 if ($conf_plugin[2]=='true') $foot=$check;453 if ($conf_plugin[0]=='true') { $evidence=$check; } else { $evidence=NULL; } 454 if ($conf_plugin[1]=='true') { $head=$check; } else { $head=NULL; } 455 if ($conf_plugin[2]=='true') { $foot=$check; } else { $foot=NULL; } 449 456 450 457 //////////////////////////////////////////////// 451 458 ////////[ liste des styles globaux ////////// 452 459 //////////////////////////////////////////////// 453 $fichier = array();460 /*$fichier = array(); 454 461 $dir = opendir('./plugins/music_player/template/style'); //ouvre le repertoire courant désigné par la variable 455 462 while(false!==($file = readdir($dir))){ //on lit tout et on récupere tout les dossiers dans $folder … … 478 485 natcasesort($fichier); //la fonction natcasesort( ) est la fonction de tri standard sauf qu'elle ignore la casse 479 486 480 481 foreach($fichier as $file) { 482 if ($conf_lecteur[9]==$file) 483 { 487 */ 488 489 function recursive_readdir ($dir) { 490 global $conf, $template; 491 $conf_lecteur = explode("," , $conf['mp_lecteur']); 492 $dh = opendir ($dir); // on l'ouvre 493 while (($file = readdir ($dh)) !== false ) { //boucle pour parcourir le repertoire 494 if ($file !== '.' && $file !== '..') { // no comment 495 $path =$dir.'/'.$file; // construction d'un joli chemin... 496 if (is_dir ($path)) { //si on tombe sur un sous-repertoire 497 //echo '<p style="font-weight: bold; border : 1pt solid #000000;">', $path, ' -> dir</p>'; // ptit style... 498 recursive_readdir ($path); // appel recursif pour lire a l'interieur de ce sous-repertoire 499 } 500 else 501 { 502 //echo $path, '<br />'; // si il s'agit d'un fichier, on affiche, tout simplement. 503 $page = explode('.', $file); 504 $nb = count($page); 505 $nom_fichier = $page[0]; 506 for ($i = 1; $i < $nb-1; $i++){ 507 $nom_fichier .= '.'.$page[$i]; 508 } 509 if(isset($page[1])){ 510 $ext_fichier = $page[$nb-2].'.'.$page[$nb-1]; 511 } 512 else { 513 $ext_fichier = ''; 514 } 484 515 485 $template->append('list_style', 486 array('FILE' => $file, 487 'TEXTE' => '->'.$file, 488 )); 489 } 490 else 491 { 492 $template->append('list_style', 493 array('FILE' => $file, 494 'TEXTE' => $file, 495 )); 516 if($ext_fichier == 'conf.php') { //On ne prend que les css 517 $path = str_replace("/plugins/music_player", "", $path); 518 if ($conf_lecteur[9]==$path) 519 { 520 $template->append('list_style', 521 array('FILE' => $path, 522 'TEXTE' => ' --> '.$path, 523 )); 524 } 525 else 526 { 527 $template->append('list_style', 528 array('FILE' => $path, 529 'TEXTE' => $path, 530 )); 531 } 532 } 533 } 496 534 } 497 535 } 536 closedir ($dh); // on ferme le repertoire courant 537 } 538 recursive_readdir ('./plugins/music_player/template/style'); 539 498 540 499 541 500 542 ////assignement des valeurs 501 if (isset($foot) and isset($head) and isset($shuffle) and isset($repeat)){502 543 $template->assign( 503 544 array( … … 521 562 ) 522 563 ); 523 } 564 524 565 // +-----------------------------------------------------------------------+ 525 566 // | affichage des msg |
Note: See TracChangeset
for help on using the changeset viewer.