ILIAS  trunk Revision v11.0_alpha-3011-gc6b235a2e85
class.ilRoleSelectionTableGUI.php
Go to the documentation of this file.
1<?php
2
19declare(strict_types=1);
20
21use ILIAS\Refinery\Factory as Refinery;
22
29{
31 protected Refinery $refinery;
32
33 public function __construct(object $a_parent_obj, string $a_parent_cmd)
34 {
35 global $DIC;
36
37 $this->review = $DIC['rbacreview'];
38 $this->refinery = $DIC['refinery'];
39
40 parent::__construct($a_parent_obj, $a_parent_cmd);
41 $this->addColumn('', 'f', (string) 1);
42 $this->addColumn($this->lng->txt('title'), 'title', "70%");
43 $this->addColumn($this->lng->txt('context'), 'context', "30%");
44
45 $this->setFormAction($this->ctrl->getFormAction($a_parent_obj));
46 $this->setRowTemplate("tpl.show_role_selection_row.html", "components/ILIAS/AccessControl");
47 $this->setDefaultOrderField('type');
48 $this->setDefaultOrderDirection("desc");
49 }
50
51 protected function fillRow(array $a_set): void
52 {
53 $this->tpl->setVariable('VAL_ID', $a_set['id']);
54 $this->tpl->setVariable('VAL_TITLE', $a_set['title']);
55 if (strlen($a_set['description'])) {
56 $this->tpl->setVariable('VAL_DESC', $a_set['description']);
57 }
58 $this->tpl->setVariable('VAL_CONTEXT', $a_set['context']);
59 }
60
61 public function parse(array $entries): void
62 {
63 $records_arr = [];
64 foreach ($entries as $entry) {
65 $role = new ilObjRole($entry['obj_id'], false);
66 $tmp_arr['id'] = $entry['obj_id'];
67 $tmp_arr['title'] = $this->refinery->encode()->htmlSpecialCharsAsEntities()->transform(
68 $role->getPresentationTitle()
69 );
70 $tmp_arr['description'] = $this->refinery->encode()->htmlSpecialCharsAsEntities()->transform(
71 $role->getDescription()
72 );
73 $tmp_arr['context'] = $this->refinery->encode()->htmlSpecialCharsAsEntities()->transform(
74 ilObject::_lookupTitle($this->review->getObjectOfRole((int) $entry['obj_id']))
75 );
76
77 $records_arr[] = $tmp_arr;
78 }
79 $this->setData($records_arr);
80 }
81}
Builds data types.
Definition: Factory.php:36
Class ilObjRole.
static _lookupTitle(int $obj_id)
class ilRbacReview Contains Review functions of core Rbac.
__construct(object $a_parent_obj, string $a_parent_cmd)
fillRow(array $a_set)
Standard Version of Fill Row.
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)
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)
setDefaultOrderField(string $a_defaultorderfield)
setRowTemplate(string $a_template, string $a_template_dir="")
Set row template.
setDefaultOrderDirection(string $a_defaultorderdirection)
setData(array $a_data)
Set table data.
__construct(Container $dic, ilPlugin $plugin)
@inheritDoc
global $DIC
Definition: shib_login.php:26