ILIAS  release_5-1 Revision 5.0.0-5477-g43f3e3fab5f
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
4include_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');
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?>
TableGUI class for title/description translations.
__construct($a_parent_obj, $a_parent_cmd, $a_incl_desc=true, $a_base_cmd="HeaderTitle")
Constructor.
Class ilTable2GUI.
setEnableHeader($a_enableheader)
Set Enable Header.
addColumn($a_text, $a_sort_field="", $a_width="", $a_is_checkbox_action_column=false, $a_class="", $a_tooltip="", $a_tooltip_with_html=false)
Add a column to the header.
setEnableTitle($a_enabletitle)
Set Enable Title.
setRowTemplate($a_template, $a_template_dir="")
Set row template.
setLimit($a_limit=0, $a_default_limit=0)
set max.
addMultiCommand($a_cmd, $a_text)
Add Command button.
setFormAction($a_form_action, $a_multipart=false)
Set Form action parameter.
addCommandButton($a_cmd, $a_text, $a_onclick='', $a_id="", $a_class=null)
Add Command button.
disable($a_module_name)
diesables particular modules of table
static formSelect($selected, $varname, $options, $multiple=false, $direct_text=false, $size="0", $style_class="", $attribs="", $disabled=false)
Builds a select form field with options and shows the selected option first.
static prepareFormOutput($a_str, $a_strip=false)
prepares string output for html forms @access public
global $ilCtrl
Definition: ilias.php:18
global $lng
Definition: privfeed.php:40