ILIAS  trunk Revision v11.0_alpha-2645-g16283d3b3f8
class.ilADTMultiTextFormBridge.php
Go to the documentation of this file.
1 <?php
2 
19 declare(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 }
addToParentElement(ilFormPropertyGUI $a_field)
ADT form bridge base class.
ADT base class.
Definition: class.ilADT.php:25
addBasicFieldProperties(ilFormPropertyGUI $a_field, ilADTDefinition $a_def)
Helper method to handle generic properties like setRequired(), setInfo()