ILIAS  release_5-4 Revision v5.4.26-12-gabc799a52e6
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 $DIC;
40 
41  $lng = $DIC['lng'];
42 
43  // :TODO:
44  $a_adt_form->getForm()->setTitle($lng->txt("test_form_title"));
45  $a_adt_form->setTitle($lng->txt("test_form_section_title"));
46  $a_adt_form->setInfo($lng->txt("test_form_section_title_info"));
47 
48  foreach ($a_adt_form->getElements() as $name => $element) {
49  $element->setTitle($lng->txt("test_form_" . $name));
50  }
51 
52  $a_adt_form->getElement("name")->setRequired(true);
53  $a_adt_form->getElement("lang")->setRequired(true);
54  $a_adt_form->getElement("tags")->setRequired(true);
55  // $a_adt_form->getElement("last_login")->setRequired(true);
56 
57  $a_adt_form->getElement("lang")->forceRadio(true, array("en" => $lng->txt("lang_en_info")));
58 
59  $a_adt_form->getElement("entry_date")->setParentElement("active");
60  // $a_adt_form->getElement("entry_date")->setDisabled(true);
61 
62  // $a_adt_form->getElement("last_login")->setParentElement(array("interests", ilADTTest::INTERESTS_LANGUAGES));
63 
64  $a_adt_form->getElement("tags")->setParentElement(array("lang", "de"));
65  $a_adt_form->getElement("tags")->setInfo($lng->txt("test_form_tags_info"));
66  }
67 }
prepareFormElements(ilADTGroupFormBridge $a_adt_form)
This is a ADT-based example object.
global $DIC
Definition: saml.php:7
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.
$lng
ADT based-object GUI base class.