ILIAS  release_8 Revision v8.19
All Data Structures Namespaces Files Functions Variables Modules Pages
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 }
setData(array $a_data)
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
setFormAction(string $a_form_action, bool $a_multipart=false)
addCommandButton(string $a_cmd, string $a_text, string $a_onclick='', string $a_id="", string $a_class="")
__construct(?object $a_parent_obj, ilBiblFieldInterface $bibl_field, ilBiblTranslationFactoryInterface $translation_factory)
setFormName(string $a_name="")
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
setId(string $a_val)
setExternalSorting(bool $a_val)
setDefaultOrderField(string $a_defaultorderfield)
setRowTemplate(string $a_template, string $a_template_dir="")
Set row template.
setDefaultOrderDirection(string $a_defaultorderdirection)
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
__construct(Container $dic, ilPlugin $plugin)
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)
addMultiCommand(string $a_cmd, string $a_text)
setEnableHeader(bool $a_enableheader)
ilBiblTranslationFactoryInterface $translation_facory
setExternalSegmentation(bool $a_val)
setPrefix(string $a_prefix)