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


PHP Modules::fetchAll方法代码示例

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


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

示例1: indexAction

 function indexAction()
 {
     // retrieve the ID of the requested page
     $pageID = $this->view->pageID = $this->_getParam('ID');
     $pageDetails = new PagesIndex();
     $pageDetailsSelect = $pageDetails->select();
     $pageDetailsSelect->where('PI_PageID = ?', $pageID)->where('PI_LanguageID = ?', $this->_defaultEditLanguage);
     $pageDetailsData = $pageDetails->fetchRow($pageDetailsSelect)->toArray();
     $this->view->assign("pageTitle", $pageDetailsData["PI_PageTitle"]);
     $authData = $this->view->user;
     $authID = $authData['EU_ID'];
     if (Cible_FunctionsAdministrators::checkAdministratorPageAccess($authID, $pageID, "data")) {
         $authData = $this->view->user;
         $authID = $authData['EU_ID'];
         if (Cible_FunctionsAdministrators::checkAdministratorPageAccess($authID, $pageID, "structure")) {
             $this->view->assign('hasAccessToStructure', true);
         }
         // Retrieve the page view layout
         $page = new Pages();
         $page_select = $page->select()->setIntegrityCheck(false);
         $page_select->from('Pages')->join('Views', 'Pages.P_ViewID = Views.V_ID')->where('P_ID = ?', $pageID);
         $page_info = Cible_FunctionsPages::getPageViewDetails($pageID);
         $template_file = 'index/' . $page_info['V_Path'];
         $_zone_count = $page_info['V_ZoneCount'];
         // make a request to get all the blocks to be displayed
         $blocks = new Blocks();
         $select = $blocks->select()->setIntegrityCheck(false);
         $select->from('Blocks')->join('Modules', 'Modules.M_ID = Blocks.B_ModuleID')->join('Pages', 'Blocks.B_PageID = P_ID')->join('BlocksIndex', 'Blocks.B_ID = BlocksIndex.BI_BlockID')->where('Blocks.B_PageID = ?', $pageID)->where('BlocksIndex.BI_LanguageID = ?', Zend_Registry::get('languageID'))->order('Blocks.B_Position ASC');
         //Send the results to the view
         $rows = $blocks->fetchAll($select);
         $_blocks = array();
         foreach ($rows as $row) {
             // create the placeholder object if not already defined
             if (!isset($_blocks[$row['B_ZoneID']])) {
                 $_blocks[$row['B_ZoneID']] = array();
             }
             $_blocks[$row['B_ZoneID']][] = $row->toArray();
         }
         $this->view->assign('template_file', $template_file);
         $this->view->assign('zone_count', $_zone_count);
         $this->view->assign('blocks', $_blocks);
         // Load the modules in the view
         $Modules = new Modules();
         $modules = $Modules->fetchAll();
         $this->view->assign('modules', $modules->toArray());
     } else {
         $this->view->assign('template_file', "");
         $this->view->assign('error_message_permission', $this->view->getCibleText('error_message_permission'));
     }
 }
开发者ID:anunay,项目名称:stentors,代码行数:50,代码来源:IndexController.php

示例2: indexAction

 function indexAction()
 {
     $modules_table = new Modules("nuts");
     $request = new Bolts_Request($this->getRequest());
     if ($request->has("id") and $request->has("perform")) {
         switch ($request->perform) {
             case "enable":
                 if (!$modules_table->isEnabled($request->id)) {
                     if ($modules_table->enable($request->id)) {
                         if (!is_null($modules_table->success)) {
                             $this->view->success = $modules_table->success;
                         } else {
                             $this->view->success = "Module \"" . $request->id . "\" enabled.";
                         }
                     }
                 } else {
                     $this->view->notice = "Module \"" . $request->id . "\" is already enabled.";
                 }
                 break;
             case "disable":
                 if ($modules_table->isEnabled($request->id)) {
                     if ($modules_table->disable($request->id)) {
                         if (!is_null($modules_table->success)) {
                             $this->view->success = $modules_table->success;
                         } else {
                             $this->view->success = "Module \"" . $request->id . "\" disabled.";
                         }
                     }
                 } else {
                     $this->view->notice = "Module \"" . $request->id . "\" is already disabled.";
                 }
                 break;
             case "install":
                 if (!$modules_table->exists($request->id)) {
                     if ($modules_table->install($request->id)) {
                         if (!is_null($modules_table->success)) {
                             $this->view->success = $modules_table->success;
                         } else {
                             $this->view->success = "Module \"" . $request->id . "\" installed.";
                         }
                     }
                 } else {
                     $this->view->notice = "Module \"" . $request->id . "\" is already installed.";
                 }
                 break;
             case "uninstall":
                 if ($modules_table->exists($request->id)) {
                     if ($modules_table->disable($request->id)) {
                         if ($modules_table->uninstall($request->id)) {
                             if (!is_null($modules_table->success)) {
                                 $this->view->success = $modules_table->success;
                             } else {
                                 $this->view->success = "Module \"" . $request->id . "\" disabled and uninstalled.";
                             }
                         }
                     }
                 } else {
                     $this->view->notice = "Module \"" . $request->id . "\" is not installed.";
                 }
                 break;
         }
         if (count($modules_table->errors) > 0) {
             $this->view->errors = $modules_table->errors;
         }
         if (!is_null($modules_table->notice)) {
             $this->view->notice = $modules_table->notice;
         }
     }
     $basepath = Zend_Registry::get('basepath');
     $module_dir = $basepath . "/nuts";
     $o_module_dir = dir($module_dir);
     $available_modules = array();
     while (false !== ($entry = $o_module_dir->read())) {
         if (substr($entry, 0, 1) != ".") {
             if ($entry != "default") {
                 $full_dir = $module_dir . "/" . $entry;
                 if (file_exists($full_dir . "/module.ini") and !$modules_table->exists($entry)) {
                     $tmp_module = $modules_table->parseIni($entry);
                     $tmp_module['id'] = $entry;
                     $tmp_module['available'] = true;
                     $available_modules[] = $tmp_module;
                 }
             }
         }
     }
     $o_module_dir->close();
     $tmp_modules = array();
     $modules = $modules_table->fetchAll(null, "id");
     if (count($modules) > 0) {
         $tmp_modules = array();
         foreach ($modules as $module) {
             $module = $module->toArray();
             try {
                 $config = $modules_table->parseIni($module['id']);
                 foreach ($config as $key => $val) {
                     $module[$key] = $val;
                 }
                 $module['available'] = false;
                 $tmp_modules[] = $module;
             } catch (Exception $e) {
//.........这里部分代码省略.........
开发者ID:jaybill,项目名称:Bolts,代码行数:101,代码来源:ModuleController.php

示例3: Modules

	// check for database changes
	$modules_table = new Modules('core');
	$modules_table->upgradeDatabase("default");
	$modules_table->setDefaultConfig("default");
	$config_table = new Config();
	$config_array = $config_table->fetchall()->toArray();
	foreach ($config_array as $config_param)
	{
		Zend_Registry::set($config_param['ckey'], $config_param['value']);
	}
	// // Make session use the DB
	// Zend_Session::setSaveHandler(new RivetyCore_SessionSaveHandler());
	// Zend_Session::start();
	// Get the list of modules from the db
	$modules_table = new Modules('modules');
	$enabled_modules = $modules_table->fetchAll("is_enabled = 1");
	if (count($enabled_modules) > 0)
	{
		foreach ($enabled_modules as $module)
		{
			$full_dir = $module_dir . "/" . $module->id;
			if ($modules_table->isEnabled($module->id))
			{
				$modules_table->setup($module->id);
				$smarty_plugins_dir = $full_dir . '/smarty_plugins';
				// if there are any OTHER smarty plugin dirs in other modules, convert smarty_plugin_dirs to an array and add the default
				if (is_dir($smarty_plugins_dir))
				{
					$tmp_dir = $smarty_plugins_dirs;
					if (is_array($smarty_plugins_dirs))
					{
开发者ID:richjoslin,项目名称:rivety,代码行数:31,代码来源:header.php


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