$dir = (substr($dir, -1) != '/' and $dir != '') ? $dir . '/' : $dir; } # Initialisation de la vue (chapo ou content) $view = !empty($_GET['v']) ? $_GET['v'] : ''; # Nouvel objet de type plxMedias $plxMedias = new plxMedias(PLX_ROOT . $plxAdmin->aConf[$medias]); # On définit la taille des miniatures; $plxMedias->miniWidth = $plxAdmin->aConf['miniatures_l']; $plxMedias->miniHeight = $plxAdmin->aConf['miniatures_h']; # Création d'un dossier if (!empty($_POST['newdir']) and !strstr($_GET['dir'], '../') and trim($_POST['newdir']) != '') { $plxMedias->newDir($dir, $_POST['newdir']); header('Location: medias.php?dir=' . urlencode($dir) . ($view != '' ? '&v=' . $view : '')); exit; } elseif (!empty($_GET['mini']) and !empty($_GET['hash']) and $_GET['hash'] == $_SESSION['hash']) { $plxMedias->makeThumb($_GET['mini']); header('Location: medias.php?dir=' . urlencode($dir) . ($view != '' ? '&v=' . $view : '')); exit; } elseif (!empty($_GET['deldir']) and !strstr($_GET['dir'], '../') and !empty($_GET['hash']) and $_GET['hash'] == $_SESSION['hash']) { $plxMedias->delDir(urldecode($_GET['deldir'])); 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'])) {