summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorxue <>2005-12-08 14:21:44 +0000
committerxue <>2005-12-08 14:21:44 +0000
commit0d2c3c84ea6457a9d0a04e25e19a26811eef8562 (patch)
tree227203839cb7be2ad59e274c8ddc392ecc3cff27
parent1b0fbdbe10f426de5de8bd361f5e0806b349bdf5 (diff)
-rw-r--r--demos/controls/protected/pages/HomePage.tpl2
-rw-r--r--demos/controls/protected/pages/master/MasterPage.tpl5
-rw-r--r--framework/Web/UI/TClientScriptManager.php16
-rw-r--r--framework/Web/UI/TPage.php28
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" %>
<com:TContent id="body" >
<com:TForm>
<div>
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">
<html xmlns="http://www.w3.org/1999/xhtml" lang="en" xml:lang="en">
-<head>
+<com:THead>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
-<title>test</title>
-</head>
+</com:THead>
<body>
<com:TContentPlaceHolder id="body" />
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("<script type=\"text/javascript\" src=\"".THttpUtility::htmlEncode($include)."\"></script>\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
@@ -41,6 +41,10 @@ class TPage extends TTemplateControl
*/
private $_form=null;
/**
+ * @var THead head instance
+ */
+ private $_head=null;
+ /**
* @var string template file name
*/
private $_templateFile=null;
@@ -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