summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorxue <>2005-12-03 04:45:44 +0000
committerxue <>2005-12-03 04:45:44 +0000
commitbdd139266bbd71b828394a1500551254fc42a819 (patch)
tree118933cdbec0a7f710666f35fa1027451d148c99
parent0d42be79b9dfeaa7686fb7da11920af4eb0561d7 (diff)
-rw-r--r--.gitattributes8
-rw-r--r--framework/Web/Services/TPageService.php8
-rw-r--r--framework/Web/THiddenFieldPageStatePersister.php80
-rw-r--r--framework/Web/UI/TAssetManager.php (renamed from framework/Web/TAssetManager.php)4
-rw-r--r--framework/Web/UI/THiddenFieldPageStatePersister.php2
-rw-r--r--framework/Web/UI/TPageStatePersister.php22
-rw-r--r--framework/Web/UI/TTemplateManager.php (renamed from framework/Web/TTemplateManager.php)0
-rw-r--r--framework/Web/UI/TThemeManager.php (renamed from framework/Web/TThemeManager.php)0
8 files changed, 10 insertions, 114 deletions
diff --git a/.gitattributes b/.gitattributes
index 90c81e47..1ff1ed0f 100644
--- a/.gitattributes
+++ b/.gitattributes
@@ -70,23 +70,21 @@ framework/TComponent.php -text
framework/TODO.txt -text
framework/Web/Javascripts/WebForms.js -text
framework/Web/Services/TPageService.php -text
-framework/Web/TAssetManager.php -text
-framework/Web/THiddenFieldPageStatePersister.php -text
framework/Web/THttpRequest.php -text
framework/Web/THttpResponse.php -text
framework/Web/THttpSession.php -text
framework/Web/THttpUtility.php -text
-framework/Web/TTemplateManager.php -text
-framework/Web/TThemeManager.php -text
+framework/Web/UI/TAssetManager.php -text
framework/Web/UI/TClientScriptManager.php -text
framework/Web/UI/TControl.php -text
framework/Web/UI/TForm.php -text
framework/Web/UI/THiddenFieldPageStatePersister.php -text
framework/Web/UI/THtmlWriter.php -text
framework/Web/UI/TPage.php -text
-framework/Web/UI/TPageStatePersister.php -text
framework/Web/UI/TPostBackOptions.php -text
framework/Web/UI/TTemplateControl.php -text
+framework/Web/UI/TTemplateManager.php -text
+framework/Web/UI/TThemeManager.php -text
framework/Web/UI/WebControls/TButton.php -text
framework/Web/UI/WebControls/TCheckBox.php -text
framework/Web/UI/WebControls/TContent.php -text
diff --git a/framework/Web/Services/TPageService.php b/framework/Web/Services/TPageService.php
index 078f8706..a95235c2 100644
--- a/framework/Web/Services/TPageService.php
+++ b/framework/Web/Services/TPageService.php
@@ -14,10 +14,10 @@
* Include classes to be used by page service
*/
Prado::using('System.Web.UI.TPage');
-Prado::using('System.Web.TTemplateManager');
-Prado::using('System.Web.TThemeManager');
-Prado::using('System.Web.TAssetManager');
-Prado::using('System.Web.THiddenFieldPageStatePersister');
+Prado::using('System.Web.UI.TTemplateManager');
+Prado::using('System.Web.UI.TThemeManager');
+Prado::using('System.Web.UI.TAssetManager');
+Prado::using('System.Web.UI.THiddenFieldPageStatePersister');
/**
* TPageService class.
diff --git a/framework/Web/THiddenFieldPageStatePersister.php b/framework/Web/THiddenFieldPageStatePersister.php
deleted file mode 100644
index 3d305668..00000000
--- a/framework/Web/THiddenFieldPageStatePersister.php
+++ /dev/null
@@ -1,80 +0,0 @@
-<?php
-
-class THiddenFieldPageStatePersister extends TComponent implements IPageStatePersister, IModule
-{
- 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;
- }
-
- /**
- * @param string id of this module
- */
- public function setID($value)
- {
- $this->_id=$value;
- }
-
- public function save($state)
- {
- $data=Prado::serialize($state);
- $hmac=$this->computeHMAC($data,$this->getKey());
- if(function_exists('gzuncompress') && function_exists('gzcompress'))
- $data=gzcompress($hmac.$data);
- else
- $data=$hmac.$data;
- $this->_application->getService()->getRequestedPage()->saveStateField($data);
- }
-
- public function load()
- {
- $str=$this->_application->getService()->getRequestedPage()->loadStateField();
- if($str==='')
- return null;
- if(function_exists('gzuncompress') && function_exists('gzcompress'))
- $data=gzuncompress($str);
- else
- $data=$str;
- if($data!==false && strlen($data)>32)
- {
- $hmac=substr($data,0,32);
- $state=substr($data,32);
- if($hmac===$this->computeHMAC($state,$this->getKey()))
- return Prado::unserialize($state);
- }
- throw new Exception('viewstate data is corrupted.');
- }
-
- private function getKey()
- {
- return 'abcdefe';
- }
-
- private function computeHMAC($data,$key)
- {
- if (strlen($key) > 64)
- $key = pack('H32', md5($key));
- else if (strlen($key) < 64)
- $key = str_pad($key, 64, "\0");
- return md5((str_repeat("\x5c", 64) ^ substr($key, 0, 64)) . pack('H32', md5((str_repeat("\x36", 64) ^ substr($key, 0, 64)) . $data)));
- }
-}
-
-?> \ No newline at end of file
diff --git a/framework/Web/TAssetManager.php b/framework/Web/UI/TAssetManager.php
index e2b9f9a8..0f96ae90 100644
--- a/framework/Web/TAssetManager.php
+++ b/framework/Web/UI/TAssetManager.php
@@ -7,7 +7,7 @@
* @copyright Copyright &copy; 2005 PradoSoft
* @license http://www.pradosoft.com/license/
* @version $Revision: $ $Date: $
- * @package System.Web
+ * @package System.Web.UI
*/
/**
@@ -38,7 +38,7 @@
*
* @author Qiang Xue <qiang.xue@gmail.com>
* @version $Revision: $ $Date: $
- * @package System.Web
+ * @package System.Web.UI
* @since 3.0
*/
class TAssetManager extends TComponent implements IModule
diff --git a/framework/Web/UI/THiddenFieldPageStatePersister.php b/framework/Web/UI/THiddenFieldPageStatePersister.php
index 3d305668..bd32f686 100644
--- a/framework/Web/UI/THiddenFieldPageStatePersister.php
+++ b/framework/Web/UI/THiddenFieldPageStatePersister.php
@@ -11,7 +11,7 @@ class THiddenFieldPageStatePersister extends TComponent implements IPageStatePer
* @param TApplication application
* @param TXmlElement module configuration
*/
- public function init($application,$config)
+ public function init($application, $config)
{
$this->_application=$application;
}
diff --git a/framework/Web/UI/TPageStatePersister.php b/framework/Web/UI/TPageStatePersister.php
deleted file mode 100644
index 6ec9527b..00000000
--- a/framework/Web/UI/TPageStatePersister.php
+++ /dev/null
@@ -1,22 +0,0 @@
-<?php
-
-abstract class TPageStatePersister extends TComponent
-{
- private $_page;
-
- public function __construct($page)
- {
- $this->_page=$page;
- }
-
- public function getPage()
- {
- return $this->_page;
- }
-
- abstract public function load();
-
- abstract public function save($state);
-}
-
-?> \ No newline at end of file
diff --git a/framework/Web/TTemplateManager.php b/framework/Web/UI/TTemplateManager.php
index 1f3044a2..1f3044a2 100644
--- a/framework/Web/TTemplateManager.php
+++ b/framework/Web/UI/TTemplateManager.php
diff --git a/framework/Web/TThemeManager.php b/framework/Web/UI/TThemeManager.php
index 504e8ecb..504e8ecb 100644
--- a/framework/Web/TThemeManager.php
+++ b/framework/Web/UI/TThemeManager.php