ILIAS  trunk Revision v11.0_alpha-3011-gc6b235a2e85
class.ilADTMultiTextFormBridge.php
Go to the documentation of this file.
1<?php
2
19declare(strict_types=1);
20
22{
23 protected function isValidADT(ilADT $a_adt): bool
24 {
25 return ($a_adt instanceof ilADTMultiText);
26 }
27
28 public function addToForm(): void
29 {
30 $text = new ilTextInputGUI($this->getTitle(), $this->getElementId());
31 $text->setMulti(true);
32
33 $this->addBasicFieldProperties($text, $this->getADT()->getCopyOfDefinition());
34
35 $text->setValue($this->getADT()->getTextElements());
36
37 $this->addToParentElement($text);
38 }
39
40 public function importFromPost(): void
41 {
42 // ilPropertyFormGUI::checkInput() is pre-requisite
43 $this->getADT()->setTextElements($this->getForm()->getInput($this->getElementId()));
44
45 $field = $this->getForm()->getItemByPostVar($this->getElementId());
46 $field->setValue($this->getADT()->getTextElements());
47 }
48}
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:26
This class represents a text property in a property form.