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"]);'));
header('Location: medias.php?dir=' . urlencode($dir) . ($view != '' ? '&v=' . $view : '')); exit; } elseif (!empty($_GET['delfile']) and !strstr($_GET['dir'], '../') and !empty($_GET['hash']) and $_GET['hash'] == $_SESSION['hash']) { $plxMedias->delFile(urldecode($_GET['delfile'])); header('Location: medias.php?dir=' . urlencode($dir) . ($view != '' ? '&v=' . $view : '')); exit; } elseif (!empty($_POST['send']) and !empty($_FILES)) { $plxMedias->upload($dir, $_FILES['file'], $medias); header('Location: medias.php?dir=' . urlencode($dir) . ($view != '' ? '&v=' . $view : '')); exit; } elseif (!empty($_POST['change'])) { $plxMedias->moveFile($dir, $_POST["files"]); header('Location: medias.php?dir=' . urlencode($dir) . ($view != '' ? '&v=' . $view : '')); exit; } elseif (!empty($_POST['thumbs'])) { $plxMedias->makeThumbs($dir); header('Location: medias.php?dir=' . urlencode($dir) . ($view != '' ? '&v=' . $view : '')); exit; } # Recuperation des fichiers du dossier en cours $plxMedias->getDirContent($dir); ?> <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"> <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="fr" lang="fr"> <head> <title>Librairie - <?php echo $plxAdmin->aConf['title']; ?> </title> <meta http-equiv="Content-Type" content="text/html; charset=<?php