diff options
Diffstat (limited to 'framework/Web/UI/THiddenFieldPageStatePersister.php')
-rw-r--r-- | framework/Web/UI/THiddenFieldPageStatePersister.php | 37 |
1 files changed, 29 insertions, 8 deletions
diff --git a/framework/Web/UI/THiddenFieldPageStatePersister.php b/framework/Web/UI/THiddenFieldPageStatePersister.php index 24ef5491..3d305668 100644 --- a/framework/Web/UI/THiddenFieldPageStatePersister.php +++ b/framework/Web/UI/THiddenFieldPageStatePersister.php @@ -1,14 +1,35 @@ <?php
-require_once(PRADO_DIR.'/Web/UI/TPageStatePersister.php');
-
-class THiddenFieldPageStatePersister extends TPageStatePersister
+class THiddenFieldPageStatePersister extends TComponent implements IPageStatePersister, IModule
{
- private $_page;
+ private $_application;
+ private $_id='persister';
+
+ /**
+ * Initializes the service.
+ * This method is required by IModule interface.
+ * @param TApplication application
+ * @param TXmlElement module configuration
+ */
+ public function init($application,$config)
+ {
+ $this->_application=$application;
+ }
+
+ /**
+ * @return string id of this module
+ */
+ public function getID()
+ {
+ return $this->_id;
+ }
- public function __construct($page)
+ /**
+ * @param string id of this module
+ */
+ public function setID($value)
{
- $this->_page=$page;
+ $this->_id=$value;
}
public function save($state)
@@ -19,12 +40,12 @@ class THiddenFieldPageStatePersister extends TPageStatePersister $data=gzcompress($hmac.$data);
else
$data=$hmac.$data;
- $this->_page->saveStateField($data);
+ $this->_application->getService()->getRequestedPage()->saveStateField($data);
}
public function load()
{
- $str=$this->_page->loadStateField();
+ $str=$this->_application->getService()->getRequestedPage()->loadStateField();
if($str==='')
return null;
if(function_exists('gzuncompress') && function_exists('gzcompress'))
|