ILIAS  release_8 Revision v8.19
All Data Structures Namespaces Files Functions Variables Modules Pages
ilADTDateTimeFormBridge 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 ilADTDateTimeFormBridge:
+ Collaboration diagram for ilADTDateTimeFormBridge:

Public Member Functions

 setTextInputMode (bool $a_value)
 
 addToForm ()
 
 importFromPost ()
 
 validate ()
 
- 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...
 

Protected Attributes

bool $invalid_input = false
 
bool $text_input = false
 
- 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.ilADTDateTimeFormBridge.php.

Member Function Documentation

◆ addToForm()

ilADTDateTimeFormBridge::addToForm ( )

Definition at line 36 of file class.ilADTDateTimeFormBridge.php.

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

36  : void
37  {
38  $adt_date = $this->getADT()->getDate();
39  $date = new ilDateTimeInputGUI($this->getTitle(), $this->getElementId());
40  $date->setShowTime(true);
41  $this->addBasicFieldProperties($date, $this->getADT()->getCopyOfDefinition());
42  $date->setDate($adt_date);
43  $this->addToParentElement($date);
44  }
addToParentElement(ilFormPropertyGUI $a_field)
addBasicFieldProperties(ilFormPropertyGUI $a_field, ilADTDefinition $a_def)
Helper method to handle generic properties like setRequired(), setInfo()
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
+ Here is the call graph for this function:

◆ importFromPost()

ilADTDateTimeFormBridge::importFromPost ( )

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

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

46  : void
47  {
48  $field = $this->getForm()->getItemByPostVar($this->getElementId());
49 
50  // because of ilDateTime the ADT can only have valid dates
51  if (!$field->hasInvalidInput()) {
52  // ilPropertyFormGUI::checkInput() is pre-requisite
53  $this->getADT()->setDate($field->getDate());
54 
55  $field->setDate($this->getADT()->getDate());
56  } else {
57  $this->invalid_input = true;
58  }
59  }
+ Here is the call graph for this function:

◆ isValidADT()

ilADTDateTimeFormBridge::isValidADT ( ilADT  $a_adt)
protected

Definition at line 26 of file class.ilADTDateTimeFormBridge.php.

26  : bool
27  {
28  return ($a_adt instanceof ilADTDateTime);
29  }

◆ setTextInputMode()

ilADTDateTimeFormBridge::setTextInputMode ( bool  $a_value)

Definition at line 31 of file class.ilADTDateTimeFormBridge.php.

31  : void
32  {
33  $this->text_input = $a_value;
34  }

◆ validate()

ilADTDateTimeFormBridge::validate ( )

Definition at line 61 of file class.ilADTDateTimeFormBridge.php.

References $invalid_input.

61  : bool
62  {
63  // :TODO: error handling is done by ilDateTimeInputGUI
64  return !$this->invalid_input;
65  }

Field Documentation

◆ $invalid_input

bool ilADTDateTimeFormBridge::$invalid_input = false
protected

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

Referenced by validate().

◆ $text_input

bool ilADTDateTimeFormBridge::$text_input = false
protected

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


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