From 0d2c3c84ea6457a9d0a04e25e19a26811eef8562 Mon Sep 17 00:00:00 2001 From: xue <> Date: Thu, 8 Dec 2005 14:21:44 +0000 Subject: --- demos/controls/protected/pages/HomePage.tpl | 2 +- .../controls/protected/pages/master/MasterPage.tpl | 5 ++-- framework/Web/UI/TClientScriptManager.php | 16 ++++++------- framework/Web/UI/TPage.php | 28 +++++++++++++++++++++- 4 files changed, 38 insertions(+), 13 deletions(-) diff --git a/demos/controls/protected/pages/HomePage.tpl b/demos/controls/protected/pages/HomePage.tpl index bebc2d4f..76c24e39 100644 --- a/demos/controls/protected/pages/HomePage.tpl +++ b/demos/controls/protected/pages/HomePage.tpl @@ -1,4 +1,4 @@ -<%@ MasterClass="Pages.master.MasterPage" %> +<%@ MasterClass="Pages.master.MasterPage" Title="Main Page" %>
diff --git a/demos/controls/protected/pages/master/MasterPage.tpl b/demos/controls/protected/pages/master/MasterPage.tpl index b3f23372..c2ce8436 100644 --- a/demos/controls/protected/pages/master/MasterPage.tpl +++ b/demos/controls/protected/pages/master/MasterPage.tpl @@ -2,10 +2,9 @@ "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"> - + -test - + diff --git a/framework/Web/UI/TClientScriptManager.php b/framework/Web/UI/TClientScriptManager.php index ee7ca88f..e42a0b20 100644 --- a/framework/Web/UI/TClientScriptManager.php +++ b/framework/Web/UI/TClientScriptManager.php @@ -78,7 +78,7 @@ class TClientScriptManager extends TComponent private $_hiddenFields=array(); private $_beginScripts=array(); private $_endScripts=array(); - private $_scriptIncludes=array(); + private $_scriptFiles=array(); private $_onSubmitStatements=array(); private $_arrayDeclares=array(); private $_expandoAttributes=array(); @@ -161,7 +161,7 @@ class TClientScriptManager extends TComponent { $url=$this->_page->getService()->getAssetManager()->publishFilePath(Prado::getFrameworkPath().'/'.self::SCRIPT_DIR.'/'.$scriptFile); $this->_publishedScriptFiles[$scriptFile]=$url; - $this->registerScriptInclude('prado:'.$scriptFile,$url); + $this->registerScriptFile('prado:'.$scriptFile,$url); } return $url; } @@ -218,9 +218,9 @@ class TClientScriptManager extends TComponent return isset($this->_scriptBlocks[$key]); } - public function isScriptIncludeRegistered($key) + public function isScriptFileRegistered($key) { - return isset($this->_scriptIncludes[$key]); + return isset($this->_scriptFiles[$key]); } public function isBeginScriptRegistered($key) @@ -243,9 +243,9 @@ class TClientScriptManager extends TComponent $this->_arrayDeclares[$name][]=$value; } - public function registerScriptInclude($key,$url) + public function registerScriptFile($key,$url) { - $this->_scriptIncludes[$key]=$url; + $this->_scriptFiles[$key]=$url; } public function registerHiddenField($name,$value) @@ -285,9 +285,9 @@ class TClientScriptManager extends TComponent } } - public function renderScriptIncludes($writer) + public function renderScriptFiles($writer) { - foreach($this->_scriptIncludes as $include) + foreach($this->_scriptFiles as $include) $writer->write("\n"); } diff --git a/framework/Web/UI/TPage.php b/framework/Web/UI/TPage.php index 1aa0d40b..e2565291 100644 --- a/framework/Web/UI/TPage.php +++ b/framework/Web/UI/TPage.php @@ -40,6 +40,10 @@ class TPage extends TTemplateControl * @var TForm form instance */ private $_form=null; + /** + * @var THead head instance + */ + private $_head=null; /** * @var string template file name */ @@ -699,7 +703,7 @@ class TPage extends TTemplateControl $cs->renderHiddenFields($writer); $cs->renderArrayDeclarations($writer); $cs->renderExpandoAttributes($writer); - $cs->renderScriptIncludes($writer); + $cs->renderScriptFiles($writer); $cs->renderEndScripts($writer); } else @@ -741,6 +745,28 @@ class TPage extends TTemplateControl protected function initializeCulture() { } + + public function getHead() + { + return $this->_head; + } + + public function setHead(THead $value) + { + if($this->_head) + throw new TInvalidOperationException('page_head_duplicated'); + $this->_head=$value; + } + + public function getTitle() + { + return $this->getViewState('Title',''); + } + + public function setTitle($value) + { + $this->setViewState('Title',$value,''); + } } ?> \ No newline at end of file -- cgit v1.2.3