Minahito
minah****@users*****
2006年 8月 19日 (土) 12:33:25 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.68 xoops2jp/html/modules/base/kernel/Legacy_Controller.class.php:1.1.2.69 --- xoops2jp/html/modules/base/kernel/Legacy_Controller.class.php:1.1.2.68 Fri Aug 18 18:10:51 2006 +++ xoops2jp/html/modules/base/kernel/Legacy_Controller.class.php Sat Aug 19 12:33:25 2006 @@ -1,7 +1,7 @@ <?php /** * @package Legacy - * @version $Id: Legacy_Controller.class.php,v 1.1.2.68 2006/08/18 09:10:51 minahito Exp $ + * @version $Id: Legacy_Controller.class.php,v 1.1.2.69 2006/08/19 03:33:25 minahito Exp $ */ if (!defined('XOOPS_ROOT_PATH')) exit(); @@ -67,6 +67,11 @@ */ var $mCreateLanguageManager = null; + /** + * @var XCube_Delegate + */ + var $mGetLanguageName = null; + var $mBlockShowFlags = array(); var $mBlockContents = array(); @@ -94,6 +99,9 @@ $this->mCreateLanguageManager =& new XCube_Delegate(); $this->mCreateLanguageManager->register("Legacy_Controller.CreateLanguageManager"); + + $this->mGetLanguageName =& new XCube_Delegate(); + $this->mGetLanguageName->register("Legacy_Controller.GetLanguageName"); set_magic_quotes_runtime(0); // ^^; @@ -420,18 +428,22 @@ { require_once XOOPS_BASE_PATH."/kernel/Legacy_LanguageManager.class.php"; - $language = "english"; + $language = null; - $handler =& 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 =& $handler->getConfigs($criteria); + $this->mGetLanguageName->call(new XCube_Ref($language)); - if (count($configs) > 0) { - $language = $configs[0]->get('conf_value', 'none'); - } + if ($language == null) { + $handler =& 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 =& $handler->getConfigs($criteria); + if (count($configs) > 0) { + $language = $configs[0]->get('conf_value', 'none'); + } + } + $this->mRoot->mLanguageManager =& $this->_createLanguageManager($language); $this->mRoot->mLanguageManager->setLanguage($language); $this->mRoot->mLanguageManager->prepare();