ILIAS  release_5-3 Revision v5.3.23-19-g915713cf615
class.ilADTTestGUI.php
Go to the documentation of this file.
1 <?php
2 
3 include_once "Services/ADT/classes/_Example/class.ilADTBasedObjectGUI.php";
4 
11 {
12  protected function initObject()
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  }
36 
37  protected function prepareFormElements(ilADTGroupFormBridge $a_adt_form)
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  }
65 }
prepareFormElements(ilADTGroupFormBridge $a_adt_form)
This is a ADT-based example object.
setTitle($a_value)
Set title (aka form field caption)
setInfo($a_value)
Set info (aka form field info text)
This is the GUI for the ADT-based example object.
if($format !==null) $name
Definition: metadata.php:146
Create styles array
The data for the language used.
global $lng
Definition: privfeed.php:17
ADT based-object GUI base class.