ILIAS  release_8 Revision v8.24
class.ilBiblTranslationTableGUI.php
Go to the documentation of this file.
1<?php
2
25{
26 use \ILIAS\Modules\OrgUnit\ARHelper\DIC;
27 protected \ilBiblFieldInterface $field;
28 protected \ilBiblTranslationFactoryInterface $translation_facory;
29
30
34 public function __construct(?object $a_parent_obj, ilBiblFieldInterface $bibl_field, ilBiblTranslationFactoryInterface $translation_factory)
35 {
36 $this->translation_facory = $translation_factory;
37 $this->field = $bibl_field;
38 $table_id = 'bibl_trans_field_' . $bibl_field->getId();
39 $this->setId($table_id);
40 $this->setPrefix($table_id);
41 $this->setFormName($table_id);
42 $this->ctrl()->saveParameter($a_parent_obj, $this->getNavParameter());
43 $this->setRowTemplate("tpl.bibl_admin_translation_row.html", "Modules/Bibliographic");
44 parent::__construct($a_parent_obj);
45 $this->setFormAction($this->ctrl()->getFormAction($a_parent_obj));
46 $this->setExternalSorting(true);
47 $this->setDefaultOrderField("id");
48 $this->setDefaultOrderDirection("asc");
49 $this->setExternalSegmentation(true);
50 $this->setEnableHeader(true);
51 $this->initColumns();
52
54 ->txt("save"));
56 ->txt("delete"));
57
58 $this->parseData();
59 }
60
61
62 protected function initColumns(): void
63 {
64 $this->addColumn($this->lng()->txt('bibl_translation_select'), '', '15px', true);
65 $this->addColumn($this->lng()->txt('bibl_translation_lang'));
66 $this->addColumn($this->lng()->txt('bibl_translation_trans'));
67 $this->addColumn($this->lng()->txt('bibl_translation_desc'));
68 }
69
70
71 protected function parseData(): void
72 {
73 $data = $this->translation_facory->getAllTranslationsForFieldAsArray($this->field);
74 $this->setData($data);
75 }
76
77
81 protected function fillRow(array $a_set): void
82 {
83 $translation = $this->translation_facory->findById($a_set['id']);
84 $this->tpl->setVariable('ID', $translation->getId());
85 $this->tpl->setVariable('LANGUAGE', $translation->getLanguageKey());
86 $this->tpl->setVariable('TEXT', $translation->getTranslation());
87 $this->tpl->setVariable('DESCRIPTION', $translation->getDescription());
88 }
89}
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
__construct(?object $a_parent_obj, ilBiblFieldInterface $bibl_field, ilBiblTranslationFactoryInterface $translation_factory)
@inheritDoc
ilBiblTranslationFactoryInterface $translation_facory
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