ILIAS  release_5-3 Revision v5.3.23-19-g915713cf615
class.ilADTMultiTextFormBridge.php
Go to the documentation of this file.
1 <?php
2 
3 require_once "Services/ADT/classes/Bridges/class.ilADTFormBridge.php";
4 
6 {
7  protected function isValidADT(ilADT $a_adt)
8  {
9  return ($a_adt instanceof ilADTMultiText);
10  }
11 
12  public function addToForm()
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()
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 }
addToParentElement(ilFormPropertyGUI $a_field)
Add form field to parent element.
ADT form bridge base class.
ADT base class.
Definition: class.ilADT.php:11
addBasicFieldProperties(ilFormPropertyGUI $a_field, ilADTDefinition $a_def)
Helper method to handle generic properties like setRequired(), setInfo()
$text
Definition: errorreport.php:18
This class represents a text property in a property form.
getElementId()
Get element id.