当前位置: 首页>>代码示例>>PHP>>正文


PHP Modules::getEnabledModules方法代码示例

本文整理汇总了PHP中Modules::getEnabledModules方法的典型用法代码示例。如果您正苦于以下问题:PHP Modules::getEnabledModules方法的具体用法?PHP Modules::getEnabledModules怎么用?PHP Modules::getEnabledModules使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在Modules的用法示例。


在下文中一共展示了Modules::getEnabledModules方法的6个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: indexAction

 function indexAction()
 {
     $config_table = new Config();
     $modules_table = new Modules("core");
     $request = new Bolts_Request($this->getRequest());
     if ($request->has('modid')) {
         $modid = $request->modid;
     } else {
         $modid = 'bolts';
     }
     if ($this->_request->isPost()) {
         //we are posting
         $config_params = $this->_request->getParams();
         foreach ($config_params as $ckey => $value) {
             $data = array('value' => $value);
             $config_table->update($data, "ckey = '" . $ckey . "' and module='" . $modid . "'");
         }
         $this->view->success = $this->_T('Configuration Updated.');
         $config_table->cache();
         $params = array();
         $this->_Bolts_plugin->doAction($this->_mca . '_post_save', $params);
         // ACTION HOOK
     }
     $config = $config_table->fetchAll($config_table->select()->where('module = ?', $modid));
     if (count($config) > 0) {
         $config = $config->toArray();
         sort($config);
         $this->view->config = $config;
     }
     $modules = $modules_table->getEnabledModules();
     sort($modules);
     $this->view->modules = $modules;
     $this->view->current = $modid;
     $this->view->modid = $modid;
 }
开发者ID:jaybill,项目名称:Bolts,代码行数:35,代码来源:ConfigController.php

示例2: indexAction

	function indexAction()
	{
		$config_table = new Config();
		// $modules_table = new Modules('core');
		$modules_table = new Modules('modules');
		$modules_table_core = new Modules('core');
		$request = new RivetyCore_Request($this->getRequest());
		$modid = $request->has('modid') ? $request->modid : 'default';
		if ($this->_request->isPost())
		{
			$config_params = $this->_request->getParams();
			foreach ($config_params as $ckey => $value)
			{
				$data = array('value' => $value);
				$config_table->update($data, "ckey = '" . $ckey . "' and module = '" . $modid . "'");
			}
			$this->view->success = $this->_T('Configuration Updated.');
			$config_table->cache();
			$params = array();
			$this->_rivety_plugin->doAction($this->_mca . '_post_save', $params); // ACTION HOOK
		}
		$config = $config_table->fetchAll($config_table->select()->where('module = ?', $modid));
		if (count($config) > 0)
		{
			$config = $config->toArray();
			sort($config);
			$this->view->config = $config;
		}
		$modules = $modules_table_core->getEnabledModules();
		sort($modules);
		$this->view->modules = $modules;
		$this->view->current = $modid;
		$this->view->modid = $modid;
		if ($modid == 'default') $mod_cfg = $modules_table_core->parseIni($modid);
		else $mod_cfg = $modules_table->parseIni($modid);
		$this->view->module_title = $mod_cfg['general']['name'];
		$this->view->breadcrumbs = array('Module Config' => null);
	}
开发者ID:richjoslin,项目名称:rivety,代码行数:38,代码来源:ConfigController.php

示例3: foreach

    global $site;
    $actions = [];
    foreach ($API as $aname => &$a) {
        $methods = [];
        foreach ($a['methods'] as $mname => &$m) {
            if (isset($m['len'])) {
                $md = ['name' => $mname, 'len' => $m['len']];
            } else {
                $md = ['name' => $mname, 'params' => $m['params']];
            }
            if (isset($m['formHandler']) && $m['formHandler']) {
                $md['formHandler'] = true;
            }
            $methods[] = $md;
        }
        $actions[$aname] = $methods;
    }
    $url = $moduleDir === false ? "data/router.php?site={$site}" : "data/router.php?site={$site}&module={$moduleDir}";
    return json_encode(['url' => $url, 'type' => 'remoting', 'actions' => $actions, 'timeout' => 760000000]);
}
require 'config.php';
// convert API config to Ext.Direct spec
header('Content-Type: text/javascript');
echo 'Ext.ns("App.data");';
echo 'App.data = [];';
echo 'App.data.push(' . getREMOTING_API($API) . ');';
if (isset($_SESSION['install']) && $_SESSION['install'] != true) {
    foreach ($m->getEnabledModules() as $module) {
        echo 'App.data.push(' . getREMOTING_API($module['actionsAPI'], $module['dir']) . ');';
    }
}
开发者ID:igez,项目名称:gaiaehr,代码行数:31,代码来源:api.php

示例4: isset

// client data
$_SESSION['client']['browser'] = isset($_SERVER['HTTP_USER_AGENT']) ? $_SERVER['HTTP_USER_AGENT'] : '';
$_SESSION['client']['os'] = isset($_SERVER['HTTP_USER_AGENT']) && strpos($_SERVER['HTTP_USER_AGENT'], 'Windows') === false ? 'Linux' : 'Windows';
// default site
$site = isset($_GET['site']) ? $_GET['site'] : 'default';
if (!isset($_SESSION['styles'])) {
    $_SESSION['styles'] = [];
}
if (file_exists(ROOT . '/sites/' . $site . '/conf.php')) {
    include_once ROOT . '/sites/' . $site . '/conf.php';
    unset($_SESSION['site']['error']);
    // load modules hooks
    if (!isset($_SESSION['hooks'])) {
        include_once ROOT . '/dataProvider/Modules.php';
        $Modules = new Modules();
        $modules = $Modules->getEnabledModules();
        unset($Modules);
        $_SESSION['styles'] = [];
        foreach ($modules as $module) {
            /**
             * Styles
             */
            if (isset($module['styles'])) {
                foreach ($module['styles'] as $style) {
                    $_SESSION['styles'][] = 'modules/' . $module['name'] . '/resources/css/' . $style;
                }
            }
            /**
             * Hooks
             */
            $HooksFile = ROOT . '/modules/' . $module['name'] . '/dataProvider/Hooks.php';
开发者ID:rrabadia89,项目名称:gaiaehr,代码行数:31,代码来源:registry.php

示例5: editAction


//.........这里部分代码省略.........
				}
			}
			$this->view->success = $this->_T("Resources updated.");
		}

		$db_roles_resources = $roles_resources_table->fetchAll('role_id = ' . $role_id );

		$resources = array();

		foreach ($db_roles_resources as $resource)
		{
			if (!array_key_exists($resource->module, $resources))
			{
				$resources[$resource->module] = array();
			}
			if (!array_key_exists($resource->controller, $resources[$resource->module]))
			{
				$resources[$resource->module][$resource->controller] = array();
			}
			$resources[$resource->module][$resource->controller][] = $resource->action;
		}

		/*
		* This is a poor man's introspector. The reflection API needs the classes actually available,
		* which creates naming conflicts between modules. What I do instead is read the physical files,
		* line by line, find the lines with "function fooAction" and determine that the action name is
		* "foo". It's a hack, but it works.
		*/

		$all_actions = array();
		$modules = array();
		$controllerdirs = array();

		$enabled_modules = $modules_table->getEnabledModules();

		foreach ($enabled_modules as $enabled_module)
		{
			$module_dir = 'modules';
			if ($enabled_module == 'default') $module_dir = 'core';
			$controllerdirs[$enabled_module] = Zend_Registry::get("basepath") . DIRECTORY_SEPARATOR . $module_dir . DIRECTORY_SEPARATOR . $enabled_module . DIRECTORY_SEPARATOR . "controllers";
		}

		$controllerdir = $controllerdirs[$module_id];

		$d = dir($controllerdir);
		$modules[] = $module_id;

		while (($entry = $d->read()) !== false)
		{
			if ($entry != '.' and $entry != '..' and $entry != '.svn')
			{
				$controller_name = substr($entry, 0, stripos($entry, 'Controller.php'));
				if ($module_id != "default" && substr($controller_name, 0, 1) == "_")
				{
					$controller_name = substr($controller_name, stripos($controller_name, '_') + 1);
				}
				$lines = file($controllerdir . DIRECTORY_SEPARATOR . $entry);
				foreach ($lines as $line)
				{
					if (preg_match('/function.*Action.*\(.*\).*\{?/', $line))
					{
						$action_name = trim(preg_replace('/Action.*/', '', preg_replace('/^.*function/', '', $line)));

						$allowed = false;
						if (array_key_exists($module_id, $resources))
						{
开发者ID:richjoslin,项目名称:rivety,代码行数:67,代码来源:ResourceController.php

示例6: init

 function init()
 {
     $params = array('username' => null);
     $modules_table = new Modules("core");
     $roles_table = new Roles();
     $enabled_modules = $modules_table->getEnabledModules();
     foreach ($enabled_modules as $enabled_module) {
         $this->view->{"module_" . $enabled_module} = true;
     }
     if (!empty($_SERVER['HTTPS'])) {
         $this->view->is_ssl = true;
         $this->_is_ssl = true;
     } else {
         $this->view->is_ssl = false;
         $this->_is_ssl = false;
     }
     $this->_uri = $_SERVER['REQUEST_URI'];
     $this->_host_id = Zend_Registry::get('host_id');
     $this->view->host_id = $this->_host_id;
     $this->view->session_id = Zend_Session::getId();
     $this->view->site_url = Bolts_Registry::get('site_url');
     $this->view->site_name = Bolts_Registry::get('site_name');
     $this->registry = Zend_Registry::getInstance();
     $this->session = new Zend_Session_Namespace('Default');
     $this->_mca = $this->_request->getModuleName() . "_" . $this->_request->getControllerName() . "_" . $this->_request->getActionName();
     $this->view->mca = str_replace("_", "-", $this->_mca);
     $this->view->controller_name = $this->_request->getControllerName();
     $this->module_name = $this->_request->getModuleName();
     $this->view->module_name = $this->_request->getModuleName();
     $this->view->action_name = $this->_request->getActionName();
     $this->_auth = Zend_Auth::getInstance();
     if ($this->_auth->hasIdentity()) {
         $this->_identity = $this->_auth->getIdentity();
         $this->view->isLoggedIn = true;
         $params['username'] = $this->_identity->username;
         $users_table = new Users();
         $loggedInUser = $users_table->fetchByUsername($this->_identity->username);
         if (!is_null($loggedInUser)) {
             $this->_loggedInUser = $loggedInUser;
             $this->view->loggedInUser = $loggedInUser->toArray();
         }
         $this->view->loggedInUsername = $this->_identity->username;
         $this->view->loggedInFullName = $this->_identity->full_name;
         $loggedInRoleIds = $roles_table->getRoleIdsByUsername($this->_identity->username);
         $this->view->loggedInRoleIds = $loggedInRoleIds;
         foreach ($loggedInRoleIds as $role_id) {
             $role = $roles_table->fetchRow('id = ' . $role_id);
             if ((bool) $role->isadmin) {
                 $this->view->isAdmin = true;
                 $this->_identity->isAdmin = true;
             }
         }
     } else {
         $this->_identity = null;
         $this->view->isLoggedIn = false;
     }
     $appNamespace = new Zend_Session_Namespace('Bolts_Temp');
     $this->view->last_login = $appNamespace->last_login;
     $this->_Bolts_plugin = Bolts_Plugin::getInstance();
     $this->_theme_locations = Zend_Registry::get('theme_locations');
     // Theme filter block: Allow plugin's to alter the current theme based on request, locale, etc.
     $theme_params = array('request' => $this->_request, 'admin' => array('current_theme' => $this->_theme_locations['admin']['current_theme']), 'frontend' => array('current_theme' => $this->_theme_locations['frontend']['current_theme']));
     $theme_params = $this->_Bolts_plugin->doFilter('current_themes', $theme_params);
     // FILTER HOOK
     if (file_exists($theme_params['admin']['current_theme']['path'])) {
         $this->_theme_locations['admin']['current_theme'] = $theme_params['admin']['current_theme'];
     }
     if (file_exists($theme_params['frontend']['current_theme']['path'])) {
         $this->_theme_locations['frontend']['current_theme'] = $theme_params['frontend']['current_theme'];
         $template_path = $this->_theme_locations['frontend']['current_theme']['path'] . "/modules/" . $this->getRequest()->getModuleName();
         $this->view->setScriptPath($template_path);
     }
     // Theme filter block: End.
     $this->view->theme_path = $this->_theme_locations['frontend']['current_theme']['path'];
     $this->view->theme_url = $this->_theme_locations['frontend']['current_theme']['url'];
     $this->view->theme_global_path = $this->_theme_locations['frontend']['current_theme']['path'] . "/global";
     $this->view->theme_global = $this->view->theme_global_path;
     $this->view->theme_controller_path = $this->_theme_locations['frontend']['current_theme']['path'] . '/modules/' . $this->getRequest()->getModuleName() . "/" . $this->getRequest()->getControllerName();
     $this->view->theme_module_path = $this->_theme_locations['frontend']['current_theme']['path'] . '/modules/' . $this->getRequest()->getModuleName();
     $this->view->default_theme_path = $this->_theme_locations['frontend']['default_theme']['path'];
     $this->view->default_theme_url = $this->_theme_locations['frontend']['default_theme']['url'];
     $this->view->default_theme_global_path = $this->_theme_locations['frontend']['default_theme']['path'] . "/global";
     $this->view->default_theme_controller_path = $this->_theme_locations['frontend']['default_theme']['path'] . '/modules/' . $this->getRequest()->getModuleName() . "/" . $this->getRequest()->getControllerName();
     $this->view->default_theme_module_path = $this->_theme_locations['frontend']['default_theme']['path'] . '/modules/' . $this->getRequest()->getModuleName();
     Bolts_Log::report("Current path " . $this->_mca, null, Zend_Log::INFO);
     $this->view->isAdminController = false;
     $this->view->title_prefix = Bolts_Registry::get('title_prefix');
     $locale_is_valid = true;
     $default_locale_code = str_replace('_', '-', trim(strtolower(Bolts_Registry::get('default_locale'))));
     $this->locale_code = $default_locale_code;
     if (Bolts_Registry::get('enable_localization') == '1') {
         // to set the locale code, look in the URL, not in the cookie
         // the only thing that should check the cookie is the home page and optionally the locale chooser page
         $locales_table = new Locales();
         $db_locales_full = $locales_table->getLocaleCodesArray(true);
         $db_locales = array_keys($db_locales_full);
         // Get the locales allowed in the config
         $allowed_locales = explode(',', Bolts_Registry::get('allowed_locales'));
         if (!empty($allowed_locales) && (bool) array_filter($allowed_locales)) {
             $allowed_locales = array_map('trim', $allowed_locales);
//.........这里部分代码省略.........
开发者ID:jaybill,项目名称:Bolts,代码行数:101,代码来源:Abstract.php


注:本文中的Modules::getEnabledModules方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。