ILIAS  release_5-1 Revision 5.0.0-5477-g43f3e3fab5f
class.ilObjectTranslation2TableGUI.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 $a_master_lang = "")
22 {
23 global $ilCtrl, $lng, $ilAccess, $lng;
24
25 parent::__construct($a_parent_obj, $a_parent_cmd);
26 $this->incl_desc = $a_incl_desc;
27 $this->base_cmd = $a_base_cmd;
28 $this->master_lang = $a_master_lang;
29
30 $this->setLimit(9999);
31
32 $this->addColumn("", "", "1");
33 $this->addColumn($this->lng->txt("language"), "", "");
34 $this->addColumn($this->lng->txt("default"), "", "");
35 $this->addColumn($this->lng->txt("title"), "", "");
36 if ($a_incl_desc)
37 {
38 $this->addColumn($this->lng->txt("description"), "", "");
39 }
40// $this->addColumn($this->lng->txt("actions"), "", "");
41
42 $this->setEnableHeader(true);
43 $this->setFormAction($ilCtrl->getFormAction($a_parent_obj));
44 $this->setRowTemplate("tpl.obj_translation2_row.html", "Services/Object");
45 $this->disable("footer");
46 $this->setEnableTitle(true);
47
48 $this->nr = 0;
49 }
50
54 function prepareOutput()
55 {
56 global $lng;
57
58 $this->addMultiCommand("delete".$this->base_cmd."s", $lng->txt("remove"));
59 if ($this->dataExists())
60 {
61 $this->addCommandButton("save".$this->base_cmd."s", $lng->txt("save"));
62 }
63 }
64
68 protected function fillRow($a_set)
69 {
70 global $lng;
71
72 $this->nr++;
73
74
75 if (!$a_set["default"] && $a_set["lang"] != $this->master_lang)
76 {
77 $this->tpl->setCurrentBlock("cb");
78 $this->tpl->setVariable("CB_NR", $this->nr);
79 $this->tpl->parseCurrentBlock();
80 }
81
82 if ($this->master_lang == "")
83 {
84 $this->tpl->setCurrentBlock("rb");
85 $this->tpl->setVariable("RB_NR", $this->nr);
86 if ($a_set["default"])
87 {
88 $this->tpl->setVariable("DEF_CHECKED", "checked=\"checked\"");
89 }
90 $this->tpl->parseCurrentBlock();
91 }
92 else if ($a_set["lang"] == $this->master_lang)
93 {
94 $this->tpl->setVariable("MASTER_LANG", $lng->txt("obj_master_lang"));
95 }
96
97 if ($this->incl_desc)
98 {
99 $this->tpl->setCurrentBlock("desc_row");
100 $this->tpl->setVariable("VAL_DESC", ilUtil::prepareFormOutput($a_set["desc"]));
101 $this->tpl->setVariable("DNR", $this->nr);
102 $this->tpl->parseCurrentBlock();
103 }
104
105 $this->tpl->setVariable("NR", $this->nr);
106
107 // lang selection
108 include_once('Services/MetaData/classes/class.ilMDLanguageItem.php');
109 $languages = ilMDLanguageItem::_getLanguages();
110 $this->tpl->setVariable("LANG_SELECT",
111 ilUtil::formSelect($a_set["lang"], "lang[".$this->nr."]", $languages,
112 false, true));
113
114
115 $this->tpl->setVariable("VAL_TITLE", ilUtil::prepareFormOutput($a_set["title"]));
116 }
117
118}
119?>
TableGUI class for title/description translations.
__construct($a_parent_obj, $a_parent_cmd, $a_incl_desc=true, $a_base_cmd="HeaderTitle", $a_master_lang="")
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