diff options
Diffstat (limited to 'lib/classes/DataFieldBoolEntry.php')
| -rw-r--r-- | lib/classes/DataFieldBoolEntry.php | 35 |
1 files changed, 35 insertions, 0 deletions
diff --git a/lib/classes/DataFieldBoolEntry.php b/lib/classes/DataFieldBoolEntry.php new file mode 100644 index 0000000..da294b6 --- /dev/null +++ b/lib/classes/DataFieldBoolEntry.php @@ -0,0 +1,35 @@ +<?php +# Lifter002: DONE +# Lifter007: TEST + +/** + * @author Jan-Hendrik Willms <tleilax+studip@gmail.com> + * @author Marcus Lunzenauer <mlunzena@uos.de> + * @author Martin Gieseking <mgieseki@uos.de> + * @license GPL2 or any later version + */ +class DataFieldBoolEntry extends DataFieldEntry +{ + protected $template = 'bool.php'; + + /** + * Returns the display/rendered value of this datafield + * + * @param bool $entities Should html entities be encoded (defaults to true) + * @return String containg the rendered value + */ + public function getDisplayValue($entities = true) + { + return $this->getValue() ? _('Ja') : _('Nein'); + } + + /** + * Sets the value from a post request + * + * @param mixed $submitted_value The value from request + */ + public function setValueFromSubmit($submitted_value) + { + $this->setValue((int) $submitted_value); + } +} |
