ILIAS  release_6 Revision v6.24-5-g0c8bfefb3b8
All Data Structures Namespaces Files Functions Variables Modules Pages
class.ilOrgUnitPositionTableGUI.php
Go to the documentation of this file.
1 <?php
2 
4 
11 {
12 
16  protected $DIC;
20  protected $columns
21  = array(
22  'title',
23  'description',
24  'authorities',
25  );
26 
27 
35  {
36  $this->DIC = $GLOBALS["DIC"];
37  $this->setPrefix('orgu_types_table');
38  $this->setId('orgu_types_table');
39  parent::__construct($parent_obj, $parent_cmd);
40  $this->setRowTemplate('tpl.position_row.html', 'Modules/OrgUnit');
41  $this->initColumns();
42  $this->addColumn($this->DIC->language()->txt('action'), '', '100px', false, 'text-right');
43  $this->buildData();
44  $this->setFormAction($this->DIC->ctrl()->getFormAction($this->parent_obj));
45  }
46 
47 
53  public function fillRow($set)
54  {
58  $obj = ilOrgUnitPosition::find($set["id"]);
59 
60  $this->tpl->setVariable('TITLE', $obj->getTitle());
61  $this->tpl->setVariable('DESCRIPTION', $obj->getDescription());
62  $this->tpl->setVariable('AUTHORITIES', implode("<br>", $obj->getAuthorities()));
63 
64  $this->DIC->ctrl()
65  ->setParameterByClass(ilOrgUnitPositionGUI::class, BaseCommands::AR_ID, $set['id']);
66  $selection = new ilAdvancedSelectionListGUI();
67  $selection->setListTitle($this->DIC->language()->txt('actions'));
68  $selection->setId(BaseCommands::AR_ID . $set['id']);
69  $selection->addItem($this->DIC->language()->txt('edit'), 'edit', $this->DIC->ctrl()
70  ->getLinkTargetByClass(ilOrgUnitPositionGUI::class, ilOrgUnitPositionGUI::CMD_EDIT));
71  if (!$obj->isCorePosition()) {
72  $selection->addItem($this->DIC->language()->txt('delete'), 'delete', $this->DIC->ctrl()
73  ->getLinkTargetByClass(ilOrgUnitPositionGUI::class, ilOrgUnitPositionGUI::CMD_CONFIRM_DELETION));
74  }
75 
76  $this->tpl->setVariable('ACTIONS', $selection->getHTML());
77  }
78 
79 
83  protected function initColumns()
84  {
85  foreach ($this->columns as $column) {
86  $this->addColumn($this->DIC->language()->txt($column), $column);
87  }
88  }
89 
90 
94  protected function buildData()
95  {
97  }
98 }
__construct(BaseCommands $parent_obj, $parent_cmd)
ilOrgUnitPositionTableGUI constructor.
setId($a_val)
Set id.
if(!defined('PATH_SEPARATOR')) $GLOBALS['_PEAR_default_error_mode']
Definition: PEAR.php:64
setPrefix($a_prefix)
setRowTemplate($a_template, $a_template_dir="")
Set row template.
setFormAction($a_form_action, $a_multipart=false)
Set Form action parameter.
__construct(Container $dic, ilPlugin $plugin)
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.
buildData()
Build and set data for table.
static getArray($key=null, $values=null)
fillRow($a_set)
Standard Version of Fill Row.
Class ilOrgUnitPositionTableGUI.