ILIAS  release_8 Revision v8.24
class.ilOrgUnitPositionTableGUI.php
Go to the documentation of this file.
1<?php
20
26{
30 protected $DIC;
34 protected $columns
35 = array(
36 'title',
37 'description',
38 'authorities',
39 );
40
47 {
48 $this->DIC = $GLOBALS["DIC"];
49 $this->setPrefix('orgu_types_table');
50 $this->setId('orgu_types_table');
51 parent::__construct($parent_obj, $parent_cmd);
52 $this->setRowTemplate('tpl.position_row.html', 'Modules/OrgUnit');
53 $this->initColumns();
54 $this->addColumn($this->DIC->language()->txt('action'), '', '100px', false, 'text-right');
55 $this->buildData();
56 $this->setFormAction($this->DIC->ctrl()->getFormAction($this->parent_obj));
57 }
58
63 public function fillRow(array $a_set): void
64 {
68 $obj = ilOrgUnitPosition::find($a_set["id"]);
69 $obj->afterObjectLoad();
70
71 $this->tpl->setVariable('TITLE', $obj->getTitle());
72 $this->tpl->setVariable('DESCRIPTION', $obj->getDescription());
73 $this->tpl->setVariable('AUTHORITIES', implode("<br>", $obj->getAuthorities()));
74
75 $this->DIC->ctrl()
76 ->setParameterByClass(ilOrgUnitPositionGUI::class, BaseCommands::AR_ID, $a_set['id']);
77 $selection = new ilAdvancedSelectionListGUI();
78 $selection->setListTitle($this->DIC->language()->txt('actions'));
79 $selection->setId(BaseCommands::AR_ID . $a_set['id']);
80 $selection->addItem($this->DIC->language()->txt('edit'), 'edit', $this->DIC->ctrl()
81 ->getLinkTargetByClass(
82 ilOrgUnitPositionGUI::class,
84 ));
85 if (!$obj->isCorePosition()) {
86 $selection->addItem($this->DIC->language()->txt('delete'), 'delete', $this->DIC->ctrl()
87 ->getLinkTargetByClass(
88 ilOrgUnitPositionGUI::class,
90 ));
91 }
92
93 $this->tpl->setVariable('ACTIONS', $selection->getHTML());
94 }
95
96 private function initColumns(): void
97 {
98 foreach ($this->columns as $column) {
99 $this->addColumn($this->DIC->language()->txt($column), $column);
100 }
101 }
102
106 private function buildData(): void
107 {
109 }
110}
if(!defined('PATH_SEPARATOR')) $GLOBALS['_PEAR_default_error_mode']
Definition: PEAR.php:64
static getArray(?string $key=null, $values=null)
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
Class ilOrgUnitPositionTableGUI.
__construct(BaseCommands $parent_obj, $parent_cmd)
ilOrgUnitPositionTableGUI constructor.
buildData()
Build and set data for table.
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
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)
fillRow(array $a_set)
Standard Version of Fill Row.
setRowTemplate(string $a_template, string $a_template_dir="")
Set row template.
setId(string $a_val)
setData(array $a_data)
Set table data.
__construct(Container $dic, ilPlugin $plugin)
@inheritDoc