Minahito
minah****@users*****
2005年 11月 28日 (月) 22:45:29 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.3 xoops2jp/html/modules/base/kernel/Legacy_Controller.class.php:1.1.2.4 --- xoops2jp/html/modules/base/kernel/Legacy_Controller.class.php:1.1.2.3 Fri Nov 25 13:26:29 2005 +++ xoops2jp/html/modules/base/kernel/Legacy_Controller.class.php Mon Nov 28 22:45:29 2005 @@ -22,12 +22,13 @@ var $_mAdminModeFlag=false; var $_mControllerState=null; + var $mDialogMode=false; + function Legacy_Controller(&$root) { parent::XCube_Controller($root); set_magic_quotes_runtime(0); // ^^; - // // Decide status. [TEST] // @@ -145,10 +146,30 @@ function _processBlock() { $i=0; + + $blockTarget=new XCube_RenderTarget(); + $blockTarget->setType(XCUBE_RENDER_TARGET_TYPE_BLOCK); + foreach($this->mBlockChain as $blockProcedure) { $blockProcedure->execute($this,$this->getXoopsUser()); if($blockProcedure->hasResult()) { - $this->mRenderSystem->renderBlock($blockProcedure); + // + // + // + $blockTarget->setTemplateName($blockProcedure->getTemplateName()); + $blockTarget->setAttribute("block",$blockProcedure->getResult()); + $blockTarget->setAttribute("mid",$blockProcedure->getId()); + + $this->mRenderSystem->renderBlock($blockTarget); + + $this->mRenderSystem->mBlockShowFlags[$blockProcedure->getEntryIndex()] = true; + $this->mRenderSystem->mBlockContents[$blockProcedure->getEntryIndex()][] = array( + 'title'=>$blockProcedure->getTitle(), + 'content'=>$blockTarget->getResult(), + 'weight'=>$blockProcedure->getWeight() + ); + + $blockTarget->reset(); } unset($blockProcedure); } @@ -284,12 +305,56 @@ function executeHeader() { parent::executeHeader(); - $this->mRenderSystem->_processStartPage(); + + // + // We changed a render-system class in a pure drawing system. Therefore + // a controller should not ask him for careful work for compatibility. + // + + // + // The following comment-outed line is old version process. + // + // $this->mRenderSystem->_processStartPage(); + + require_once XOOPS_ROOT_PATH.'/include/old_theme_functions.php'; + $GLOBALS['xoopsTheme']['thename'] = $GLOBALS['xoopsConfig']['theme_set']; + ob_start(); + + $renderTarget=new Legacy_RenderTargetMain(); + $this->mRenderSystem->setRenderTarget($renderTarget); } function executeView() { - $this->mRenderSystem->display(); + // + // Buffering handling of standard output for main render target is responsibility + // of a controller. Of course all controllers do not have to implement this. + // The following lines are movement for compatibility and the feature of + // this controller. + // + if(!$this->mRenderSystem->mTemplateName) + $this->mRenderSystem->mTemplateName = isset($GLOBALS['xoopsOption']['template_main']) ? $GLOBALS['xoopsOption']['template_main'] : null; + + $renderTarget=&$this->mRenderSystem->getRenderTarget(); + + $renderTarget->setTemplateName($this->mRenderSystem->mTemplateName); + + $renderTarget->setAttribute("stdout_buffer",ob_get_contents()); + ob_end_clean(); + +// $this->mRenderSystem->mRenderTarget->copyAttributes($mainRenderTarget); + + $this->mRenderSystem->renderWithTarget($renderTarget); + + // + // Theme Control + // + $screenTarget=$this->mDialogMode ? new Legacy_DialogRenderTarget() : new Legacy_ThemeRenderTarget(); + $screenTarget->setTemplateName($this->mConfig['theme_set']); + + $screenTarget->setAttribute('xoops_contents',$renderTarget->getResult()); + + $this->mRenderSystem->renderWithTarget($screenTarget); $isAdmin=false; if(is_object($this->mXoopsUser)) {