diff --git a/public/main/admin/user_list.php b/public/main/admin/user_list.php index 3bcbbfd0c4..5691d00650 100644 --- a/public/main/admin/user_list.php +++ b/public/main/admin/user_list.php @@ -536,9 +536,10 @@ function modify_filter($user_id, $url_params, $row) if (api_is_platform_admin()) { if (!$user_is_anonymous) { $result .= ''. - Display::return_icon('info2.png', get_lang('Information')).'  '; + Display::getMdiIcon('information', 'ch-tool-icon', null, 22, get_lang('Information')). + ''; } else { - $result .= Display::return_icon('info2_na.png', get_lang('Information')).'  '; + $result .= Display::getMdiIcon('information', 'ch-tool-icon-disabled', null, 22, get_lang('Information')); } } @@ -557,26 +558,34 @@ function modify_filter($user_id, $url_params, $row) if (!$user_is_anonymous) { if (api_global_admin_can_edit_admin($user_id, null, $sessionAdminCanLoginAs)) { $result .= ''. - Display::return_icon('login_as.png', get_lang('Login as')).' '; + Display::getMdiIcon('account-key', 'ch-tool-icon', null, 22, get_lang('Login as')).''; } else { - $result .= Display::return_icon('login_as_na.png', get_lang('Login as')).' '; + $result .= Display::getMdiIcon('account-key', 'ch-tool-icon-disabled', null, 22, get_lang('Login as')); } } else { - $result .= Display::return_icon('login_as_na.png', get_lang('Login as')).' '; + $result .= Display::getMdiIcon('account-key', 'ch-tool-icon-disabled', null, 22, get_lang('Login as')); } } else { - $result .= Display::return_icon('login_as_na.png', get_lang('Login as')).' '; + $result .= Display::getMdiIcon('account-key', 'ch-tool-icon-disabled', null, 22, get_lang('Login as')); } if ($current_user_status_label != $statusname[STUDENT]) { - $result .= Display::return_icon( - 'statistics_na.png', + $result .= Display::getMdiIcon( + 'chart-box', + 'ch-tool-icon-disabled', + null, + 22, get_lang('Reporting') - ).' '; + ); } else { $result .= ''. - Display::return_icon('statistics.png', get_lang('Reporting')). - ' '; + Display::getMdiIcon( + 'chart-box', + 'ch-tool-icon', + null, + 22, + get_lang('Reporting') + ).''; } if (api_is_platform_admin(true)) { @@ -585,20 +594,22 @@ function modify_filter($user_id, $url_params, $row) api_global_admin_can_edit_admin($user_id, null, true) ) { $result .= ''. - Display::return_icon( - 'edit.png', - get_lang('Edit'), - [], - ICON_SIZE_SMALL + Display::getMdiIcon( + 'pencil', + 'ch-tool-icon', + null, + 22, + get_lang('Edit') ). - ' '; + ''; } else { - $result .= Display::return_icon( - 'edit_na.png', - get_lang('Edit'), - [], - ICON_SIZE_SMALL - ).' '; + $result .= Display::getMdiIcon( + 'pencil', + 'ch-tool-icon-disabled', + null, + 22, + get_lang('Edit') + ).''; } } @@ -606,36 +617,122 @@ function modify_filter($user_id, $url_params, $row) if ($allowAssignSkill) { $result .= Display::url( - Display::return_icon( - 'skill-badges.png', - get_lang('Assign skill'), + Display::getMdiIcon( + 'shield-star', + 'ch-tool-icon', null, - ICON_SIZE_SMALL + 22, + get_lang('Assign skill') ), api_get_path(WEB_CODE_PATH).'badge/assign.php?'.http_build_query(['user' => $user_id]) ); } if ($is_admin) { - $result .= Display::return_icon( - 'admin_star.png', - get_lang('Is administrator'), - ['width' => ICON_SIZE_SMALL, 'heigth' => ICON_SIZE_SMALL] + $result .= Display::getMdiIcon( + 'star', + 'ch-tool-icon', + null, + 22, + get_lang('Is administrator') ); } else { - $result .= Display::return_icon( - 'admin_star_na.png', + $result .= Display::getMdiIcon( + 'star', + 'ch-tool-icon-disabled', + null, + 22, get_lang('Is not administrator') ); } + if (api_is_platform_admin()) { + /* Temporarily disabled until improved + $result .= ' '. + Display::getMdiIcon( + 'calendar-text', + 'ch-tool-icon', + null, + 22, + get_lang('Free/Busy calendar') + ). + ''; + */ + if ($user_id != $currentUserId && + !$user_is_anonymous && + api_global_admin_can_edit_admin($user_id) + ) { + $result .= ' '. + Display::getMdiIcon( + 'incognito', + 'ch-tool-icon', + null, + 22, + get_lang('Anonymize') + ). + ''; + } + + $deleteAllowed = !api_get_configuration_value('deny_delete_users'); + if ($deleteAllowed) { + if ($user_id != $currentUserId && + !$user_is_anonymous && + api_global_admin_can_edit_admin($user_id) + ) { + // you cannot lock yourself out otherwise you could disable all the accounts + // including your own => everybody is locked out and nobody can change it anymore. + $result .= ' '. + Display::getMdiIcon( + 'delete', + 'ch-tool-icon', + null, + 22, + get_lang('Delete') + ). + ''; + } else { + $result .= Display::getMdiIcon( + 'delete', + 'ch-tool-icon-disabled', + null, + 22, + get_lang('Delete') + ); + } + } + } + + $allowDelete = api_get_configuration_value('allow_delete_user_for_session_admin'); + + if (api_is_session_admin() && $allowDelete) { + if ($user_id != $currentUserId && + !$user_is_anonymous && + api_global_admin_can_edit_admin($user_id, null, true) + ) { + // you cannot lock yourself out otherwise you could disable all the accounts including your own => everybody is locked out and nobody can change it anymore. + $result .= ' '. + Display::getMdiIcon( + 'delete', + 'ch-tool-icon', + null, + 22, + get_lang('Delete') + ). + ''; + } + } + + // actions for assigning sessions, courses or users if (!api_is_session_admin()) { if ($current_user_status_label == $statusname[SESSIONADMIN]) { $result .= Display::url( - Display::return_icon( - 'view_more_stats.gif', - get_lang('AssignCourse sessions') + Display::getMdiIcon( + 'google-classroom', + 'ch-tool-icon', + null, + 22, + get_lang('Assign sessions') ), "dashboard_add_sessions_to_user.php?user={$user_id}" ); @@ -645,11 +742,12 @@ function modify_filter($user_id, $url_params, $row) $current_user_status_label == $statusname[STUDENT_BOSS] ) { $result .= Display::url( - Display::return_icon( - 'user_subscribe_course.png', - get_lang('Assign users'), - '', - ICON_SIZE_SMALL + Display::getMdiIcon( + 'account-child', + 'ch-tool-icon', + null, + 22, + get_lang('Assign users') ), "dashboard_add_users_to_user.php?user={$user_id}" ); @@ -657,17 +755,23 @@ function modify_filter($user_id, $url_params, $row) if ($current_user_status_label == $statusname[DRH] || UserManager::is_admin($user_id)) { $result .= Display::url( - Display::return_icon( - 'add.png', + Display::getMdiIcon( + 'book-open-page-variant', + 'ch-tool-icon', + null, + 22, get_lang('Assign courses') ), "dashboard_add_courses_to_user.php?user={$user_id}" ); $result .= Display::url( - Display::return_icon( - 'view_more_stats.gif', - get_lang('AssignCourse sessions') + Display::getMdiIcon( + 'google-classroom', + 'ch-tool-icon', + null, + 22, + get_lang('Assign sessions') ), "dashboard_add_sessions_to_user.php?user={$user_id}" ); @@ -675,75 +779,6 @@ function modify_filter($user_id, $url_params, $row) } } - $allowDelete = api_get_configuration_value('allow_delete_user_for_session_admin'); - - if (api_is_session_admin() && $allowDelete) { - if ($user_id != $currentUserId && - !$user_is_anonymous && - api_global_admin_can_edit_admin($user_id, null, true) - ) { - // you cannot lock yourself out otherwise you could disable all the accounts including your own => everybody is locked out and nobody can change it anymore. - $result .= ' '. - Display::return_icon( - 'delete.png', - get_lang('Delete'), - [], - ICON_SIZE_SMALL - ). - ''; - } - } - if (api_is_platform_admin()) { - $result .= ' '. - Display::return_icon( - 'calendar.png', - get_lang('Free/Busy calendar'), - [], - ICON_SIZE_SMALL - ). - ''; - - if ($user_id != $currentUserId && - !$user_is_anonymous && - api_global_admin_can_edit_admin($user_id) - ) { - $result .= ' '. - Display::return_icon( - 'anonymous.png', - get_lang('Anonymize'), - [], - ICON_SIZE_SMALL - ). - ''; - } - - $deleteAllowed = !api_get_configuration_value('deny_delete_users'); - if ($deleteAllowed) { - if ($user_id != $currentUserId && - !$user_is_anonymous && - api_global_admin_can_edit_admin($user_id) - ) { - // you cannot lock yourself out otherwise you could disable all the accounts - // including your own => everybody is locked out and nobody can change it anymore. - $result .= ' '. - Display::return_icon( - 'delete.png', - get_lang('Delete'), - [], - ICON_SIZE_SMALL - ). - ''; - } else { - $result .= Display::return_icon( - 'delete_na.png', - get_lang('Delete'), - [], - ICON_SIZE_SMALL - ); - } - } - } - return $result; } @@ -959,7 +994,7 @@ $actionsCenter = ''; $actionsRight = ''; if (api_is_platform_admin()) { $actionsLeft .= ''. - Display::return_icon('new_user.png', get_lang('Add a user'), '', ICON_SIZE_MEDIUM).''; + Display::getMdiIcon('account-plus', 'ch-tool-icon-gradient', null, 32, get_lang('Add a user')).''; } $actionsRight .= $form->returnForm();