本文整理匯總了PHP中Listing::ls_dir方法的典型用法代碼示例。如果您正苦於以下問題:PHP Listing::ls_dir方法的具體用法?PHP Listing::ls_dir怎麽用?PHP Listing::ls_dir使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類Listing
的用法示例。
在下文中一共展示了Listing::ls_dir方法的2個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。
示例1: ls_dir
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;
}
示例2: page
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.