summaryrefslogtreecommitdiff
path: root/framework/Web/UI/ActiveControls/TActiveControlAdapter.php
diff options
context:
space:
mode:
authorJens Klaer <kj.landwehr.software@gmail.com>2015-05-20 15:41:19 +0200
committerJens Klaer <kj.landwehr.software@gmail.com>2015-05-20 15:41:19 +0200
commitee25e9fc2a4cc702f1ac9af5645134eaa893cf4c (patch)
tree91a089704b449c3cb6fbd2e9acad709bfed6d639 /framework/Web/UI/ActiveControls/TActiveControlAdapter.php
parent4b74caee2b905dbf7f334ee5b1ef81134f2ffe79 (diff)
viewstate tracking with custom pagestate tracker class
- made tracker class customizable through setter, leaving old TCallbackPageStateTracker as default - changed visibility for the tracked control in TCallbackPageStateTracker to protected so deriving tracker classes can access it
Diffstat (limited to 'framework/Web/UI/ActiveControls/TActiveControlAdapter.php')
-rw-r--r--framework/Web/UI/ActiveControls/TActiveControlAdapter.php17
1 files changed, 15 insertions, 2 deletions
diff --git a/framework/Web/UI/ActiveControls/TActiveControlAdapter.php b/framework/Web/UI/ActiveControls/TActiveControlAdapter.php
index bf1bc9f5..a74babf7 100644
--- a/framework/Web/UI/ActiveControls/TActiveControlAdapter.php
+++ b/framework/Web/UI/ActiveControls/TActiveControlAdapter.php
@@ -45,6 +45,10 @@ class TActiveControlAdapter extends TControlAdapter
* @var TCallbackPageStateTracker view state tracker.
*/
private $_stateTracker;
+ /**
+ * @var string view state tracker class.
+ */
+ private $_stateTrackerClass='TCallbackPageStateTracker';
/**
* Constructor.
@@ -140,7 +144,8 @@ class TActiveControlAdapter extends TControlAdapter
{
if($this->getIsTrackingPageState())
{
- $this->_stateTracker = new TCallbackPageStateTracker($this->getControl());
+ $stateTrackerClass = $this->_stateTrackerClass;
+ $this->_stateTracker = new $stateTrackerClass($this->getControl());
$this->_stateTracker->trackChanges();
}
parent::onLoad($param);
@@ -167,6 +172,14 @@ class TActiveControlAdapter extends TControlAdapter
{
return $this->_stateTracker;
}
+
+ /**
+ * @param string state tracker class.
+ */
+ public function setStateTracker($value)
+ {
+ $this->_stateTrackerClass = TPropertyValue::ensureString($value);
+ }
}
/**
@@ -191,7 +204,7 @@ class TCallbackPageStateTracker
/**
* @var TControl the control tracked
*/
- private $_control;
+ protected $_control;
/**
* @var object null object.
*/