NobuNobu
nobun****@users*****
2006年 5月 16日 (火) 21:59:36 JST
Index: xoops2jp/html/modules/base/kernel/Legacy_Controller.class.php diff -u xoops2jp/html/modules/base/kernel/Legacy_Controller.class.php:1.1.2.32 xoops2jp/html/modules/base/kernel/Legacy_Controller.class.php:1.1.2.33 --- xoops2jp/html/modules/base/kernel/Legacy_Controller.class.php:1.1.2.32 Fri Apr 28 15:47:13 2006 +++ xoops2jp/html/modules/base/kernel/Legacy_Controller.class.php Tue May 16 21:59:36 2006 @@ -51,6 +51,53 @@ $this->_mControllerState= $adminStateFlag ? new BaseControllerAdminState() : new BaseControllerPublicState(); } + /** + * @access public + */ + function executeCommon() + { + // + // Setup Filter chain and execute the process of these filters. + // + $this->_setupFilterChain(); + $this->_processFilter(); + + $this->mRoot->setEventManager($this->_createEventManager()); + $this->mRoot->setServiceManager($this->_createServiceManager()); + + // ^^; + $this->_setupErrorHandler(); + + $this->_setupEnvironment(); + + $this->_setupLogger(); + + $this->_setupDB(); + + $this->_setupLanguage(); + + $this->_setupConfig(); + + $this->_setupDebugger(); + + $this->_processPreBlockFilter(); // What's !? + + $languageManager =& $this->_createLanguageManager(); + $this->mRoot->setLanguageManager($languageManager); + + $this->_processHostAbstractLayer(); + + $this->_setupSession(); + + $this->_setupUser(); + + $this->_setupModuleController(); + + $this->_setupRenderSystem(); + + $this->_processModuleController(); + } + function _setupLogger() { require_once XOOPS_ROOT_PATH.'/class/logger.php'; @@ -312,16 +359,36 @@ $GLOBALS['xoopsDB']=&$this->mDB; } + function _setupLanguage() + { + if (!$this->mLanguage) { + $configHandler=&xoops_gethandler('config'); + $criteria =& new CriteriaCompo(new Criteria('conf_modid',0)); + $criteria->add(new Criteria('conf_catid',XOOPS_CONF)); + $criteria->add(new Criteria('conf_name','language')); + $configs =& $configHandler->getConfigs($criteria); + if (count($configs)) { + $this->mLanguage = $configs[0]->getVar('conf_value'); + } + } + if ($this->mLanguage) { + $fname = XOOPS_MODULE_PATH .'/base/language/' .$this->mLanguage .'/charset_'.XOOPS_DB_TYPE.'.php'; + if (file_exists($fname)) { + require_once($fname); + } + } + } + function _setupConfig() { $configHandler=&xoops_gethandler('config'); $this->mConfig=&$configHandler->getConfigsByCat(XOOPS_CONF); $this->mRoot->setThemeName($this->mConfig['theme_set']); - + if ($this->mLanguage) { + $this->mConfig['language'] = $this->mLanguage; + } $GLOBALS['xoopsConfig']=&$this->mConfig; - - $this->mRoot->setThemeName($this->mConfig['theme_set']); } /** @@ -338,11 +405,11 @@ if (defined("OH_MY_GOD_HELP_ME")) { $debug_mode = XOOPS_DEBUG_PHP; } - + $this->mDebugger =& Legacy_DebuggerManager::getInstance($debug_mode); $this->mDebugger->prepare(); - $GLOBALS['xoopsDebugger'] =& $this->mDebugger; + $GLOBALS['xoopsDebugger']=&$this->mDebugger; } function _processPreBlockFilter() @@ -536,9 +603,9 @@ // // Debug Process // - $isAdmin = false; - if (is_object($this->mXoopsUser)) { - if ($this->mModuleController->isModuleProcess() && $this->mModuleController->isActive()) { + $isAdmin=false; + if(is_object($this->mXoopsUser)) { + if($this->mModuleController->isModuleProcess() && $this->mModuleController->isActive()) { // @todo I depend on Legacy Module Controller. $mid=$this->mModuleController->mModuleObject->getVar('mid'); }