19 declare(strict_types=1);
38 private bool $role_assignment_editable =
true,
39 private bool $is_administration_context =
false 41 $this->
setId(
'rbac_ua_' . $role_id);
46 $this->
addColumn($this->
lng->txt(
'login'),
'login',
'29%');
47 $this->
addColumn($this->
lng->txt(
'firstname'),
'firstname',
'29%');
48 $this->
addColumn($this->
lng->txt(
'lastname'),
'lastname',
'29%');
55 $this->
setRowTemplate(
'tpl.user_assignment_row.html',
'components/ILIAS/AccessControl');
63 if ($this->role_assignment_editable) {
68 $this->
lng->loadLanguageModule(
'user');
71 $this->
lng->txt(
'clipboard_add_btn')
81 return $this->role_id;
89 return $this->role_assignment_editable;
112 $this->
setData((array) $usr_data[
'set']);
118 protected function fillRow(array $user_row): void
120 $this->tpl->setVariable(
'VAL_FIRSTNAME', $user_row[
'firstname']);
121 $this->tpl->setVariable(
'VAL_LASTNAME', $user_row[
'lastname']);
126 $this->tpl->setVariable(
'ID', $user_row[
'usr_id']);
129 $actions = $this->
getActions($user_row[
'login'], $user_row[
'usr_id']);
131 $login_entry = $user_row[
'login'];
133 if ($this->is_administration_context) {
134 $login_entry = $this->ui_renderer->render(
135 $this->
getChangeLink($user_row[
'usr_id'], $user_row[
'login'])
139 $this->tpl->setVariable(
'VAL_LOGIN', $login_entry);
141 $actions_dropdown = $this->ui_factory->dropdown()->standard($actions)
142 ->withLabel($this->
lng->txt(
'actions'));
144 $this->tpl->setVariable(
146 $this->ui_renderer->render($actions_dropdown)
154 private function getActions(
string $login,
int $usr_id): array
160 if ($this->is_administration_context) {
178 [
'fr' => rawurlencode(base64_encode($this->
ctrl->getLinkTarget(
179 $this->getParentObject(),
186 [
'type' =>
'new',
'rcp_to' => $login]
189 return $this->ui_factory->link()->standard(
190 $this->
lng->txt(
'message'),
197 $this->
ctrl->setParameterByClass(
'ilobjusergui',
'ref_id', 7);
198 $this->
ctrl->setParameterByClass(
'ilobjusergui',
'obj_id', $usr_id);
199 $change_link = $this->
ctrl->getLinkTargetByClass([
'iladministrationgui',
'ilobjusergui'],
'view');
200 return $this->ui_factory->link()->standard(
211 return $this->ui_factory->link()->standard(
212 $this->
lng->txt(
'remove'),
getLeaveLink(int $usr_id)
fillRow(array $user_row)
Fill table row.
setFormAction(string $a_form_action, bool $a_multipart=false)
setEnableTitle(bool $a_enabletitle)
static stripSlashes(string $a_str, bool $a_strip_html=true, string $a_allow="")
setSelectAllCheckbox(string $a_select_all_checkbox, bool $a_select_all_on_top=false)
const SYSTEM_USER_ID
This file contains constants for PHPStan analyis, see: https://phpstan.org/config-reference#constants...
getChangeLink(int $usr_id, string $label)
getItems()
Get user items.
getRoleId()
get current role id
__construct(object $parent_obj, string $parent_cmd, private UIFactory $ui_factory, private Renderer $ui_renderer, private int $role_id, private bool $role_assignment_editable=true, private bool $is_administration_context=false)
static getUserListData(string $a_order_field, string $a_order_dir, int $a_offset, int $a_limit, string $a_string_filter="", string $a_activation_filter="", ?ilDateTime $a_last_login_filter=null, bool $a_limited_access_filter=false, bool $a_no_courses_filter=false, int $a_course_group_filter=0, int $a_role_filter=0, ?array $a_user_folder_filter=null, ?array $a_additional_fields=null, ?array $a_user_filter=null, string $a_first_letter="", string $a_authentication_filter="")
Get data for user administration list.
while($session_entry=$r->fetchRow(ilDBConstants::FETCHMODE_ASSOC)) return null
getActions(string $login, int $usr_id)
setExternalSorting(bool $a_val)
setShowRowsSelector(bool $a_value)
Toggle rows-per-page selector.
setDefaultOrderField(string $a_defaultorderfield)
isRoleAssignmentEditable()
Check if role assignment is editable.
setRowTemplate(string $a_template, string $a_template_dir="")
Set row template.
setDefaultOrderDirection(string $a_defaultorderdirection)
__construct(Container $dic, ilPlugin $plugin)
TableGUI class for role administration.
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)
getContactLink(string $login)
addMultiCommand(string $a_cmd, string $a_text)
determineOffsetAndOrder(bool $a_omit_offset=false)
setEnableHeader(bool $a_enableheader)
setMaxCount(int $a_max_count)
set max.
setExternalSegmentation(bool $a_val)