public function ls_dir($dir, $recurse) { $index = Listing::get_dir_contents($dir); $return_str = "<div id=\"browser-div-sub\">"; if (count($index['directories']) > 0) { $no_contents = false; $return = ""; foreach ($index['directories'] as $f) { //if(!$recurse) $return_str .= Listing::dir_listing($f['file.name'], $f['path.hash']); $return_str .= Listing::dir_listing($f['file.name'], $f['path.hash']); if ($recurse) { $return_str .= Listing::ls_dir($f['path'], true); } } } $return_str .= "<hr />\n"; if (count($index['files']) > 0) { $no_contents = false; foreach ($index['files'] as $f) { $return_str .= Listing::file_listing($f['path.hash'], $f['file.name']); } $return_str .= "<div>...</div><hr />\n"; } $return_str .= "</div>"; return $return_str; }
if ($mask != $Cfg_FolderLoc) { $index_UI->previous_href = "pitchfork-application-index.php?mask=" . $context['previous_dir']; } else { $index_UI->previous_href = "pitchfork-application-index.php"; } # Set a title for this page (that will appear in the browser window title and on the page) if ($hash == $Cfg_FolderLoc) { $index_UI->set_page_title("Index of all files"); } else { $index_UI->set_page_title("Index of " . end(explode('/', $mask))); } # Detect the browser and see if they can be trusted with the javascript //if(strpos($browser,"MSIE 6.0")==true){} //else {$index_UI -> include_js("pitchfork-quicktime-playback.js");} # Include the page header that contains all the DOCTYPES / javascript / stylesheet $index_UI->load_header(); $dir_result = $list->ls_dir($mask, $recurse); if ($list->directory_empty) { $index_UI->load("directory-empty"); } else { $index_UI->load('index'); $index_UI->append("<div id=\"browser-div\">"); $index_UI->append($dir_result); $index_UI->append("</div>"); } # This closes everything up and includes the navigation elements. $index_UI->load_footer(); # Return the User interface... $index_UI->return_UI(); //print_r($_SESSION); # Part of Pitchfork.