ILIAS  release_5-3 Revision v5.3.23-19-g915713cf615
ilADTBooleanFormBridge Class Reference
+ Inheritance diagram for ilADTBooleanFormBridge:
+ Collaboration diagram for ilADTBooleanFormBridge:

Public Member Functions

 addToForm ()
 
 importFromPost ()
 
 validate ()
 
- Public Member Functions inherited from ilADTFormBridge
 __construct (ilADT $a_adt)
 Constructor. More...
 
 getADT ()
 Get ADT. More...
 
 setForm (ilPropertyFormGUI $a_form)
 Set form. More...
 
 getForm ()
 Get form. More...
 
 setElementId ($a_value)
 Set element id (aka form field) More...
 
 getElementId ()
 Get element id. More...
 
 setTitle ($a_value)
 Set title (aka form field caption) More...
 
 getTitle ()
 Get title. More...
 
 setInfo ($a_value)
 Set info (aka form field info text) More...
 
 getInfo ()
 Get info. More...
 
 setParentElement ($a_value)
 Set parent element. More...
 
 getParentElement ()
 Get parent element. More...
 
 setDisabled ($a_value)
 Set disabled. More...
 
 isDisabled ()
 Get disabled. More...
 
 setRequired ($a_value)
 Set required. More...
 
 isRequired ()
 Get required. More...
 
 addToForm ()
 Add ADT-specific fields to form. More...
 
 addJS (ilTemplate $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 ()
 Validate ADT and parse error codes. More...
 
 setExternalErrors ($a_errors)
 

Protected Member Functions

 isValidADT (ilADT $a_adt)
 
 isActiveForSubItems ($a_parent_option=null)
 
- Protected Member Functions inherited from ilADTFormBridge
 isValidADT (ilADT $a_adt)
 Check if given ADT is valid. More...
 
 setADT (ilADT $a_adt)
 Set ADT. More...
 
 addBasicFieldProperties (ilFormPropertyGUI $a_field, ilADTDefinition $a_def)
 Helper method to handle generic properties like setRequired(), setInfo() More...
 
 findParentElementInForm ()
 Try to find parent element in form (could be option) More...
 
 addToParentElement (ilFormPropertyGUI $a_field)
 Add form field to parent element. More...
 
 isActiveForSubItems ($a_parent_option=null)
 Check if element is currently active for subitem(s) More...
 

Additional Inherited Members

- Protected Attributes inherited from ilADTFormBridge
 $adt
 
 $form
 
 $id
 
 $title
 
 $info
 
 $parent_element
 
 $required
 
 $disabled
 

Detailed Description

Definition at line 5 of file class.ilADTBooleanFormBridge.php.

Member Function Documentation

◆ addToForm()

ilADTBooleanFormBridge::addToForm ( )

Definition at line 12 of file class.ilADTBooleanFormBridge.php.

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

13  {
14  $bool = new ilCheckboxInputGUI($this->getTitle(), $this->getElementId());
15  $bool->setValue(1);
16 
17  $this->addBasicFieldProperties($bool, $this->getADT()->getCopyOfDefinition());
18 
19  // :TODO: required checkboxes do not make sense
20  $bool->setRequired(false);
21 
22  $bool->setChecked($this->getADT()->getStatus());
23 
24  $this->addToParentElement($bool);
25  }
addToParentElement(ilFormPropertyGUI $a_field)
Add form field to parent element.
This class represents a checkbox property in a property form.
addBasicFieldProperties(ilFormPropertyGUI $a_field, ilADTDefinition $a_def)
Helper method to handle generic properties like setRequired(), setInfo()
getElementId()
Get element id.
+ Here is the call graph for this function:

◆ importFromPost()

ilADTBooleanFormBridge::importFromPost ( )

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

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

28  {
29  // ilPropertyFormGUI::checkInput() is pre-requisite
30  $incoming = $this->getForm()->getInput($this->getElementId());
31 
32  // unchecked == no incoming
33  $incoming = (bool) $incoming;
34 
35  $this->getADT()->setStatus($incoming);
36 
37  $field = $this->getForm()->getItemByPostvar($this->getElementId());
38  $field->setChecked($this->getADT()->getStatus());
39  }
getElementId()
Get element id.
+ Here is the call graph for this function:

◆ isActiveForSubItems()

ilADTBooleanFormBridge::isActiveForSubItems (   $a_parent_option = null)
protected

Definition at line 46 of file class.ilADTBooleanFormBridge.php.

References ilADTFormBridge\getADT().

47  {
48  return ($this->getADT()->getStatus() === true);
49  }
+ Here is the call graph for this function:

◆ isValidADT()

ilADTBooleanFormBridge::isValidADT ( ilADT  $a_adt)
protected

Definition at line 7 of file class.ilADTBooleanFormBridge.php.

8  {
9  return ($a_adt instanceof ilADTBoolean);
10  }

◆ validate()

ilADTBooleanFormBridge::validate ( )

Definition at line 41 of file class.ilADTBooleanFormBridge.php.

42  {
43  return true;
44  }

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