ILIAS  release_5-4 Revision v5.4.26-12-gabc799a52e6
ilADTDateFormBridge Class Reference
+ Inheritance diagram for ilADTDateFormBridge:
+ Collaboration diagram for ilADTDateFormBridge:

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)
 
 addToElementId ($a_add)
 
- 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...
 

Protected Attributes

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

Detailed Description

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

Member Function Documentation

◆ addToElementId()

ilADTDateFormBridge::addToElementId (   $a_add)
protected

Definition at line 14 of file class.ilADTDateFormBridge.php.

References ilADTFormBridge\getElementId().

15  {
16  return $this->getElementId() . "[" . $a_add . "]";
17  }
getElementId()
Get element id.
+ Here is the call graph for this function:

◆ addToForm()

ilADTDateFormBridge::addToForm ( )

Definition at line 19 of file class.ilADTDateFormBridge.php.

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

20  {
21  $adt_date = $this->getADT()->getDate();
22 
23  $date = new ilDateTimeInputGUI($this->getTitle(), $this->getElementId());
24  $date->setShowTime(false);
25 
26  $this->addBasicFieldProperties($date, $this->getADT()->getCopyOfDefinition());
27 
28  $date->setDate($adt_date);
29 
30  $this->addToParentElement($date);
31  }
addToParentElement(ilFormPropertyGUI $a_field)
Add form field to parent element.
addBasicFieldProperties(ilFormPropertyGUI $a_field, ilADTDefinition $a_def)
Helper method to handle generic properties like setRequired(), setInfo()
This class represents a date/time property in a property form.
getElementId()
Get element id.
+ Here is the call graph for this function:

◆ importFromPost()

ilADTDateFormBridge::importFromPost ( )

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

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

34  {
35  $field = $this->getForm()->getItemByPostvar($this->getElementId());
36 
37  // because of ilDate the ADT can only have valid dates
38  if (!$field->hasInvalidInput()) {
39  // ilPropertyFormGUI::checkInput() is pre-requisite
40  $this->getADT()->setDate($field->getDate());
41 
42  $field->setDate($this->getADT()->getDate());
43  } else {
44  $this->invalid_input = true;
45  }
46  }
getElementId()
Get element id.
+ Here is the call graph for this function:

◆ isValidADT()

ilADTDateFormBridge::isValidADT ( ilADT  $a_adt)
protected

Definition at line 9 of file class.ilADTDateFormBridge.php.

10  {
11  return ($a_adt instanceof ilADTDate);
12  }

◆ validate()

ilADTDateFormBridge::validate ( )

Definition at line 48 of file class.ilADTDateFormBridge.php.

49  {
50  // :TODO: error handling is done by ilDateTimeInputGUI
51  return !(bool) $this->invalid_input;
52  }

Field Documentation

◆ $invalid_input

ilADTDateFormBridge::$invalid_input
protected

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


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