From 656c339879a071f2f875831281ed833b876e4361 Mon Sep 17 00:00:00 2001 From: "ctrlaltca@gmail.com" <> Date: Mon, 20 Jun 2011 10:48:45 +0000 Subject: removed useless calls to empty contructor; reverted some additional undocumented changes; upported the "cgi workaround" to trunk/; large (fake) changeset are due to mixed cr/crlf used previously --- framework/Web/UI/TPage.php | 136 ++------------------------------------------- 1 file changed, 4 insertions(+), 132 deletions(-) (limited to 'framework/Web/UI/TPage.php') diff --git a/framework/Web/UI/TPage.php b/framework/Web/UI/TPage.php index 5405391d..cde3b3db 100644 --- a/framework/Web/UI/TPage.php +++ b/framework/Web/UI/TPage.php @@ -22,6 +22,7 @@ Prado::using('System.Web.UI.TClientScriptManager'); * TPage class * * @author Qiang Xue + * @author Brad Anderson * @version $Id$ * @package System.Web.UI * @since 3.0 @@ -50,21 +51,13 @@ class TPage extends TTemplateControl implements IPageEvents 'PRADO_CALLBACK_PARAMETER'=>true ); /** - * @var THtml html instance + * @var TForm form instance */ - private $_html; + private $_form; /** * @var THead head instance */ private $_head; - /** - * @var TBody body instance - */ - private $_body; - /** - * @var TForm form instance - */ - private $_form; /** * @var array list of registered validators */ @@ -77,10 +70,6 @@ class TPage extends TTemplateControl implements IPageEvents * @var TTheme page theme */ private $_theme; - /** - * @var collection of all the skins - */ - private $_skincontrols = array(); /** * @var string page title set when Head is not in page yet */ @@ -578,11 +567,8 @@ class TPage extends TTemplateControl implements IPageEvents */ public function applyControlSkin($control) { - if(($theme=$this->getTheme())!==null) { + if(($theme=$this->getTheme())!==null) $theme->applySkin($control); - if($control->SkinID) - $this->registerSkin($control); - } } /** @@ -1012,48 +998,6 @@ class TPage extends TTemplateControl implements IPageEvents $this->_enableJavaScript=TPropertyValue::ensureBoolean($value); } - /** - * @return THtml, null if not available - */ - public function getHtml() - { - return $this->_html; - } - - /** - * @param THead page head - * @throws TInvalidOperationException if a head already exists - */ - public function setHtml(THtml $value) - { - if($this->_html===null) - $this->_html = $value; - else - throw new TInvalidOperationException('page_body_duplicated'); - } - - /** - * @return TBody the body on the page - */ - public function getBody() - { - return $this->_body; - } - - /** - * Registers the TBody instance on the page. - * Note, a page can contain at most one TBody instance. - * @param TBody the form on the page - * @throws TInvalidOperationException if this method is invoked more than once. - */ - public function setBody(TBody $body) - { - if($this->_body===null) - $this->_body=$body; - else - throw new TInvalidOperationException('page_body_duplicated'); - } - /** * @return THead page head, null if not available */ @@ -1246,78 +1190,6 @@ class TPage extends TTemplateControl implements IPageEvents } } - /** - * Registers a controls skin id with the page. This function links the control to its skin on the page for access. - * @param TControl the object to register the skinid - */ - protected function registerSkin($control) - { - $id = $control->SkinID; - if(!$id) return; - - if(!is_array($this->_skincontrols)) - $this->_skincontrols = array(); - - if(!isset($this->_skincontrols[$id])) - $this->_skincontrols[$id] = array(); - - $this->_skincontrols[$id][] = $control; - } - - /** - * This gets a control based on its SkinId. If there are multiple controls with the same skin, - * you can give this method the second parameter for an index into all the controls with that - * skin id. This will return the first one if and index is not specifiec - * @param string $skinid the skin to look for within the page - * @param index $index the index of the skin if there are many of the same name, defaults to 0 or the first - */ - public function getSkinControl($skinid, $index = 0) - { - if(isset($this->_skincontrols[$skinid][$index])) - return $this->_skincontrols[$skinid][$index]; - } - - /** - * This gets a control based on its SkinId. If there are multiple controls with the same skin, - * you can give this method the second parameter for an index into all the controls with that - * skin id. This will return the first one if and index is not specifiec - * @param string $skinid the skin to look for within the page - */ - public function getSkinControls($skinid) - { - if(isset($this->_skincontrols[$skinid])) - return $this->_skincontrols[$skinid]; - } - - /** - * Return the count of the skins with that id - * @param integer $skinid the skin to look for within the page - */ - public function getSkinControlCount($skinid) - { - if(isset($this->_skincontrols[$skinid])) - return count($this->_skincontrols[$skinid]); - } - public function getSkinControlsByType($skinid, $type) - { - $result = array(); - if(isset($this->_skincontrols[$skinid])) - foreach($this->_skincontrols[$skinid] as $ctl) - if($ctl instanceof $type) - $result[] = $ctl; - - return $result; - } - - public function getSkinControlByType($skinid, $type, $index = 0) - { - if(isset($this->_skincontrols[$skinid])) - foreach($this->_skincontrols[$skinid] as $ctl) - if(($ctl instanceof $type) && $index--) - return $ctl; - } - - /** * @return TStack stack of {@link TOutputCache} objects */ -- cgit v1.2.3