ILIAS  Release_4_4_x_branch Revision 61816
 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, $a_base_cmd = "HeaderTitle")
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  $this->base_cmd = $a_base_cmd;
27 
28  $this->setLimit(9999);
29 
30  $this->addColumn("", "", "1");
31  $this->addColumn($this->lng->txt("language"), "", "");
32  $this->addColumn($this->lng->txt("default"), "", "");
33  $this->addColumn($this->lng->txt("title"), "", "");
34  if ($a_incl_desc)
35  {
36  $this->addColumn($this->lng->txt("description"), "", "");
37  }
38 // $this->addColumn($this->lng->txt("actions"), "", "");
39 
40  $this->setEnableHeader(true);
41  $this->setFormAction($ilCtrl->getFormAction($a_parent_obj));
42  $this->setRowTemplate("tpl.obj_translation_row.html", "Services/Object");
43  $this->disable("footer");
44  $this->setEnableTitle(true);
45 
46  $this->nr = 0;
47  }
48 
52  function prepareOutput()
53  {
54  global $lng;
55 
56  $this->addMultiCommand("delete".$this->base_cmd."s", $lng->txt("remove"));
57  if ($this->dataExists())
58  {
59  $this->addCommandButton("save".$this->base_cmd."s", $lng->txt("save"));
60  }
61  $this->addCommandButton("add".$this->base_cmd, $lng->txt("add"));
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 ?>