本文整理汇总了PHP中osC_DirectoryListing::setStats方法的典型用法代码示例。如果您正苦于以下问题:PHP osC_DirectoryListing::setStats方法的具体用法?PHP osC_DirectoryListing::setStats怎么用?PHP osC_DirectoryListing::setStats使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类osC_DirectoryListing
的用法示例。
在下文中一共展示了osC_DirectoryListing::setStats方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: listDirectory
function listDirectory()
{
global $osC_Language, $toC_Json, $osC_MessageStack;
$directory = OSC_ADMIN_FILE_MANAGER_ROOT_PATH;
if (isset($_REQUEST['directory']) && !empty($_REQUEST['directory'])) {
$directory .= '/' . urldecode($_REQUEST['directory']);
} elseif (isset($_REQUEST['goto']) && !empty($_REQUEST['goto'])) {
$directory .= '/' . urldecode($_REQUEST['goto']);
}
$osC_DirectoryListing = new osC_DirectoryListing($directory);
$osC_DirectoryListing->setStats(true);
$records = array();
foreach ($osC_DirectoryListing->getFiles() as $file) {
$file_owner = function_exists('posix_getpwuid') ? posix_getpwuid($file['user_id']) : '-?-';
$group_owner = function_exists('posix_getgrgid') ? posix_getgrgid($file['group_id']) : '-?-';
if ($file['is_directory'] === true) {
$entry_icon = osc_icon('folder_red.png');
$action = array(array('class' => 'icon-empty-record', 'qtip' => ''), array('class' => 'icon-empty-record', 'qtip' => ''), array('class' => 'icon-delete-record', 'qtip' => $osC_Language->get('icon_trash')));
} else {
$entry_icon = osc_icon('file.png');
$action = array(array('class' => 'icon-edit-record', 'qtip' => $osC_Language->get('icon_edit')), array('class' => 'icon-download-record', 'qtip' => $osC_Language->get('icon_download')), array('class' => 'icon-delete-record', 'qtip' => $osC_Language->get('icon_trash')));
}
$records[] = array('icon' => $entry_icon, 'file_name' => $file['name'], 'is_directory' => $file['is_directory'], 'size' => number_format($file['size']), 'permission' => osc_get_file_permissions($file['permissions']), 'file_owner' => $file_owner, 'group_owner' => $group_owner, 'writeable' => osc_icon(is_writable($osC_DirectoryListing->getDirectory() . '/' . $file['name']) ? 'checkbox_ticked.gif' : 'checkbox_crossed.gif'), 'last_modified_date' => osC_DateTime::getShort(osC_DateTime::fromUnixTimestamp($file['last_modified']), true), 'action' => $action);
}
$response = array(EXT_JSON_READER_ROOT => $records);
echo $toC_Json->encode($response);
}
示例2: osc_link_object
as published by the Free Software Foundation.
*/
$goto_array = array(array('id' => '', 'text' => $osC_Language->get('top_level')));
if ($_SESSION['fm_directory'] != OSC_ADMIN_FILE_MANAGER_ROOT_PATH) {
$path_array = explode('/', substr($_SESSION['fm_directory'], strlen(OSC_ADMIN_FILE_MANAGER_ROOT_PATH) + 1));
foreach ($path_array as $value) {
if (sizeof($goto_array) < 2) {
$goto_array[] = array('id' => $value, 'text' => $value);
} else {
$parent = end($goto_array);
$goto_array[] = array('id' => $parent['id'] . '/' . $value, 'text' => $parent['id'] . '/' . $value);
}
}
}
$osC_DirectoryListing = new osC_DirectoryListing($_SESSION['fm_directory']);
$osC_DirectoryListing->setStats(true);
?>
<h1><?php
echo osc_link_object(osc_href_link_admin(FILENAME_DEFAULT, $osC_Template->getModule()), $osC_Template->getPageTitle());
?>
</h1>
<?php
if ($osC_MessageStack->size($osC_Template->getModule()) > 0) {
echo $osC_MessageStack->get($osC_Template->getModule());
}
?>
<div style="float: right;">
<form name="file_manager" action="<?php