ILIAS  Release_5_0_x_branch Revision 61816
 All Data Structures Namespaces Files Functions Variables Groups Pages
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  {
48  $element->setTitle($lng->txt("test_form_".$name));
49  }
50 
51  $a_adt_form->getElement("name")->setRequired(true);
52  $a_adt_form->getElement("lang")->setRequired(true);
53  $a_adt_form->getElement("tags")->setRequired(true);
54  // $a_adt_form->getElement("last_login")->setRequired(true);
55 
56  $a_adt_form->getElement("lang")->forceRadio(true, array("en"=>$lng->txt("lang_en_info")));
57 
58  $a_adt_form->getElement("entry_date")->setParentElement("active");
59  // $a_adt_form->getElement("entry_date")->setDisabled(true);
60 
61  // $a_adt_form->getElement("last_login")->setParentElement(array("interests", ilADTTest::INTERESTS_LANGUAGES));
62 
63  $a_adt_form->getElement("tags")->setParentElement(array("lang", "de"));
64  $a_adt_form->getElement("tags")->setInfo($lng->txt("test_form_tags_info"));
65  }
66 }
67 
68 ?>