summaryrefslogtreecommitdiff
path: root/framework/Web/UI/THiddenFieldPageStatePersister.php
diff options
context:
space:
mode:
authorxue <>2005-12-03 16:19:08 +0000
committerxue <>2005-12-03 16:19:08 +0000
commit3ea63072225a473239227facfabde294bb58ed1d (patch)
tree2716662f13c184f31281bab45871c3ad3c9634b4 /framework/Web/UI/THiddenFieldPageStatePersister.php
parentbdd139266bbd71b828394a1500551254fc42a819 (diff)
Diffstat (limited to 'framework/Web/UI/THiddenFieldPageStatePersister.php')
-rw-r--r--framework/Web/UI/THiddenFieldPageStatePersister.php9
1 files changed, 5 insertions, 4 deletions
diff --git a/framework/Web/UI/THiddenFieldPageStatePersister.php b/framework/Web/UI/THiddenFieldPageStatePersister.php
index bd32f686..5525b50a 100644
--- a/framework/Web/UI/THiddenFieldPageStatePersister.php
+++ b/framework/Web/UI/THiddenFieldPageStatePersister.php
@@ -14,6 +14,7 @@ class THiddenFieldPageStatePersister extends TComponent implements IPageStatePer
public function init($application, $config)
{
$this->_application=$application;
+ $application->getService()->setPageStatePersister($this);
}
/**
@@ -36,19 +37,19 @@ class THiddenFieldPageStatePersister extends TComponent implements IPageStatePer
{
$data=Prado::serialize($state);
$hmac=$this->computeHMAC($data,$this->getKey());
- if(function_exists('gzuncompress') && function_exists('gzcompress'))
+ if(extension_loaded('zlib'))
$data=gzcompress($hmac.$data);
else
$data=$hmac.$data;
- $this->_application->getService()->getRequestedPage()->saveStateField($data);
+ $this->_application->getService()->getRequestedPage()->getClientScript()->registerHiddenField(TClientScriptManager::FIELD_PAGE_STATE,base64_encode($data));
}
public function load()
{
- $str=$this->_application->getService()->getRequestedPage()->loadStateField();
+ $str=base64_decode($this->_application->getRequest()->getItems()->itemAt(TClientScriptManager::FIELD_PAGE_STATE));
if($str==='')
return null;
- if(function_exists('gzuncompress') && function_exists('gzcompress'))
+ if(extension_loaded('zlib'))
$data=gzuncompress($str);
else
$data=$str;