//default path is /
$relative = '/';
$manager = new ExtendedFileManager($IMConfig, $insertMode);
//process any file uploads
$uploadStatus = $manager->processUploads();
//process any file renames
$renameStatus = $manager->processRenames();
if ($manager->deleteFiles()) {
    $refreshFile = true;
}
$refreshDir = false;
//process any directory functions
if ($manager->deleteDirs() || $manager->processNewDir()) {
    $refreshDir = true;
}
$diskInfo = $manager->getDiskInfo();
//check for any sub-directory request
//check that the requested sub-directory exists
//and valid
if (isset($_REQUEST['dir'])) {
    $path = rawurldecode($_REQUEST['dir']);
    if ($manager->validRelativePath($path)) {
        $relative = $path;
    }
}
$afruViewType = "";
if (isset($_REQUEST['viewtype'])) {
    $afruViewType = $_REQUEST['viewtype'];
}
if ($afruViewType != "thumbview" && $afruViewType != "listview") {
    $afruViewType = $IMConfig['view_type'];