aboutsummaryrefslogtreecommitdiff
path: root/lib/classes/forms/CheckboxCollectionInput.php
diff options
context:
space:
mode:
authorThomas Hackl <hackl@data-quest.de>2024-11-25 08:41:07 +0000
committerThomas Hackl <hackl@data-quest.de>2024-11-25 08:41:07 +0000
commitd1375e5f7b5d7543ec694df7c2f47b0a967f8951 (patch)
tree68f494e37de796f46e13d79caafb8f8b7cb2072c /lib/classes/forms/CheckboxCollectionInput.php
parenta69083a3ec3fcd8fb510fc6ea4c53f6ffcb3e436 (diff)
Resolve "Garuda in den Kern übernehmen"
Closes #3326 Merge request studip/studip!3035
Diffstat (limited to 'lib/classes/forms/CheckboxCollectionInput.php')
-rw-r--r--lib/classes/forms/CheckboxCollectionInput.php25
1 files changed, 25 insertions, 0 deletions
diff --git a/lib/classes/forms/CheckboxCollectionInput.php b/lib/classes/forms/CheckboxCollectionInput.php
new file mode 100644
index 0000000..7859b9a
--- /dev/null
+++ b/lib/classes/forms/CheckboxCollectionInput.php
@@ -0,0 +1,25 @@
+<?php
+
+namespace Studip\Forms;
+
+class CheckboxCollectionInput extends Input
+{
+ public function render()
+ {
+ $template = $GLOBALS['template_factory']->open('forms/checkbox_collection_input');
+ $template->title = $this->title;
+ $template->name = $this->name;
+ $template->selected = $this->value;
+ $template->required = $this->required;
+
+ $template->collapsable = $this->attributes['collapsable'] ?? false;
+ if (isset($this->attributes['collapsable'])) {
+ unset($this->attributes['collapsable']);
+ }
+ $options = $this->extractOptionsFromAttributes($this->attributes);
+
+ $template->attributes = arrayToHtmlAttributes($this->attributes);
+ $template->options = $options;
+ return $template->render();
+ }
+}