ILIAS  release_8 Revision v8.24
class.ilADTMultiTextFormBridge.php
Go to the documentation of this file.
1<?php
2
3declare(strict_types=1);
4
6{
7 protected function isValidADT(ilADT $a_adt): bool
8 {
9 return ($a_adt instanceof ilADTMultiText);
10 }
11
12 public function addToForm(): void
13 {
14 $text = new ilTextInputGUI($this->getTitle(), $this->getElementId());
15 $text->setMulti(true);
16
17 $this->addBasicFieldProperties($text, $this->getADT()->getCopyOfDefinition());
18
19 $text->setValue($this->getADT()->getTextElements());
20
21 $this->addToParentElement($text);
22 }
23
24 public function importFromPost(): void
25 {
26 // ilPropertyFormGUI::checkInput() is pre-requisite
27 $this->getADT()->setTextElements($this->getForm()->getInput($this->getElementId()));
28
29 $field = $this->getForm()->getItemByPostVar($this->getElementId());
30 $field->setValue($this->getADT()->getTextElements());
31 }
32}
ADT form bridge base class.
addBasicFieldProperties(ilFormPropertyGUI $a_field, ilADTDefinition $a_def)
Helper method to handle generic properties like setRequired(), setInfo()
addToParentElement(ilFormPropertyGUI $a_field)
importFromPost()
Import values from form request POST data.
addToForm()
Add ADT-specific fields to form.
ADT base class.
Definition: class.ilADT.php:12
This class represents a text property in a property form.