ILIAS  trunk Revision v11.0_alpha-3011-gc6b235a2e85
class.ilShibbolethRoleAssignmentTableGUI.php
Go to the documentation of this file.
1<?php
2
29{
33 public function __construct(ilAuthShibbolethSettingsGUI $a_parent_obj, string $a_parent_cmd = '')
34 {
35 global $DIC;
36 $this->ctrl = $DIC->ctrl();
37 $this->lng = $DIC->language();
38 parent::__construct($a_parent_obj, $a_parent_cmd);
39
40 $this->addColumn('', 'f', 1);
41 $this->addColumn($this->lng->txt('shib_rule_type'), 'type', "20%");
42 $this->addColumn($this->lng->txt('shib_ilias_role'), 'role', "30%");
43 $this->addColumn($this->lng->txt('shib_rule_condition'), 'condition', "20%");
44 $this->addColumn($this->lng->txt('shib_add_remove'), 'add_remove', "30%");
45 $this->setFormAction($this->ctrl->getFormAction($a_parent_obj));
46 $this->setRowTemplate("tpl.show_role_assignment_row.html", "components/ILIAS/AuthShibboleth");
47 $this->setDefaultOrderField('type');
48 $this->setDefaultOrderDirection("desc");
49 }
50
54 #[\Override]
55 protected function fillRow(array $a_set): void
56 {
57 $this->tpl->setVariable('VAL_ID', $a_set['id']);
58 $this->tpl->setVariable('VAL_TYPE', $a_set['type']);
59 $this->tpl->setVariable('VAL_CONDITION', $a_set['condition']);
60 $this->tpl->setVariable('VAL_ROLE', $a_set['role']);
61 $this->tpl->setVariable('TXT_EDIT', $this->lng->txt('edit'));
62 if ($a_set['add']) {
63 $this->tpl->setVariable('STATA_SRC', ilUtil::getImagePath('standard/icon_ok.svg'));
64 $this->tpl->setVariable('STATA_ALT', $this->lng->txt('yes'));
65 } else {
66 $this->tpl->setVariable('STATA_SRC', ilUtil::getImagePath('standard/icon_not_ok.svg'));
67 $this->tpl->setVariable('STATA_ALT', $this->lng->txt('no'));
68 }
69 if ($a_set['remove']) {
70 $this->tpl->setVariable('STATB_SRC', ilUtil::getImagePath('standard/icon_ok.svg'));
71 $this->tpl->setVariable('STATB_ALT', $this->lng->txt('yes'));
72 } else {
73 $this->tpl->setVariable('STATB_SRC', ilUtil::getImagePath('standard/icon_not_ok.svg'));
74 $this->tpl->setVariable('STATB_ALT', $this->lng->txt('no'));
75 }
76 $this->ctrl->setParameter($this->getParentObject(), 'rule_id', $a_set['id']);
77 $this->tpl->setVariable('EDIT_LINK', $this->ctrl->getLinkTarget($this->getParentObject(), 'editRoleAssignment'));
78 }
79
80
81 public function parse(array $rule_objs): void
82 {
83 $records_arr = [];
84 foreach ($rule_objs as $rule) {
85 $tmp_arr['id'] = $rule->getRuleId();
86 $tmp_arr['type'] = $rule->isPluginActive() ? $this->lng->txt('shib_role_by_plugin') : $this->lng->txt('shib_role_by_attribute');
87 $tmp_arr['add'] = $rule->isAddOnUpdateEnabled();
88 $tmp_arr['remove'] = $rule->isRemoveOnUpdateEnabled();
89 $tmp_arr['condition'] = $rule->conditionToString();
90 $tmp_arr['role'] = ilObject::_lookupTitle($rule->getRoleId());
91 $records_arr[] = $tmp_arr;
92 }
93 $this->setData($records_arr);
94 }
95}
Class ilAuthShibbolethSettingsGUI.
static _lookupTitle(int $obj_id)
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
__construct(ilAuthShibbolethSettingsGUI $a_parent_obj, string $a_parent_cmd='')
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.
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