ILIAS  eassessment Revision 61809
 All Data Structures Namespaces Files Functions Variables Groups Pages
class.ilObjectTranslationTableGUI.php
Go to the documentation of this file.
1 <?php
2 /* Copyright (c) 1998-2009 ILIAS open source, Extended GPL, see docs/LICENSE */
3 
4 include_once("./Services/Table/classes/class.ilTable2GUI.php");
5 
15 {
16 
20  function __construct($a_parent_obj, $a_parent_cmd, $a_incl_desc = true)
21  {
22  global $ilCtrl, $lng, $ilAccess, $lng;
23 
24  parent::__construct($a_parent_obj, $a_parent_cmd);
25  $this->incl_desc = $a_incl_desc;
26 
27  $this->setLimit(9999);
28 
29  $this->addColumn("", "", "1");
30  $this->addColumn($this->lng->txt("language"), "", "");
31  $this->addColumn($this->lng->txt("default"), "", "");
32  $this->addColumn($this->lng->txt("title"), "", "");
33  if ($a_incl_desc)
34  {
35  $this->addColumn($this->lng->txt("description"), "", "");
36  }
37 // $this->addColumn($this->lng->txt("actions"), "", "");
38 
39  $this->setEnableHeader(true);
40  $this->setFormAction($ilCtrl->getFormAction($a_parent_obj));
41  $this->setRowTemplate("tpl.obj_translation_row.html", "Services/Object");
42  $this->disable("footer");
43  $this->setEnableTitle(true);
44 
45  $this->nr = 0;
46  }
47 
51  function prepareOutput()
52  {
53  global $lng;
54 
55  $this->addMultiCommand("deleteHeaderTitles", $lng->txt("remove"));
56  if ($this->dataExists())
57  {
58  $this->addCommandButton("saveHeaderTitles", $lng->txt("save"));
59  }
60  $this->addCommandButton("addHeaderTitle", $lng->txt("add"));
61  }
62 
63 
67  protected function fillRow($a_set)
68  {
69  global $lng;
70 
71  $this->nr++;
72 
73  if ($this->incl_desc)
74  {
75  $this->tpl->setCurrentBlock("desc_row");
76  $this->tpl->setVariable("VAL_DESC", ilUtil::prepareFormOutput($a_set["desc"]));
77  $this->tpl->setVariable("DNR", $this->nr);
78  $this->tpl->parseCurrentBlock();
79  }
80 
81  $this->tpl->setVariable("NR", $this->nr);
82 
83  // lang selection
84  include_once('Services/MetaData/classes/class.ilMDLanguageItem.php');
85  $languages = ilMDLanguageItem::_getLanguages();
86  $this->tpl->setVariable("LANG_SELECT",
87  ilUtil::formSelect($a_set["lang"], "lang[".$this->nr."]", $languages,
88  false, true));
89 
90  if ($a_set["default"])
91  {
92  $this->tpl->setVariable("DEF_CHECKED", "checked=\"checked\"");
93  }
94 
95  $this->tpl->setVariable("VAL_TITLE", ilUtil::prepareFormOutput($a_set["title"]));
96  }
97 
98 }
99 ?>