diff options
Diffstat (limited to 'tests/FunctionalTests/tickets/protected')
-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 |