From 9af68616fb4b8762d309ab437ee50520f00d5dea Mon Sep 17 00:00:00 2001 From: xue <> Date: Sat, 30 Jun 2007 15:07:50 +0000 Subject: Fixed #659. --- .../protected/controls/ToggleImageButton.php | 24 ++++++++++++---------- 1 file changed, 13 insertions(+), 11 deletions(-) (limited to 'tests/FunctionalTests/tickets/protected/controls') diff --git a/tests/FunctionalTests/tickets/protected/controls/ToggleImageButton.php b/tests/FunctionalTests/tickets/protected/controls/ToggleImageButton.php index 80c16ce5..a55b7f29 100644 --- a/tests/FunctionalTests/tickets/protected/controls/ToggleImageButton.php +++ b/tests/FunctionalTests/tickets/protected/controls/ToggleImageButton.php @@ -1,39 +1,40 @@ getViewState('state', ToggleImageButtonState::Down); } - + public function setState($value) { - $this->setViewState('state', TPropertyValue::ensureEnum($value, ToggleImageButtonState)); + $this->setViewState('state', TPropertyValue::ensureEnum($value, 'ToggleImageButtonState')); } - + public function toggleState () { $this->setState(($this->getState()===ToggleImageButtonState::Down)?ToggleImageButtonState::Up:ToggleImageButtonState::Down); } - + public function onClick ($param) { $this->toggleState(); parent::onClick($param); } - + public function getImageUrl () { $img=($this->getState()===ToggleImageButtonState::Down)?'down.gif':'up.gif'; - return $this->publishAsset($img); + return $this->publishAsset($img,__CLASS__); } - - public function setImageUrl() { + + public function setImageUrl($url) { throw new TUnsupportedOperationException('ImageUrl property is read-only'); } } @@ -42,4 +43,5 @@ class ToggleImageButtonState extends TEnumerable { const Down='Down'; const Up='Up'; } + ?> \ No newline at end of file -- cgit v1.2.3