本文整理汇总了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.