Minahito
minah****@users*****
2006年 10月 6日 (金) 18:48:12 JST
Index: xoops2jp/html/modules/base/kernel/Legacy_HttpContext.class.php diff -u xoops2jp/html/modules/base/kernel/Legacy_HttpContext.class.php:1.1.2.2 xoops2jp/html/modules/base/kernel/Legacy_HttpContext.class.php:1.1.2.3 --- xoops2jp/html/modules/base/kernel/Legacy_HttpContext.class.php:1.1.2.2 Thu Oct 5 19:18:13 2006 +++ xoops2jp/html/modules/base/kernel/Legacy_HttpContext.class.php Fri Oct 6 18:48:12 2006 @@ -1,11 +1,13 @@ <?php /** * @package Legacy - * @version $Id: Legacy_HttpContext.class.php,v 1.1.2.2 2006/10/05 10:18:13 minahito Exp $ + * @version $Id: Legacy_HttpContext.class.php,v 1.1.2.3 2006/10/06 09:48:12 minahito Exp $ */ if (!defined('XOOPS_ROOT_PATH')) exit(); +require_once XOOPS_ROOT_PATH . "/modules/base/kernel/Legacy_Module.class.php"; + /** * The context class for Legacy which extends to keep Legacy-module-specific * informations. @@ -64,121 +66,4 @@ } -class Legacy_Module -{ - /** - * @access public - * @var XoopsModule - */ - var $mXoopsModule = null; - - /** - * @access public - * @var array - */ - var $mModuleConfig = array(); - - var $mCacheInfo = null; - - var $mRender = null; - - function &getCacheInfo() - { - if (!is_object($this->mCacheInfo)) { - $this->_createCacheInfo(); - } - - return $this->mCacheInfo; - } - - function _createCacheInfo() - { - $this->mCacheInfo =& new Legacy_ModuleCacheInformation(); - $this->mCacheInfo->mURL = xoops_getenv('REQUEST_URI'); - $this->mCacheInfo->setModule($this->mXoopsModule); - } - - function &getRenderBuffer() - { - if ($this->mRender == null) { - $this->_createRenderBuffer(); - } - - return $this->mRender; - } - - function _createRenderBuffer() - { - $this->mRender =& new XCube_RenderTarget(); - $this->mRender->setType(XCUBE_RENDER_TARGET_TYPE_MAIN); - if ($this->mXoopsModule != null) { - $this->mRender->setModuleName($this->mXoopsModule->get('dirname')); - } - } - - function getRenderSystemName() - { - $root =& XCube_Root::getSingleton(); - return $root->mContext->mBaseRenderSystemName; - } - - function isActive() - { - return $this->mXoopsModule->get('isactive') ? true : false; - } - - function setupLanguage() - { - $root =& XCube_Root::getSingleton(); - $root->mLanguageManager->loadModuleMessageCatalog($this->mXoopsModule->getVar('dirname')); - } - - /** - * Gets a value indicating whether the current module has a option of - * configurations to use the cache system. - * @return bool - */ - function hasCacheConfig() - { - if (xoops_getenv('REQUEST_METHOD') == 'POST') { - return false; - } - - $root =& XCube_Root::getSingleton(); - - return is_object($this->mXoopsModule) && !empty($root->mController->mConfig['module_cache'][$this->mXoopsModule->get('mid')]); - } - - /** - * Initializes a cache information object, and returns it. - * @return Legacy_ModuleCacheInformation - */ - function &createCacheInfo() - { - $this->mCacheInfo =& new Legacy_ModuleCacheInformation(); - $this->mCacheInfo->mURL = xoops_getenv('REQUEST_URI'); - $this->mCacheInfo->setModule($xoopsModule); - - return $this->mCacheInfo; - } -} - -class Legacy_AdminModule extends Legacy_Module -{ - function setupLanguage() - { - $root =& XCube_Root::getSingleton(); - if (isset($this->mXoopsModule->modinfo['cube_style']) && $this->mXoopsModule->modinfo['cube_style'] != false) { - $root->mLanguageManager->loadModuleMessageCatalog($this->mXoopsModule->get('dirname')); - } - $root->mLanguageManager->loadModuleAdminMessageCatalog($this->mXoopsModule->get('dirname')); - $root->mLanguageManager->loadModinfoMessageCatalog($this->mXoopsModule->get('dirname')); - } - - function hasCacheConfig() - { - return false; - } -} - ?> \ No newline at end of file