plxPlugins->callHook('AdminMediasPrepend')); # Recherche du type de medias à afficher via la session if(empty($_SESSION['medias']) OR !empty($_POST['btn_images'])) { $_SESSION['medias'] = $plxAdmin->aConf['images']; $_SESSION['folder'] = ''; } elseif(!empty($_POST['btn_documents'])) { $_SESSION['medias'] = $plxAdmin->aConf['documents']; $_SESSION['folder'] = ''; } elseif(!empty($_POST['folder'])) { $_SESSION['currentfolder']= (isset($_SESSION['folder'])?$_SESSION['folder']:''); $_SESSION['folder'] = ($_POST['folder']=='.'?'':$_POST['folder']); } # Nouvel objet de type plxMedias if($plxAdmin->aConf['userfolders'] AND $_SESSION['profil']==PROFIL_WRITER) $plxMedias = new plxMedias(PLX_ROOT.$_SESSION['medias'].$_SESSION['user'].'/',$_SESSION['folder']); else $plxMedias = new plxMedias(PLX_ROOT.$_SESSION['medias'],$_SESSION['folder']); #---- if(!empty($_POST['btn_newfolder']) AND !empty($_POST['newfolder'])) { $newdir = plxUtils::title2filename(trim($_POST['newfolder'])); if($plxMedias->newDir($newdir)) { $_SESSION['folder'] = $_SESSION['folder'].$newdir.'/'; } header('Location: medias.php'); exit; } elseif(!empty($_POST['btn_delete']) AND !empty($_POST['folder']) AND $_POST['folder']!='.') { if($plxMedias->deleteDir($_POST['folder'])) { $_SESSION['folder'] = ''; } header('Location: medias.php'); exit; } elseif(!empty($_POST['btn_upload'])) { $plxMedias->uploadFiles($_FILES, $_POST); header('Location: medias.php'); exit; } elseif(isset($_POST['selection']) AND ((!empty($_POST['btn_ok1']) AND $_POST['selection'][0]=='delete') OR (!empty($_POST['btn_ok2']) AND$_POST['selection'][1]=='delete')) AND isset($_POST['idFile'])) { $plxMedias->deleteFiles($_POST['idFile']); header('Location: medias.php'); exit; } elseif(isset($_POST['selection']) AND ((!empty($_POST['btn_ok1']) AND $_POST['selection'][0]=='move') OR (!empty($_POST['btn_ok2']) AND$_POST['selection'][1]=='move')) AND isset($_POST['idFile'])) { $plxMedias->moveFiles($_POST['idFile'], $_SESSION['currentfolder'], $_POST['folder']); header('Location: medias.php'); exit; } elseif(isset($_POST['selection']) AND ((!empty($_POST['btn_ok1']) AND $_POST['selection'][0]=='thumbs') OR (!empty($_POST['btn_ok2']) AND $_POST['selection'][1]=='thumbs')) AND isset($_POST['idFile'])) { $plxMedias->makeThumbs($_POST['idFile'], $plxAdmin->aConf['miniatures_l'], $plxAdmin->aConf['miniatures_h']); header('Location: medias.php'); exit; } # Tri de l'affichage des fichiers if(isset($_POST['sort']) AND !empty($_POST['sort'])) { $sort = $_POST['sort']; } else { $sort = isset($_SESSION['sort_medias']) ? $_SESSION['sort_medias'] : 'title_asc'; } $sort_title = 'title_desc'; $sort_date = 'date_desc'; switch ($sort) { case 'title_asc': $sort_title = 'title_desc'; usort($plxMedias->aFiles, create_function('$b, $a', 'return strcmp($a["name"], $b["name"]);')); break; case 'title_desc': $sort_title = 'title_asc'; usort($plxMedias->aFiles, create_function('$a, $b', 'return strcmp($a["name"], $b["name"]);')); break; case 'date_asc': $sort_date = 'date_desc'; usort($plxMedias->aFiles, create_function('$b, $a', 'return strcmp($a["date"], $b["date"]);')); break; case 'date_desc': $sort_date = 'date_asc'; usort($plxMedias->aFiles, create_function('$a, $b', 'return strcmp($a["date"], $b["date"]);')); break; } $_SESSION['sort_medias']=$sort; # Contenu des 2 listes déroulantes $selectionList = array('' =>L_FOR_SELECTION, 'move'=>L_PLXMEDIAS_MOVE_FOLDER, 'thumbs'=>L_MEDIAS_RECREATE_THUMB, '-'=>'-----', 'delete' =>L_DELETE); # On inclut le header include(dirname(__FILE__).'/top.php'); ?>
plxPlugins->callHook('AdminMediasTop')) # Hook Plugins ?>