ILIAS  Release_5_0_x_branch Revision 61816
 All Data Structures Namespaces Files Functions Variables Groups Pages
ilADTBooleanFormBridge Class Reference
+ Inheritance diagram for ilADTBooleanFormBridge:
+ Collaboration diagram for ilADTBooleanFormBridge:

Public Member Functions

 addToForm ()
 Add ADT-specific fields to form.
 importFromPost ()
 Import values from form request POST data.
 validate ()
 Validate ADT and parse error codes.
- Public Member Functions inherited from ilADTFormBridge
 __construct (ilADT $a_adt)
 Constructor.
 getADT ()
 Get ADT.
 setForm (ilPropertyFormGUI $a_form)
 Set form.
 getForm ()
 Get form.
 setElementId ($a_value)
 Set element id (aka form field)
 getElementId ()
 Get element id.
 setTitle ($a_value)
 Set title (aka form field caption)
 getTitle ()
 Get title.
 setInfo ($a_value)
 Set info (aka form field info text)
 getInfo ()
 Get info.
 setParentElement ($a_value)
 Set parent element.
 getParentElement ()
 Get parent element.
 setDisabled ($a_value)
 Set disabled.
 isDisabled ()
 Get disabled.
 setRequired ($a_value)
 Set required.
 isRequired ()
 Get required.
 addJS (ilTemplate $a_tpl)
 Add ADT-specific JS-files to template.
 shouldBeImportedFromPost (ilADTFormBridge $a_parent_adt=null)
 Check if incoming values should be imported at all.
 setExternalErrors ($a_errors)

Protected Member Functions

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

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

ilADTBooleanFormBridge::addToForm ( )

Add ADT-specific fields to form.

Reimplemented from ilADTFormBridge.

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

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

{
$bool = new ilCheckboxInputGUI($this->getTitle(), $this->getElementId());
$bool->setValue(1);
$this->addBasicFieldProperties($bool, $this->getADT()->getCopyOfDefinition());
// :TODO: required checkboxes do not make sense
$bool->setRequired(false);
$bool->setChecked($this->getADT()->getStatus());
$this->addToParentElement($bool);
}

+ Here is the call graph for this function:

ilADTBooleanFormBridge::importFromPost ( )

Import values from form request POST data.

Reimplemented from ilADTFormBridge.

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

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

{
// ilPropertyFormGUI::checkInput() is pre-requisite
$incoming = $this->getForm()->getInput($this->getElementId());
// unchecked == no incoming
$incoming = (bool)$incoming;
$this->getADT()->setStatus($incoming);
$field = $this->getForm()->getItemByPostvar($this->getElementId());
$field->setChecked($this->getADT()->getStatus());
}

+ Here is the call graph for this function:

ilADTBooleanFormBridge::isActiveForSubItems (   $a_parent_option = null)
protected

Check if element is currently active for subitem(s)

Parameters
mixed$a_parent_option
Returns
bool

Reimplemented from ilADTFormBridge.

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

References ilADTFormBridge\getADT().

{
return ($this->getADT()->getStatus() === true);
}

+ Here is the call graph for this function:

ilADTBooleanFormBridge::isValidADT ( ilADT  $a_adt)
protected

Check if given ADT is valid.

:TODO: This could be avoided with type-specifc constructors :TODO: bridge base class?

Parameters
ilADT$a_adt

Reimplemented from ilADTFormBridge.

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

{
return ($a_adt instanceof ilADTBoolean);
}
ilADTBooleanFormBridge::validate ( )

Validate ADT and parse error codes.

Returns
boolean

Reimplemented from ilADTFormBridge.

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

{
return true;
}

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