ILIAS  trunk Revision v11.0_alpha-3011-gc6b235a2e85
class.ilBiblTranslationTableGUI.php
Go to the documentation of this file.
1<?php
2
19use ILIAS\components\OrgUnit\ARHelper\DIC;
20
27{
28 use DIC;
29
30
34 public function __construct(?object $a_parent_obj, protected \ilBiblFieldInterface $field, protected \ilBiblTranslationFactoryInterface $translation_facory)
35 {
36 $table_id = 'bibl_trans_field_' . $this->field->getId();
37 $this->setId($table_id);
38 $this->setPrefix($table_id);
39 $this->setFormName($table_id);
40 $this->ctrl()->saveParameter($a_parent_obj, $this->getNavParameter());
41 $this->setRowTemplate("tpl.bibl_admin_translation_row.html", "components/ILIAS/Bibliographic");
42 parent::__construct($a_parent_obj);
43 $this->setFormAction($this->ctrl()->getFormAction($a_parent_obj));
44 $this->setExternalSorting(true);
45 $this->setDefaultOrderField("id");
46 $this->setDefaultOrderDirection("asc");
47 $this->setExternalSegmentation(true);
48 $this->setEnableHeader(true);
49 $this->initColumns();
50
52 ->txt("save"));
54 ->txt("delete"));
55
56 $this->parseData();
57 }
58
59
60 protected function initColumns(): void
61 {
62 $this->addColumn($this->lng()->txt('bibl_translation_select'), '', '15px', true);
63 $this->addColumn($this->lng()->txt('bibl_translation_lang'));
64 $this->addColumn($this->lng()->txt('bibl_translation_trans'));
65 $this->addColumn($this->lng()->txt('bibl_translation_desc'));
66 }
67
68
69 protected function parseData(): void
70 {
71 $data = $this->translation_facory->getAllTranslationsForFieldAsArray($this->field);
72 $this->setData($data);
73 }
74
75
79 #[\Override]
80 protected function fillRow(array $a_set): void
81 {
82 $translation = $this->translation_facory->findById($a_set['id']);
83 $this->tpl->setVariable('ID', $translation->getId());
84 $this->tpl->setVariable('LANGUAGE', $translation->getLanguageKey());
85 $this->tpl->setVariable('TEXT', $translation->getTranslation());
86 $this->tpl->setVariable('DESCRIPTION', $translation->getDescription());
87 }
88}
Class ilBiblTranslationTableGUI.
__construct(?object $a_parent_obj, protected \ilBiblFieldInterface $field, protected \ilBiblTranslationFactoryInterface $translation_facory)
@inheritDoc
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
setExternalSegmentation(bool $a_val)
addCommandButton(string $a_cmd, string $a_text, string $a_onclick='', string $a_id="", string $a_class="")
setFormName(string $a_name="")
addMultiCommand(string $a_cmd, string $a_text)
setPrefix(string $a_prefix)
set prefix for sort and offset fields (if you have two or more tables on a page that you want to sort...
setFormAction(string $a_form_action, bool $a_multipart=false)
addColumn(string $a_text, string $a_sort_field="", string $a_width="", bool $a_is_checkbox_action_column=false, string $a_class="", string $a_tooltip="", bool $a_tooltip_with_html=false)
setEnableHeader(bool $a_enableheader)
setDefaultOrderField(string $a_defaultorderfield)
setExternalSorting(bool $a_val)
setRowTemplate(string $a_template, string $a_template_dir="")
Set row template.
setId(string $a_val)
setDefaultOrderDirection(string $a_defaultorderdirection)
setData(array $a_data)
Set table data.
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
__construct(Container $dic, ilPlugin $plugin)
@inheritDoc