ILIAS  release_5-4 Revision v5.4.26-12-gabc799a52e6
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 }
addCommandButton($a_cmd, $a_text, $a_onclick='', $a_id="", $a_class=null)
Add Command button.
setExternalSorting($a_val)
Set external sorting.
setDefaultOrderField($a_defaultorderfield)
Set Default order field.
static find($primary_key, array $add_constructor_args=array())
__construct(ilMMItemTranslationGUI $a_parent_obj, ilMMItemFacadeInterface $item_facade)
ilMMItemTranslationTableGUI constructor.
setExternalSegmentation($a_val)
Set external segmentation.
static where($where, $operator=null)
setId($a_val)
Set id.
setDefaultOrderDirection($a_defaultorderdirection)
Set Default order direction.
Class ilTable2GUI.
addMultiCommand($a_cmd, $a_text)
Add Command button.
setPrefix($a_prefix)
getFormAction()
Get Form action parameter.
Class ilMMItemTranslationGUI.
setRowTemplate($a_template, $a_template_dir="")
Set row template.
Class ilMMItemTranslationTableGUI.
setFormAction($a_form_action, $a_multipart=false)
Set Form action parameter.
setFormName($a_formname="")
Set Form name.
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.
setEnableHeader($a_enableheader)
Set Enable Header.
fillRow($a_set)
Standard Version of Fill Row.
Interface ilMMItemFacadeInterface.