Minahito
minah****@users*****
2005年 11月 28日 (月) 22:44:14 JST
Index: xoops2jp/html/modules/base/class/Legacy_AdminRenderSystem.class.php diff -u xoops2jp/html/modules/base/class/Legacy_AdminRenderSystem.class.php:1.1.2.4 xoops2jp/html/modules/base/class/Legacy_AdminRenderSystem.class.php:1.1.2.5 --- xoops2jp/html/modules/base/class/Legacy_AdminRenderSystem.class.php:1.1.2.4 Fri Nov 25 13:22:12 2005 +++ xoops2jp/html/modules/base/class/Legacy_AdminRenderSystem.class.php Mon Nov 28 22:44:14 2005 @@ -33,34 +33,26 @@ "xoops_upload_url"=>XOOPS_UPLOAD_URL)); } - function setAttribute($key,$value) + function renderBlock(&$target) { - $this->mSmarty->assign($key,$value); - } - - function getAttribute($key,$value) - { - return $this->mSmarty->get_template_vars($key); - } - - function renderBlock(&$blockProcedure) - { - $templateName=$blockProcedure->getTemplateName(); - $this->mSmarty->assign_by_ref("block",$blockProcedure->getResult()); - $this->mSmarty->template_dir=XOOPS_ROOT_PATH."/modules/base/admin/templates/blocks"; - - $renderResult=&$this->mSmarty->fetch($blockProcedure->getTemplateName()); - $this->mSmarty->clear_assign('block'); - - $this->mBlockContents[]=array( - "title"=>$blockProcedure->getTitle(), - "content"=>$renderResult, - "weight"=>$blockProcedure->getWeight()); + foreach($target->getAttributes() as $key=>$value) { + $this->mSmarty->assign($key,$value); + } + + $result=&$this->mSmarty->fetch($target->getTemplateName()); + $target->setResult($result); + + // + // Reset + // + foreach($target->getAttributes() as $key=>$value) { + $this->mSmarty->clear_assign($key); + } } - function _renderTheme(&$target) + function renderTheme(&$target) { $this->mController->mDebugger->displayLog(); @@ -73,51 +65,31 @@ $this->mSmarty->assign("currentModule",$this->mController->mModuleController->mModuleObject); - // - // [TODO] - // We must implement with a render-target. - // - $this->_processLegacyTemplate(); - // // Theme rendering // - foreach($this->mBlockContents as $result) { + foreach($this->mBlockContents[0] as $result) { $this->mSmarty->append('xoops_lblocks',$result); } - if($target->isTheme()) { - $this->mSmarty->template_dir=XOOPS_ROOT_PATH."/themes/admin/"; - $result=$this->mSmarty->fetch("file:admin_theme.html"); + $this->mSmarty->template_dir=XOOPS_ROOT_PATH."/themes/admin/"; + $result=$this->mSmarty->fetch("file:admin_theme.html"); - $this->mRenderTarget->setResult($result); - } - else { - // --- ADD CODE --- - } + $target->setResult($result); } - function _processStartPage() + function renderMain(&$target) { - ob_start(); - } - - function _processLegacyTemplate() - { - if($this->mTemplateName==null) { - $contents=ob_get_contents(); - ob_end_clean(); + $result=null; + if($target->getTemplateName()) { + $this->mSmarty->template_dir=$this->mController->mModuleController->getModuleDir() . "/". LEGACY_ADMIN_RENDER_TEMPLATE_DIRNAME; + $result=$this->mSmarty->fetch("file:".$this->mTemplateName); } else { - // - // Test: using template - // - $this->mSmarty->template_dir=$this->mController->mModuleController->getModuleDir() . "/". LEGACY_ADMIN_RENDER_TEMPLATE_DIRNAME; - $contents=$this->mSmarty->fetch("file:".$this->mTemplateName); - ob_end_flush(); + $result=$target->getAttribute("stdout_buffer"); } - - $this->mSmarty->assign_by_ref('xoops_contents',$contents); + + $target->setResult($result); } }