Exemple #1
0
#----
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;
}