ILIAS  trunk Revision v11.0_alpha-3011-gc6b235a2e85
class.ilAvailableRolesStatusTableGUI.php
Go to the documentation of this file.
1<?php
2
19declare(strict_types=1);
20
27{
28 protected \ILIAS\UI\Renderer $renderer;
29 protected \ILIAS\UI\Factory $ui_factory;
30
34 public function __construct(?object $a_parent_obj, string $a_parent_cmd)
35 {
36 global $DIC;
37
38 $this->setId('available_roles' . $a_parent_obj->user->getId());
39 parent::__construct($a_parent_obj, $a_parent_cmd);
40
41 $this->renderer = $DIC->ui()->renderer();
42 $this->ui_factory = $DIC->ui()->factory();
43
44 $this->setEnableHeader(true);
45 $this->disable('numinfo');
46 $this->setLimit(100);
47 $this->setRowTemplate("tpl.available_roles_status_row.html", "components/ILIAS/AccessControl");
48
49 $this->addColumn($this->lng->txt("status"), "status", "5%");
50 $this->addColumn($this->lng->txt("role"), "role", "32%");
51 $this->addColumn(
52 str_replace(" ", "&nbsp;", $this->lng->txt("info_permission_source")),
53 "effective_from",
54 "32%"
55 );
56 $this->addColumn(str_replace(" ", "&nbsp;", $this->lng->txt("info_permission_origin")), "original_position");
57 }
58
62 protected function fillRow(array $a_set): void
63 {
64 if ($a_set["img"] == ilObjectPermissionStatusGUI::IMG_OK) {
65 $img_path = ilUtil::getImagePath("standard/icon_ok.svg");
66 $img_info = $this->lng->txt("info_assigned");
67 } else {
68 $img_path = ilUtil::getImagePath("standard/icon_not_ok.svg");
69 $img_info = $this->lng->txt("info_not_assigned");
70 }
71 $this->tpl->setVariable("ICON", $this->renderer->render(
72 $this->ui_factory->symbol()->icon()->custom($img_path, $img_info)
73 ));
74
75 $link = $this->ctrl->getLinkTargetByClass(['ilpermissiongui'], 'perm', '', true);
76 $this->tpl->setVariable("ROLE_LINK", $link);
77 $this->tpl->setVariable("TXT_ROLE", $a_set["role"]);
78
79 if ($a_set["effective_from"] != "") {
80 $this->tpl->setCurrentBlock("effective_from");
81 $this->tpl->setVariable("EFFECTIVE_FROM_LINK", ilLink::_getLink($a_set["effective_from_ref_id"]));
82 $this->tpl->setVariable("TXT_EFFECTIVE_FROM", $a_set["effective_from"]);
83 $this->tpl->parseCurrentBlock();
84 }
85
86 if ($a_set["original_position_ref_id"] !== false) {
87 $this->tpl->setCurrentBlock("original_position_with_link");
88 $this->tpl->setVariable("TXT_ORIGINAL_POSITION_WITH_LINK", $a_set["original_position"]);
89 $this->tpl->setVariable(
90 "ORIGINAL_POSITION_LINK",
91 ilLink::_getLink((int) $a_set["original_position_ref_id"])
92 );
93 $this->tpl->parseCurrentBlock();
94 } else {
95 $this->tpl->setVariable("TXT_ORIGINAL_POSITION", $a_set["original_position"]);
96 }
97 }
98}
renderer()
Table for Available Roles in Permission > Permission of User.
__construct(?object $a_parent_obj, string $a_parent_cmd)
Constructor.
fillRow(array $a_set)
Fill a single data row.
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
setLimit(int $a_limit=0, int $a_default_limit=0)
set max.
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)
setEnableHeader(bool $a_enableheader)
setRowTemplate(string $a_template, string $a_template_dir="")
Set row template.
setId(string $a_val)
disable(string $a_module_name)
static getImagePath(string $image_name, string $module_path="", string $mode="output", bool $offline=false)
get image path (for images located in a template directory)
__construct(Container $dic, ilPlugin $plugin)
@inheritDoc
global $DIC
Definition: shib_login.php:26