//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'];
}
//get the list of files and directories
$list = $manager->getFiles($relative);
/* ================= OUTPUT/DRAW FUNCTIONS ======================= */
/**
 * Draw folders and files. Changed by Afru
 */
function drawDirs_Files($list, &$manager)
{
    global $relative, $afruViewType, $IMConfig, $insertMode;
    switch ($afruViewType) {
        case 'listview':
            $maxNameLength = 30;
            ?>
            <table class="listview">
            <thead>
            <tr><th colspan="2">Name</th><th>Size</th><th>Image Size</th><th>Date Modified</th><th>&nbsp;</th></tr></thead>
            <tbody>