ILIAS  trunk Revision v11.0_alpha-3011-gc6b235a2e85
ilADTTextFormBridge Class Reference
+ Inheritance diagram for ilADTTextFormBridge:
+ Collaboration diagram for ilADTTextFormBridge:

Public Member Functions

 __construct (ilADT $a_adt)
 
 setMulti (bool $a_value, ?int $a_cols=null, ?int $a_rows=null)
 
 isMulti ()
 
 addToForm ()
 Add ADT-specific fields to form. More...
 
 importFromPost ()
 Import values from form request POST data. More...
 
- Public Member Functions inherited from ilADTFormBridge
 __construct (ilADT $a_adt)
 
 getADT ()
 
 setForm (ilPropertyFormGUI $a_form)
 
 getForm ()
 
 setElementId (string $a_value)
 Set element id (aka form field) More...
 
 getElementId ()
 
 setTitle (string $a_value)
 
 getTitle ()
 
 setInfo (string $a_value)
 
 getInfo ()
 
 setParentElement ($a_value)
 
 getParentElement ()
 Get parent element. More...
 
 setDisabled (bool $a_value)
 
 isDisabled ()
 
 setRequired (bool $a_value)
 
 isRequired ()
 
 addToForm ()
 Add ADT-specific fields to form. More...
 
 addJS (ilGlobalTemplateInterface $a_tpl)
 Add ADT-specific JS-files to template. More...
 
 shouldBeImportedFromPost (?ilADTFormBridge $a_parent_adt=null)
 Check if incoming values should be imported at all. More...
 
 importFromPost ()
 Import values from form request POST data. More...
 
 validate ()
 
 setExternalErrors (array $a_errors)
 

Protected Member Functions

 isValidADT (ilADT $a_adt)
 
 addElementToForm (string $title, string $element_id, string $value, bool $is_translation=false, string $language='')
 
- Protected Member Functions inherited from ilADTFormBridge
 isValidADT (ilADT $a_adt)
 
 setADT (ilADT $a_adt)
 
 addBasicFieldProperties (ilFormPropertyGUI $a_field, ilADTDefinition $a_def)
 Helper method to handle generic properties like setRequired(), setInfo() More...
 
 findParentElementInForm ()
 
 addToParentElement (ilFormPropertyGUI $a_field)
 
 isActiveForSubItems ($a_parent_option=null)
 Check if element is currently active for subitem(s) More...
 

Protected Attributes

bool $multi = false
 
int $multi_rows
 
int $multi_cols
 
- Protected Attributes inherited from ilADTFormBridge
ilADT $adt
 
ilPropertyFormGUI $form
 
 $parent
 
string $id = null
 
string $title = ''
 
string $info = ''
 
 $parent_element
 
bool $required = false
 
bool $disabled = false
 
ilLanguage $lng
 

Detailed Description

Definition at line 21 of file class.ilADTTextFormBridge.php.

Constructor & Destructor Documentation

◆ __construct()

ilADTTextFormBridge::__construct ( ilADT  $a_adt)

Reimplemented from ilADTFormBridge.

Definition at line 27 of file class.ilADTTextFormBridge.php.

28 {
29 parent::__construct($a_adt);
30 $this->lng->loadLanguageModule('meta');
31 }
__construct(Container $dic, ilPlugin $plugin)
@inheritDoc

References ILIAS\GlobalScreen\Provider\__construct(), and ILIAS\Repository\lng().

+ Here is the call graph for this function:

Member Function Documentation

◆ addElementToForm()

ilADTTextFormBridge::addElementToForm ( string  $title,
string  $element_id,
string  $value,
bool  $is_translation = false,
string  $language = '' 
)
protected

Definition at line 50 of file class.ilADTTextFormBridge.php.

56 : void {
57 $def = $this->getADT()->getCopyOfDefinition();
58
59 if (!$this->isMulti()) {
60 $text = new ilTextInputGUI($title, $element_id);
61
62 if ($def->getMaxLength()) {
63 $max = $def->getMaxLength();
64 $size = $text->getSize();
65
66 $text->setMaxLength($max);
67
68 if ($size && $max < $size) {
69 $text->setSize($max);
70 }
71 }
72 } else {
73 $text = new ilTextAreaInputGUI($title, $element_id);
74 if ($this->multi_rows) {
75 $text->setRows($this->multi_rows);
76 }
77 if ($this->multi_cols) {
78 $text->setCols($this->multi_cols);
79 }
80
81 if ($def->getMaxLength()) {
82 $max = $def->getMaxLength();
83 $text->setMaxNumOfChars($max);
84 }
85 }
86 $this->addBasicFieldProperties($text, $def);
87
88 if ($is_translation) {
89 $text->setInfo($this->lng->txt('md_adv_int_translation_info') . ' ' . $this->lng->txt('meta_l_' . $language));
90 $text->setRequired(false);
91 }
92 $text->setValue($value);
93 $this->addToParentElement($text);
94 }
addBasicFieldProperties(ilFormPropertyGUI $a_field, ilADTDefinition $a_def)
Helper method to handle generic properties like setRequired(), setInfo()
addToParentElement(ilFormPropertyGUI $a_field)
This class represents a text area property in a property form.
This class represents a text property in a property form.

References ilADTFormBridge\$title.

Referenced by ilADTLocalizedTextFormBridge\addToForm().

+ Here is the caller graph for this function:

◆ addToForm()

ilADTTextFormBridge::addToForm ( )

Add ADT-specific fields to form.

Reimplemented from ilADTFormBridge.

Reimplemented in ilADTLocalizedTextFormBridge.

Definition at line 96 of file class.ilADTTextFormBridge.php.

96 : void
97 {
98 $this->addElementToForm(
99 (string) $this->getTitle(),
100 (string) $this->getElementId(),
101 (string) $this->getADT()->getText()
102 );
103 }
addElementToForm(string $title, string $element_id, string $value, bool $is_translation=false, string $language='')

References ILIAS\GlobalScreen\Scope\Footer\Factory\getTitle().

+ Here is the call graph for this function:

◆ importFromPost()

ilADTTextFormBridge::importFromPost ( )

Import values from form request POST data.

Reimplemented from ilADTFormBridge.

Reimplemented in ilADTLocalizedTextFormBridge.

Definition at line 105 of file class.ilADTTextFormBridge.php.

105 : void
106 {
107 // ilPropertyFormGUI::checkInput() is pre-requisite
108 $this->getADT()->setText($this->getForm()->getInput($this->getElementId()));
109 $field = $this->getForm()->getItemByPostVar($this->getElementId());
110 $field->setValue($this->getADT()->getText());
111 }

◆ isMulti()

ilADTTextFormBridge::isMulti ( )

Definition at line 40 of file class.ilADTTextFormBridge.php.

40 : bool
41 {
42 return $this->multi;
43 }

References $multi.

◆ isValidADT()

ilADTTextFormBridge::isValidADT ( ilADT  $a_adt)
protected

Reimplemented from ilADTFormBridge.

Reimplemented in ilADTLocalizedTextFormBridge.

Definition at line 45 of file class.ilADTTextFormBridge.php.

45 : bool
46 {
47 return ($a_adt instanceof ilADTText);
48 }

◆ setMulti()

ilADTTextFormBridge::setMulti ( bool  $a_value,
?int  $a_cols = null,
?int  $a_rows = null 
)

Definition at line 33 of file class.ilADTTextFormBridge.php.

33 : void
34 {
35 $this->multi = $a_value;
36 $this->multi_rows = ($a_rows === null) ? null : $a_rows;
37 $this->multi_cols = ($a_cols === null) ? null : $a_cols;
38 }

Field Documentation

◆ $multi

bool ilADTTextFormBridge::$multi = false
protected

Definition at line 23 of file class.ilADTTextFormBridge.php.

Referenced by isMulti().

◆ $multi_cols

int ilADTTextFormBridge::$multi_cols
protected

Definition at line 25 of file class.ilADTTextFormBridge.php.

◆ $multi_rows

int ilADTTextFormBridge::$multi_rows
protected

Definition at line 24 of file class.ilADTTextFormBridge.php.


The documentation for this class was generated from the following file: