本文整理汇总了PHP中osC_DirectoryListing::getSize方法的典型用法代码示例。如果您正苦于以下问题:PHP osC_DirectoryListing::getSize方法的具体用法?PHP osC_DirectoryListing::getSize怎么用?PHP osC_DirectoryListing::getSize使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类osC_DirectoryListing
的用法示例。
在下文中一共展示了osC_DirectoryListing::getSize方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: getGadgets
function getGadgets()
{
global $toC_Json, $osC_Language;
$record = array();
$osC_DirectoryListing = new osC_DirectoryListing('includes/modules/gadgets');
if ($osC_DirectoryListing->getSize()) {
foreach ($osC_DirectoryListing->getFiles() as $file) {
$gadget = substr($file['name'], 0, strrpos($file['name'], '.'));
$class_path = 'includes/modules/gadgets/' . $gadget . '.php';
if (!empty($gadget) && file_exists($class_path)) {
include $class_path;
$osC_Language->loadIniFile('modules/gadgets/' . $gadget . '.php');
if (class_exists('toC_Gadget_' . $gadget)) {
$module_class = 'toC_Gadget_' . $gadget;
$module = new $module_class();
$records[] = array('code' => $module->getCode(), 'type' => $module->getType(), 'icon' => $module->getIcon(), 'title' => $module->getTitle(), 'file' => $module->getFile(), 'description' => $module->getDescription());
}
}
}
$response = array('success' => true, 'records' => $records);
} else {
$response = array('success' => false);
}
echo $toC_Json->encode($response);
}
示例2: getPages
function getPages()
{
global $toC_Json, $osC_Database, $osC_Language;
$Qtemplate = $osC_Database->query('select code from :table_templates where id = :id');
$Qtemplate->bindTable(':table_templates', TABLE_TEMPLATES);
$Qtemplate->bindValue(':id', $_REQUEST['filter']);
$Qtemplate->execute();
$filter_id = $_REQUEST['filter'];
$_REQUEST['filter'] = $Qtemplate->Value('code');
$pages_array = array(array('id' => $filter_id . '/*', 'text' => '*'));
$d_boxes = new osC_DirectoryListing('../templates/' . $_REQUEST['filter'] . '/content');
$d_boxes->setRecursive(true);
$d_boxes->setAddDirectoryToFilename(true);
$d_boxes->setCheckExtension('php');
$d_boxes->setExcludeEntries('.svn');
foreach ($d_boxes->getFiles(false) as $box) {
if ($box['is_directory'] === true) {
$entry = array('id' => $filter_id . '/' . $box['name'] . '/*', 'text' => $box['name'] . '/*');
} else {
$page_filename = substr($box['name'], 0, strrpos($box['name'], '.'));
$entry = array('id' => $filter_id . '/' . $page_filename, 'text' => $page_filename);
}
if ($_REQUEST['filter'] != DEFAULT_TEMPLATE && $d_boxes->getSize() > 0) {
$entry['group'] = '-- ' . $_REQUEST['filter'] . ' --';
}
$pages_array[] = $entry;
}
if ($_REQUEST['filter'] != DEFAULT_TEMPLATE) {
$d_boxes = new osC_DirectoryListing('../templates/' . DEFAULT_TEMPLATE . '/content');
$d_boxes->setRecursive(true);
$d_boxes->setAddDirectoryToFilename(true);
$d_boxes->setCheckExtension('php');
$d_boxes->setExcludeEntries('.svn');
foreach ($d_boxes->getFiles(false) as $box) {
if ($box['is_directory'] === true) {
$entry = array('id' => $filter_id . '/' . $box['name'] . '/*', 'text' => $box['name'] . '/*');
} else {
$page_filename = substr($box['name'], 0, strrpos($box['name'], '.'));
$entry = array('id' => $filter_id . '/' . $page_filename, 'text' => $page_filename);
}
$check_entry = $entry;
$check_entry['group'] = '-- ' . $_REQUEST['filter'] . ' --';
if (!in_array($check_entry, $pages_array)) {
$entry['group'] = '-- ' . DEFAULT_TEMPLATE . ' --';
$pages_array[] = $entry;
}
}
}
$response = array(EXT_JSON_READER_ROOT => $pages_array);
echo $toC_Json->encode($response);
}
示例3: array
$boxes_array[] = array('id' => $Qboxes->valueInt('id'), 'text' => $Qboxes->value('title'));
}
$pages_array = array(array('id' => $filter_id . '/*', 'text' => '*'));
$d_boxes = new osC_DirectoryListing('../templates/' . $_GET['filter'] . '/content');
$d_boxes->setRecursive(true);
$d_boxes->setAddDirectoryToFilename(true);
$d_boxes->setCheckExtension('php');
$d_boxes->setExcludeEntries('.svn');
foreach ($d_boxes->getFiles(false) as $box) {
if ($box['is_directory'] === true) {
$entry = array('id' => $filter_id . '/' . $box['name'] . '/*', 'text' => $box['name'] . '/*');
} else {
$page_filename = substr($box['name'], 0, strrpos($box['name'], '.'));
$entry = array('id' => $filter_id . '/' . $page_filename, 'text' => $page_filename);
}
if ($_GET['filter'] != DEFAULT_TEMPLATE && $d_boxes->getSize() > 0) {
$entry['group'] = '-- ' . $_GET['filter'] . ' --';
}
$pages_array[] = $entry;
}
if ($_GET['filter'] != DEFAULT_TEMPLATE) {
$d_boxes = new osC_DirectoryListing('../templates/' . DEFAULT_TEMPLATE . '/content');
$d_boxes->setRecursive(true);
$d_boxes->setAddDirectoryToFilename(true);
$d_boxes->setCheckExtension('php');
$d_boxes->setExcludeEntries('.svn');
foreach ($d_boxes->getFiles(false) as $box) {
if ($box['is_directory'] === true) {
$entry = array('id' => $filter_id . '/' . $box['name'] . '/*', 'text' => $box['name'] . '/*');
} else {
$page_filename = substr($box['name'], 0, strrpos($box['name'], '.'));
示例4: sendSystemMail
function sendSystemMail($data)
{
global $osC_Session;
$mailer = new osC_Mail();
$mailer->setFrom($this->getAccountName(), $this->getAccountEmail());
foreach ($data['to'] as $to) {
$mailer->addTo($to['name'], $to['email']);
}
if ($data['cc'] != null) {
foreach ($data['cc'] as $cc) {
$mailer->AddCC($cc['name'], $cc['email']);
}
}
if ($data['bcc'] != null) {
foreach ($data['bcc'] as $bcc) {
$mailer->AddBCC($bcc['name'], $bcc['email']);
}
}
$mailer->setSubject($data['subject']);
if ($data['content_type'] == 'html') {
$mailer->setBodyHTML($data['body']);
} elseif ($data['content_type'] == 'text') {
$mailer->setBodyPlain($data['body']);
}
$path = DIR_FS_CACHE_ADMIN . 'emails/attachments/' . $osC_Session->getID();
$directory = new osC_DirectoryListing($path);
if ($directory->getSize() > 0) {
foreach ($directory->getFiles() as $file) {
$mailer->AddAttachment($path . '/' . $file['name']);
}
}
if ($mailer->Send()) {
$data['messages_flag'] = EMAIL_MESSAGE_SENT_ITEM;
return $this->saveSentMessage($data);
}
return false;
}