From 1b20976d3c07fa7a1737556a5987c88476c4782d Mon Sep 17 00:00:00 2001 From: xue <> Date: Mon, 13 Feb 2006 18:18:32 +0000 Subject: Added PagePath property to TPage. --- framework/Web/Services/TPageService.php | 1 + framework/Web/UI/TPage.php | 11 +++++++++++ tests/FunctionalTests/tickets/protected/pages/Layout.php | 2 +- 3 files changed, 13 insertions(+), 1 deletion(-) diff --git a/framework/Web/Services/TPageService.php b/framework/Web/Services/TPageService.php index 988f665a..32f7514c 100644 --- a/framework/Web/Services/TPageService.php +++ b/framework/Web/Services/TPageService.php @@ -457,6 +457,7 @@ class TPageService extends TService $this->_page=new $className(); + $this->_page->setPagePath($this->getRequestedPagePath()); // initialize page properties with those set in configurations foreach($this->_properties as $name=>$value) $this->_page->setSubProperty($name,$value); diff --git a/framework/Web/UI/TPage.php b/framework/Web/UI/TPage.php index 7a7cbce4..2e3dd68e 100644 --- a/framework/Web/UI/TPage.php +++ b/framework/Web/UI/TPage.php @@ -119,6 +119,7 @@ class TPage extends TTemplateControl * @var TControl|string the control or the ID of the element on the page to be focused when the page is sent back to user */ private $_focus=null; + private $_pagePath=''; /** * @var boolean whether or not to maintain page scroll position */ @@ -845,6 +846,16 @@ class TPage extends TTemplateControl { $this->_enableStateEncryption=TPropertyValue::ensureBoolean($value); } + + public function getPagePath() + { + return $this->_pagePath; + } + + public function setPagePath($value) + { + $this->_pagePath=$value; + } } interface IPageStatePersister diff --git a/tests/FunctionalTests/tickets/protected/pages/Layout.php b/tests/FunctionalTests/tickets/protected/pages/Layout.php index 64b0aebe..c2a8a44c 100644 --- a/tests/FunctionalTests/tickets/protected/pages/Layout.php +++ b/tests/FunctionalTests/tickets/protected/pages/Layout.php @@ -4,7 +4,7 @@ class Layout extends TTemplateControl { public function onLoad($param) { - $num = str_replace('Ticket','',get_class($this->getPage())); + $num = str_replace('Ticket','',$this->getPage()->getPagePath()); $this->getPage()->setTitle("Verifying Ticket $num"); $this->ticketlink->setText("Verifying Ticket $num"); $this->ticketlink->setNavigateUrl("http://trac.pradosoft.com/ticket/{$num}"); -- cgit v1.2.3