ILIAS  release_5-3 Revision v5.3.23-19-g915713cf615
class.ilOrgUnitPositionTableGUI.php
Go to the documentation of this file.
1<?php
2
4
11{
12
16 protected $DIC;
20 protected $columns = array(
21 'title',
22 'description',
23 'authorities',
24 );
25
26
34 {
35 $this->DIC = $GLOBALS["DIC"];
36 $this->setPrefix('orgu_types_table');
37 $this->setId('orgu_types_table');
38 parent::__construct($parent_obj, $parent_cmd);
39 $this->setRowTemplate('tpl.position_row.html', 'Modules/OrgUnit');
40 $this->initColumns();
41 $this->addColumn($this->DIC->language()->txt('action'), '', '100px', false, 'text-right');
42 $this->buildData();
43 $this->setFormAction($this->DIC->ctrl()->getFormAction($this->parent_obj));
44 }
45
46
52 public function fillRow($set)
53 {
57 $obj = ilOrgUnitPosition::find($set["id"]);
58
59 $this->tpl->setVariable('TITLE', $obj->getTitle());
60 $this->tpl->setVariable('DESCRIPTION', $obj->getDescription());
61 $this->tpl->setVariable('AUTHORITIES', implode("<br>", $obj->getAuthorities()));
62
63 $this->DIC->ctrl()
64 ->setParameterByClass(ilOrgUnitPositionGUI::class, BaseCommands::AR_ID, $set['id']);
65 $selection = new ilAdvancedSelectionListGUI();
66 $selection->setListTitle($this->DIC->language()->txt('actions'));
67 $selection->setId(BaseCommands::AR_ID . $set['id']);
68 $selection->addItem($this->DIC->language()->txt('edit'), 'edit', $this->DIC->ctrl()
69 ->getLinkTargetByClass(ilOrgUnitPositionGUI::class, ilOrgUnitPositionGUI::CMD_EDIT));
70 if (!$obj->isCorePosition()) {
71 $selection->addItem($this->DIC->language()->txt('delete'), 'delete', $this->DIC->ctrl()
72 ->getLinkTargetByClass(ilOrgUnitPositionGUI::class, ilOrgUnitPositionGUI::CMD_CONFIRM_DELETION));
73 }
74
75 $this->tpl->setVariable('ACTIONS', $selection->getHTML());
76 }
77
78
82 protected function initColumns()
83 {
84 foreach ($this->columns as $column) {
85 $this->addColumn($this->DIC->language()->txt($column), $column);
86 }
87 }
88
89
93 protected function buildData()
94 {
96 }
97}
$column
Definition: 39dropdown.php:62
static getArray($key=null, $values=null)
An exception for terminatinating execution or to throw for unit testing.
User interface class for advanced drop-down selection lists.
Class ilOrgUnitPositionTableGUI.
__construct(BaseCommands $parent_obj, $parent_cmd)
ilOrgUnitPositionTableGUI constructor.
buildData()
Build and set data for table.
Class ilTable2GUI.
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...
fillRow($a_set)
Standard Version of Fill Row.
setData($a_data)
set table data @access public
setRowTemplate($a_template, $a_template_dir="")
Set row template.
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.
setId($a_val)
Set id.
setFormAction($a_form_action, $a_multipart=false)
Set Form action parameter.
$GLOBALS['loaded']
Global hash that tracks already loaded includes.