ILIAS  release_5-4 Revision v5.4.26-12-gabc799a52e6
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{
19 protected $ctrl;
20
24 protected $access;
25
26
30 public function __construct($a_parent_obj, $a_parent_cmd, $a_incl_desc = true, $a_base_cmd = "HeaderTitle")
31 {
32 global $DIC;
33
34 $this->ctrl = $DIC->ctrl();
35 $this->lng = $DIC->language();
36 $this->access = $DIC->access();
37 $ilCtrl = $DIC->ctrl();
38 $lng = $DIC->language();
39 $ilAccess = $DIC->access();
40 $lng = $DIC->language();
41
42 parent::__construct($a_parent_obj, $a_parent_cmd);
43 $this->incl_desc = $a_incl_desc;
44 $this->base_cmd = $a_base_cmd;
45
46 $this->setLimit(9999);
47
48 $this->addColumn("", "", "1");
49 $this->addColumn($this->lng->txt("language"), "", "");
50 $this->addColumn($this->lng->txt("default"), "", "");
51 $this->addColumn($this->lng->txt("title"), "", "");
52 if ($a_incl_desc) {
53 $this->addColumn($this->lng->txt("description"), "", "");
54 }
55 // $this->addColumn($this->lng->txt("actions"), "", "");
56
57 $this->setEnableHeader(true);
58 $this->setFormAction($ilCtrl->getFormAction($a_parent_obj));
59 $this->setRowTemplate("tpl.obj_translation_row.html", "Services/Object");
60 $this->disable("footer");
61 $this->setEnableTitle(true);
62
63 $this->nr = 0;
64 }
65
69 public function prepareOutput()
70 {
72
73 $this->addMultiCommand("delete" . $this->base_cmd . "s", $lng->txt("remove"));
74 if ($this->dataExists()) {
75 $this->addCommandButton("save" . $this->base_cmd . "s", $lng->txt("save"));
76 }
77 $this->addCommandButton("add" . $this->base_cmd, $lng->txt("add"));
78 }
79
83 protected function fillRow($a_set)
84 {
86
87 $this->nr++;
88
89 if ($this->incl_desc) {
90 $this->tpl->setCurrentBlock("desc_row");
91 $this->tpl->setVariable("VAL_DESC", ilUtil::prepareFormOutput($a_set["desc"]));
92 $this->tpl->setVariable("DNR", $this->nr);
93 $this->tpl->parseCurrentBlock();
94 }
95
96 $this->tpl->setVariable("NR", $this->nr);
97
98 // lang selection
99 include_once('Services/MetaData/classes/class.ilMDLanguageItem.php');
101 $this->tpl->setVariable(
102 "LANG_SELECT",
104 $a_set["lang"],
105 "lang[" . $this->nr . "]",
107 false,
108 true
109 )
110 );
111
112 if ($a_set["default"]) {
113 $this->tpl->setVariable("DEF_CHECKED", "checked=\"checked\"");
114 }
115
116 $this->tpl->setVariable("VAL_TITLE", ilUtil::prepareFormOutput($a_set["title"]));
117 }
118}
An exception for terminatinating execution or to throw for unit testing.
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.
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.
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.
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
$languages
Definition: cssgen2.php:34
global $ilCtrl
Definition: ilias.php:18
global $DIC
Definition: saml.php:7