Minahito
minah****@users*****
2006年 11月 10日 (金) 01:00:14 JST
Index: xoops2jp/html/modules/legacyRender/kernel/Legacy_RenderSystem.class.php diff -u xoops2jp/html/modules/legacyRender/kernel/Legacy_RenderSystem.class.php:1.1.2.30.2.9 xoops2jp/html/modules/legacyRender/kernel/Legacy_RenderSystem.class.php:1.1.2.30.2.10 --- xoops2jp/html/modules/legacyRender/kernel/Legacy_RenderSystem.class.php:1.1.2.30.2.9 Wed Nov 8 15:12:10 2006 +++ xoops2jp/html/modules/legacyRender/kernel/Legacy_RenderSystem.class.php Fri Nov 10 01:00:14 2006 @@ -1,6 +1,6 @@ <?php /** - * @version $Id: Legacy_RenderSystem.class.php,v 1.1.2.30.2.9 2006/11/08 06:12:10 minahito Exp $ + * @version $Id: Legacy_RenderSystem.class.php,v 1.1.2.30.2.10 2006/11/09 16:00:14 minahito Exp $ */ if (!defined('XOOPS_ROOT_PATH')) exit(); @@ -207,7 +207,11 @@ $this->mRenderTarget->getAttribute($key); } - function renderBlock(&$target) + /** + * @protected + * Assign common variables for the compatibility with X2. + */ + function _commonPrepareRender() { $themeName = $this->mController->mRoot->mContext->getThemeName(); $this->mXoopsTpl->assign('xoops_theme', $themeName); @@ -217,6 +221,24 @@ $this->mXoopsTpl->assign('xoops_sitename', htmlspecialchars($this->mController->mRoot->mContext->getAttribute('legacy_sitename'), ENT_QUOTES)); $this->mXoopsTpl->assign('xoops_pagetitle', htmlspecialchars($this->mController->mRoot->mContext->getAttribute('legacy_pagetitle'), ENT_QUOTES)); $this->mXoopsTpl->assign('xoops_slogan', htmlspecialchars($this->mController->mRoot->mContext->getAttribute('legacy_slogan'), ENT_QUOTES)); + + // + // Assign module informations. + // + if($this->mController->mRoot->mContext->mModule != null) { // The process of module + $xoopsModule =& $this->mController->mRoot->mContext->mXoopsModule; + $this->mXoopsTpl->assign(array('xoops_modulename' => $xoopsModule->getShow('name'), + 'xoops_dirname' => $xoopsModule->getShow('dirname'))); + } + + if (isset($GLOBALS['xoopsUserIsAdmin'])) { + $this->mXoopsTpl->assign('xoops_isadmin', $GLOBALS['xoopsUserIsAdmin']); + } + } + + function renderBlock(&$target) + { + $this->_commonPrepareRender(); if (isset($GLOBALS['xoopsUserIsAdmin'])) { $this->mXoopsTpl->assign('xoops_isadmin', $GLOBALS['xoopsUserIsAdmin']); @@ -282,14 +304,7 @@ function renderMain(&$target) { - $themeName = $this->mController->mRoot->mContext->getThemeName(); - $this->mXoopsTpl->assign('xoops_theme', $themeName); - $this->mXoopsTpl->assign('xoops_imageurl', XOOPS_THEME_URL . "/${themeName}/"); - $this->mXoopsTpl->assign('xoops_themecss', xoops_getcss($themeName)); - - $this->mXoopsTpl->assign('xoops_sitename', htmlspecialchars($this->mController->mRoot->mContext->getAttribute('legacy_sitename'), ENT_QUOTES)); - $this->mXoopsTpl->assign('xoops_pagetitle', htmlspecialchars($this->mController->mRoot->mContext->getAttribute('legacy_pagetitle'), ENT_QUOTES)); - $this->mXoopsTpl->assign('xoops_slogan', htmlspecialchars($this->mController->mRoot->mContext->getAttribute('legacy_slogan'), ENT_QUOTES)); + $this->_commonPrepareRender(); if (isset($GLOBALS['xoopsUserIsAdmin'])) { $this->mXoopsTpl->assign('xoops_isadmin', $GLOBALS['xoopsUserIsAdmin']); @@ -321,27 +336,7 @@ function renderTheme(&$target) { - $themeName = $this->mController->mRoot->mContext->getThemeName(); - $this->mXoopsTpl->assign('xoops_theme', $themeName); - $this->mXoopsTpl->assign('xoops_imageurl', XOOPS_THEME_URL . "/${themeName}/"); - $this->mXoopsTpl->assign('xoops_themecss', xoops_getcss($themeName)); - - $this->mXoopsTpl->assign('xoops_sitename', htmlspecialchars($this->mController->mRoot->mContext->getAttribute('legacy_sitename'), ENT_QUOTES)); - $this->mXoopsTpl->assign('xoops_pagetitle', htmlspecialchars($this->mController->mRoot->mContext->getAttribute('legacy_pagetitle'), ENT_QUOTES)); - $this->mXoopsTpl->assign('xoops_slogan', htmlspecialchars($this->mController->mRoot->mContext->getAttribute('legacy_slogan'), ENT_QUOTES)); - - // - // Assign module informations. - // - if($this->mController->mRoot->mContext->mModule != null) { // The process of module - $xoopsModule =& $this->mController->mRoot->mContext->mXoopsModule; - $this->mXoopsTpl->assign(array('xoops_modulename' => $xoopsModule->getShow('name'), - 'xoops_dirname' => $xoopsModule->getShow('dirname'))); - } - - if (isset($GLOBALS['xoopsUserIsAdmin'])) { - $this->mXoopsTpl->assign('xoops_isadmin', $GLOBALS['xoopsUserIsAdmin']); - } + $this->_commonPrepareRender(); // // Assign from attributes of the render-target.