ILIAS  release_9 Revision v9.13-25-g2c18ec4c24f
class.ilBiblLibraryTableGUI.php
Go to the documentation of this file.
1 <?php
26 {
27  use \ILIAS\Modules\OrgUnit\ARHelper\DIC;
28 
29 
33  public function __construct(ilBiblLibraryGUI $parent_gui)
34  {
35  parent::__construct($parent_gui);
36  $this->setTitle($this->lng()->txt('bibl_settings_libraries'));
37  $this->setId('bibl_libraries_tbl');
38  $this->initColumns();
39  $this->setEnableNumInfo(false);
40  $this->setFormAction($this->ctrl()->getFormAction($parent_gui));
41  $this->setRowTemplate('tpl.bibl_settings_lib_list_row.html', 'Modules/Bibliographic');
42  }
43 
44 
45  public function fillRow(array $a_set): void
46  {
47  $this->tpl->setVariable('VAL_LIBRARY_NAME', $a_set['name']);
48  $this->tpl->setVariable('VAL_LIBRARY_URL', $a_set['url']);
49  $this->tpl->setVariable('VAL_LIBRARY_IMG', $a_set['img']);
50 
51  if ($this->checkPermissionBoolAndReturn('write')) {
52  $this->ctrl()->setParameter($this->parent_obj, ilBiblLibraryGUI::F_LIB_ID, $a_set['id']);
53  // build edit action entry
54  $action_entries['edit'] = $this->ui()->factory()->button()->shy(
55  $this->lng->txt(ilBiblLibraryGUI::CMD_EDIT),
56  $this->ctrl()->getLinkTarget($this->parent_obj, ilBiblLibraryGUI::CMD_EDIT)
57  );
58  // build delete action entry
59  $action_entries['delete'] = $this->ui()->factory()->button()->shy(
60  $this->lng->txt(ilBiblLibraryGUI::CMD_DELETE),
61  $this->ctrl()->getLinkTarget($this->parent_obj, ilBiblLibraryGUI::CMD_DELETE)
62  );
63  // build actions dropdown
64  $actions = $this->ui()->factory()->dropdown()->standard($action_entries)->withLabel($this->lng->txt("actions"));
65  $rendered_actions = $this->ui()->renderer()->render($actions);
66 
67  $this->tpl->setVariable('VAL_ACTIONS', $rendered_actions);
68  } else {
69  $this->tpl->setVariable('VAL_ACTIONS', "&nbsp;");
70  }
71  }
72 
73 
74  protected function initColumns(): void
75  {
76  $this->addColumn($this->lng()->txt('bibl_library_name'), '', '30%');
77  $this->addColumn($this->lng()->txt('bibl_library_url'), '30%');
78  $this->addColumn($this->lng()->txt('bibl_library_img'), '', '30%');
79  $this->addColumn($this->lng()->txt('actions'), '', '8%');
80  }
81 }
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)
setId(string $a_val)
__construct(VocabulariesInterface $vocabularies)
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
setRowTemplate(string $a_template, string $a_template_dir="")
Set row template.
setTitle(string $a_title, string $a_icon="", string $a_icon_alt="")
setEnableNumInfo(bool $a_val)
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)
__construct(ilBiblLibraryGUI $parent_gui)
ilObjBibliographicAdminTableGUI constructor.