summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorxue <>2006-03-30 19:38:44 +0000
committerxue <>2006-03-30 19:38:44 +0000
commit95045861e77f7ad9978cf6f3e741f3ffe66e8f96 (patch)
tree2c66b67f09d0ae5d9593245e0c6079dab1143635
parent152f44e871998d6715a9b7d39e8d2bc30530aaf1 (diff)
Enhanced page title manipulation so that page title is always stored in THead.
-rw-r--r--HISTORY4
-rw-r--r--framework/Web/UI/TPage.php19
-rw-r--r--framework/Web/UI/WebControls/THead.php3
3 files changed, 20 insertions, 6 deletions
diff --git a/HISTORY b/HISTORY
index d8cfffbd..89912f1e 100644
--- a/HISTORY
+++ b/HISTORY
@@ -20,8 +20,8 @@ NEW: TSQLMap module (Wei)
NEW: TStack class (Qiang)
NEW: TImageMap control (Qiang)
NEW: TWizard control (Qiang)
-NEW: Added TVarDumper and PradoBase::varDump() (Qiang)
-NEW: Added TComponentReflection (Qiang)
+NEW: TVarDumper and PradoBase::varDump() (Qiang)
+NEW: TComponentReflection (Qiang)
Version 3.0b March 6, 2006
==========================
diff --git a/framework/Web/UI/TPage.php b/framework/Web/UI/TPage.php
index 27742ddd..e13f21c1 100644
--- a/framework/Web/UI/TPage.php
+++ b/framework/Web/UI/TPage.php
@@ -70,6 +70,10 @@ class TPage extends TTemplateControl
*/
private $_theme=null;
/**
+ * @var string page title set when Head is not in page yet
+ */
+ private $_title=null;
+ /**
* @var TTheme page stylesheet theme
*/
private $_styleSheet=null;
@@ -792,6 +796,11 @@ class TPage extends TTemplateControl
if($this->_head)
throw new TInvalidOperationException('page_head_duplicated');
$this->_head=$value;
+ if($this->_title!==null)
+ {
+ $this->_head->setTitle($this->_title);
+ $this->_title=null;
+ }
}
/**
@@ -799,7 +808,10 @@ class TPage extends TTemplateControl
*/
public function getTitle()
{
- return $this->getViewState('Title','');
+ if($this->_head)
+ return $this->_head->getTitle();
+ else
+ return $this->_title===null ? '' : $this->_title;
}
/**
@@ -810,7 +822,10 @@ class TPage extends TTemplateControl
*/
public function setTitle($value)
{
- $this->setViewState('Title',$value,'');
+ if($this->_head)
+ $this->_head->setTitle($value);
+ else
+ $this->_title=$value;
}
/**
diff --git a/framework/Web/UI/WebControls/THead.php b/framework/Web/UI/WebControls/THead.php
index 078582d5..40736a92 100644
--- a/framework/Web/UI/WebControls/THead.php
+++ b/framework/Web/UI/WebControls/THead.php
@@ -116,8 +116,7 @@ class THead extends TControl
public function render($writer)
{
$page=$this->getPage();
- if(($title=$page->getTitle())==='')
- $title=$this->getTitle();
+ $title=$this->getTitle();
$writer->write("<head>\n<title>".THttpUtility::htmlEncode($title)."</title>\n");
if(($metaTags=$this->getMetaTags())!==null)
{