plxPlugins->callHook('AdminMediasPrepend')); # Recherche du type de medias à afficher via la session if(empty($_SESSION['medias'])) { $_SESSION['medias'] = $plxAdmin->aConf['medias']; $_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['folder']) AND $_POST['folder']!='.' AND !empty($_POST['btn_delete'])) { 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_ok']) AND $_POST['selection']=='delete')) AND isset($_POST['idFile'])) { $plxMedias->deleteFiles($_POST['idFile']); header('Location: medias.php'); exit; } elseif(isset($_POST['selection']) AND ((!empty($_POST['btn_ok']) AND $_POST['selection']=='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_ok']) AND $_POST['selection']=='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_FILE); # On inclut le header include(dirname(__FILE__).'/top.php'); $curFolder = '/'.plxUtils::strCheck(basename($_SESSION['medias']).'/'.$_SESSION['folder']); $curFolders = explode('/', $curFolder); ?> plxPlugins->callHook('AdminMediasTop')) # Hook Plugins ?>

('.L_PLXMEDIAS_ROOT.') / '; if($curFolders) { $path=''; foreach($curFolders as $id => $folder) { if(!empty($folder) AND $id>1) { $path .= $folder.'/'; echo ''.$folder.' / '; } } } ?>

   
 :  contentFolder() ?>     
 : 
aFiles) { foreach($plxMedias->aFiles as $v) { # Pour chaque fichier $isImage = in_array(strtolower($v['extension']), array('.png', '.gif', '.jpg')); $ordre = ++$num; echo ''; echo ''; echo ''; echo ''; echo ''; echo ''; $dimensions = ' '; if($isImage AND (isset($v['infos']) AND isset($v['infos'][0]) AND isset($v['infos'][1]))) { $dimensions = $v['infos'][0].' x '.$v['infos'][1]; } echo ''; echo ''; echo ''; } } else echo ''; ?>
 
'; if(is_file($v['path']) AND $isImage) { echo ''; } echo ''; echo ''.plxUtils::strCheck($v['name']).'
'; if($isImage AND is_file(plxUtils::thumbName($v['path']))) { echo ''.L_MEDIAS_THUMB.' : '.$v['thumb']['infos'][0].' x '.$v['thumb']['infos'][1]. ' ('.plxUtils::formatFilesize($v['thumb']['filesize']).')'; } echo '
'.strtoupper($v['extension']).''.plxUtils::formatFilesize($v['filesize']).''.$dimensions.''.plxDate::formatDate(plxDate::timestamp2Date($v['date'])).'
'.L_MEDIAS_NO_FILE.'
plxPlugins->callHook('AdminMediasFoot')); # On inclut le footer include(dirname(__FILE__).'/foot.php'); ?>