Minahito
minah****@users*****
2005年 11月 25日 (金) 13:23:39 JST
Index: xoops2jp/html/class/XCube_RenderSystem.class.php diff -u xoops2jp/html/class/XCube_RenderSystem.class.php:1.1.2.7 xoops2jp/html/class/XCube_RenderSystem.class.php:1.1.2.8 --- xoops2jp/html/class/XCube_RenderSystem.class.php:1.1.2.7 Sat Nov 12 02:18:08 2005 +++ xoops2jp/html/class/XCube_RenderSystem.class.php Fri Nov 25 13:23:39 2005 @@ -4,6 +4,95 @@ define("XCUBE_RENDER_MODE_DIALOG",2); /** + * This is a target whom a render-system renders. This has a buffer and receives + * a result of a render-system to the buffer. A developer can control rendering + * with using this class. + */ +class XCube_RenderTarget +{ + var $mName; + + var $mRenderBuffer; + + var $mTemplateName; + var $mAttributes; + + function XCube_RenderTarget() + { + } + + function setName($name) + { + $this->mName=$name; + } + + function getName() + { + return $this->mName; + } + + function setTemplateName($name) + { + $this->mTemplateName=$name; + } + + function getTemplateName() + { + return $this->mTemplateName; + } + + function setAttribute($key,$value) + { + $this->mAttributes[$key]=$value; + } + + function getAttribute($key) + { + return $this->mAttributes[$key]; + } + + function getAttributes() + { + return $this->mAttributes; + } + + function setRenderBuffer($buf) + { + $this->mRenderBuffer=$buf; + } + + function getRenderBuffer($buf) + { + return $this->mRenderBuffer; + } + + function setResult($result) + { + $this->mRenderBuffer=$result; + } + + function getResult() + { + return $this->mRenderBuffer; + } + + /** + * @return bool + */ + function isTheme() + { + } + + function isGlobal() + { + } + + function display() + { + } +} + +/** * This system is in charge of rendering and contents cache management. * For cache management, this system must talk with a business logic before business logic executes. * This class has a bad design so that the template engine is strongly tied to cache management. @@ -27,6 +116,13 @@ var $mRenderMode=XCUBE_RENDER_MODE_NORMAL; + /** + * This is default whom this renders without the render-target specified. + * + * @access private + */ + var $mRenderTarget=null; + function XCube_RenderSystem(&$controller) { $this->mController=&$controller; @@ -36,6 +132,26 @@ { } + /** + * Set main render target. + * + * @param $renderTarget XCube_RenderTarget + */ + function setRenderTarget(&$renderTarget) + { + $this->mRenderTarget=&$renderTarget; + } + + /** + * Return main render target. + * + * @return XCube_RenderTarget + */ + function getRenderTarget() + { + return $this->mRenderTarget; + } + function setTemplateName($name) { $this->mTemplateName=$name; @@ -63,20 +179,21 @@ { } - /** - * @access protected - */ - function sendHeader() + function render() { + $this->renderWithTarget($this->mRenderTarget); } - /** - * We rename this method to execute. Wmm... - */ - function display() + function renderWithTarget(&$renderTarget) { + if($renderTarget->isGlobal()) { + $this->_renderTheme($renderTarget); + } + else { + $this->_render($renderTarget); + } } - + /** * If you set false, the render system may don't display the theme that have 3 columns layout. * However, XOOPS Cube don't force sub-class to implement this feature. @@ -100,19 +217,6 @@ { return null; } - - function setDialogRenderMode() - { - $this->mRenderMode=XCUBE_RENDER_MODE_DIALOG; - } - - /** - * @return bool - */ - function isDialogRenderMode() - { - return $this->mRenderMode==XCUBE_RENDER_MODE_DIALOG; - } } ?> \ No newline at end of file