diff options
author | xue <> | 2005-12-21 22:20:50 +0000 |
---|---|---|
committer | xue <> | 2005-12-21 22:20:50 +0000 |
commit | 2b648e92557d804c0a628949e3264902a43013e7 (patch) | |
tree | d4646fbc805b01faa87f2b9973c5266d768fd717 /framework/Web/UI/WebControls | |
parent | 6960f40252533b7e286465c27fa810b3c3213e72 (diff) |
Diffstat (limited to 'framework/Web/UI/WebControls')
-rw-r--r-- | framework/Web/UI/WebControls/THead.php | 20 |
1 files changed, 10 insertions, 10 deletions
diff --git a/framework/Web/UI/WebControls/THead.php b/framework/Web/UI/WebControls/THead.php index 6da9e757..c3d111de 100644 --- a/framework/Web/UI/WebControls/THead.php +++ b/framework/Web/UI/WebControls/THead.php @@ -59,21 +59,18 @@ class THead extends TControl */
public function getTitle()
{
- if(($page=$this->getPage())===null)
- return '';
- else
- return $page->getTitle();
+ return $this->getViewState('Title','');
}
/**
- * Sets the page title. Note, if the page is not available, the title won't be set.
- * Try to use {@link TPage::setTitle} instead in this case.
+ * Sets the page title.
+ * This title will be rendered only if the {@link TPage::getTitle Title} property
+ * of the page is empty.
* @param string the page title.
*/
public function setTitle($value)
{
- if(($page=$this->getPage())!==null)
- $page->setTitle($value);
+ $this->setViewState('Title',$value,'');
}
/**
@@ -103,13 +100,16 @@ class THead extends TControl */
public function render($writer)
{
- $writer->write("<head>\n<title>".THttpUtility::htmlEncode($this->getTitle())."</title>\n");
+ $page=$this->getPage();
+ if(($title=$page->getTitle())==='')
+ $title=$this->getTitle();
+ $writer->write("<head>\n<title>".THttpUtility::htmlEncode($title)."</title>\n");
foreach($this->_metaTags as $metaTag)
{
$metaTag->render($writer);
$writer->writeLine();
}
- $cs=$this->getPage()->getClientScript();
+ $cs=$page->getClientScript();
$cs->renderStyleSheetFiles($writer);
$cs->renderStyleSheets($writer);
$cs->renderHeadScriptFiles($writer);
|