本文整理汇总了PHP中osC_DirectoryListing::setIncludeDirectories方法的典型用法代码示例。如果您正苦于以下问题:PHP osC_DirectoryListing::setIncludeDirectories方法的具体用法?PHP osC_DirectoryListing::setIncludeDirectories怎么用?PHP osC_DirectoryListing::setIncludeDirectories使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类osC_DirectoryListing
的用法示例。
在下文中一共展示了osC_DirectoryListing::setIncludeDirectories方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: listServices
function listServices()
{
global $toC_Json, $osC_Language;
$osC_DirectoryListing = new osC_DirectoryListing('includes/modules/services');
$osC_DirectoryListing->setIncludeDirectories(false);
$files = $osC_DirectoryListing->getFiles();
$installed = explode(';', MODULE_SERVICES_INSTALLED);
$modules = array();
foreach ($files as $file) {
include 'includes/modules/services/' . $file['name'];
$class = substr($file['name'], 0, strrpos($file['name'], '.'));
$module = 'osC_Services_' . $class . '_Admin';
$module = new $module();
$action = array();
if (in_array($class, $installed) && !osc_empty($module->keys())) {
$action[] = array('class' => 'icon-edit-record', 'qtip' => $osC_Language->get('icon_edit'));
} else {
$action[] = array('class' => 'icon-edit-gray-record', 'qtip' => $osC_Language->get('icon_edit'));
}
if (!in_array($class, $installed)) {
$action[] = array('class' => 'icon-install-record', 'qtip' => $osC_Language->get('icon_install'));
} else {
if ($module->uninstallable == false) {
$action[] = array('class' => 'icon-uninstall-gray-record', 'qtip' => $osC_Language->get('icon_uninstall'));
} else {
$action[] = array('class' => 'icon-uninstall-record', 'qtip' => $osC_Language->get('icon_uninstall'));
}
}
$modules[] = array('code' => $class, 'title' => $module->title, 'action' => $action);
}
$response[EXT_JSON_READER_ROOT] = $modules;
echo $toC_Json->encode($response);
}
示例2: listGeoipModules
function listGeoipModules()
{
global $toC_Json, $osC_Language;
$osC_DirectoryListing = new osC_DirectoryListing('includes/modules/geoip');
$osC_DirectoryListing->setIncludeDirectories(false);
$files = $osC_DirectoryListing->getFiles();
$modules = array();
foreach ($files as $file) {
include 'includes/modules/geoip/' . $file['name'];
$class = substr($file['name'], 0, strrpos($file['name'], '.'));
if (class_exists('osC_GeoIP_' . $class)) {
$osC_Language->loadIniFile('modules/geoip/' . $class . '.php');
$module = 'osC_GeoIP_' . $class;
$module = new $module();
$action = array();
if ($module->isInstalled()) {
$action[] = array('class' => 'icon-uninstall-record', 'qtip' => $osC_Language->get('icon_uninstall'));
} else {
$action[] = array('class' => 'icon-install-record', 'qtip' => $osC_Language->get('icon_install'));
}
$modules[] = array('code' => $class, 'title' => $module->getTitle(), 'description' => $module->getDescription(), 'author' => $module->getAuthorName(), 'action' => $action);
}
}
$response[EXT_JSON_READER_ROOT] = $modules;
echo $toC_Json->encode($response);
}
示例3: listTemplates
function listTemplates()
{
global $toC_Json, $osC_Language;
$osC_DirectoryListing = new osC_DirectoryListing('../templates');
$osC_DirectoryListing->setIncludeDirectories(true);
$osC_DirectoryListing->setIncludeFiles(false);
$osC_DirectoryListing->setExcludeEntries('system');
$files = $osC_DirectoryListing->getFiles(true);
foreach ($files as $file) {
include '../templates/' . $file['name'] . '/template.php';
$code = $file['name'];
$class = 'osC_Template_' . $code;
if (class_exists($class)) {
$module = new $class();
$module_title = $module->getTitle();
$action = array();
if ($module->isInstalled()) {
if ($module->getCode() == DEFAULT_TEMPLATE) {
$module_title .= ' (' . $osC_Language->get('default_entry') . ')';
$action[] = array('class' => 'icon-default-record', 'qtip' => $osC_Language->get('field_set_as_default'));
} else {
$action[] = array('class' => 'icon-default-gray-record', 'qtip' => $osC_Language->get('field_set_as_default'));
}
$action[] = array('class' => 'icon-uninstall-record', 'qtip' => $osC_Language->get('icon_uninstall'));
} else {
$action[] = array('class' => 'icon-empty-record', 'qtip' => $osC_Language->get('field_set_as_default'));
$action[] = array('class' => 'icon-install-record', 'qtip' => $osC_Language->get('icon_install'));
}
$modules[] = array('code' => $module->getCode(), 'title' => $module_title, 'author' => $module->getAuthorName(), 'url' => $module->getAuthorAddress(), 'action' => $action);
}
}
$response = array(EXT_JSON_READER_ROOT => $modules);
echo $toC_Json->encode($response);
}
示例4: getAccesses
function getAccesses()
{
global $toC_Json, $osC_Language;
$osC_DirectoryListing = new osC_DirectoryListing('includes/modules/access');
$osC_DirectoryListing->setIncludeDirectories(false);
$access_modules_array = array();
foreach ($osC_DirectoryListing->getFiles() as $file) {
$module = substr($file['name'], 0, strrpos($file['name'], '.'));
if (!class_exists('osC_Access_' . ucfirst($module))) {
$osC_Language->loadIniFile('modules/access/' . $file['name']);
include $osC_DirectoryListing->getDirectory() . '/' . $file['name'];
}
$module = 'osC_Access_' . ucfirst($module);
$module = new $module();
$title = osC_Access::getGroupTitle($module->getGroup());
$access_modules_array[$title][] = array('id' => $module->getModule(), 'text' => $module->getTitle(), 'leaf' => true);
}
ksort($access_modules_array);
$access_options = array();
$count = 1;
foreach ($access_modules_array as $group => $modules) {
$access_option['id'] = $count;
$access_option['text'] = $group;
$mod_arrs = array();
foreach ($modules as $module) {
$mod_arrs[] = $module;
}
$access_option['children'] = $mod_arrs;
$access_options[] = $access_option;
$count++;
}
echo $toC_Json->encode($access_options);
}
示例5: listCache
function listCache()
{
global $toC_Json;
$osC_DirectoryListing = new osC_DirectoryListing(DIR_FS_WORK);
$osC_DirectoryListing->setIncludeDirectories(false);
$osC_DirectoryListing->setCheckExtension('cache');
$response = array();
foreach ($osC_DirectoryListing->getFiles() as $file) {
$last_modified = filemtime(DIR_FS_WORK . '/' . $file['name']);
if (strpos($file['name'], '-') !== false) {
$code = substr($file['name'], 0, strpos($file['name'], '-'));
} else {
$code = substr($file['name'], 0, strpos($file['name'], '.'));
}
if (isset($cached_files[$code])) {
$cached_files[$code]['total']++;
if ($last_modified > $cached_files[$code]['last_modified']) {
$cached_files[$code]['last_modified'] = $last_modified;
}
} else {
$cached_files[$code] = array('total' => 1, 'last_modified' => $last_modified);
}
$response[] = array('code' => $code, 'total' => $cached_files[$code]['total'], 'last_modified' => osC_DateTime::getShort(osC_DateTime::fromUnixTimestamp($cached_files[$code]['last_modified']), true));
}
$response = array(EXT_JSON_READER_ROOT => $response);
echo $toC_Json->encode($response);
}
示例6: listTemplatesModules
function listTemplatesModules()
{
global $toC_Json, $osC_Language;
$osC_Language->load('modules-' . $_REQUEST['set']);
$osC_DirectoryListing = new osC_DirectoryListing('../includes/modules/' . $_REQUEST['set']);
$osC_DirectoryListing->setIncludeDirectories(false);
$files = $osC_DirectoryListing->getFiles();
$modules = array();
foreach ($files as $file) {
include '../includes/modules/' . $_REQUEST['set'] . '/' . $file['name'];
$code = substr($file['name'], 0, strrpos($file['name'], '.'));
$class = 'osC_' . ucfirst($_REQUEST['set']) . '_' . $code;
if (class_exists($class)) {
if (call_user_func(array($class, 'isInstalled'), $code, $_GET['set']) === false) {
$osC_Language->injectDefinitions('modules/' . $_GET['set'] . '/' . $code . '.xml');
}
$module = new $class();
$action = array();
if ($module->isInstalled() && $module->isActive()) {
if ($module->hasKeys()) {
$action[] = array('class' => 'icon-edit-record', 'qtip' => $osC_Language->get('icon_edit'));
} else {
$action[] = array('class' => 'icon-edit-gray-record', 'qtip' => $osC_Language->get('icon_edit'));
}
$action[] = array('class' => 'icon-uninstall-record', 'qtip' => $osC_Language->get('icon_uninstall'));
} else {
$action[] = array('class' => 'icon-edit-gray-record', 'qtip' => $osC_Language->get('icon_edit'));
$action[] = array('class' => 'icon-install-record', 'qtip' => $osC_Language->get('icon_install'));
}
$modules[] = array('code' => $code, 'title' => $module->getTitle(), 'author' => $module->getAuthorName(), 'url' => $module->getAuthorAddress(), 'action' => $action);
}
}
$response[EXT_JSON_READER_ROOT] = $modules;
echo $toC_Json->encode($response);
}
示例7: listShippingModules
function listShippingModules()
{
global $toC_Json, $osC_Language;
$osC_DirectoryListing = new osC_DirectoryListing('includes/modules/shipping');
$osC_DirectoryListing->setIncludeDirectories(false);
$files = $osC_DirectoryListing->getFiles();
$modules = array();
foreach ($files as $file) {
include 'includes/modules/shipping/' . $file['name'];
$class = substr($file['name'], 0, strrpos($file['name'], '.'));
if (class_exists('osC_Shipping_' . $class)) {
$osC_Language->injectDefinitions('modules/shipping/' . $class . '.xml');
$module = 'osC_Shipping_' . $class;
$module = new $module();
$action = array();
if ($module->isInstalled()) {
$action[] = array('class' => 'icon-edit-record', 'qtip' => $osC_Language->get('icon_edit'));
$action[] = array('class' => 'icon-uninstall-record', 'qtip' => $osC_Language->get('icon_uninstall'));
} else {
$action[] = array('class' => 'icon-edit-gray-record', 'qtip' => $osC_Language->get('icon_edit'));
$action[] = array('class' => 'icon-install-record', 'qtip' => $osC_Language->get('icon_install'));
}
$modules[] = array('code' => $module->getCode(), 'title' => $module->getTitle(), 'sort_order' => $module->getSortOrder(), 'action' => $action);
}
}
$response[EXT_JSON_READER_ROOT] = $modules;
echo $toC_Json->encode($response);
}
示例8: listBackup
function listBackup()
{
global $toC_Json;
$osC_DirectoryListing = new osC_DirectoryListing(DIR_FS_BACKUP);
$osC_DirectoryListing->setIncludeDirectories(false);
$osC_DirectoryListing->setExcludeEntries('.htaccess');
$response = array();
foreach ($osC_DirectoryListing->getFiles() as $file) {
$response[] = array('file' => $file['name'], 'date' => osC_DateTime::getDate(osC_DateTime::fromUnixTimestamp(filemtime(DIR_FS_BACKUP . $file['name'])), true), 'size' => number_format(filesize(DIR_FS_BACKUP . $file['name'])));
}
$response = array(EXT_JSON_READER_ROOT => $response);
echo $toC_Json->encode($response);
}
示例9: getOriginalLogo
function getOriginalLogo()
{
$osC_DirectoryListing = new osC_DirectoryListing('../' . DIR_WS_IMAGES);
$osC_DirectoryListing->setIncludeDirectories(false);
$files = $osC_DirectoryListing->getFiles();
foreach ($files as $file) {
$filename = explode(".", $file['name']);
if ($filename[0] == 'logo_originals') {
return '../' . DIR_WS_IMAGES . 'logo_originals.' . $filename[1];
}
}
return false;
}
示例10: getLocalImages
public static function getLocalImages()
{
$osC_DirectoryListing = new osC_DirectoryListing('../images/products/_upload', true);
$osC_DirectoryListing->setCheckExtension('gif');
$osC_DirectoryListing->setCheckExtension('jpg');
$osC_DirectoryListing->setCheckExtension('png');
$osC_DirectoryListing->setIncludeDirectories(false);
$result = array('entries' => array());
foreach ($osC_DirectoryListing->getFiles() as $file) {
$result['entries'][] = $file['name'];
}
$result['rpcStatus'] = RPC_STATUS_SUCCESS;
echo json_encode($result);
}
示例11: foreach
function osC_LanguageInstall()
{
$osC_DirectoryListing = new osC_DirectoryListing('../includes/languages');
$osC_DirectoryListing->setIncludeDirectories(false);
$osC_DirectoryListing->setCheckExtension('xml');
foreach ($osC_DirectoryListing->getFiles() as $file) {
$osC_XML = new osC_XML(file_get_contents('../includes/languages/' . $file['name']));
$lang = $osC_XML->toArray();
$this->_languages[$lang['language']['data']['code']] = array('name' => $lang['language']['data']['title'], 'code' => $lang['language']['data']['code'], 'charset' => $lang['language']['data']['character_set']);
}
unset($lang);
$language = isset($_GET['language']) && !empty($_GET['language']) ? $_GET['language'] : '';
$this->set($language);
$this->loadIniFile();
$this->loadIniFile(basename($_SERVER['SCRIPT_FILENAME']));
}
示例12: getModules
function getModules()
{
global $toC_Json, $osC_Language;
$osC_DirectoryListing = new osC_DirectoryListing('includes/modules/newsletters');
$osC_DirectoryListing->setIncludeDirectories(false);
$records = array();
foreach ($osC_DirectoryListing->getFiles() as $file) {
$module = substr($file['name'], 0, strrpos($file['name'], '.'));
$osC_Language->loadIniFile('modules/newsletters/' . $file['name']);
include 'includes/modules/newsletters/' . $file['name'];
$newsletter_module_class = 'osC_Newsletter_' . $module;
$osC_NewsletterModule = new $newsletter_module_class();
$records[] = array('id' => $module, 'text' => $osC_NewsletterModule->getTitle());
}
$response = array(EXT_JSON_READER_ROOT => $records);
echo $toC_Json->encode($response);
}
示例13: listImages
function listImages()
{
global $toC_Json;
$osC_DirectoryListing = new osC_DirectoryListing('includes/modules/image');
$osC_DirectoryListing->setIncludeDirectories(false);
$osC_DirectoryListing->setCheckExtension('php');
$record = array();
foreach ($osC_DirectoryListing->getFiles() as $file) {
$class = 'osC_Image_Admin_' . substr($file['name'], 0, strrpos($file['name'], '.'));
if (class_exists($class)) {
$module = new $class();
$record[] = array('module' => $module->getTitle(), 'run' => substr($file['name'], 0, strrpos($file['name'], '.')));
}
}
$response = array(EXT_JSON_READER_ROOT => $record);
echo $toC_Json->encode($response);
}
示例14: getGadgets
function getGadgets()
{
global $osC_Language;
$osC_DirectoryListing = new osC_DirectoryListing('includes/modules/gadgets');
$osC_DirectoryListing->setIncludeDirectories(false);
$gadgets = array();
foreach ($osC_DirectoryListing->getFiles() as $file) {
require_once 'includes/modules/gadgets/' . $file['name'];
$class = substr($file['name'], 0, strrpos($file['name'], '.'));
$osC_Language->loadIniFile('modules/gadgets/' . $file['name']);
if (class_exists('toC_Gadget_' . $class)) {
$module_class = 'toC_Gadget_' . $class;
$module = new $module_class();
$gadgets[] = array('code' => $module->getCode(), 'title' => $module->getTitle());
}
}
return $gadgets;
}
示例15: getUserLevels
/**
* Return the Administration Tool Application modules the administrator has access to
*
* @param int $id The ID of the administrator
* @access public
* @return array
*/
public static function getUserLevels($id)
{
global $osC_Database;
$modules = array();
$Qaccess = $osC_Database->query('select module from :table_administrators_access where administrators_id = :administrators_id');
$Qaccess->bindTable(':table_administrators_access', TABLE_ADMINISTRATORS_ACCESS);
$Qaccess->bindInt(':administrators_id', $id);
$Qaccess->execute();
while ($Qaccess->next()) {
$modules[] = $Qaccess->value('module');
}
if (in_array('*', $modules)) {
$modules = array();
$osC_DirectoryListing = new osC_DirectoryListing('includes/modules/access');
$osC_DirectoryListing->setIncludeDirectories(false);
foreach ($osC_DirectoryListing->getFiles() as $file) {
$modules[] = substr($file['name'], 0, strrpos($file['name'], '.'));
}
}
return $modules;
}