ILIAS  release_9 Revision v9.13-25-g2c18ec4c24f
class.ilRoleSelectionTableGUI.php
Go to the documentation of this file.
1 <?php
2 
19 declare(strict_types=1);
20 
27 {
28  protected ilRbacReview $review;
29 
30  public function __construct(object $a_parent_obj, string $a_parent_cmd)
31  {
32  global $DIC;
33 
34  $this->review = $DIC['rbacreview'];
35 
36  parent::__construct($a_parent_obj, $a_parent_cmd);
37  $this->addColumn('', 'f', (string) 1);
38  $this->addColumn($this->lng->txt('title'), 'title', "70%");
39  $this->addColumn($this->lng->txt('context'), 'context', "30%");
40 
41  $this->setFormAction($this->ctrl->getFormAction($a_parent_obj));
42  $this->setRowTemplate("tpl.show_role_selection_row.html", "Services/AccessControl");
43  $this->setDefaultOrderField('type');
44  $this->setDefaultOrderDirection("desc");
45  }
46 
47  protected function fillRow(array $a_set): void
48  {
49  $this->tpl->setVariable('VAL_ID', $a_set['id']);
50  $this->tpl->setVariable('VAL_TITLE', $a_set['title']);
51  if (strlen($a_set['description'])) {
52  $this->tpl->setVariable('VAL_DESC', $a_set['description']);
53  }
54  $this->tpl->setVariable('VAL_CONTEXT', $a_set['context']);
55  }
56 
57  public function parse(array $entries): void
58  {
59  $records_arr = [];
60  foreach ($entries as $entry) {
61  $role = new ilObjRole($entry['obj_id'], false);
62  $tmp_arr['id'] = $entry['obj_id'];
63  $tmp_arr['title'] = strip_tags(
64  $role->getPresentationTitle()
65  );
66  $tmp_arr['description'] = strip_tags(
67  $role->getDescription()
68  );
69  $tmp_arr['context'] = strip_tags(
70  ilObject::_lookupTitle($this->review->getObjectOfRole((int) $entry['obj_id']))
71  );
72 
73  $records_arr[] = $tmp_arr;
74  }
75  $this->setData($records_arr);
76  }
77 }
Class ilObjRole.
setData(array $a_data)
setFormAction(string $a_form_action, bool $a_multipart=false)
global $DIC
Definition: feed.php:28
__construct(VocabulariesInterface $vocabularies)
static _lookupTitle(int $obj_id)
setDefaultOrderField(string $a_defaultorderfield)
setRowTemplate(string $a_template, string $a_template_dir="")
Set row template.
setDefaultOrderDirection(string $a_defaultorderdirection)
__construct(object $a_parent_obj, string $a_parent_cmd)
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)