Location: PHPKode > projects > mediaIndex > includes/viewDir.php
<?php _includeFile(_MEDIAPATH.$GLOBALS['dir']->path."HEADER.html") ?>

<?php include(_BASEPATH."/includes/dirDetails.php") ?>

<?php include(_BASEPATH."/includes/subDirs.php") ?>

<?php _includeFile(_MEDIAPATH.$GLOBALS['dir']->path."README.html") ?>

<?php
// show no files if none
$_files = $GLOBALS['dir']->getFiles();
if (count($_files) == 0) {
    echo "<p>No files exist in this directory.</p>";
    _includeFile(_MEDIAPATH.$GLOBALS['dir']->path."FOOTER.html");
    return;
}

// construct array of group handlers, populate them with files
$files = array();
foreach ($_files as $_file) {
    $files[$_file->groupRef->groupName]['files'][] = $_file;
    $files[$_file->groupRef->groupName]['object'] = $_file->groupRef;
}

// loop groups, sort files, send to group to print
foreach ($files as $groupName=>$mixed) {
    echo "<div class=\"group\">".$groupName."</div>\n";
    usort($mixed['files'], "_key_compare");
    $mixed['object']->printGroup($mixed['files']);
}

_includeFile(_MEDIAPATH.$GLOBALS['dir']->path."FOOTER.html");

echo "<div class=\"options\">";
if (_ENABLEZIPDIR) {
    echo "<a href=\"?do=zipdir&amp;dir=".rawurlencode($GLOBALS['dir']->path)."\"><img class=\"fade\" src=\""._ICONSURL."/zipdir.gif\" border=\"0\" alt=\"*\" />&nbsp;Download Entire Directory in ZIP Format</a>&nbsp;";
}
echo "</div>\n";

?>
Return current item: mediaIndex