<?php
/* Simple well-not-designed PHP file index 
   Author: Saren
   License: GPL v3 */

/* Settings */

error_reporting(0);

$settings = array(
    "helpers"       => True,/* Enable thumbnails, text preview, tooltip */
    "responsive"    => True,/* Enable responsive design */
    "icons"         => True,/* File icons */

    "displayDot"    => False,   /* Display files and folders start with "." */

    "thumbMimes"    => array("image"),   /* MIME types that thumbnails are able to be generated. */
    "thumbnailSize" => 220, /* Max PX of each side */

    "previewMimes"  => array("subtitle", "text", "python", "javascript", "script"/*, "html", "c++" */),
    "previewLimit"  => 250, /* Bytes */

    "displayRows"   => 50,  /* Default display rows */
    "rowsSelection" => array(10 ,20, 30, 50, 100),   /* Numbers of display rows for selection */

    "indexFiles"    => array("index.php", "index.html", "index.htm"),/* WARNING: Does not really prevent your files in a directory from being listed! */
    //"indexFiles"    => array(),  /* Do if you want the index page list files of indexed directories instead. */

    /* Cache Time To Live (TTL) settings. They are all in seconds. 
       In case you don't know: Caches gets things faster, but things will not be updated real-time.
       If TTL is up, then cache expires, the page will have to generate the cache again, things would get a bit slower. */
    "contentTTL"    => 10,  /* Content of a directory */
    "hasIndexTTL"   => 3600,/* Whether a directory has an index file */
    "sizeTTL"       => 180, /* Size of a file */
    "lastModdedTTL" => 180, /* Last modified time of a file */
    "thumbnailTTL"  => 600, /* Thumbnail of a viewable image */
    "previewTTL"    => 180, /* Preview text of a file */
);

$localization = array(
    "filename"  => "Filename",
    "filetype"  => "Type",
    "filesize"  => "File Size",
    "filemtime" => "Last Modification",
    "thumbnail" => "Thumbnail",
    "preview"   => "Preview",

    "image"         => "Image",
    "video"         => "Video",
    "audio"         => "Audio",
    "compressed"    => "zipped",
    "cdimage"       => "CD Image",
    "executable"    => "Executable",
    "subtitle"      => "Subtitle",
    "installer"     => "Installer",
    "appext"        => "Extention",
    "text"          => "Text",
    "python"        => "Python File",
    "javascript"    => "Javascript",
    "script"        => "Script",
    /*  "html"          => "Happy toffee milk lemon", */

    "folder"        => "=Folder=",
    "file"          => "File",

    "goBackToParentDirectory" => "Back to parent directory",

    "measureWordOfEntitles" => " items",
    "entitles"              => "Content",
    "firstPage"             => "Index",
    "lastPage"              => "Last Page",
    "nextPage"              => "Next page",
    "previousPage"          => "Previous Page",
    "all"                   => "All",
    "filter"                => "Search",
    "show"                  => "Show",

    "sInfo"                 => "Total Number of Content:_TOTAL_. Displaying items _START_ to _END_",
    "sInfoFiltered"         => "Filtered from _MAX_",
    "sInfoEmpty"            => "No result",
    "sEmptyTable"           => "No content",
);

$mimeTypes = array(
    "image"         => array("jpg", "jpeg", "png", "gif", "tif", "tiff", "pcd", "psd", "png", "ico"),
    "video"         => array("avi", "wmv", "mov", "mp4", "mkv", "wtv", "rm", "rmvb", "rma", "m4v", "flv", "f4v", "ts", "mpg", "3gp", "webm", "pmp", "264"),
    "audio"         => array("mp3", "ogg", "aac", "ape", "tta", "wav", "flac", "mid"),
    "compressed"    => array("zip", "rar", "7z", "tar", "gz", "bz2", "lzw", "tgz"),
    "cdimage"       => array("iso", "cue", "mds", "mdf"),
    "executable"    => array("exe"),
    "subtitle"      => array("ass", "srt"),
    "installer"     => array("msi", "apk", "ipa"),
    "appext"        => array("dll", "so"),
    "text"          => array("txt", "nfo"),
    "python"        => array("py"),
    "javascript"    => array("js"),
    "script"        => array("sh", "bat"),
    /*  "html"          => array("html", "htm"), */
);

$iconOfMimeTypes = array(
    /* Base64 encoded 24*24 PNG. Gnome icons are from Open Icon Library. 
       I don't either understand or care about the licenses of them,
       but I am pretty sure I am permitted to used them without asking. */
    "image"         => "iVBORw0KGgoAAAANSUhEUgAAABgAAAAYCAYAAADgdz34AAAABmJLR0QAAAAAAAD5Q7t/AAAACXBIWXMAAAsTAAALEwEAmpwYAAAACXZwQWcAAAAYAAAAGAB4TKWmAAACz0lEQVRIx+2UTUhUURiGn3Pu38zozL3Mn8loU9NIRSUkUlD0Q62CIKhd0KKIKIgWhgVtWlWU/diiXRBRmxYR1aZNtZQyKbR/CcNxbMxoQB2zGb2nhZo6hlq2aNG7ut/hnP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nqAAAADp0RVh0U291cmNlX1VSTABodHRwOi8vY29tbW9ucy53aWtpbWVkaWEub3JnL3dpa2kvQ3J5c3RhbF9DbGVhcq++RWMAAAAASUVORK5CYII=",
    /*  "html"          => "iAmAbAsE64ENCodEDPng", */
);

/* End of settings */

$GLOBALS["requestPath"] = explode('?', $_SERVER['REQUEST_URI'], 2)[0];

/* Fake APC function, 10x slower than APC. */

if (!function_exists("apc_exists") AND !function_exists("apc_store") AND !function_exists("apc_fetch")) {
    $fakeAPC = array();
    function apc_exists($key) {
        global $fakeAPC;
        return array_key_exists($key, $fakeAPC);
    }

    function apc_store($key, $val, $ttl) {
        global $fakeAPC;
        $fakeAPC[$key] = $val;
        return True;
    }

    function apc_fetch($key) {
        global $fakeAPC;
        return $fakeAPC[$key];
    }
}

function currentDir() {
    foreach ($_GET as $key => $val) {
        $key = base64_decode(preg_replace("/\_/", "+", $key));
        while (!is_dir("./".$key) or isBadDir($key)) {
            $key = dirname($key);
            if ($key == "." or empty($key)) {
                /* prevent infinite loop */
                return "./";
            }
        }
        /* "./path/to////a//folder/" -> "./path/to/a/folder/" */
        return preg_replace("/\/+/", "/", $key."/");
    }
    return "./";
}

function parentDirLink() {
    $parentDir = dirname($GLOBALS["currentDir"]);
    if ($GLOBALS["currentDir"] == "./") {
        return "<a href='..'>Index of ".$GLOBALS["requestPath"].substr($GLOBALS["currentDir"], 2)."</a>";
    }
    return "<a href='?".base64_encode($parentDir)."'>Index of ".$GLOBALS["requestPath"].substr($GLOBALS["currentDir"], 2)."</a>";

}

function isBadDir($dir) {
    /* Unreliable trick to prevent parent directory of this index page from being listed. It can be bypassed easily I think?*/
    if (empty($dir)) {
        return True;
    } elseif (strpos($dir, "../") !== false) {
        return True;
    } else {
        $tree = explode("/", $dir);
        $len = count($tree);
        if (empty($tree[$len-1])) {
            if ($tree[$len-2] == "." or $tree[$len-2] == "..") {
                return True;
            }
        } else {
            if ($tree[$len-1] == "." or $tree[$len-1] == "..") {
                return True;
            }
        }
        return False;
    }
}

function getURL($file) {
    global $settings;
    if (!apc_exists($_SERVER['HTTP_HOST'].$GLOBALS["requestPath"]."_File_".base64_encode($file))) {
        $href = $GLOBALS["currentDir"].$file;
        $iconImg = "";
        if (!is_file($href)) {
            if ($settings["icons"]) {
                $iconImg = "<img src='?i=folder'/>";
            }
            $url = "<a href='?".base64_encode($href)."'>".$iconImg." ".$file."</a>";
        } else {
            $href = str_replace("./", "", $href);
            if ($settings["icons"]) {
                $iconImg = "<img src='?i=".getMimeType($GLOBALS["currentDir"].$file)."'/>";
            }
            $href = rawurlencode($href);
            $href = str_replace("%2F", "/", $href);
            $url = "<a href='$href'>$iconImg $file</a>";
        }

        apc_store($_SERVER['HTTP_HOST'].$GLOBALS["requestPath"]."_File_".base64_encode($file), $url, $settings["contentTTL"]);
    } else {
        $url = apc_fetch($_SERVER['HTTP_HOST'].$GLOBALS["requestPath"]."_File_".base64_encode($file));
    }
    return $url;
}

function getContent($dir) {
    global $settings;
    if (!apc_exists($_SERVER['HTTP_HOST'].$GLOBALS["requestPath"]."_Content_".base64_encode($dir))) {
        $files = array();
        if ($handle = opendir($dir)) {
            while (false !== ($file = readdir($handle))) { //scan the folder
                if ($settings["displayDot"]) {
                    if ($file != "." AND $file != "..") {
                        $files[] = $file;
                    }
                } else {
                    if (substr($file, 0, 1) != ".") {
                        $files[] = $file;
                    }
                }
            }
            closedir($handle);
        }
        apc_store($_SERVER['HTTP_HOST'].$GLOBALS["requestPath"]."_Content_".base64_encode($dir), $files, $settings["contentTTL"]);
    } else {
        $files = apc_fetch($_SERVER['HTTP_HOST'].$GLOBALS["requestPath"]."_Content_".base64_encode($dir));
    }
    return $files;
}

function getMimeType($file) {
    if (!apc_exists($_SERVER['HTTP_HOST'].$GLOBALS["requestPath"]."_MimeType_".base64_encode($file))) {
        global $mimeTypes, $settings;
        if (!is_file($file)) {
            $mime = "folder";
        } else {
            foreach ($mimeTypes as $key => $val) {
                $fileExt = pathinfo($file, PATHINFO_EXTENSION);
                if (in_array(strtolower($fileExt), $val)) {
                    $mime = $key;
                    break;
                }
            }
            if (!isset($mime)) {
                $mime = "file";
            }
        }
        apc_store($_SERVER['HTTP_HOST'].$GLOBALS["requestPath"]."_MimeType_".base64_encode($file), $mime, $settings["contentTTL"]);
    } else {
        $mime = apc_fetch($_SERVER['HTTP_HOST'].$GLOBALS["requestPath"]."_MimeType_".base64_encode($file));
    }
    return $mime;
}

function hasIndex($dir) {
    /* If a directory contains index such as index.html, return the real path */
    global $settings;
    if (!apc_exists($_SERVER['HTTP_HOST'].$GLOBALS["requestPath"]."_hasIndex_".base64_encode($dir))) {
        $hasIndex = False;
        foreach (getContent($dir) as $childFile) {
            if (in_array($childFile, $settings["indexFiles"])) {
                $hasIndex = True;
                break;
            }
        }
        apc_store($_SERVER['HTTP_HOST'].$GLOBALS["requestPath"]."_hasIndex_".base64_encode($dir), $hasIndex, $settings["hasIndexTTL"]);
    } else {
        $hasIndex = apc_fetch($_SERVER['HTTP_HOST'].$GLOBALS["requestPath"]."_hasIndex_".base64_encode($dir));
    }
    return $hasIndex;
}

function getSize($file) {
    global $settings;
    if (!apc_exists($_SERVER['HTTP_HOST'].$GLOBALS["requestPath"]."_filesizeString_".base64_encode($file))) {
        if (is_file($file)) {
            $filesize = filesize($file);
            $filesizeString = toHumanReadable($filesize);
        } else {
            $filesizeString = "";
        }
        apc_store($_SERVER['HTTP_HOST'].$GLOBALS["requestPath"]."_filesizeString_".base64_encode($file), $filesizeString, $settings["sizeTTL"]);
    } else {
        $filesizeString = apc_fetch($_SERVER['HTTP_HOST'].$GLOBALS["requestPath"]."_filesizeString_".base64_encode($file));
    }
    return $filesizeString;
}

function toHumanReadable($filesize) {
    $sizeTexts = array("B", "KB", "MB", "GB", "TB", "PB");
    $tmpfilesize = $filesize;
    foreach ($sizeTexts as $lvl => $sizeText) {
        if ($filesize <= pow(1024,$lvl+1)) {
            return round($tmpfilesize,2).$sizeText;
        } else {
            $tmpfilesize = $tmpfilesize/1024;
        }
    }
}

function getLastModded($file) {
    global $settings;
    if (!apc_exists($_SERVER['HTTP_HOST'].$GLOBALS["requestPath"]."_lastModded_".base64_encode($file))) {
        $lastModded = date("Y-m-d h:i:s", filemtime($file));
        apc_store($_SERVER['HTTP_HOST'].$GLOBALS["requestPath"]."_lastModded_".base64_encode($file), $lastModded, $settings["lastModdedTTL"]);
    } else {
        $lastModded = apc_fetch($_SERVER['HTTP_HOST'].$GLOBALS["requestPath"]."_lastModded_".base64_encode($file));
    }
    return $lastModded;
}

function getThumbnail($filepathEncoded) {
    global $settings;
    if (!apc_exists($_SERVER['HTTP_HOST'].$GLOBALS["requestPath"]."_thumb_$filepathEncoded")) {
        $filepathDecoded = base64_decode($filepathEncoded);
        /* Unreliable trick to prevent parent directory of this index page from being listed, again. */
        if (isBadDir($filepathDecoded)) {
            exit;
        }
        if (!in_array(getMimeType($filepathDecoded), $settings["thumbMimes"])) {
            exit;
        }
        $handle = fopen($filepathDecoded, "r");
        list($width, $height) = getimagesize($filepathDecoded);
        $srcImageStr = fread($handle, filesize($filepathDecoded));
        $srcImage = imagecreatefromstring($srcImageStr);

        $maxPx = max($width, $height);
        if ($maxPx >= $settings["thumbnailSize"]) {
            $percent = $settings["thumbnailSize"]/$maxPx;
        } else {
            /* Make sure the file is really an picture */
            ob_start();
            imagepng($srcImage);
            $srcImageStr = ob_get_contents();
            ob_end_clean();
            apc_store($_SERVER['HTTP_HOST'].$GLOBALS["requestPath"]."_thumb_$filepathEncoded", $srcImageStr, $settings["thumbnailTTL"]);
            return $srcImageStr;
        }

        $newwidth = $width * $percent;
        $newheight = $height * $percent;

        $thumb = imagecreatetruecolor($newwidth, $newheight);
        imagealphablending($thumb, false);
        imagesavealpha($thumb, true);
        imagecopyresampled($thumb, $srcImage, 0, 0, 0, 0, $newwidth, $newheight, $width, $height);

        ob_start();
        imagepng($thumb);
        $thumbStr = ob_get_contents();
        ob_end_clean();

        apc_store($_SERVER['HTTP_HOST'].$GLOBALS["requestPath"]."_thumb_lastModded_$filepathEncoded", time(), $settings["thumbnailTTL"]);
        apc_store($_SERVER['HTTP_HOST'].$GLOBALS["requestPath"]."_thumb_$filepathEncoded", $thumbStr, $settings["thumbnailTTL"]);
    } else {
        $thumbStr = apc_fetch($_SERVER['HTTP_HOST'].$GLOBALS["requestPath"]."_thumb_$filepathEncoded");
    }
    return $thumbStr;
}

function getPreviewText($file) {
    global $settings;
    if (!apc_exists($_SERVER['HTTP_HOST'].$GLOBALS["requestPath"]."_previewText_".base64_encode($file))) {
        $handle = fopen($file, "r");
        $previewText = htmlentities(fread($handle, $settings["previewLimit"]), ENT_QUOTES | ENT_IGNORE, "UTF-8");
        apc_store($_SERVER['HTTP_HOST'].$GLOBALS["requestPath"]."_previewText_".base64_encode($file), $previewText, $settings["previewTTL"]);
    } else {
        $previewText = apc_fetch($_SERVER['HTTP_HOST'].$GLOBALS["requestPath"]."_previewText_".base64_encode($file));
    }
    return $previewText;
}

if (isset($_GET["t"]) AND !empty($_GET["t"])):
    header('Content-Type: image/png');
    $lastModded = apc_fetch($_SERVER['HTTP_HOST'].$GLOBALS["requestPath"]."_thumb_lastModded_".$_GET["t"]);
    header("Last-Modified: " . gmdate("D, d M Y H:i:s", $lastModded) . " GMT");
    if (@strtotime($_SERVER['HTTP_IF_MODIFIED_SINCE']) == $lastModded && apc_exists($_SERVER['HTTP_HOST'].$GLOBALS["requestPath"]."_thumb_".$_GET["t"])) {
        header("HTTP/1.1 304 Not Modified");
        exit();
    }
    echo getThumbnail($_GET["t"]);

elseif (isset($_GET["i"]) AND !empty($_GET["i"])):
    header('Content-Type: image/png');
    if (apc_exists($_SERVER['HTTP_HOST'].$GLOBALS["requestPath"]."_icon_lastModded_".$_GET["i"])) {
        $lastModded = apc_fetch($_SERVER['HTTP_HOST'].$GLOBALS["requestPath"]."_icon_lastModded_".$_GET["i"]);
    } else {
        $lastModded = time();
        apc_store($_SERVER['HTTP_HOST'].$GLOBALS["requestPath"]."_icon_lastModded_".$_GET["i"], $lastModded);
    }
    header("Last-Modified: " . gmdate("D, d M Y H:i:s", $lastModded) . " GMT");
    if (@strtotime($_SERVER['HTTP_IF_MODIFIED_SINCE']) == $lastModded) {
        header("HTTP/1.1 304 Not Modified");
        exit();
    }
    echo base64_decode($iconOfMimeTypes[$_GET["i"]]);

elseif (hasIndex($GLOBALS["currentDir"] = currentDir()) && $GLOBALS["currentDir"] != "./"):
    $GLOBALS["currentDir"] = str_replace("./", "", $GLOBALS["currentDir"]);
    $GLOBALS["currentDir"] = rawurlencode($GLOBALS["currentDir"]);
    $GLOBALS["currentDir"] = str_replace("%2F", "/", $GLOBALS["currentDir"]);
    header("Location: ".$GLOBALS['currentDir'], true, 302);
else:

    ?>
    <!DOCTYPE HTML>
    <html>
    <head>
	<p>Online Content Explorer. All credit to Saren Arterius, Licensed under GPL v3</p>
        <title>Index of <?php echo $GLOBALS["requestPath"].substr($GLOBALS["currentDir"], 2); ?></title>
        <meta charset="utf-8">
        <meta name="viewport" content="width=device-width, initial-scale=1.0">
        <link rel="stylesheet" href="//netdna.bootstrapcdn.com/bootstrap/3.0.3/css/bootstrap.min.css">
        <style>
            .container {
                padding-top: 150px;
                padding-bottom: 60px;
                width: 80%;
            }

            .page-header {
                float: left;
                position: absolute;
                margin-top: 50px;
                width: 100%;
                background-color: white;
            }

            .filter {
                text-align: right;
                margin: auto;
                position: fixed;
                right: 20px;
                bottom: 20px;
                height: 34px;
            }

            .pagingfull_numbers {
                text-align: left;
                margin: auto;
                position: fixed;
                left: 20px;
                bottom: 20px;
            }

            .info {
                text-align: center;
                position: fixed;
                width: 380px;
                bottom: 20px;
                left: 0;
                right: 0;
                margin: auto;
            }

            #display_menu {
                width: auto;
                display: inline;
            }

            table {
                margin: 1em 0;
                clear: both;
            }
        </style>
        <script type="text/javascript" src="//ajax.googleapis.com/ajax/libs/jquery/1.10.2/jquery.min.js"></script>
        <script type="text/javascript" src="//ajax.aspnetcdn.com/ajax/jquery.dataTables/1.9.4/jquery.dataTables.min.js"></script>
        <script src="//netdna.bootstrapcdn.com/bootstrap/3.0.3/js/bootstrap.min.js"></script>
        <script>
            /* Default class modification */
            $.extend( $.fn.dataTableExt.oStdClasses, {
                "sInfo": "help-block",
                "sPageFirst": "btn btn-primary",
                "sPagePrevious": "btn btn-primary",
                "sPageNext": "btn btn-primary",
                "sPageLast": "btn btn-primary",
                "sPageButton": "btn btn-default",
                "sPageButtonStaticDisabled": "btn btn-default disabled",
                "sPageButtonActive": "btn btn-default disabled",
                "sFilter": "<?php if ($settings["responsive"]) { echo "filter"; } ?>",
                "sPaging": "<?php if ($settings["responsive"]) { echo "paging"; } ?>",
                "sInfo": "<?php if ($settings["responsive"]) { echo "info"; } ?> well well-sm",
            } );

            /* Sort by human-readable file size. http://datatables.net/plug-ins/sorting#file_size */
            $.extend( $.fn.dataTableExt.oSort, {
                "file-size-pre": function ( a ) {
                    var x = a.substring(0,a.length - 2);

                    if (a.substring(a.length - 2, a.length) == "KB") {
                        var x_unit = 1024;
                    } else if (a.substring(a.length - 2, a.length) == "MB") {
                        var x_unit = 1048576;
                    } else if (a.substring(a.length - 2, a.length) == "GB") {
                        var x_unit = 1073741824;
                    } else if (a.substring(a.length - 2, a.length) == "TB") {
                        var x_unit = 1099511627776;
                    } else if (a.substring(a.length - 2, a.length) == "TB") {
                        var x_unit = 1125899906842624;
                    } else if (a.substring(a.length - 1, a.length) == "B") {
                        x = a.substring(0,a.length - 1);
                        var x_unit = 1;
                    } else {
                        return -1;
                    }

                    return parseInt( x * x_unit, 10 );
                },

                "file-size-asc": function ( a, b ) {
                    return ((a < b) ? -1 : ((a > b) ? 1 : 0));
                },

                "file-size-desc": function ( a, b ) {
                    return ((a < b) ? 1 : ((a > b) ? -1 : 0));
                }
            } );


            $(document).ready(function() {
                /* Mother of sort and filtering */
                $('.table').dataTable({
                    "sPaginationType": "full_numbers",
                    "iDisplayLength": <?php echo $settings["displayRows"]; ?>,
                    "oLanguage": {
                        "sSearch": "",
                        "sInfo": "<?php echo $localization["sInfo"]; ?>",
                        "sInfoFiltered": "<br/><?php echo $localization["sInfoFiltered"]; ?>",
                        "sInfoEmpty": "<?php echo $localization["sInfoEmpty"]; ?>",
                        "sEmptyTable": "<?php echo $localization["sEmptyTable"]; ?>",
                        "sLengthMenu": '<?php echo $localization["show"]; ?><select id="display_menu" class="form-control">'+
                        <?php
                            foreach ($settings["rowsSelection"] as $val) { ?>
                        '<option value="<?php echo $val; ?>"><?php echo $val.$localization["measureWordOfEntitles"]; ?></option>'+
                        <?php
                            }
                        ?>
                        '<option value="-1"><?php echo $localization["all"]; ?></option>'+
                        '</select><?php echo $localization["entitles"]; ?>',
                        "oPaginate": {
                            "sFirst": "<?php echo $localization["firstPage"]; ?>",
                            "sLast": "<?php echo $localization["lastPage"]; ?>",
                            "sNext": "<?php echo $localization["nextPage"]; ?>",
                            "sPrevious": "<?php echo $localization["previousPage"]; ?>",
                        }
                    },
                    "aaSorting": [
                        [ 1, "asc" ],
                        [ 0, "asc" ]
                    ],
                    "aoColumns": [
                        null,
                        null,
                        { "sType": "file-size" },
                        null
                    ]
                });
                $("input[aria-controls='DataTables_Table_0']").addClass("form-control");
                $("input[aria-controls='DataTables_Table_0']").attr("placeholder", "<?php echo $localization["filter"]; ?>");

                /* Set navbar(.page-header) to fixed if it is scrolled over */
                var navpos = $(".page-header").offset();
                $(window).bind('scroll', function() {
                    if ($(window).scrollTop() > navpos.top && $(window).height() > 500) {
                        $(".page-header").css({
                            "position": "fixed",
                            "margin-top": "0px",
                        });
                    } else {
                        $(".page-header").css({
                            "position": "absolute",
                            "margin-top": "50px",
                        });
                    }
                });

                function responsive() {
                    if ($(window).width()/2 <= paginateWidth + 210) {
                        $(".well-sm").removeClass("info");
                    } else {
                        $(".well-sm").addClass("info");
                    }
                    if ($(window).width() <= paginateWidth + filterWidth + 156) {
                        $("#DataTables_Table_0_filter").removeClass("filter");
                        $("#DataTables_Table_0_paginate").removeClass("pagingfull_numbers");
                    } else {
                        $("#DataTables_Table_0_filter").addClass("filter");
                        $("#DataTables_Table_0_paginate").addClass("pagingfull_numbers");
                    }
                    if (paginateWidth >= $(".table-responsive").width()) {
                        $("#DataTables_Table_0_first").text("<<");
                        $("#DataTables_Table_0_previous").text("<");
                        $("#DataTables_Table_0_next").text(">");
                        $("#DataTables_Table_0_last").text(">>");
                    } else {
                        $("#DataTables_Table_0_first").text(firstStr);
                        $("#DataTables_Table_0_previous").text(prevStr);
                        $("#DataTables_Table_0_next").text(nextStr);
                        $("#DataTables_Table_0_last").text(lastStr);
                    }

                    if ($(window).width() <= 960) {
                        $(".container").css({
                            "width": "100%",
                            "padding-right": "0px",
                            "padding-left": "0px",
                        });
                    } else {
                        $(".container").css({
                            "width": "80%",
                            "padding-right": "15px",
                            "padding-left": "15px",
                        });
                    }

                    if ($(window).height() <= 500) {
                        $(".page-header").css({
                            "position": "absolute",
                            "margin-top": "50px",
                        });
                    } else if ($(window).scrollTop() > navpos.top) {
                        $(".page-header").css({
                            "position": "fixed",
                            "margin-top": "0px",
                        });
                    }
                }

                function helpersInit() {
                    $(".page-header").tooltip({
                        container: "body",
                        placement: "auto",
                    });

                    $('.has_popover').popover({
                        trigger: "hover",
                        container: "body",
                        placement: "auto",
                        html: true,
                    });
                }

                <?php 
                    if ($settings["responsive"]) { 
                        echo '  $(window).resize(function() {
                                    responsive();
                                });
                                $("#display_menu").change(function() {
                                    paginateWidth = $("#DataTables_Table_0_paginate").width();
                                });
                                var paginateWidth = $("#DataTables_Table_0_paginate").width();
                                var filterWidth = $(".form-control").width();
                                var firstStr = $("#DataTables_Table_0_first").html()
                                var prevStr = $("#DataTables_Table_0_previous").html()
                                var nextStr = $("#DataTables_Table_0_next").html()
                                var lastStr = $("#DataTables_Table_0_last").html()
                            '; 
                        echo "responsive();"; 
                    } 
                    if ($settings["helpers"]) { 
                        echo '  $("body").bind("click mouseover", function() {
                                    helpersInit();
                                });
                            '; 
                        echo "helpersInit();"; 
                    }
                ?>
            });
        </script>
    </head>
    <body>
    <div title="<?php echo $localization["goBackToParentDirectory"]; ?>" class="page-header" style="text-align: center; ">
        <h1><?php echo parentDirLink(); ?></h1>
    </div>
    <div class="container">
        <div class="<?php if ($settings["responsive"]) { echo "table-responsive"; } ?>">
            <table class="table table-hover table-condensed">
                <thead>
                <tr>
                    <th title="<?php echo $localization["filename"]; ?>"><?php echo $localization["filename"]; ?></th>
                    <th title="<?php echo $localization["filetype"]; ?>"><?php echo $localization["filetype"]; ?></th>
                    <th title="<?php echo $localization["filesize"]; ?>" style="width: 90px;"><?php echo $localization["filesize"]; ?></th>
                    <th title="<?php echo $localization["filemtime"]; ?>" style="width: 160px;"><?php echo $localization["filemtime"]; ?></th>
                </tr>
                </thead>
                <tbody>
                <?php
                foreach (getContent($GLOBALS["currentDir"]) as $file) { ?>

                    <tr<?php
                    if (!is_file($GLOBALS["currentDir"].$file)) {
                        echo " class='success'";
                    }
                    $mineType = getMimeType($GLOBALS["currentDir"].$file);
                    ?>>
                        <?php
                        if (in_array($mineType, $settings["thumbMimes"])) {
                            ?>

                            <td class='has_popover' title='<?php echo $localization["thumbnail"]; ?>' data-content='<img src="?t=<?php echo base64_encode($GLOBALS["currentDir"].$file); ?>"/>'><?php echo getURL($file); ?></td>
                        <?php
                        } elseif (in_array($mineType, $settings["previewMimes"])) {
                            ?>

                            <td class='has_popover' title='<?php echo $localization["preview"]; ?>' data-content='<pre><?php echo getPreviewText($GLOBALS["currentDir"].$file); ?></pre>'><?php echo getURL($file); ?></td>
                        <?php
                        } else {
                            ?>

                            <td><?php echo getURL($file); ?></td>
                        <?php
                        }
                        ?>

                        <td><?php echo $localization[$mineType]; ?></td>
                        <td><?php echo getSize($GLOBALS["currentDir"].$file); ?></td>
                        <td><?php echo getLastModded($GLOBALS["currentDir"].$file); ?></td>
                    </tr>
                <?php
                }
                ?>

                </tbody>
            </table>
        </div>
    </div>
    </body>
    </html>
<?php
endif;
?>