From 515bf0870e9b420ee2dd51bc9bf99129f4efd8cb Mon Sep 17 00:00:00 2001 From: Yannick Warnier Date: Sun, 31 Dec 2023 01:00:37 +0100 Subject: [PATCH] Display: Use new icons in administration section --- public/main/admin/course_list_admin.php | 45 ++------ public/main/admin/course_request_accepted.php | 21 ++-- public/main/admin/course_request_edit.php | 34 +++++- public/main/admin/course_request_rejected.php | 64 ++++++----- public/main/admin/course_request_review.php | 70 +++++++++--- .../admin/dashboard_add_courses_to_user.php | 5 +- .../admin/dashboard_add_sessions_to_user.php | 6 +- .../admin/dashboard_add_users_to_user.php | 6 +- public/main/admin/extra_field_options.php | 4 +- public/main/admin/extra_fields.php | 4 +- public/main/admin/filler.php | 7 +- public/main/admin/grade_models.php | 8 +- public/main/admin/gradebook_dependency.php | 2 +- public/main/admin/gradebook_list.php | 6 +- public/main/admin/index.php | 83 ++++++++------- public/main/admin/languages.php | 25 ++--- public/main/admin/ldap_import_students.php | 8 +- .../admin/ldap_import_students_to_session.php | 17 +-- public/main/admin/legal_add.php | 2 +- public/main/admin/legal_list.php | 5 +- public/main/admin/promotions.php | 18 ++-- public/main/admin/questions.php | 4 +- public/main/admin/settings.lib.php | 42 ++++---- public/main/admin/settings.php | 5 + public/main/admin/specific_fields.php | 6 +- public/main/admin/statistics/index.php | 4 +- public/main/admin/subscribe_user2course.php | 4 +- public/main/admin/system_announcements.php | 22 ++-- public/main/admin/teacher_time_report.php | 22 +--- .../admin/teachers_time_by_session_report.php | 4 +- public/main/admin/user_edit.php | 14 +-- public/main/admin/user_information.php | 100 ++++++++++-------- public/main/admin/user_linking_requests.php | 6 +- public/main/admin/user_list.php | 32 +++--- public/main/admin/user_list_consent.php | 77 ++++++-------- public/main/admin/user_move_stats.php | 2 +- public/main/admin/usergroup_users.php | 11 +- public/main/admin/usergroups.php | 24 +++-- 38 files changed, 418 insertions(+), 401 deletions(-) diff --git a/public/main/admin/course_list_admin.php b/public/main/admin/course_list_admin.php index bada61bd94..c2d6cc142d 100644 --- a/public/main/admin/course_list_admin.php +++ b/public/main/admin/course_list_admin.php @@ -8,6 +8,7 @@ */ use Chamilo\CoreBundle\Component\Utils\ActionIcon; +use Chamilo\CoreBundle\Component\Utils\StateIcon; $cidReset = true; require_once __DIR__.'/../inc/global.inc.php'; @@ -246,39 +247,19 @@ function get_course_visibility_icon($visibility) $style = 'margin-bottom:0;margin-right:5px;'; switch ($visibility) { case 0: - return Display::return_icon( - 'bullet_red.png', - get_lang('Closed - the course is only accessible to the teachers'), - ['style' => $style] - ); + return Display::getMdiIcon(StateIcon::CLOSED_VISIBILITY, 'ch-tool-icon', $style, ICON_SIZE_SMALL, get_lang('Closed - the course is only accessible to the teachers')); break; case 1: - return Display::return_icon( - 'bullet_orange.png', - get_lang('Private access (access authorized to group members only)'), - ['style' => $style] - ); + return Display::getMdiIcon(StateIcon::PRIVATE_VISIBILITY, 'ch-tool-icon', $style, ICON_SIZE_SMALL, get_lang('Private access (access authorized to group members only)')); break; case 2: - return Display::return_icon( - 'bullet_green.png', - get_lang('Open - access allowed for users registered on the platform'), - ['style' => $style] - ); + return Display::getMdiIcon(StateIcon::OPEN_VISIBILITY, 'ch-tool-icon', $style, ICON_SIZE_SMALL, get_lang('Open - access allowed for users registered on the platform')); break; case 3: - return Display::return_icon( - 'bullet_blue.png', - get_lang('Public - access allowed for the whole world'), - ['style' => $style] - ); + return Display::getMdiIcon(StateIcon::PUBLIC_VISIBILITY, 'ch-tool-icon', $style, ICON_SIZE_SMALL, get_lang('Public - access allowed for the whole world')); break; case 4: - return Display::return_icon( - 'bullet_grey.png', - get_lang('Hidden - Completely hidden to all users except the administrators'), - ['style' => $style] - ); + return Display::getMdiIcon(StateIcon::HIDDEN_VISIBILITY, 'ch-tool-icon', $style, ICON_SIZE_SMALL, get_lang('Hidden - Completely hidden to all users except the administrators')); break; default: return ''; @@ -415,23 +396,13 @@ if (isset($_GET['search']) && 'advanced' === $_GET['search']) { $courseListUrl = api_get_self(); $actions1 = Display::url( - Display::return_icon( - 'new_course.png', - get_lang('AddCourse'), - [], - ICON_SIZE_MEDIUM - ), + Display::getMdiIcon(ActionIcon::ADD, 'ch-tool-icon', null, ICON_SIZE_MEDIUM, get_lang('AddCourse')), api_get_path(WEB_CODE_PATH).'admin/course_add.php' ); if ('true' === api_get_setting('course_validation')) { $actions1 .= Display::url( - Display::return_icon( - 'course_request_pending.png', - get_lang('ReviewCourseRequests'), - [], - ICON_SIZE_MEDIUM - ), + Display::getMdiIcon('notebook-heart-outline', 'ch-tool-icon', null, ICON_SIZE_MEDIUM, get_lang('ReviewCourseRequests')), api_get_path(WEB_CODE_PATH).'admin/course_request_review.php' ); } diff --git a/public/main/admin/course_request_accepted.php b/public/main/admin/course_request_accepted.php index 614e00112b..d7f1b3bec4 100644 --- a/public/main/admin/course_request_accepted.php +++ b/public/main/admin/course_request_accepted.php @@ -132,15 +132,14 @@ function modify_filter($id) $code = CourseRequestManager::get_course_request_code($id); return ''. - Display::return_icon('edit.png', get_lang('Edit'), ['style' => 'vertical-align: middle;']).''. - ' '. - Display::return_icon( - 'delete.png', - get_lang('Delete this course request'), - [ - 'style' => 'vertical-align: middle;', - 'onclick' => 'javascript: if (!confirm(\''.addslashes(api_htmlentities(sprintf(get_lang('The course request %s is going to be deleted. Is it OK to proceed?'), $code), ENT_QUOTES)).'\')) return false;', - ] + Display::getMdiIcon(ActionIcon::EDIT, 'ch-tool-icon', 'vertical-align: middle;', ICON_SIZE_SMALL, get_lang('Edit')).''. + ' '. + Display::getMdiIcon( + ActionIcon::DELETE, + 'ch-tool-icon', + 'vertical-align: middle;', + ICON_SIZE_SMALL, + get_lang('Delete this course request') ). ''; } @@ -175,9 +174,9 @@ $form->addButtonSearch(get_lang('Search')); // The action bar. echo '
'; echo ' '. - Display::return_icon('course_request_pending.png', get_lang('Review incoming course requests')).get_lang('Review incoming course requests').''; + Display::getMdiIcon('notebook-heart-outline', 'ch-tool-icon', null, ICON_SIZE_SMALL, get_lang('Review incoming course requests')).get_lang('Review incoming course requests').''; echo ' '. - Display::return_icon('course_request_rejected.gif', get_lang('Rejected course requests')).get_lang('Rejected course requests').''; + Display::getMdiIcon('notebook-remove-outline', 'ch-tool-icon', null, ICON_SIZE_SMALL, get_lang('Rejected course requests')).get_lang('Rejected course requests').''; echo '
'; echo '
'; $form->display(); diff --git a/public/main/admin/course_request_edit.php b/public/main/admin/course_request_edit.php index c013884571..4a7c584bb5 100644 --- a/public/main/admin/course_request_edit.php +++ b/public/main/admin/course_request_edit.php @@ -8,7 +8,7 @@ * @author Ivan Tcholakov , 2010 */ -use Chamilo\CoreBundle\Component\Utils\ActionIcon; +use Chamilo\CoreBundle\Component\Utils\ToolIcon; $cidReset = true; require_once __DIR__.'/../inc/global.inc.php'; @@ -349,15 +349,39 @@ if (!$course_validation_feature) { // The action bar. echo ''; diff --git a/public/main/admin/course_request_rejected.php b/public/main/admin/course_request_rejected.php index 100337296f..162a45227c 100644 --- a/public/main/admin/course_request_rejected.php +++ b/public/main/admin/course_request_rejected.php @@ -12,6 +12,7 @@ */ use Chamilo\CoreBundle\Component\Utils\ActionIcon; +use Chamilo\CoreBundle\Component\Utils\StateIcon; $cidReset = true; @@ -160,37 +161,34 @@ function modify_filter($id) { $code = CourseRequestManager::get_course_request_code($id); $result = ''. - Display::return_icon('edit.png', get_lang('Edit'), ['style' => 'vertical-align: middle;']).''. - ' '. - Display::return_icon( - 'accept.png', - get_lang('Accept this course'), - [ - 'style' => 'vertical-align: middle;', - 'onclick' => 'javascript: if (!confirm(\''.addslashes(api_htmlentities(sprintf(get_lang('A new course %s is going to be created. Is it OK to proceed?'), $code), ENT_QUOTES)).'\')) return false;', - ] + Display::getMdiIcon(ActionIcon::EDIT, 'ch-tool-icon', 'vertical-align: middle;', ICON_SIZE_SMALL, get_lang('Edit')).''. + ' '. + Display::getMdiIcon( + ActionIcon::ACCEPT, + 'ch-tool-icon', + 'vertical-align: middle;', + ICON_SIZE_SMALL, + get_lang('Accept this course') ). ''; if (!CourseRequestManager::additional_info_asked($id)) { - $result .= ' '. - Display::return_icon( - 'request_info.gif', - get_lang('Ask for additional information'), - [ - 'style' => 'vertical-align: middle;', - 'onclick' => 'javascript: if (!confirm(\''.addslashes(api_htmlentities(sprintf(get_lang('Additional information about %s course request is going to be asked through an e-mail message. Is it OK to proceed?'), $code), ENT_QUOTES)).'\')) return false;', - ] + $result .= ' '. + Display::getMdiIcon( + ActionIcon::INFORMATION, + 'ch-tool-icon', + 'vertical-align: middle;', + ICON_SIZE_SMALL, + get_lang('Ask for additional information') ). ''; } - $result .= ' '. - Display::return_icon( - 'delete.png', - get_lang('Delete this course request'), - [ - 'style' => 'vertical-align: middle;', - 'onclick' => 'javascript: if (!confirm(\''.addslashes(api_htmlentities(sprintf(get_lang('The course request %s is going to be deleted. Is it OK to proceed?'), $code), ENT_QUOTES)).'\')) return false;', - ] + $result .= ' '. + Display::getMdiIcon( + ActionIcon::DELETE, + 'ch-tool-icon', + 'vertical-align: middle;', + ICON_SIZE_SMALL, + get_lang('Delete this course request') ). ''; @@ -228,10 +226,22 @@ $form->addButtonSearch(get_lang('Search')); // The action bar. echo '
'; echo ' '. - Display::return_icon('course_request_pending.png', get_lang('Review incoming course requests')).get_lang('Review incoming course requests'). + Display::getMdiIcon( + 'notebook-heart-outline', + 'ch-tool-icon', + null, + ICON_SIZE_SMALL, + get_lang('Review incoming course requests') + ).get_lang('Review incoming course requests'). ''; echo ' '. - Display::return_icon('course_request_accepted.gif', get_lang('Accepted course requests')).get_lang('Accepted course requests'). + Display::getMdiIcon( + StateIcon::COMPLETE, + 'ch-tool-icon', + null, + ICON_SIZE_SMALL, + get_lang('Accepted course requests') + ).get_lang('Accepted course requests'). ''; echo '
'; echo '
'; diff --git a/public/main/admin/course_request_review.php b/public/main/admin/course_request_review.php index a740fb20de..97689186ff 100644 --- a/public/main/admin/course_request_review.php +++ b/public/main/admin/course_request_review.php @@ -11,6 +11,7 @@ */ use Chamilo\CoreBundle\Component\Utils\ActionIcon; +use Chamilo\CoreBundle\Component\Utils\StateIcon; $cidReset = true; require_once __DIR__.'/../inc/global.inc.php'; @@ -200,25 +201,48 @@ function modify_filter($id) { $code = CourseRequestManager::get_course_request_code($id); $result = ''. - Display::return_icon('edit.png', get_lang('Edit'), ['style' => 'vertical-align: middle;']).''. - ' '. - Display::return_icon('accept.png', get_lang('Accept this course'), ['style' => 'vertical-align: middle;', 'onclick' => 'javascript: if (!confirm(\''.addslashes(api_htmlentities(sprintf(get_lang('A new course %s is going to be created. Is it OK to proceed?'), $code), ENT_QUOTES)).'\')) return false;'], 16).''. - ' '. - Display::return_icon('error.png', get_lang('Reject this course request'), ['style' => 'vertical-align: middle;', 'onclick' => 'javascript: if (!confirm(\''.addslashes(api_htmlentities(sprintf(get_lang('The course request %s is going to be rejected. Is it OK to proceed?'), $code), ENT_QUOTES)).'\')) return false;'], 16).''; + Display::getMdiIcon( + ActionIcon::EDIT, + 'ch-tool-icon', + 'vertical-align: middle;', + ICON_SIZE_SMALL, + get_lang('Edit') + ).''. + ' '. + Display::getMdiIcon( + StateIcon::COMPLETE, + 'ch-tool-icon', + 'vertical-align: middle;', + ICON_SIZE_TINY, + get_lang('Accept this course') + ).''. + ' '. + Display::getMdiIcon( + 'trash-can-outline', + 'ch-tool-icon', + 'vertical-align: middle;', + ICON_SIZE_TINY, + get_lang('Reject this course request') + ).''; if (!CourseRequestManager::additional_info_asked($id)) { - $result .= ' '. - Display::return_icon('request_info.gif', get_lang('Ask for additional information'), ['style' => 'vertical-align: middle;', 'onclick' => 'javascript: if (!confirm(\''.addslashes(api_htmlentities(sprintf(get_lang('Additional information about %s course request is going to be asked through an e-mail message. Is it OK to proceed?'), $code), ENT_QUOTES)).'\')) return false;']).''; + $result .= ' '. + Display::getMdiIcon( + ActionIcon::INFORMATION, + 'ch-tool-icon', + 'vertical-align: middle;', + ICON_SIZE_SMALL, + get_lang('Ask for additional information'), + ).''; } if (DELETE_ACTION_ENABLED) { $message = addslashes(api_htmlentities(sprintf(get_lang('The course request %s is going to be deleted. Is it OK to proceed?'), $code), ENT_QUOTES)); - $result .= ' '; - $result .= Display::return_icon( - 'delete.png', - get_lang('Delete this course request'), - [ - 'style' => 'vertical-align: middle;', - 'onclick' => 'javascript: if (!confirm(\''.$message.'\')) return false;', - ] + $result .= ' '; + $result .= Display::getMdiIcon( + ActionIcon::DELETE, + 'ch-tool-icon', + 'vertical-align: middle;', + ICON_SIZE_SMALL, + get_lang('Delete this course request') ); $result .= ''; } @@ -257,11 +281,23 @@ $form->addButtonSearch(get_lang('Search')); // The action bar. echo '
'; echo ' '; -echo Display::return_icon('course_request_accepted.gif', get_lang('Accepted course requests')). +echo Display::getMdiIcon( + StateIcon::COMPLETE, + 'ch-tool-icon', + null, + ICON_SIZE_SMALL, + get_lang('Accepted course requests') + ). get_lang('Accepted course requests'); echo ''; echo ' '; -echo Display::return_icon('course_request_rejected.gif', get_lang('Rejected course requests')). +echo Display::getMdiIcon( + StateIcon::INCOMPLETE, + 'ch-tool-icon', + null, + ICON_SIZE_SMALL, + get_lang('Rejected course requests') + ). get_lang('Rejected course requests'); echo ''; echo '
'; diff --git a/public/main/admin/dashboard_add_courses_to_user.php b/public/main/admin/dashboard_add_courses_to_user.php index 5a1776898e..68db355852 100644 --- a/public/main/admin/dashboard_add_courses_to_user.php +++ b/public/main/admin/dashboard_add_courses_to_user.php @@ -6,6 +6,7 @@ */ use Chamilo\CoreBundle\Component\Utils\ActionIcon; +use Chamilo\CoreBundle\Component\Utils\ObjectIcon; // resetting the course id $cidReset = true; @@ -174,9 +175,9 @@ Display::display_header($tool_name); // actions $actionsLeft = ''. - Display::return_icon('add-user.png', get_lang('Assign users'), null, ICON_SIZE_MEDIUM).''; + Display::getMdiIcon(ObjectIcon::USER, 'ch-tool-icon', null, ICON_SIZE_MEDIUM, get_lang('Assign users')).''; $actionsLeft .= ''. - Display::return_icon('session-add.png', get_lang('Assign sessions'), null, ICON_SIZE_MEDIUM).''; + Display::getMdiIcon(ObjectIcon::SESSION, 'ch-tool-icon', null, ICON_SIZE_MEDIUM, get_lang('Assign sessions')).''; echo $html = Display::toolbarAction('toolbar-dashboard', [$actionsLeft]); diff --git a/public/main/admin/dashboard_add_sessions_to_user.php b/public/main/admin/dashboard_add_sessions_to_user.php index ac84a4c2ce..8d9fde3f1d 100644 --- a/public/main/admin/dashboard_add_sessions_to_user.php +++ b/public/main/admin/dashboard_add_sessions_to_user.php @@ -5,7 +5,7 @@ * Interface for assigning sessions to Human Resources Manager. */ -use Chamilo\CoreBundle\Component\Utils\ActionIcon; +use Chamilo\CoreBundle\Component\Utils\ObjectIcon; // resetting the course id $cidReset = true; @@ -178,9 +178,9 @@ Display::display_header($tool_name); // Actions if (!$isSessionAdmin) { $actionsLeft = ''. - Display::return_icon('add-user.png', get_lang('Assign users'), null, ICON_SIZE_MEDIUM).''; + Display::getMdiIcon(ObjectIcon::USER, 'ch-tool-icon', null, ICON_SIZE_MEDIUM, get_lang('Assign users')).''; $actionsLeft .= ''. - Display::return_icon('course-add.png', get_lang('Assign courses'), null, ICON_SIZE_MEDIUM).''; + Display::getMdiIcon(ObjectIcon::COURSE, 'ch-tool-icon', null, ICON_SIZE_MEDIUM, get_lang('Assign courses')).''; echo Display::toolbarAction('toolbar-dashboard', [$actionsLeft]); } diff --git a/public/main/admin/dashboard_add_users_to_user.php b/public/main/admin/dashboard_add_users_to_user.php index a9284b561f..3218f4182e 100644 --- a/public/main/admin/dashboard_add_users_to_user.php +++ b/public/main/admin/dashboard_add_users_to_user.php @@ -5,7 +5,7 @@ * Interface for assigning users to Human Resources Manager. */ -use Chamilo\CoreBundle\Component\Utils\ActionIcon; +use Chamilo\CoreBundle\Component\Utils\ObjectIcon; // resetting the course id $cidReset = true; @@ -320,12 +320,12 @@ Display::display_header($tool_name); $actionsLeft = ''; if (STUDENT_BOSS != $userStatus) { $actionsLeft = Display::url( - Display::return_icon('course-add.png', get_lang('Assign courses'), null, ICON_SIZE_MEDIUM), + Display::getMdiIcon(ObjectIcon::COURSE, 'ch-tool-icon', null, ICON_SIZE_MEDIUM, get_lang('Assign courses')), "dashboard_add_courses_to_user.php?user=$user_id" ); $actionsLeft .= Display::url( - Display::return_icon('session-add.png', get_lang('Assign sessions'), null, ICON_SIZE_MEDIUM), + Display::getMdiIcon(ObjectIcon::SESSION, 'ch-tool-icon', null, ICON_SIZE_MEDIUM, get_lang('Assign sessions')), "dashboard_add_sessions_to_user.php?user=$user_id" ); } diff --git a/public/main/admin/extra_field_options.php b/public/main/admin/extra_field_options.php index 4a12c719f9..e7180b952a 100644 --- a/public/main/admin/extra_field_options.php +++ b/public/main/admin/extra_field_options.php @@ -118,8 +118,8 @@ $extra_params['height'] = 'auto'; //With this function we can add actions to the jgrid (edit, delete, etc) $action_links = 'function action_formatter(cellvalue, options, rowObject) { - return \''.Display::return_icon('edit.png', get_lang('Edit'), '', ICON_SIZE_SMALL).''. - ' '.Display::return_icon('delete.png', get_lang('Delete'), '', ICON_SIZE_SMALL).''. + return \''.Display::getMdiIcon(ActionIcon::EDIT, 'ch-tool-icon', null, ICON_SIZE_SMALL, get_lang('Edit')).''. + ' '.Display::getMdiIcon(ActionIcon::DELETE, 'ch-tool-icon', null, ICON_SIZE_SMALL, get_lang('Delete')).''. '\'; }'; diff --git a/public/main/admin/extra_fields.php b/public/main/admin/extra_fields.php index 6361f89d45..8847129767 100644 --- a/public/main/admin/extra_fields.php +++ b/public/main/admin/extra_fields.php @@ -126,7 +126,7 @@ switch ($action) { $obj->display(); } else { $actions = ''. - Display::return_icon('back.png', get_lang('Back'), '', ICON_SIZE_MEDIUM).''; + Display::getMdiIcon(ActionIcon::BACK, 'ch-tool-icon', null, ICON_SIZE_MEDIUM, get_lang('Back')).''; echo Display::toolbarAction('toolbar', [$actions]); $form->addElement('hidden', 'sec_token'); $form->setConstants(['sec_token' => $token]); @@ -150,7 +150,7 @@ switch ($action) { $obj->display(); } else { $actions = ''. - Display::return_icon('back.png', get_lang('Back'), '', ICON_SIZE_MEDIUM).''; + Display::getMdiIcon(ActionIcon::BACK, 'ch-tool-icon', null, ICON_SIZE_MEDIUM, get_lang('Back')).''; echo Display::toolbarAction('toolbar', [$actions]); $form->addElement('hidden', 'sec_token'); $form->setConstants(['sec_token' => $token]); diff --git a/public/main/admin/filler.php b/public/main/admin/filler.php index 45b77a14e7..082cbd2488 100644 --- a/public/main/admin/filler.php +++ b/public/main/admin/filler.php @@ -6,6 +6,7 @@ */ use Chamilo\CoreBundle\Component\Utils\ActionIcon; +use Chamilo\CoreBundle\Component\Utils\ObjectIcon; // resetting the course id $cidReset = true; @@ -65,7 +66,7 @@ if (count($output) > 0) {

@@ -73,14 +74,14 @@ if (count($output) > 0) {
  • diff --git a/public/main/admin/grade_models.php b/public/main/admin/grade_models.php index d141ea78df..1618fada1d 100644 --- a/public/main/admin/grade_models.php +++ b/public/main/admin/grade_models.php @@ -108,8 +108,8 @@ $extra_params['height'] = 'auto'; //With this function we can add actions to the jgrid (edit, delete, etc) $action_links = 'function action_formatter(cellvalue, options, rowObject) { - return \''.Display::return_icon('edit.png', get_lang('Edit'), '', ICON_SIZE_SMALL).''. - ' '.Display::return_icon('delete.png', get_lang('Delete'), '', ICON_SIZE_SMALL).''. + return \''.Display::getMdiIcon(ActionIcon::EDIT, 'ch-tool-icon', null, ICON_SIZE_SMALL, get_lang('Edit')).''. + ' '.Display::getMdiIcon(ActionIcon::DELETE, 'ch-tool-icon', null, ICON_SIZE_SMALL, get_lang('Delete')).''. '\'; }'; ?> @@ -155,7 +155,7 @@ switch ($action) { } else { echo ''; $form->addElement('hidden', 'sec_token'); @@ -179,7 +179,7 @@ switch ($action) { } else { echo ''; $form->addElement('hidden', 'sec_token'); diff --git a/public/main/admin/gradebook_dependency.php b/public/main/admin/gradebook_dependency.php index 1adf0b0742..22a6007050 100644 --- a/public/main/admin/gradebook_dependency.php +++ b/public/main/admin/gradebook_dependency.php @@ -41,7 +41,7 @@ $interbreadcrumb[] = [ $tpl = new Template(get_lang('Course list')); $toolbar = Display::url( - Display::return_icon('back.png', get_lang('Add'), [], ICON_SIZE_MEDIUM), + Display::getMdiIcon(ActionIcon::BACK, 'ch-tool-icon', null, ICON_SIZE_MEDIUM, get_lang('Add')), api_get_path(WEB_CODE_PATH).'admin/gradebook_list.php' ); diff --git a/public/main/admin/gradebook_list.php b/public/main/admin/gradebook_list.php index 731c2102b1..7b305cf4ee 100644 --- a/public/main/admin/gradebook_list.php +++ b/public/main/admin/gradebook_list.php @@ -45,7 +45,7 @@ $table = Database::get_main_table(TABLE_MAIN_GRADEBOOK_CATEGORY); $contentForm = ''; $toolbar = Display::url( - Display::return_icon('add.png', get_lang('Add'), [], ICON_SIZE_MEDIUM), + Display::getMdiIcon(ActionIcon::ADD, 'ch-tool-icon', null, ICON_SIZE_MEDIUM, get_lang('Add')), $currentUrl.'&action=add' ); @@ -66,7 +66,7 @@ $tpl = new Template($toolName); switch ($action) { case 'add': $toolbar = Display::url( - Display::return_icon('back.png', get_lang('Back'), [], ICON_SIZE_MEDIUM), + Display::getMdiIcon(ActionIcon::BACK, 'ch-tool-icon', null, ICON_SIZE_MEDIUM, get_lang('Back')), $currentUrl ); $form = new FormValidator( @@ -167,7 +167,7 @@ switch ($action) { break; case 'edit': $toolbar = Display::url( - Display::return_icon('back.png', get_lang('Back'), [], ICON_SIZE_MEDIUM), + Display::getMdiIcon(ActionIcon::BACK, 'ch-tool-icon', null, ICON_SIZE_MEDIUM, get_lang('Back')), $currentUrl ); /** @var GradebookCategory $category */ diff --git a/public/main/admin/index.php b/public/main/admin/index.php index 8f08e7fbd3..3634f0c91a 100644 --- a/public/main/admin/index.php +++ b/public/main/admin/index.php @@ -7,6 +7,9 @@ */ use Chamilo\CoreBundle\Component\Utils\ActionIcon; +use Chamilo\CoreBundle\Component\Utils\ToolIcon; +use Chamilo\CoreBundle\Component\Utils\ObjectIcon; +use Chamilo\CoreBundle\Component\Utils\StateIcon; // Resetting the course id. $cidReset = true; @@ -50,12 +53,12 @@ $blocks = []; /* Users */ $blocks['users']['mdi_icon'] = 'account'; -$blocks['users']['icon'] = Display::return_icon( - 'members.png', - get_lang('User management'), - [], +$blocks['users']['icon'] = Display::getMdiIcon( + ObjectIcon::USER, + 'ch-tool-icon', + null, ICON_SIZE_MEDIUM, - false + get_lang('User management') ); $blocks['users']['description'] = get_lang('Here you can manage registered users within your platform'); $blocks['users']['label'] = get_lang('User management'); @@ -127,12 +130,12 @@ $blocks['users']['extra'] = null; if (api_is_platform_admin()) { /* Courses */ $blocks['courses']['mdi_icon'] = 'book-open-page-variant'; - $blocks['courses']['icon'] = Display::return_icon( - 'course.png', - get_lang('Course management'), - [], + $blocks['courses']['icon'] = Display::getMdiIcon( + ObjectIcon::COURSE, + 'ch-tool-icon', + null, ICON_SIZE_MEDIUM, - false + get_lang('Course management') ); $blocks['courses']['label'] = get_lang('Course management'); $blocks['courses']['description'] = get_lang('Create and manage your courses in a simple way'); @@ -187,12 +190,12 @@ if (api_is_platform_admin()) { /* Sessions */ $blocks['sessions']['mdi_icon'] = 'google-classroom'; - $blocks['sessions']['icon'] = Display::return_icon( - 'session.png', - get_lang('Sessions management'), - [], + $blocks['sessions']['icon'] = Display::getMdiIcon( + ObjectIcon::SESSION, + 'ch-tool-icon', + null, ICON_SIZE_MEDIUM, - false + get_lang('Sessions management') ); $blocks['sessions']['label'] = get_lang('Sessions management'); $blocks['sessions']['description'] = get_lang('Create course packages for a certain time with training sessions.'); @@ -261,12 +264,12 @@ if (api_is_platform_admin()) { // Skills if (SkillModel::isToolAvailable()) { $blocks['skills']['mdi_icon'] = 'certificate'; - $blocks['skills']['icon'] = Display::return_icon( - 'skill-badges.png', - get_lang('Skills'), - [], + $blocks['skills']['icon'] = Display::getMdiIcon( + ObjectIcon::BADGE, + 'ch-tool-icon', + null, ICON_SIZE_MEDIUM, - false + get_lang('Skills') ); $blocks['skills']['label'] = get_lang('Skills and gradebook'); $blocks['skills']['description'] = get_lang('Manage the skills of your users, through courses and badges'); @@ -400,12 +403,12 @@ if (api_is_platform_admin()) { /* Settings */ if (api_is_platform_admin()) { $blocks['settings']['mdi_icon'] = 'tools'; - $blocks['settings']['icon'] = Display::return_icon( - 'settings.png', - get_lang('System'), - [], + $blocks['settings']['icon'] = Display::getMdiIcon( + ToolIcon::SETTINGS, + 'ch-tool-icon', + null, ICON_SIZE_MEDIUM, - false + get_lang('System') ); $blocks['settings']['label'] = get_lang('System'); $blocks['settings']['description'] = get_lang('View the status of your server, perform performance tests'); @@ -480,12 +483,12 @@ if (api_is_platform_admin()) { if ($menuAdministratorItems) { $blocks['plugins']['mdi_icon'] = 'puzzle'; - $blocks['plugins']['icon'] = Display::return_icon( - 'plugins.png', - get_lang('Plugins'), - [], + $blocks['plugins']['icon'] = Display::getMdiIcon( + ToolIcon::PLUGIN, + 'ch-tool-icon', + null, ICON_SIZE_MEDIUM, - false + get_lang('Plugins') ); $blocks['plugins']['label'] = get_lang('Plugins'); $blocks['plugins']['class'] = 'block-admin-platform'; @@ -517,12 +520,12 @@ if (api_is_platform_admin()) { /* Chamilo.org */ $blocks['chamilo']['mdi_icon'] = 'cogs'; - $blocks['chamilo']['icon'] = Display::return_icon( - 'platform.png', - 'Chamilo.org', - [], + $blocks['chamilo']['icon'] = Display::getMdiIcon( + ActionIcon::INFORMATION, + 'ch-tool-icon', + null, ICON_SIZE_MEDIUM, - false + 'Chamilo.org' ); $blocks['chamilo']['label'] = 'Chamilo.org'; $blocks['chamilo']['description'] = get_lang('Learn more about Chamilo and its use, official references links'); @@ -549,12 +552,12 @@ if (api_is_platform_admin()) { // Version check $blocks['version_check']['mdi_icon'] = ''; - $blocks['version_check']['icon'] = Display::return_icon( - 'platform.png', - 'Chamilo.org', - [], + $blocks['version_check']['icon'] = Display::getMdiIcon( + StateIcon::COMPLETE, + 'ch-tool-icon', + null, ICON_SIZE_MEDIUM, - false + 'Chamilo.org' ); $blocks['version_check']['label'] = get_lang('Version Check'); $blocks['version_check']['extra'] = '
    '; diff --git a/public/main/admin/languages.php b/public/main/admin/languages.php index a808be8b1e..b7668d0a3b 100644 --- a/public/main/admin/languages.php +++ b/public/main/admin/languages.php @@ -13,6 +13,8 @@ */ use Chamilo\CoreBundle\Component\Utils\ActionIcon; +use Chamilo\CoreBundle\Component\Utils\ToolIcon; +use Chamilo\CoreBundle\Component\Utils\StateIcon; // we are in the admin area so we do not need a course id $cidReset = true; @@ -305,16 +307,11 @@ while ($row = Database::fetch_array($result_select)) { $row_td[] = $row['english_name'].' ('.$row['isocode'].')'; if ($row['isocode'] == $currentLanguage) { - $setplatformlanguage = Display::return_icon( - 'languages.png', - get_lang('Current portal\'s language'), - '', - ICON_SIZE_SMALL - ); + $setplatformlanguage = Display::getMdiIcon(ToolIcon::TRANSLATION, 'ch-tool-icon', null, ICON_SIZE_SMALL, get_lang('Current portal\'s language')); } else { $setplatformlanguage = "". - Display::return_icon('languages_na.png', get_lang('Set language as default'), null, ICON_SIZE_SMALL).""; + Display::getMdiIcon(ToolIcon::TRANSLATION, 'ch-tool-icon-disabled', null, ICON_SIZE_SMALL, get_lang('Set language as default')).""; } $allow_delete_sub_language = null; @@ -326,7 +323,7 @@ while ($row = Database::fetch_array($result_select)) { if (false === $verified_if_is_sub_language) { $verified_if_is_father = SubLanguageManager::check_if_language_is_father($row['id']); $allow_use_sub_language = " ". - Display::return_icon('new_language.png', get_lang('Create sub-language'), [], ICON_SIZE_SMALL).""; + Display::getMdiIcon(ToolIcon::TRANSLATION, 'ch-tool-icon', null, ICON_SIZE_SMALL, get_lang('Create sub-language')).""; if (true === $verified_if_is_father) { $allow_add_term_sub_language = ''; } else { @@ -335,23 +332,23 @@ while ($row = Database::fetch_array($result_select)) { } else { $allow_use_sub_language = ''; $all_information_of_sub_language = SubLanguageManager::get_all_information_of_language($row['id']); - $allow_add_term_sub_language = " ".Display::return_icon('2rightarrow.png', get_lang('Add terms to the sub-language'), ['width' => ICON_SIZE_SMALL, 'height' => ICON_SIZE_SMALL]).""; - $allow_delete_sub_language = " ".Display::return_icon('delete.png', get_lang('Delete sub-language'), ['width' => ICON_SIZE_SMALL, 'height' => ICON_SIZE_SMALL]).""; + $allow_add_term_sub_language = " ".Display::getMdiIcon(ActionIcon::VIEW_DETAILS, 'ch-tool-icon', null, ICON_SIZE_SMALL, get_lang('Add terms to the sub-language')).""; + $allow_delete_sub_language = " ".Display::getMdiIcon(ActionIcon::DELETE, 'ch-tool-icon', null, ICON_SIZE_SMALL, get_lang('Delete sub-language')).""; } } if ($row['isocode'] == $currentLanguage) { - $row_td[] = Display::return_icon('visible.png', get_lang('Visible')). + $row_td[] = Display::getMdiIcon(StateIcon::ACTIVE, 'ch-tool-icon', null, ICON_SIZE_SMALL, get_lang('Visible')). "". - Display::return_icon('edit.png', get_lang('Edit'), '', ICON_SIZE_SMALL)." + Display::getMdiIcon(ActionIcon::EDIT, 'ch-tool-icon', null, ICON_SIZE_SMALL, get_lang('Edit'))."  ".$setplatformlanguage.$allow_use_sub_language.$allow_add_term_sub_language.$allow_delete_sub_language; } else { if (1 == $row['available']) { $row_td[] = "". - Display::return_icon('visible.png', get_lang('Make unavailable'), ['id' => 'imglinktool_'.$row['id']], ICON_SIZE_SMALL)." ".Display::return_icon('edit.png', get_lang('Edit'), '', ICON_SIZE_SMALL)." ".$setplatformlanguage.$allow_use_sub_language.$allow_add_term_sub_language.$allow_delete_sub_language; + Display::getMdiIcon(StateIcon::ACTIVE, 'ch-tool-icon', null, ICON_SIZE_SMALL, get_lang('Make unavailable'), ['id' => 'imglinktool_'.$row['id']])." ".Display::getMdiIcon(ActionIcon::EDIT, 'ch-tool-icon', null, ICON_SIZE_SMALL, get_lang('Edit'))." ".$setplatformlanguage.$allow_use_sub_language.$allow_add_term_sub_language.$allow_delete_sub_language; } else { $row_td[] = "". - Display::return_icon('invisible.png', get_lang('Make available'), ['id' => 'imglinktool_'.$row['id']], ICON_SIZE_SMALL)." ".Display::return_icon('edit.png', get_lang('Edit'), '', ICON_SIZE_SMALL)." ".$setplatformlanguage.$allow_use_sub_language.$allow_add_term_sub_language.$allow_delete_sub_language; + Display::getMdiIcon(StateIcon::INACTIVE, 'ch-tool-icon', null, ICON_SIZE_SMALL, get_lang('Make available'), ['id' => 'imglinktool_'.$row['id']])." ".Display::getMdiIcon(ActionIcon::EDIT, 'ch-tool-icon', null, ICON_SIZE_SMALL, get_lang('Edit'))." ".$setplatformlanguage.$allow_use_sub_language.$allow_add_term_sub_language.$allow_delete_sub_language; } } $language_data[] = $row_td; diff --git a/public/main/admin/ldap_import_students.php b/public/main/admin/ldap_import_students.php index b84268ff76..af7095f2ba 100644 --- a/public/main/admin/ldap_import_students.php +++ b/public/main/admin/ldap_import_students.php @@ -5,7 +5,7 @@ * Script to import students from LDAP. */ -use Chamilo\CoreBundle\Component\Utils\ActionIcon; +use Chamilo\CoreBundle\Component\Utils\ObjectIcon; // resetting the course id $cidReset = true; @@ -54,7 +54,7 @@ $course = $_POST['course']; if (empty($annee) && empty($course)) { Display::display_header($tool_name); echo '
    '; - echo Display::return_icon('group.gif', get_lang('Select a filter to find a matching string at the end of the OU attribute')); + echo Display::getMdiIcon(ObjectIcon::GROUP, 'ch-tool-icon', null, ICON_SIZE_SMALL, get_lang('Select a filter to find a matching string at the end of the OU attribute')); echo get_lang('Select a filter to find a matching string at the end of the OU attribute'); //echo ''.get_lang('In order to do this, you must enter the year, the component and the component's step').'
    '; ///echo get_lang('Follow each of these steps, step by step').'
    '; @@ -68,7 +68,7 @@ if (empty($annee) && empty($course)) { } elseif (!empty($annee) && empty($course)) { Display::display_header($tool_name); echo '
    '; - echo Display::return_icon('course.png', get_lang('Select a course in which you would like to register the users you are going to select next')).' '.get_lang('Select a course in which you would like to register the users you are going to select next').'
    '; + echo Display::getMdiIcon(ObjectIcon::COURSE, 'ch-tool-icon', null, ICON_SIZE_SMALL, get_lang('Select a course in which you would like to register the users you are going to select next')).' '.get_lang('Select a course in which you would like to register the users you are going to select next').'
    '; echo '

    '; echo ' '; @@ -61,10 +61,13 @@ if (empty($annee) && empty($id_session)) { } elseif (!empty($annee) && empty($id_session)) { Display::display_header($tool_name); echo '
    '; - echo Display::return_icon( - 'course.png', - get_lang('Select the session in which you want to import these users') - ).' '.get_lang('Select the session in which you want to import these users').'
    '; + echo Display::getMdiIcon( + ObjectIcon::COURSE, + 'ch-tool-icon', + null, + ICON_SIZE_SMALL, + get_lang('Select the session in which you want to import these users') + ).' '.get_lang('Select the session in which you want to import these users').'
    '; echo '
    '; echo '