From 252f43cbafdff06d308863507db600966e6ae640 Mon Sep 17 00:00:00 2001 From: xue <> Date: Thu, 23 Mar 2006 22:51:04 +0000 Subject: Added UseDefaultLayout property to TWizard. --- framework/Web/UI/WebControls/TWizard.php | 46 ++++++++++++++++++++++++++++++-- 1 file changed, 44 insertions(+), 2 deletions(-) (limited to 'framework') diff --git a/framework/Web/UI/WebControls/TWizard.php b/framework/Web/UI/WebControls/TWizard.php index 729b1c8f..420d6eb3 100644 --- a/framework/Web/UI/WebControls/TWizard.php +++ b/framework/Web/UI/WebControls/TWizard.php @@ -578,6 +578,24 @@ class TWizard extends TWebControl implements INamingContainer return $style; } + /** + * @return boolean whether to use default layout to arrange side bar and the rest wizard components. Defaults to true. + */ + public function getUseDefaultLayout() + { + return $this->getViewState('UseDefaultLayout',true); + } + + /** + * @param boolean whether to use default layout to arrange side bar and the rest wizard components. + * If true, an HTML table will be used which places the side bar in the left cell + * while the rest components in the right cell. + */ + public function setUseDefaultLayout($value) + { + $this->setViewState('UseDefaultLayout',TPropertyValue::ensureBoolean($value),true); + } + /** * Raises OnActiveStepChanged event. * This event is raised when the current visible step is changed in the @@ -731,8 +749,32 @@ class TWizard extends TWebControl implements INamingContainer public function render($writer) { $this->ensureChildControls(); - $this->applyControlProperties(); - parent::render($writer); + if($this->getHasControls()) + { + if($this->getUseDefaultLayout()) + { + $this->applyControlProperties(); + $this->renderBeginTag($writer); + $writer->write("\n\n
\n"); + $this->_sideBar->renderControl($writer); + $writer->write("\n\n"); + $this->_header->renderControl($writer); + $this->_stepContent->renderControl($writer); + $this->_navigation->renderControl($writer); + $writer->write("\n
\n"); + $this->renderEndTag($writer); + } + else + { + $this->applyControlProperties(); + $this->renderBeginTag($writer); + $this->_sideBar->renderControl($writer); + $this->_header->renderControl($writer); + $this->_stepContent->renderControl($writer); + $this->_navigation->renderControl($writer); + $this->renderEndTag($writer); + } + } } /** -- cgit v1.2.3