ILIAS  trunk Revision v5.2.0beta1-34115-g3a2438be29
ilADTFloatFormBridge Class Reference

This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Learning e.V. More...

+ Inheritance diagram for ilADTFloatFormBridge:
+ Collaboration diagram for ilADTFloatFormBridge:

Public Member Functions

 addToForm ()
 
 importFromPost ()
 
- 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)
 
- 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...
 

Additional Inherited Members

- 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

This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Learning e.V.

ILIAS is licensed with the GPL-3.0, see https://www.gnu.org/licenses/gpl-3.0.en.html You should have received a copy of said license along with the source code, too.

If this is not the case or you just want to try ILIAS, you'll find us at: https://www.ilias.de https://github.com/ILIAS-eLearning

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

Member Function Documentation

◆ addToForm()

ilADTFloatFormBridge::addToForm ( )

Definition at line 28 of file class.ilADTFloatFormBridge.php.

References ilADTFormBridge\addBasicFieldProperties(), ilADTFormBridge\addToParentElement(), ilADTFormBridge\getADT(), ilADTFormBridge\getElementId(), and ilADTFormBridge\getTitle().

28  : void
29  {
30  $def = $this->getADT()->getCopyOfDefinition();
31 
32  $number = new ilNumberInputGUI($this->getTitle(), $this->getElementId());
33  $number->setSize(10);
34  $number->setDecimals($def->getDecimals());
35 
36  $this->addBasicFieldProperties($number, $def);
37 
38  $min = $def->getMin();
39  if ($min !== null) {
40  $number->setMinValue($min);
41  }
42 
43  $max = $def->getMax();
44  if ($max !== null) {
45  $number->setMaxValue($max);
46 
47  $length = strlen((string) $max) + $def->getDecimals() + 1;
48  $number->setSize($length);
49  $number->setMaxLength($length);
50  }
51  $suffix = $def->getSuffix();
52  if ($suffix !== null) {
53  $number->setSuffix($suffix);
54  }
55  $number->setValue((string) $this->getADT()->getNumber());
56  $this->addToParentElement($number);
57  }
addToParentElement(ilFormPropertyGUI $a_field)
addBasicFieldProperties(ilFormPropertyGUI $a_field, ilADTDefinition $a_def)
Helper method to handle generic properties like setRequired(), setInfo()
+ Here is the call graph for this function:

◆ importFromPost()

ilADTFloatFormBridge::importFromPost ( )

Definition at line 59 of file class.ilADTFloatFormBridge.php.

References ilADTFormBridge\getADT(), ilADTFormBridge\getElementId(), and ilADTFormBridge\getForm().

59  : void
60  {
61  // ilPropertyFormGUI::checkInput() is pre-requisite
62  $this->getADT()->setNumber($this->getForm()->getInput($this->getElementId()));
63  $field = $this->getForm()->getItemByPostVar($this->getElementId());
64  $field->setValue((string) $this->getADT()->getNumber());
65  }
+ Here is the call graph for this function:

◆ isValidADT()

ilADTFloatFormBridge::isValidADT ( ilADT  $a_adt)
protected

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

23  : bool
24  {
25  return ($a_adt instanceof ilADTFloat);
26  }
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...

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