ILIAS  release_6 Revision v6.24-5-g0c8bfefb3b8
class.ilMMItemTranslationTableGUI.php
Go to the documentation of this file.
1<?php
2
9{
10 use \ILIAS\Modules\OrgUnit\ARHelper\DIC;
14 private $item_facade;
15
16
24 {
25 $table_id = self::class;
26 $this->item_facade = $item_facade;
27 $this->setId($table_id);
28 $this->setPrefix($table_id);
29 $this->setFormName($table_id);
30 parent::__construct($a_parent_obj);
31 $this->ctrl()->saveParameter($a_parent_obj, $this->getNavParameter());
32 $this->setRowTemplate("tpl.translation_row.html", "Services/MainMenu");
33 $this->setFormAction($this->ctrl()->getFormAction($a_parent_obj));
34 $this->setExternalSorting(true);
35 $this->setDefaultOrderField("id");
36 $this->setDefaultOrderDirection("asc");
37 $this->setExternalSegmentation(true);
38 $this->setEnableHeader(true);
39 $this->initColumns();
40 $this->initCommands();
41 $this->lng->loadLanguageModule("meta");
42
43 $this->addCommandButton(
45 $this->lng()
46 ->txt("save")
47 );
48 $this->addMultiCommand(
50 $this->lng()
51 ->txt("delete")
52 );
53
54 $this->parseData();
55 }
56
57
58 protected function initColumns()
59 {
60 $this->addColumn($this->lng()->txt('mm_translation_select'), '', '15px', true);
61 $this->addColumn($this->lng()->txt('mm_translation_lang'));
62 $this->addColumn($this->lng()->txt('mm_translation_trans'));
63 }
64
65
66 protected function initCommands()
67 {
69 ->txt("delete"));
70 }
71
72
73 protected function parseData()
74 {
75 $this->setData(ilMMItemTranslationStorage::where(['identification' => $this->item_facade->getId()])->getArray());
76 }
77
78
82 protected function fillRow($a_set)
83 {
87 $translation = ilMMItemTranslationStorage::find($a_set['id']);
88
89 $this->tpl->setVariable('ID', $translation->getId());
90 $this->tpl->setVariable('LANGUAGE', $this->lng()->txt("meta_l_" . $translation->getLanguageKey()));
91 $this->tpl->setVariable('TEXT', $translation->getTranslation());
92 }
93}
static where($where, $operator=null)
An exception for terminatinating execution or to throw for unit testing.
static find($primary_key, array $add_constructor_args=array())
@inheritDoc
Class ilMMItemTranslationGUI.
Class ilMMItemTranslationTableGUI.
__construct(ilMMItemTranslationGUI $a_parent_obj, ilMMItemFacadeInterface $item_facade)
ilMMItemTranslationTableGUI constructor.
Class ilTable2GUI.
setEnableHeader($a_enableheader)
Set Enable Header.
setExternalSorting($a_val)
Set external sorting.
setPrefix($a_prefix)
set prefix for sort and offset fields (if you have two or more tables on a page that you want to sort...
fillRow($a_set)
Standard Version of Fill Row.
getFormAction()
Get Form action parameter.
setData($a_data)
set table data @access public
setRowTemplate($a_template, $a_template_dir="")
Set row template.
addMultiCommand($a_cmd, $a_text)
Add Command button.
setDefaultOrderField($a_defaultorderfield)
Set Default order field.
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.
setExternalSegmentation($a_val)
Set external segmentation.
setId($a_val)
Set id.
setFormName($a_formname="")
Set Form name.
setFormAction($a_form_action, $a_multipart=false)
Set Form action parameter.
setDefaultOrderDirection($a_defaultorderdirection)
Set Default order direction.
addCommandButton($a_cmd, $a_text, $a_onclick='', $a_id="", $a_class=null)
Add Command button.
Interface ilMMItemFacadeInterface.
__construct(Container $dic, ilPlugin $plugin)
@inheritDoc