diff options
author | xue <> | 2007-06-30 15:07:50 +0000 |
---|---|---|
committer | xue <> | 2007-06-30 15:07:50 +0000 |
commit | 9af68616fb4b8762d309ab437ee50520f00d5dea (patch) | |
tree | 678dbfbee8dcbff08011109e2322770d3edf1a58 /tests/FunctionalTests/tickets/protected/controls | |
parent | 548242ca9bba40ca0c690817e9e860deaf4b3ced (diff) |
Fixed #659.
Diffstat (limited to 'tests/FunctionalTests/tickets/protected/controls')
-rw-r--r-- | tests/FunctionalTests/tickets/protected/controls/ToggleImageButton.php | 24 |
1 files changed, 13 insertions, 11 deletions
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 @@ <?php + /** * - * + * * @author Christophe BOULAIN (Christophe.Boulain@ceram.fr) * @copyright Copyright © 2007, CERAM Sophia Antipolis * @license url nameoflicense * @version $Id$ - * + * */ class ToggleImageButton extends TImageButton { - + public function getState () { return $this->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 |