Esempio n. 1
0
}
# Hook Plugins
eval($plxAdmin->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;
Esempio n. 2
0
$medias = !empty($_SESSION['medias']) ? $_SESSION['medias'] : 'images';
if (!empty($_POST['medias'])) {
    $medias = $_POST['sel_medias'];
    $_SESSION['medias'] = $medias;
    $_GET['dir'] = '';
}
# Recherche du repertoire à afficher
$dir = '';
if (!empty($_GET['dir']) and !strstr($_GET['dir'], '../')) {
    $dir = urldecode($_GET['dir']);
    $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 : ''));