ILIAS  release_5-3 Revision v5.3.23-19-g915713cf615
ilADTTestGUI Class Reference

This is the GUI for the ADT-based example object. More...

+ Inheritance diagram for ilADTTestGUI:
+ Collaboration diagram for ilADTTestGUI:

Protected Member Functions

 initObject ()
 
 prepareFormElements (ilADTGroupFormBridge $a_adt_form)
 
- Protected Member Functions inherited from ilADTBasedObjectGUI
 initObject ()
 Init ADT-based object. More...
 
 prepareFormElements (ilADTGroupFormBridge $a_adt_form)
 Prepare/customize form elements. More...
 
 initForm ()
 Init ADT-based form. More...
 

Additional Inherited Members

- Public Member Functions inherited from ilADTBasedObjectGUI
 __construct (ilObjectGUI $a_parent_gui)
 Constructor. More...
 
 editAction (ilADTGroupFormBridge $a_form=null)
 Edit object ADT properties. More...
 
 updateAction ()
 Parse incoming values and update if valid. More...
 
- Protected Attributes inherited from ilADTBasedObjectGUI
 $object
 

Detailed Description

This is the GUI for the ADT-based example object.

It expects an existing record with Id 1 and doesn't do much

Definition at line 10 of file class.ilADTTestGUI.php.

Member Function Documentation

◆ initObject()

ilADTTestGUI::initObject ( )
protected

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

13  {
14  include_once "Services/ADT/classes/_Example/class.ilADTTest.php";
15 
16  /*
17  $test = new ilADTTest();
18  $test->getName()->setText("2. Satz");
19  $test->getLang()->setSelection("en");
20  $home = $test->getHome();
21  $home->setLatitude(1);
22  $home->setLongitude(2);
23  $test->getLastLogin()->setDate(new ilDateTime(time(), IL_CAL_UNIX));
24  if(!$test->isValid())
25  {
26  var_dump($test->getAllTranslatedErrors());
27  }
28  else if(!$test->create())
29  {
30  var_dump($test->getAllTranslatedErrors());
31  }
32  */
33 
34  return new ilADTTest(1);
35  }
This is a ADT-based example object.

◆ prepareFormElements()

ilADTTestGUI::prepareFormElements ( ilADTGroupFormBridge  $a_adt_form)
protected

Definition at line 37 of file class.ilADTTestGUI.php.

References $lng, $name, array, ilADTGroupFormBridge\getElement(), ilADTGroupFormBridge\getElements(), ilADTFormBridge\getForm(), ilADTFormBridge\setInfo(), and ilADTFormBridge\setTitle().

38  {
39  global $lng;
40 
41  // :TODO:
42  $a_adt_form->getForm()->setTitle($lng->txt("test_form_title"));
43  $a_adt_form->setTitle($lng->txt("test_form_section_title"));
44  $a_adt_form->setInfo($lng->txt("test_form_section_title_info"));
45 
46  foreach ($a_adt_form->getElements() as $name => $element) {
47  $element->setTitle($lng->txt("test_form_" . $name));
48  }
49 
50  $a_adt_form->getElement("name")->setRequired(true);
51  $a_adt_form->getElement("lang")->setRequired(true);
52  $a_adt_form->getElement("tags")->setRequired(true);
53  // $a_adt_form->getElement("last_login")->setRequired(true);
54 
55  $a_adt_form->getElement("lang")->forceRadio(true, array("en"=>$lng->txt("lang_en_info")));
56 
57  $a_adt_form->getElement("entry_date")->setParentElement("active");
58  // $a_adt_form->getElement("entry_date")->setDisabled(true);
59 
60  // $a_adt_form->getElement("last_login")->setParentElement(array("interests", ilADTTest::INTERESTS_LANGUAGES));
61 
62  $a_adt_form->getElement("tags")->setParentElement(array("lang", "de"));
63  $a_adt_form->getElement("tags")->setInfo($lng->txt("test_form_tags_info"));
64  }
setTitle($a_value)
Set title (aka form field caption)
setInfo($a_value)
Set info (aka form field info text)
if($format !==null) $name
Definition: metadata.php:146
Create styles array
The data for the language used.
global $lng
Definition: privfeed.php:17
+ Here is the call graph for this function:

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