ILIAS  release_5-4 Revision v5.4.26-12-gabc799a52e6
class.ilBiblTranslationTableGUI.php
Go to the documentation of this file.
1<?php
2
9{
10 use \ILIAS\Modules\OrgUnit\ARHelper\DIC;
14 protected $field;
19
20
24 public function __construct($a_parent_obj, ilBiblFieldInterface $bibl_field, ilBiblTranslationFactoryInterface $translation_factory)
25 {
26 $this->translation_facory = $translation_factory;
27 $this->field = $bibl_field;
28 $table_id = 'bibl_trans_field_' . $bibl_field->getId();
29 $this->setId($table_id);
30 $this->setPrefix($table_id);
31 $this->setFormName($table_id);
32 $this->ctrl()->saveParameter($a_parent_obj, $this->getNavParameter());
33 $this->setRowTemplate("tpl.bibl_admin_translation_row.html", "Modules/Bibliographic");
34 parent::__construct($a_parent_obj);
35 $this->setFormAction($this->ctrl()->getFormAction($a_parent_obj));
36 $this->setExternalSorting(true);
37 $this->setDefaultOrderField("id");
38 $this->setDefaultOrderDirection("asc");
39 $this->setExternalSegmentation(true);
40 $this->setEnableHeader(true);
41 $this->initColumns();
42
44 ->txt("save"));
46 ->txt("delete"));
47
48 $this->parseData();
49 }
50
51
52 protected function initColumns()
53 {
54 $this->addColumn($this->lng()->txt('bibl_translation_select'), '', '15px', true);
55 $this->addColumn($this->lng()->txt('bibl_translation_lang'));
56 $this->addColumn($this->lng()->txt('bibl_translation_trans'));
57 $this->addColumn($this->lng()->txt('bibl_translation_desc'));
58 }
59
60
61 protected function parseData()
62 {
63 $data = $this->translation_facory->getAllTranslationsForFieldAsArray($this->field);
64 $this->setData($data);
65 }
66
67
71 protected function fillRow($a_set)
72 {
73 $translation = $this->translation_facory->findById($a_set['id']);
74 $this->tpl->setVariable('ID', $translation->getId());
75 $this->tpl->setVariable('LANGUAGE', $translation->getLanguageKey());
76 $this->tpl->setVariable('TEXT', $translation->getTranslation());
77 $this->tpl->setVariable('DESCRIPTION', $translation->getDescription());
78 }
79}
An exception for terminatinating execution or to throw for unit testing.
Class ilBiblTranslationTableGUI.
__construct($a_parent_obj, ilBiblFieldInterface $bibl_field, ilBiblTranslationFactoryInterface $translation_factory)
@inheritDoc
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...
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 ilBiblEntryInterface.