From fdf140ab1f2992ba4a9a82f8c41f025352047889 Mon Sep 17 00:00:00 2001 From: Yannick Warnier Date: Tue, 2 Jan 2024 17:05:19 +0100 Subject: [PATCH] Display: Use new icons in various tools --- public/main/announcements/announcements.php | 3 +- public/main/auth/profile.php | 5 +- .../main/course_copy/copy_course_session.php | 13 ++-- .../copy_course_session_selected.php | 24 ++++--- public/main/course_progress/index.php | 5 +- .../main/dashboard/dashboard_controller.php | 15 ++-- public/main/dropbox/index.php | 60 ++++++++-------- public/main/exercise/TestCategory.php | 5 +- public/main/exercise/category.php | 6 +- public/main/exercise/exercise.class.php | 39 ++++++----- public/main/exercise/exercise_history.php | 5 +- .../exercise/exercise_question_reminder.php | 5 +- public/main/exercise/exercise_reminder.php | 5 +- public/main/exercise/exercise_show.php | 3 +- public/main/exercise/exercise_submit.php | 5 +- .../main/exercise/exercise_submit_modal.php | 70 +++++++++++-------- .../export/aiken/aiken_import.inc.php | 9 +-- public/main/exercise/live_stats.php | 4 +- public/main/exercise/qti2.php | 4 +- public/main/exercise/question_create.php | 3 +- .../main/exercise/question_list_admin.inc.php | 29 ++------ public/main/exercise/question_pool.php | 20 +++--- public/main/exercise/result.php | 3 +- public/main/exercise/stats.php | 11 ++- public/main/exercise/tests_category.php | 10 +-- public/main/exercise/upload_exercise.php | 10 +-- public/main/glossary/index.php | 5 +- .../gradebook_display_certificate.php | 16 +++-- public/main/gradebook/gradebook_edit_all.php | 13 ++-- .../main/gradebook/gradebook_view_result.php | 13 ++-- .../main/gradebook/lib/be/category.class.php | 8 +-- .../main/gradebook/lib/fe/dataform.class.php | 4 +- .../gradebook/lib/fe/flatviewtable.class.php | 36 +++++----- .../gradebook/lib/fe/gradebooktable.class.php | 8 ++- .../gradebook/lib/fe/resulttable.class.php | 19 ++--- public/main/gradebook/user_stats.php | 17 +++-- public/main/help/faq.php | 4 +- public/main/inc/ajax/course_home.ajax.php | 12 ++-- public/main/inc/ajax/dropbox.ajax.php | 16 +++-- public/main/inc/ajax/link.ajax.php | 20 +++--- public/main/inc/ajax/model.ajax.php | 52 ++++++++------ public/main/inc/ajax/session.ajax.php | 5 +- public/main/inc/ajax/work.ajax.php | 30 ++++---- 43 files changed, 358 insertions(+), 291 deletions(-) diff --git a/public/main/announcements/announcements.php b/public/main/announcements/announcements.php index 9efa679a5a..01c07fa65e 100644 --- a/public/main/announcements/announcements.php +++ b/public/main/announcements/announcements.php @@ -5,6 +5,7 @@ use Chamilo\CoreBundle\Entity\AbstractResource; use Chamilo\CoreBundle\Framework\Container; use Chamilo\CourseBundle\Entity\CAnnouncement; +use Chamilo\CoreBundle\Component\Utils\ObjectIcon; /** * @author Frederik Vermeire , UGent Internship @@ -291,7 +292,7 @@ switch ($action) { ) { $html .= Display::noDataView( get_lang('Announcements'), - Display::return_icon('valves.png', '', [], 64), + Display::getMdiIcon(ObjectIcon::ANNOUNCEMENT, 'ch-tool-icon', null, ICON_SIZE_BIG, get_lang('Add an announcement')), get_lang('Add an announcement'), api_get_self().'?'.api_get_cidreq().'&action=add' ); diff --git a/public/main/auth/profile.php b/public/main/auth/profile.php index f04274c2e5..c39d8a0a2b 100644 --- a/public/main/auth/profile.php +++ b/public/main/auth/profile.php @@ -3,6 +3,7 @@ use Chamilo\CoreBundle\Entity\User; use ChamiloSession as Session; +use Chamilo\CoreBundle\Component\Utils\ActionIcon; /** * This file displays the user's profile, @@ -668,10 +669,10 @@ if ($allowSocialTool) { if (isset($_GET['type']) && 'extended' === $_GET['type']) { $actions .= ''. - Display::return_icon('edit.png', get_lang('Edit normal profile'), '', 16).''; + Display::getMdiIcon(ActionIcon::EDIT, 'ch-tool-icon', null, ICON_SIZE_TINY, get_lang('Edit normal profile')).''; } else { $actions .= ''. - Display::return_icon('edit.png', get_lang('Edit extended profile'), '', 16).''; + Display::getMdiIcon(ActionIcon::EDIT, 'ch-tool-icon', null, ICON_SIZE_TINY, get_lang('Edit extended profile')).''; } } } diff --git a/public/main/course_copy/copy_course_session.php b/public/main/course_copy/copy_course_session.php index 24b5136895..cbb83a2b79 100644 --- a/public/main/course_copy/copy_course_session.php +++ b/public/main/course_copy/copy_course_session.php @@ -5,6 +5,7 @@ use Chamilo\CourseBundle\Component\CourseCopy\CourseBuilder; use Chamilo\CourseBundle\Component\CourseCopy\CourseRestorer; use Chamilo\CourseBundle\Component\CourseCopy\CourseSelectForm; use ChamiloSession as Session; +use Chamilo\CoreBundle\Component\Utils\ActionIcon; /** * Copy resources from one course in a session to another one. @@ -92,7 +93,7 @@ function display_form() // Link back to the documents overview $actionsLeft = ''. - Display::return_icon('back.png', get_lang('Back to').' '.get_lang('Administration'), '', ICON_SIZE_MEDIUM). + Display::getMdiIcon(ActionIcon::BACK, 'ch-tool-icon', null, ICON_SIZE_MEDIUM, get_lang('Back to').' '.get_lang('Administration')). ''; $html .= Display::toolbarAction('toolbar-copysession', [$actionsLeft]); @@ -398,10 +399,12 @@ if (Security::check_token('post') && ( $hiddenFields['sec_token'] = Security::get_token(); CourseSelectForm :: display_form($course, $hiddenFields, true); echo '
'. - Display::return_icon( - 'back.png', - get_lang('Back').' '.get_lang('To').' '.get_lang('Administration'), - ['style' => 'vertical-align:middle'] + Display::getMdiIcon( + ActionIcon::BACK, + 'ch-tool-icon', + 'vertical-align:middle', + ICON_SIZE_SMALL, + get_lang('Back').' '.get_lang('To').' '.get_lang('Administration') ). get_lang('Back').'
'; } else { diff --git a/public/main/course_copy/copy_course_session_selected.php b/public/main/course_copy/copy_course_session_selected.php index 3bc14eb290..577ed27412 100644 --- a/public/main/course_copy/copy_course_session_selected.php +++ b/public/main/course_copy/copy_course_session_selected.php @@ -5,6 +5,7 @@ use Chamilo\CourseBundle\Component\CourseCopy\CourseBuilder; use Chamilo\CourseBundle\Component\CourseCopy\CourseRestorer; use Chamilo\CourseBundle\Component\CourseCopy\CourseSelectForm; use ChamiloSession as Session; +use Chamilo\CoreBundle\Component\Utils\ActionIcon; /** * Copy resources from one course in a session to another one. @@ -114,11 +115,12 @@ function displayForm() // Actions $html .= ''; @@ -383,12 +385,12 @@ if (('course_select_form' === $action) || CourseSelectForm :: display_form($course, $hiddenFields, true); echo '
'. - Display::return_icon( - 'back.png', - get_lang('Back').' '.get_lang('To').' '.get_lang( - 'PlatformAdmin' - ), - ['style' => 'vertical-align:middle'] + Display::getMdiIcon( + ActionIcon::BACK, + 'ch-tool-icon', + 'vertical-align:middle', + ICON_SIZE_SMALL, + get_lang('Back').' '.get_lang('To').' '.get_lang('PlatformAdmin') ). get_lang('Back').'
'; } else { diff --git a/public/main/course_progress/index.php b/public/main/course_progress/index.php index 5cb247f888..e8a6d35c9a 100644 --- a/public/main/course_progress/index.php +++ b/public/main/course_progress/index.php @@ -3,11 +3,12 @@ /* For licensing terms, see /license.txt */ use Chamilo\CoreBundle\Framework\Container; -use Chamilo\CoreBundle\Component\Utils\ActionIcon; use Chamilo\CourseBundle\Entity\CThematic; use Chamilo\CourseBundle\Entity\CThematicAdvance; use Chamilo\CourseBundle\Entity\CThematicPlan; use ChamiloSession as Session; +use Chamilo\CoreBundle\Component\Utils\ActionIcon; +use Chamilo\CoreBundle\Component\Utils\ToolIcon; require_once __DIR__.'/../inc/global.inc.php'; @@ -655,7 +656,7 @@ switch ($action) { if (api_is_allowed_to_edit(null, true)) { $noData = Display::noDataView( get_lang('Educational programming'), - Display::return_icon('course_progress.png', '', [], 64), + Display::getMdiIcon(ToolIcon::COURSE_PROGRESS, 'ch-tool-icon', null, ICON_SIZE_BIG), get_lang('Add thematic'), api_get_path(WEB_CODE_PATH).'course_progress/index.php?'.api_get_cidreq().'&action=thematic_add' ); diff --git a/public/main/dashboard/dashboard_controller.php b/public/main/dashboard/dashboard_controller.php index 8db3469a3e..127dd0082e 100644 --- a/public/main/dashboard/dashboard_controller.php +++ b/public/main/dashboard/dashboard_controller.php @@ -11,6 +11,10 @@ * * @todo move to main/inc/lib */ + +use Chamilo\CoreBundle\Component\Utils\ActionIcon; +use Chamilo\CoreBundle\Component\Utils\ToolIcon; + class DashboardController { private $user_id; @@ -70,21 +74,16 @@ class DashboardController $link_blocks_view = $link_list_view = null; if ('list' == $view) { $link_blocks_view = ''. - Display::return_icon('blocks.png', get_lang('Dashboard blocks'), '', ICON_SIZE_MEDIUM).''; + Display::getMdiIcon('monitor-dashboard', 'ch-tool-icon', null, ICON_SIZE_MEDIUM, get_lang('Dashboard blocks')).''; } else { $link_list_view = ''. - Display::return_icon('edit.png', get_lang('Edit blocks'), '', ICON_SIZE_MEDIUM).''; + Display::getMdiIcon(ActionIcon::EDIT, 'ch-tool-icon', null, ICON_SIZE_MEDIUM, get_lang('Edit blocks')).''; } $configuration_link = null; if (api_is_platform_admin()) { $configuration_link = '' - .Display::return_icon( - 'settings.png', - get_lang('Configure Dashboard Plugin'), - '', - ICON_SIZE_MEDIUM - ).''; + .Display::getMdiIcon(ToolIcon::SETTINGS, 'ch-tool-icon', null, ICON_SIZE_MEDIUM, get_lang('Configure Dashboard Plugin')).''; } $actions = Display::toolbarAction('toolbar', [$link_blocks_view.$link_list_view.$configuration_link]); diff --git a/public/main/dropbox/index.php b/public/main/dropbox/index.php index bb5519109f..c79243e389 100644 --- a/public/main/dropbox/index.php +++ b/public/main/dropbox/index.php @@ -3,6 +3,9 @@ /* For licensing terms, see /license.txt */ // The file that contains all the initialisation stuff (and includes all the configuration stuff) + +use Chamilo\CoreBundle\Component\Utils\ActionIcon; + require_once 'dropbox_init.inc.php'; $_course = api_get_course_info(); @@ -244,25 +247,25 @@ if ('add' != $action) { if (0 == api_get_session_id()) { if (0 != $view_dropbox_category_received && api_is_allowed_to_session_edit(false, true)) { $actions .= ''. - Display::return_icon('folder_up.png', get_lang('Up').' '.get_lang('root'), '', ICON_SIZE_MEDIUM). + Display::getMdiIcon(ActionIcon::UP, 'ch-tool-icon', null, ICON_SIZE_MEDIUM, get_lang('Up').' '.get_lang('root')). ""; $actions .= get_lang('Category').': '.Security::remove_XSS($dropbox_categories[$view_dropbox_category_received]['cat_name']).' '; $movelist[0] = 'Root'; // move_received selectbox content } else { $actions .= ''. - Display::return_icon('new_folder.png', get_lang('Add a new folder'), '', ICON_SIZE_MEDIUM).''; + Display::getMdiIcon(ActionIcon::CREATE_FOLDER, 'ch-tool-icon', null, ICON_SIZE_MEDIUM, get_lang('Add a new folder')).''; } echo Display::toolbarAction('dropbox', [$actions]); } else { if (api_is_allowed_to_session_edit(false, true)) { if (0 != $view_dropbox_category_received && api_is_allowed_to_session_edit(false, true)) { $actions .= ''. - Display::return_icon('folder_up.png', get_lang('Up').' '.get_lang('root'), '', ICON_SIZE_MEDIUM).""; + Display::getMdiIcon(ActionIcon::UP, 'ch-tool-icon', null, ICON_SIZE_MEDIUM, get_lang('Up').' '.get_lang('root')).""; $actions .= get_lang('Category').': '.Security::remove_XSS($dropbox_categories[$view_dropbox_category_received]['cat_name']).' '; $movelist[0] = 'Root'; // move_received selectbox content } else { $actions .= ''. - Display::return_icon('new_folder.png', get_lang('Add a new folder'), '', ICON_SIZE_MEDIUM). + Display::getMdiIcon(ActionIcon::CREATE_FOLDER, 'ch-tool-icon', null, ICON_SIZE_MEDIUM, get_lang('Add a new folder')). ''; } echo Display::toolbarAction('dropbox', [$actions]); @@ -283,34 +286,34 @@ if ('add' != $action) { if (0 == api_get_session_id()) { if (empty($viewSentCategory)) { $actions .= "". - Display::return_icon('upload_file.png', get_lang('Share a new file'), '', ICON_SIZE_MEDIUM). + Display::getMdiIcon(ActionIcon::UPLOAD, 'ch-tool-icon', null, ICON_SIZE_MEDIUM, get_lang('Share a new file')). ""; } if (0 != $view_dropbox_category_sent) { $actions .= ''. - Display::return_icon('folder_up.png', get_lang('Up').' '.get_lang('root'), '', ICON_SIZE_MEDIUM). + Display::getMdiIcon(ActionIcon::UP, 'ch-tool-icon', null, ICON_SIZE_MEDIUM, get_lang('Up').' '.get_lang('root')). ""; $actions .= get_lang('Category').': '.Security::remove_XSS($dropbox_categories[$view_dropbox_category_sent]['cat_name']).' '; } else { $actions .= "". - Display::return_icon('new_folder.png', get_lang('Add a new folder'), '', ICON_SIZE_MEDIUM)."\n"; + Display::getMdiIcon(ActionIcon::CREATE_FOLDER, 'ch-tool-icon', null, ICON_SIZE_MEDIUM, get_lang('Add a new folder'))."\n"; } echo Display::toolbarAction('dropbox', [$actions]); } else { if (api_is_allowed_to_session_edit(false, true)) { if (empty($viewSentCategory)) { $actions .= "". - Display::return_icon('upload_file.png', get_lang('Share a new file'), '', ICON_SIZE_MEDIUM). + Display::getMdiIcon(ActionIcon::UPLOAD, 'ch-tool-icon', null, ICON_SIZE_MEDIUM, get_lang('Share a new file')). ""; } if (0 != $view_dropbox_category_sent) { $actions .= get_lang('You are in folder').': '.Security::remove_XSS($dropbox_categories[$view_dropbox_category_sent]['cat_name']).' '; $actions .= ''. - Display::return_icon('folder_up.png', get_lang('Up').' '.get_lang('root'), '', ICON_SIZE_MEDIUM). + Display::getMdiIcon(ActionIcon::UP, 'ch-tool-icon', null, ICON_SIZE_MEDIUM, get_lang('Up').' '.get_lang('root')). ""; } else { $actions .= "". - Display::return_icon('new_folder.png', get_lang('Add a new folder'), '', ICON_SIZE_MEDIUM)."\n"; + Display::getMdiIcon(ActionIcon::CREATE_FOLDER, 'ch-tool-icon', null, ICON_SIZE_MEDIUM, get_lang('Add a new folder'))."\n"; } echo Display::toolbarAction('dropbox', [$actions]); } @@ -414,19 +417,14 @@ if ('add' != $action) { $_SESSION['_seen'][$_course['id']][TOOL_DROPBOX] ) ) { - $new_icon = ' '.Display::return_icon( - 'new_dropbox_message.png', - get_lang('New'), - '', - ICON_SIZE_SMALL - ); + $new_icon = ' '.Display::getMdiIcon(ActionIcon::ADD, 'ch-tool-icon', null, ICON_SIZE_SMALL, get_lang('New')); } } $link_open = ''; $dropbox_file_data[] = $link_open.DocumentManager::build_document_icon_tag('file', $dropbox_file->title).''; $dropbox_file_data[] = ''. - Display::return_icon('save.png', get_lang('Download'), ['style' => 'float:right;'], ICON_SIZE_SMALL). + Display::getMdiIcon(ActionIcon::SAVE_FORM, 'ch-tool-icon', null, ICON_SIZE_SMALL, get_lang('Download')). ''.$link_open.$dropbox_file->title.''.$new_icon.'
'.$dropbox_file->description; $file_size = $dropbox_file->filesize; $dropbox_file_data[] = format_file_size($file_size); @@ -442,11 +440,11 @@ if ('add' != $action) { $action_icons = check_number_feedback($dropbox_file->id, $number_feedback).' '.get_lang('Feedback').' '. - Display::return_icon('discuss.png', get_lang('Comment'), '', ICON_SIZE_SMALL).' + Display::getMdiIcon(ActionIcon::COMMENT, 'ch-tool-icon', null, ICON_SIZE_SMALL, get_lang('Comment')).' '. - Display::return_icon('move.png', get_lang('Move'), '', ICON_SIZE_SMALL).' + Display::getMdiIcon(ActionIcon::MOVE, 'ch-tool-icon', null, ICON_SIZE_SMALL, get_lang('Move')).' '. - Display::return_icon('delete.png', get_lang('Delete'), '', ICON_SIZE_SMALL). + Display::getMdiIcon(ActionIcon::DELETE, 'ch-tool-icon', null, ICON_SIZE_SMALL, get_lang('Delete')). ''; // This is a hack to have an additional row in a sortable table @@ -487,15 +485,15 @@ if ('add' != $action) { $dropbox_category_data[] = $link_open.DocumentManager::build_document_icon_tag('folder', $category['cat_name']).''; $dropbox_category_data[] = ''. - Display::return_icon('save_pack.png', get_lang('Save'), ['style' => 'float:right;'], ICON_SIZE_SMALL).''.$link_open.$category['cat_name'].''; + Display::getMdiIcon(ActionIcon::SAVE_FORM, 'ch-tool-icon', null, ICON_SIZE_SMALL, get_lang('Save')).''.$link_open.$category['cat_name'].''; $dropbox_category_data[] = ''; $dropbox_category_data[] = ''; $dropbox_category_data[] = ''; $dropbox_category_data[] = ''. - 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')).' '. - Display::return_icon('delete.png', get_lang('Delete'), '', ICON_SIZE_SMALL).''; + Display::getMdiIcon(ActionIcon::DELETE, 'ch-tool-icon', null, ICON_SIZE_SMALL, get_lang('Delete')).''; } if (is_array($dropbox_category_data) && count($dropbox_category_data) > 0) { $dropbox_data_recieved[] = $dropbox_category_data; @@ -602,7 +600,7 @@ if ('add' != $action) { $link_open = ''; $dropbox_file_data[] = $link_open.DocumentManager::build_document_icon_tag('file', $dropbox_file->title).''; $dropbox_file_data[] = ''. - Display::return_icon('save.png', get_lang('Save'), ['style' => 'float:right;'], ICON_SIZE_SMALL). + Display::getMdiIcon(ActionIcon::SAVE_FORM, 'ch-tool-icon', null, ICON_SIZE_SMALL, get_lang('Save')). ''. $link_open. $dropbox_file->title. @@ -625,16 +623,16 @@ if ('add' != $action) { $action_icons = check_number_feedback($dropbox_file->id, $number_feedback).' '.get_lang('Feedback').' '. - Display::return_icon('discuss.png', get_lang('Comment'), '', ICON_SIZE_SMALL). + Display::getMdiIcon(ActionIcon::COMMENT, 'ch-tool-icon', null, ICON_SIZE_SMALL, get_lang('Comment')). ' '. - Display::return_icon('upload_file.png', get_lang('Update'), '', ICON_SIZE_SMALL). + Display::getMdiIcon(ActionIcon::UPLOAD, 'ch-tool-icon', null, ICON_SIZE_SMALL, get_lang('Update')). ' '. - Display::return_icon('move.png', get_lang('Move'), '', ICON_SIZE_SMALL).' + Display::getMdiIcon(ActionIcon::MOVE, 'ch-tool-icon', null, ICON_SIZE_SMALL, get_lang('Move')).' '. - Display::return_icon('delete.png', get_lang('Delete'), '', ICON_SIZE_SMALL). + Display::getMdiIcon(ActionIcon::DELETE, 'ch-tool-icon', null, ICON_SIZE_SMALL, get_lang('Delete')). ''; // This is a hack to have an additional row in a sortable table if ('viewfeedback' == $action && isset($_GET['id']) && is_numeric($_GET['id']) && $dropbox_file->id == $_GET['id']) { @@ -665,14 +663,14 @@ if ('add' != $action) { $link_open = ''; $dropbox_category_data[] = $link_open.DocumentManager::build_document_icon_tag('folder', Security::remove_XSS($category['cat_name'])).''; $dropbox_category_data[] = ''. - Display::return_icon('save_pack.png', get_lang('Save'), ['style' => 'float:right;'], ICON_SIZE_SMALL).''.$link_open.Security::remove_XSS($category['cat_name']).''; + Display::getMdiIcon(ActionIcon::SAVE_FORM, 'ch-tool-icon', null, ICON_SIZE_SMALL, get_lang('Save')).''.$link_open.Security::remove_XSS($category['cat_name']).''; $dropbox_category_data[] = ''; $dropbox_category_data[] = ''; $dropbox_category_data[] = ''; $dropbox_category_data[] = ''. - 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')).' '. - Display::return_icon('delete.png', get_lang('Delete'), '', ICON_SIZE_SMALL).''; + Display::getMdiIcon(ActionIcon::DELETE, 'ch-tool-icon', null, ICON_SIZE_SMALL, get_lang('Delete')).''; } if (is_array($dropbox_category_data) && count($dropbox_category_data) > 0) { $dropbox_data_sent[] = $dropbox_category_data; diff --git a/public/main/exercise/TestCategory.php b/public/main/exercise/TestCategory.php index dbcad0d9dd..fb6f729723 100644 --- a/public/main/exercise/TestCategory.php +++ b/public/main/exercise/TestCategory.php @@ -5,6 +5,7 @@ use Chamilo\CoreBundle\Framework\Container; use Chamilo\CourseBundle\Entity\CQuizQuestionCategory; use ChamiloSession as Session; +use Chamilo\CoreBundle\Component\Utils\ActionIcon; /** * Class TestCategory. @@ -1127,12 +1128,12 @@ class TestCategory if (!$sessionId) { $links .= ''. - Display::return_icon('edit.png', get_lang('Edit'), []).''; + Display::getMdiIcon(ActionIcon::EDIT, 'ch-tool-icon', null, ICON_SIZE_SMALL, get_lang('Edit')).''; $links .= ' '; - $links .= Display::return_icon('delete.png', get_lang('Delete'), []).''; + $links .= Display::getMdiIcon(ActionIcon::DELETE, 'ch-tool-icon', null, ICON_SIZE_SMALL, get_lang('Delete')).''; } $html .= Display::panel($content, $category->getTitle().$links); diff --git a/public/main/exercise/category.php b/public/main/exercise/category.php index 467c9e59b2..128a1218b2 100644 --- a/public/main/exercise/category.php +++ b/public/main/exercise/category.php @@ -2,6 +2,8 @@ /* For licensing terms, see /license.txt */ +use Chamilo\CoreBundle\Component\Utils\ActionIcon; + require_once __DIR__.'/../inc/global.inc.php'; if ('true' !== api_get_setting('exercise.allow_exercise_categories')) { @@ -98,7 +100,7 @@ switch ($action) { exit; } 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')).''; $content = Display::toolbarAction('toolbar', [$actions]); $form->addElement('hidden', 'sec_token'); $form->setConstants(['sec_token' => $token]); @@ -122,7 +124,7 @@ switch ($action) { exit; } 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')).''; $content = Display::toolbarAction('toolbar', [$actions]); $form->addElement('hidden', 'sec_token'); $form->setConstants(['sec_token' => $token]); diff --git a/public/main/exercise/exercise.class.php b/public/main/exercise/exercise.class.php index 35838f6eb1..2c8ccda1c7 100644 --- a/public/main/exercise/exercise.class.php +++ b/public/main/exercise/exercise.class.php @@ -3,7 +3,6 @@ /* For licensing terms, see /license.txt */ use Chamilo\CoreBundle\Component\Utils\ChamiloApi; -use Chamilo\CoreBundle\Component\Utils\ActionIcon; use Chamilo\CoreBundle\Entity\GradebookLink; use Chamilo\CoreBundle\Entity\TrackEExercise; use Chamilo\CoreBundle\Entity\TrackEExerciseConfirmation; @@ -13,6 +12,9 @@ use Chamilo\CourseBundle\Entity\CExerciseCategory; use Chamilo\CourseBundle\Entity\CQuiz; use Chamilo\CourseBundle\Entity\CQuizRelQuestionCategory; use ChamiloSession as Session; +use Chamilo\CoreBundle\Component\Utils\ActionIcon; +use Chamilo\CoreBundle\Component\Utils\StateIcon; + /** * @author Olivier Brouckaert @@ -7245,7 +7247,7 @@ class Exercise '' ); $html .= ''; - $icon = Display::getMdiIcon('clock-outline'); + $icon = Display::getMdiIcon('clock-outline', 'ch-tool-icon'); $html .= '
'.get_lang('RemainingTimeToFinishExercise').' '.$icon.' @@ -8976,7 +8978,7 @@ class Exercise // Test settings $settings = Display::url( - Display::getMdiIcon('cog', 'ch-tool-icon', null, ICON_SIZE_SMALL, get_lang('Configure')), + Display::getMdiIcon(ToolIcon::SETTINGS, 'ch-tool-icon', null, ICON_SIZE_SMALL, get_lang('Configure')), 'exercise_admin.php?'.api_get_cidreq().'&exerciseId='.$exerciseId ); @@ -8987,7 +8989,7 @@ class Exercise // Exercise results $resultsLink = ''. - Display::getMdiIcon('chart-box', 'ch-tool-icon', null, ICON_SIZE_SMALL, get_lang('Results')).''; + Display::getMdiIcon(ToolIcon::TRACKING, 'ch-tool-icon', null, ICON_SIZE_SMALL, get_lang('Results')).''; if ($limitTeacherAccess) { if (api_is_platform_admin()) { @@ -9034,7 +9036,7 @@ class Exercise if (true === $allowClean) { if (!$locked) { $clean = Display::url( - Display::getMdiIcon('broom', 'ch-tool-icon', null, ICON_SIZE_SMALL, get_lang('CleanStudentResults') + Display::getMdiIcon(ActionIcon::RESET, 'ch-tool-icon', null, ICON_SIZE_SMALL, get_lang('CleanStudentResults') ), '', [ @@ -9050,7 +9052,7 @@ class Exercise ] ); } else { - $clean = Display::getMdiIcon('broom', 'ch-tool-icon-disabled', null, ICON_SIZE_SMALL, get_lang('ResourceLockedByGradebook') + $clean = Display::getMdiIcon(ActionIcon::RESET, 'ch-tool-icon-disabled', null, ICON_SIZE_SMALL, get_lang('ResourceLockedByGradebook') ); } } @@ -9059,12 +9061,12 @@ class Exercise // Visible / invisible // Check if this exercise was added in a LP if ($exercise->exercise_was_added_in_lp) { - $visibility = Display::getMdiIcon('eye-off', 'ch-tool-icon', null, ICON_SIZE_SMALL, get_lang('AddedToLPCannotBeAccessed') + $visibility = Display::getMdiIcon(StateIcon::PRIVATE_VISIBILITY, 'ch-tool-icon', null, ICON_SIZE_SMALL, get_lang('AddedToLPCannotBeAccessed') ); } else { if (0 === $exerciseEntity->getActive()) { $visibility = Display::url( - Display::getMdiIcon('eye-off', 'ch-tool-icon', null, ICON_SIZE_SMALL, get_lang('Activate') + Display::getMdiIcon(StateIcon::PRIVATE_VISIBILITY, 'ch-tool-icon', null, ICON_SIZE_SMALL, get_lang('Activate') ), 'exercise.php?'.api_get_cidreq( ).'&choice=enable&sec_token='.$token.'&exerciseId='.$exerciseId @@ -9072,7 +9074,7 @@ class Exercise } else { // else if not active $visibility = Display::url( - Display::getMdiIcon('eye', 'ch-tool-icon', null, ICON_SIZE_SMALL, get_lang('Deactivate') + Display::getMdiIcon(StateIcon::PUBLIC_VISIBILITY, 'ch-tool-icon', null, ICON_SIZE_SMALL, get_lang('Deactivate') ), 'exercise.php?'.api_get_cidreq( ).'&choice=disable&sec_token='.$token.'&exerciseId='.$exerciseId @@ -9110,12 +9112,12 @@ class Exercise // Check if this exercise was added in a LP if ($exercise->exercise_was_added_in_lp) { - $visibility = Display::getMdiIcon('eye-off', 'ch-tool-icon', null, ICON_SIZE_SMALL, get_lang('AddedToLPCannotBeAccessed') + $visibility = Display::getMdiIcon(StateIcon::PRIVATE_VISIBILITY, 'ch-tool-icon', null, ICON_SIZE_SMALL, get_lang('AddedToLPCannotBeAccessed') ); } else { if (0 === $exerciseEntity->getActive() || 0 == $visibility) { $visibility = Display::url( - Display::getMdiIcon('eye-off', 'ch-tool-icon', null, ICON_SIZE_SMALL, get_lang('Activate') + Display::getMdiIcon(StateIcon::PRIVATE_VISIBILITY, 'ch-tool-icon', null, ICON_SIZE_SMALL, get_lang('Activate') ), 'exercise.php?'.api_get_cidreq( ).'&choice=enable&sec_token='.$token.'&exerciseId='.$exerciseId @@ -9123,7 +9125,7 @@ class Exercise } else { // else if not active $visibility = Display::url( - Display::getMdiIcon('eye', 'ch-tool-icon', null, ICON_SIZE_SMALL, get_lang('Deactivate') + Display::getMdiIcon(StateIcon::PUBLIC_VISIBILITY, 'ch-tool-icon', null, ICON_SIZE_SMALL, get_lang('Deactivate') ), 'exercise.php?'.api_get_cidreq( ).'&choice=disable&sec_token='.$token.'&exerciseId='.$exerciseId @@ -9137,7 +9139,7 @@ class Exercise $actions .= $visibility; $actions .= ''. - Display::getMdiIcon('chart-box', 'ch-tool-icon', null, ICON_SIZE_SMALL, get_lang('Results')).''; + Display::getMdiIcon(ToolIcon::TRACKING, 'ch-tool-icon', null, ICON_SIZE_SMALL, get_lang('Results')).''; $actions .= Display::url( Display::getMdiIcon('disc', 'ch-tool-icon', null, ICON_SIZE_SMALL, get_lang('Copy this exercise as a new one')), '', @@ -9167,8 +9169,11 @@ class Exercise ] ); } else { - $delete = Display::return_icon( - 'delete_na.png', + $delete = Display::getMdiIcon( + ActionIcon::DELETE, + 'ch-tool-icon-disabled', + null, + ICON_SIZE_SMALL, get_lang( 'This option is not available because this activity is contained by an assessment, which is currently locked. To unlock the assessment, ask your platform administrator.' ) @@ -9389,7 +9394,7 @@ class Exercise if ($isDrhOfCourse) { $currentRow[] = ''. - Display::getMdiIcon('chart-box', 'ch-tool-icon', null, ICON_SIZE_SMALL, get_lang('Results')). + Display::getMdiIcon(ToolIcon::TRACKING, 'ch-tool-icon', null, ICON_SIZE_SMALL, get_lang('Results')). ''; } if ($returnData) { @@ -9408,7 +9413,7 @@ class Exercise if ($is_allowedToEdit && 'learnpath' !== $origin) { $content .= Display::noDataView( get_lang('Quiz'), - Display::return_icon('quiz.png', '', [], 64), + Display::getMdiIcon(ToolIcon::QUIZ, 'ch-tool-icon', null, ICON_SIZE_BIG), get_lang('Create a new test'), 'exercise_admin.php?'.api_get_cidreq() ); diff --git a/public/main/exercise/exercise_history.php b/public/main/exercise/exercise_history.php index ac8ae06feb..cb3b1030bf 100644 --- a/public/main/exercise/exercise_history.php +++ b/public/main/exercise/exercise_history.php @@ -8,6 +8,9 @@ * @author Denes Nagy, HotPotatoes integration * @author Wolfgang Schneider, code/html cleanup */ + +use Chamilo\CoreBundle\Component\Utils\ActionIcon; + require_once __DIR__.'/../inc/global.inc.php'; $this_section = SECTION_COURSES; api_protect_course_script(true); @@ -50,7 +53,7 @@ if (isset($_GET['message'])) { } $actions = ''. - Display::return_icon('back.png', get_lang('Back to result list'), '', ICON_SIZE_MEDIUM).''; + Display::getMdiIcon(ActionIcon::BACK, 'ch-tool-icon', null, ICON_SIZE_MEDIUM, get_lang('Back to result list')).''; echo Display::toolbarAction('toolbar', [$actions]); ?> diff --git a/public/main/exercise/exercise_question_reminder.php b/public/main/exercise/exercise_question_reminder.php index 8ffb158a75..974d8f50cf 100644 --- a/public/main/exercise/exercise_question_reminder.php +++ b/public/main/exercise/exercise_question_reminder.php @@ -3,6 +3,7 @@ /* For licensing terms, see /license.txt */ use ChamiloSession as Session; +use Chamilo\CoreBundle\Component\Utils\ActionIcon; require_once __DIR__.'/../inc/global.inc.php'; $current_course_tool = TOOL_QUIZ; @@ -106,9 +107,9 @@ if (!$hideHeaderAndFooter) { // I'm in a preview mode as course admin. Display the action menu. if (!$hideHeaderAndFooter && api_is_course_admin()) { $actions = ''. - Display::return_icon('back.png', get_lang('GoBackToQuestionList'), [], 32).''; + Display::getMdiIcon(ActionIcon::BACK, 'ch-tool-icon', null, ICON_SIZE_MEDIUM, get_lang('GoBackToQuestionList')).''; $actions .= ''. - Display::return_icon('edit.png', get_lang('ModifyExercise'), [], 32).''; + Display::getMdiIcon(ActionIcon::EDIT, 'ch-tool-icon', null, ICON_SIZE_MEDIUM, get_lang('ModifyExercise')).''; echo Display::toolbarAction('toolbar', [$actions]); } echo Display::page_header($categoryObj->name); diff --git a/public/main/exercise/exercise_reminder.php b/public/main/exercise/exercise_reminder.php index 75acf5f405..56d08281fc 100644 --- a/public/main/exercise/exercise_reminder.php +++ b/public/main/exercise/exercise_reminder.php @@ -3,6 +3,7 @@ /* For licensing terms, see /license.txt */ use ChamiloSession as Session; +use Chamilo\CoreBundle\Component\Utils\ActionIcon; /** * Exercise reminder overview @@ -95,9 +96,9 @@ if (!$hideHeaderAndFooter) { // I'm in a preview mode as course admin. Display the action menu. if (!$hideHeaderAndFooter && api_is_course_admin()) { $actions = ''. - Display::return_icon('back.png', get_lang('Go back to the questions list'), [], 32).''; + Display::getMdiIcon(ActionIcon::BACK, 'ch-tool-icon', null, ICON_SIZE_MEDIUM, get_lang('Go back to the questions list')).''; $actions .= ''. - Display::return_icon('edit.png', get_lang('ModifyTest'), [], 32).''; + Display::getMdiIcon(ActionIcon::EDIT, 'ch-tool-icon', null, ICON_SIZE_MEDIUM, get_lang('ModifyTest')).''; echo Display::toolbarAction('toolbar', [$actions]); } echo Display::page_header(get_lang('Questions to be reviewed')); diff --git a/public/main/exercise/exercise_show.php b/public/main/exercise/exercise_show.php index c86ae478f1..c20d360dbf 100644 --- a/public/main/exercise/exercise_show.php +++ b/public/main/exercise/exercise_show.php @@ -2,6 +2,7 @@ /* For licensing terms, see /license.txt */ use ChamiloSession as Session; +use Chamilo\CoreBundle\Component\Utils\ActionIcon; /** * Shows the exercise results. @@ -184,7 +185,7 @@ if ('export' != $action) { echo Display::toolbarAction('toolbar', [ Display::url( - Display::return_icon('pdf.png', get_lang('Export')), + Display::getMdiIcon(ActionIcon::EXPORT_PDF, 'ch-tool-icon', null, ICON_SIZE_SMALL, get_lang('Export')), api_get_self().'?'.api_get_cidreq().'&id='.$id.'&action=export&' ), ]); ?> diff --git a/public/main/exercise/exercise_submit.php b/public/main/exercise/exercise_submit.php index f9115838f9..c8d9740746 100644 --- a/public/main/exercise/exercise_submit.php +++ b/public/main/exercise/exercise_submit.php @@ -4,6 +4,7 @@ use ChamiloSession as Session; use Chamilo\CoreBundle\Component\Utils\ActionIcon; +use Chamilo\CoreBundle\Component\Utils\StateIcon; /** * Exercise submission @@ -1618,10 +1619,10 @@ if ($allowBlockCategory && $("#save_all_response").html(return_value.savedAnswerMessage); window.location = "'.$script_php.'?'.$params.'"; } else { - $("#save_all_response").html(\''.Display::return_icon('accept.png').'\'); + $("#save_all_response").html(\''.Display::getMdiIcon(StateIcon::COMPLETE, 'ch-tool-icon').'\'); } } else { - $("#save_all_response").html(\''.Display::return_icon('wrong.gif').'\'); + $("#save_all_response").html(\''.Display::getMdiIcon(StateIcon::INCOMPLETE, 'ch-tool-icon').'\'); } } }); diff --git a/public/main/exercise/exercise_submit_modal.php b/public/main/exercise/exercise_submit_modal.php index 036be5fdea..83384b24be 100644 --- a/public/main/exercise/exercise_submit_modal.php +++ b/public/main/exercise/exercise_submit_modal.php @@ -5,6 +5,9 @@ use Chamilo\CoreBundle\Framework\Container; use Chamilo\CourseBundle\Entity\CQuizQuestion; use ChamiloSession as Session; +use Chamilo\CoreBundle\Component\Utils\ActionIcon; +use Chamilo\CoreBundle\Component\Utils\ObjectIcon; +use Chamilo\CoreBundle\Component\Utils\StateIcon; /** * @author Julio Montoya @@ -118,26 +121,28 @@ echo '
'; if (empty($choiceValue) && empty($hotSpot) && $loaded) { $nextQuestion = $questionNum + 1; $destinationId = isset($questionList[$nextQuestion]) ? $questionList[$nextQuestion] : -1; - $icon = Display::return_icon( - 'reload.png', - '', - ['style' => 'width:22px; height:22px; padding-left:0px;padding-right:5px;'] + $icon = Display::getMdiIcon( + ActionIcon::REFRESH, + 'ch-tool-icon', + 'width:22px; height:22px; padding-left:0px;padding-right:5px;', + ICON_SIZE_SMALL ); $links = ''.get_lang('Try again').' '.$icon.' '; // the link to finish the test if (-1 == $destinationId) { - $links .= Display::return_icon( - 'finish.gif', - '', - ['style' => 'width:22px; height:22px; padding-left:0px;padding-right:5px;'] + $links .= Display::getMdiIcon( + StateIcon::COMPLETE, + 'ch-tool-icon', + 'width:22px; height:22px; padding-left:0px;padding-right:5px;', + ICON_SIZE_SMALL ).''.get_lang('End of activity').'

'; } else { // the link to other question if (in_array($destinationId, $questionList)) { $num_value_array = array_keys($questionList, $destinationId); - $icon = Display::return_icon( - 'quiz.png', + $icon = Display::getMdiIcon( + ObjectIcon::TEST, '', ['style' => 'padding-left:0px;padding-right:5px;'] ); @@ -390,20 +395,22 @@ if (isset($result['answer_destination'])) { // the link to retry the question if (isset($try) && 1 == $try) { $num_value_array = array_keys($questionList, $questionId); - $links .= Display:: return_icon( - 'reload.gif', - '', - ['style' => 'padding-left:0px;padding-right:5px;'] + $links .= Display::getMdiIcon( + ActionIcon::REFRESH, + 'ch-tool-icon', + 'padding-left:0px;padding-right:5px;', + ICON_SIZE_SMALL ).''.get_lang('Try again').'

'; } // the link to theory (a learning path) if (!empty($lp)) { $lp_url = api_get_path(WEB_CODE_PATH).'lp/lp_controller.php?'.api_get_cidreq().'&action=view&lp_id='.$lp; - $links .= Display:: return_icon( - 'theory.gif', - '', - ['style' => 'padding-left:0px;padding-right:5px;'] + $links .= Display::getMdiIcon( + ObjectIcon::DOCUMENT, + 'ch-tool-icon', + 'padding-left:0px;padding-right:5px;', + ICON_SIZE_SMALL ).''.get_lang('Theory link').'
'; } @@ -411,10 +418,11 @@ $links .= '
'; // the link to an external website or link if (!empty($url) && -1 != $url) { - $links .= Display:: return_icon( - 'link.gif', - '', - ['style' => 'padding-left:0px;padding-right:5px;'] + $links .= Display::getMdiIcon( + ObjectIcon::LINK, + 'ch-tool-icon', + 'padding-left:0px;padding-right:5px;', + ICON_SIZE_SMALL ).''.get_lang('Visit this link').'

'; } @@ -423,19 +431,21 @@ $destinationId = isset($questionList[$nextQuestion]) ? $questionList[$nextQuesti // the link to finish the test if (-1 == $destinationId) { - $links .= Display:: return_icon( - 'finish.gif', - '', - ['style' => 'width:22px; height:22px; padding-left:0px;padding-right:5px;'] + $links .= Display::getMdiIcon( + StateIcon::COMPLETE, + 'ch-tool-icon', + 'width:22px; height:22px; padding-left:0px;padding-right:5px;', + ICON_SIZE_SMALL ).''.get_lang('End of activity').'

'; } else { // the link to other question if (in_array($destinationId, $questionList)) { $num_value_array = array_keys($questionList, $destinationId); - $icon = Display::return_icon( - 'quiz.png', - '', - ['style' => 'padding-left:0px;padding-right:5px;'] + $icon = Display::getMdiIcon( + ObjectIcon::TEST, + 'ch-tool-icon', + 'padding-left:0px;padding-right:5px;', + ICON_SIZE_SMALL ); $links .= ''. get_lang('Question').' '.$num_value_array[0].' '; diff --git a/public/main/exercise/export/aiken/aiken_import.inc.php b/public/main/exercise/export/aiken/aiken_import.inc.php index d5e3172338..8818471c3f 100644 --- a/public/main/exercise/export/aiken/aiken_import.inc.php +++ b/public/main/exercise/export/aiken/aiken_import.inc.php @@ -10,6 +10,8 @@ * @author César Perales Parse function for Aiken format */ +use Chamilo\CoreBundle\Component\Utils\ActionIcon; + /** * This function displays the form for import of the zip file with qti2. * @@ -20,12 +22,7 @@ function aiken_display_form() $name_tools = get_lang('Import Aiken quiz'); $form = '
'; $form .= ''. - Display::return_icon( - 'back.png', - get_lang('Back to Tests tool'), - '', - ICON_SIZE_MEDIUM - ).''; + Display::getMdiIcon(ActionIcon::BACK, 'ch-tool-icon', null, ICON_SIZE_MEDIUM, get_lang('Back to Tests tool')).''; $form .= '
'; $form_validator = new FormValidator( 'aiken_upload', diff --git a/public/main/exercise/live_stats.php b/public/main/exercise/live_stats.php index 902c807216..743ef55c1c 100644 --- a/public/main/exercise/live_stats.php +++ b/public/main/exercise/live_stats.php @@ -1,6 +1,8 @@ '. - Display::return_icon('back.png', get_lang('Go back to the questions list'), '', ICON_SIZE_MEDIUM).''; + Display::getMdiIcon(ActionIcon::BACK, 'ch-tool-icon', null, ICON_SIZE_MEDIUM, get_lang('Go back to the questions list')).''; $actions = Display::toolbarAction('exercise_report', [$actions]); echo Display::grid_html('live_stats'); diff --git a/public/main/exercise/qti2.php b/public/main/exercise/qti2.php index ebb1ff3fb7..150848bf74 100644 --- a/public/main/exercise/qti2.php +++ b/public/main/exercise/qti2.php @@ -9,6 +9,8 @@ * * @version $Id: qti2.php 2010-03-12 12:14:25Z $ */ +use Chamilo\CoreBundle\Component\Utils\ActionIcon; + require_once __DIR__.'/../inc/global.inc.php'; api_protect_course_script(true); @@ -35,7 +37,7 @@ function displayForm() { $form = '
'; $form .= ''. - Display::return_icon('back.png', get_lang('BackToTestsList'), '', ICON_SIZE_MEDIUM).''; + Display::getMdiIcon(ActionIcon::BACK, 'ch-tool-icon', null, ICON_SIZE_MEDIUM, get_lang('BackToTestsList')).''; $form .= '
'; $formValidator = new FormValidator( 'qti_upload', diff --git a/public/main/exercise/question_create.php b/public/main/exercise/question_create.php index af972ca2e7..dac769d46a 100644 --- a/public/main/exercise/question_create.php +++ b/public/main/exercise/question_create.php @@ -4,6 +4,7 @@ use Chamilo\CoreBundle\Framework\Container; use Chamilo\CourseBundle\Entity\CQuiz; +use Chamilo\CoreBundle\Component\Utils\ActionIcon; require_once __DIR__.'/../inc/global.inc.php'; @@ -107,7 +108,7 @@ if ($form->validate()) { } else { Display::display_header($nameTools); $actions = ''. - Display::return_icon('back.png', get_lang('BackToTestsList'), '', ICON_SIZE_MEDIUM).''; + Display::getMdiIcon(ActionIcon::BACK, 'ch-tool-icon', null, ICON_SIZE_MEDIUM, get_lang('BackToTestsList')).''; echo Display::toolbarAction('toolbar', [$actions]); $form->display(); diff --git a/public/main/exercise/question_list_admin.inc.php b/public/main/exercise/question_list_admin.inc.php index 960bdb08fb..4e1f8b174b 100644 --- a/public/main/exercise/question_list_admin.inc.php +++ b/public/main/exercise/question_list_admin.inc.php @@ -3,6 +3,7 @@ /* For licensing terms, see /license.txt */ use ChamiloSession as Session; +use Chamilo\CoreBundle\Component\Utils\ActionIcon; /** * @author Olivier Brouckaert & Julio Montoya & Hubert Borderiou 21-10-2011 (Question by category) @@ -193,33 +194,18 @@ if (!$inATest) { } $clone_link = Display::url( - Display::return_icon( - 'cd.png', - get_lang('Copy'), - [], - ICON_SIZE_TINY - ), + Display::getMdiIcon(ActionIcon::COPY_CONTENT, 'ch-tool-icon', null, ICON_SIZE_TINY, get_lang('Copy')), api_get_self().'?'.api_get_cidreq().'&clone_question='.$id.'&page='.$page, ['class' => 'btn btn--plain btn-sm'] ); $edit_link = CALCULATED_ANSWER == $objQuestionTmp->selectType() && $objQuestionTmp->isAnswered() ? Display::span( - Display::return_icon( - 'edit_na.png', - get_lang('Question edition is not available because the question has been already answered. However, you can copy and modify it.'), - [], - ICON_SIZE_TINY - ), + Display::getMdiIcon(ActionIcon::EDIT, 'ch-tool-icon-disabled', null, ICON_SIZE_TINY, get_lang('Question edition is not available because the question has been already answered. However, you can copy and modify it.')), ['class' => 'btn btn--plain btn-sm'] ) : Display::url( - Display::return_icon( - 'edit.png', - get_lang('Edit'), - [], - ICON_SIZE_TINY - ), + Display::getMdiIcon(ActionIcon::EDIT, 'ch-tool-icon', null, ICON_SIZE_TINY, get_lang('Edit')), api_get_self().'?'.api_get_cidreq().'&' .http_build_query([ 'type' => $objQuestionTmp->selectType(), @@ -231,12 +217,7 @@ if (!$inATest) { $delete_link = null; if (true == $objExercise->edit_exercise_in_lp) { $delete_link = Display::url( - Display::return_icon( - 'delete.png', - get_lang('Remove from test'), - [], - ICON_SIZE_TINY - ), + Display::getMdiIcon(ActionIcon::DELETE, 'ch-tool-icon', null, ICON_SIZE_TINY, get_lang('Remove from test')), api_get_self().'?'.api_get_cidreq().'&' .http_build_query([ 'id' => $exerciseId, diff --git a/public/main/exercise/question_pool.php b/public/main/exercise/question_pool.php index 4fcab9dbc1..c02db6afb8 100644 --- a/public/main/exercise/question_pool.php +++ b/public/main/exercise/question_pool.php @@ -5,6 +5,8 @@ use Chamilo\CoreBundle\Entity\ExtraField as ExtraFieldEntity; use Chamilo\CoreBundle\Framework\Container; use ChamiloSession as Session; use Knp\Component\Pager\Paginator; +use Chamilo\CoreBundle\Component\Utils\ActionIcon; +use Chamilo\CoreBundle\Component\Utils\ObjectIcon; /** * Question Pool @@ -1027,12 +1029,12 @@ Display::display_header($nameTools, 'Exercise'); $actions = ''; if (isset($fromExercise) && $fromExercise > 0) { $actions .= ''. - Display::return_icon('back.png', get_lang('Go back to the questions list'), '', ICON_SIZE_MEDIUM).''; + Display::getMdiIcon(ActionIcon::BACK, 'ch-tool-icon', null, ICON_SIZE_MEDIUM, get_lang('Go back to the questions list')).''; } else { $actions .= ''. - Display::return_icon('back.png', get_lang('BackToTestsList'), '', ICON_SIZE_MEDIUM).''; + Display::getMdiIcon(ActionIcon::BACK, 'ch-tool-icon', null, ICON_SIZE_MEDIUM, get_lang('BackToTestsList')).''; $actions .= "". - Display::return_icon('add_question.gif', get_lang('New question'), '', ICON_SIZE_MEDIUM).''; + Display::getMdiIcon(ActionIcon::ADD, 'ch-tool-icon', null, ICON_SIZE_MEDIUM, get_lang('New question')).''; } echo Display::toolbarAction('toolbar', [$actions]); @@ -1182,7 +1184,7 @@ function getLinkForQuestion( if ($in_addA) { $sessionIcon = ''; if (!empty($sessionId) && -1 != $sessionId) { - $sessionIcon = ' '.Display::return_icon('star.png', get_lang('Session')); + $sessionIcon = ' '.Display::getMdiIcon(ObjectIcon::STAR, 'ch-tool-icon', null, ICON_SIZE_SMALL, get_lang('Session')); } $exerciseId = (int) $exerciseId; $questionId = (int) $questionId; @@ -1237,11 +1239,11 @@ function get_action_icon_for_question( } if (isQuestionInActiveQuiz($in_questionid)) { - $res = Display::return_icon('delete_na.png', get_lang('ThisQuestionExistsInAnotherExercisesWarning')); + $res = Display::getMdiIcon(ActionIcon::DELETE, 'ch-tool-icon-disabled', null, ICON_SIZE_SMALL, get_lang('ThisQuestionExistsInAnotherExercisesWarning')); } else { $res = ""; - $res .= Display::return_icon('delete.png', get_lang('Delete')); + $res .= Display::getMdiIcon(ActionIcon::DELETE, 'ch-tool-icon', null, ICON_SIZE_SMALL, get_lang('Delete')); $res .= ""; } @@ -1252,7 +1254,7 @@ function get_action_icon_for_question( $from_exercise, $in_questionid, $in_questiontype, - Display::return_icon('edit.png', get_lang('Edit')), + Display::getMdiIcon(ActionIcon::EDIT, 'ch-tool-icon', null, ICON_SIZE_SMALL, get_lang('Edit')), $in_session_id, $in_exercise_id ); @@ -1263,7 +1265,7 @@ function get_action_icon_for_question( if (!$myObjEx->hasQuestion($in_questionid)) { $res = ""; - $res .= Display::return_icon('view_more_stats.gif', get_lang('InsertALinkToThisQuestionInTheExercise')); + $res .= Display::getMdiIcon(ActionIcon::VIEW_DETAILS, 'ch-tool-icon', null, ICON_SIZE_SMALL, get_lang('InsertALinkToThisQuestionInTheExercise')); $res .= ''; } @@ -1272,7 +1274,7 @@ function get_action_icon_for_question( $url = api_get_self().'?'.api_get_cidreq().$getParams. "&question_copy=$in_questionid&course_id=$in_selected_course&fromExercise=$from_exercise"; $res = Display::url( - Display::return_icon('cd.png', get_lang('Re-use a copy inside the current test')), + Display::getMdiIcon(ActionIcon::COPY_CONTENT, 'ch-tool-icon', null, ICON_SIZE_SMALL, get_lang('Re-use a copy inside the current test')), $url ); diff --git a/public/main/exercise/result.php b/public/main/exercise/result.php index ec5a6317cf..25a9851c43 100644 --- a/public/main/exercise/result.php +++ b/public/main/exercise/result.php @@ -3,6 +3,7 @@ /* For licensing terms, see /license.txt */ use ChamiloSession as Session; +use Chamilo\CoreBundle\Component\Utils\ActionIcon; /** * Shows the exercise results. @@ -84,7 +85,7 @@ if ($show_headers) { if ('mobileapp' === $origin) { $actions = ''. - Display::return_icon('back.png', get_lang('GoBackToQuestionList'), [], 32).''; + Display::getMdiIcon(ActionIcon::BACK, 'ch-tool-icon', null, ICON_SIZE_MEDIUM, get_lang('GoBackToQuestionList')).''; echo Display::toolbarAction('toolbar', [$actions]); } } diff --git a/public/main/exercise/stats.php b/public/main/exercise/stats.php index 043771e8a3..1c32a116a5 100644 --- a/public/main/exercise/stats.php +++ b/public/main/exercise/stats.php @@ -2,6 +2,8 @@ /* See license terms in /license.txt */ +use Chamilo\CoreBundle\Component\Utils\ActionIcon; + require_once __DIR__.'/../inc/global.inc.php'; $this_section = SECTION_COURSES; @@ -332,15 +334,10 @@ $interbreadcrumb[] = [ $tpl = new Template(get_lang('Report by question')); $actions = ''. - Display:: return_icon( - 'back.png', - get_lang('Go back to the questions list'), - '', - ICON_SIZE_MEDIUM - ) + Display::getMdiIcon(ActionIcon::BACK, 'ch-tool-icon', null, ICON_SIZE_MEDIUM, get_lang('Go back to the questions list')) .''; $actions .= Display::url( - Display::return_icon('pdf.png', get_lang('ExportToPDF'), [], ICON_SIZE_MEDIUM), + Display::getMdiIcon(ActionIcon::EXPORT_PDF, 'ch-tool-icon', null, ICON_SIZE_MEDIUM, get_lang('ExportToPDF')), 'stats.php?exerciseId='.$exerciseId.'&export_pdf=1&'.api_get_cidreq() ); $actions = Display::toolbarAction('exercise_report', [$actions]); diff --git a/public/main/exercise/tests_category.php b/public/main/exercise/tests_category.php index 3607c96fbd..39cf240634 100644 --- a/public/main/exercise/tests_category.php +++ b/public/main/exercise/tests_category.php @@ -2,6 +2,8 @@ /* For licensing terms, see /license.txt */ +use Chamilo\CoreBundle\Component\Utils\ActionIcon; + require_once __DIR__.'/../inc/global.inc.php'; /** @@ -254,18 +256,18 @@ function add_category_form($action) function displayActionBar() { $actions = ''. - Display::return_icon('back.png', get_lang('Go back to the questions list'), '', ICON_SIZE_MEDIUM).''; + Display::getMdiIcon(ActionIcon::BACK, 'ch-tool-icon', null, ICON_SIZE_MEDIUM, get_lang('Go back to the questions list')).''; $actions .= ''. - Display::return_icon('new_folder.png', get_lang('Add category'), null, ICON_SIZE_MEDIUM).''; + Display::getMdiIcon(ActionIcon::CREATE_FOLDER, 'ch-tool-icon', null, ICON_SIZE_MEDIUM, get_lang('Add category')).''; $actions .= Display::url( - Display::return_icon('export_csv.png', get_lang('CSV export'), [], ICON_SIZE_MEDIUM), + Display::getMdiIcon(ActionIcon::EXPORT_CSV, 'ch-tool-icon', null, ICON_SIZE_MEDIUM, get_lang('CSV export')), api_get_self().'?action=export_category&'.api_get_cidreq() ); $actions .= Display::url( - Display::return_icon('import_csv.png', get_lang('Import from a CSV'), [], ICON_SIZE_MEDIUM), + Display::getMdiIcon(ActionIcon::IMPORT_ARCHIVE, 'ch-tool-icon', null, ICON_SIZE_MEDIUM, get_lang('Import from a CSV')), api_get_self().'?action=import_category&'.api_get_cidreq() ); diff --git a/public/main/exercise/upload_exercise.php b/public/main/exercise/upload_exercise.php index 1559157b7c..1631f10352 100644 --- a/public/main/exercise/upload_exercise.php +++ b/public/main/exercise/upload_exercise.php @@ -3,6 +3,7 @@ /* For licensing terms, see /license.txt */ use ChamiloSession as Session; +use Chamilo\CoreBundle\Component\Utils\ActionIcon; /** * Upload quiz: This script shows the upload quiz feature. @@ -45,12 +46,7 @@ lp_upload_quiz_main(); function lp_upload_quiz_actions() { return ''. - Display::return_icon( - 'back.png', - get_lang('BackToTestsList'), - '', - ICON_SIZE_MEDIUM - ).''; + Display::getMdiIcon(ActionIcon::BACK, 'ch-tool-icon', null, ICON_SIZE_MEDIUM, get_lang('BackToTestsList')).''; } function lp_upload_quiz_main() @@ -67,7 +63,7 @@ function lp_upload_quiz_main() $form->addElement('header', get_lang('Import quiz from Excel')); $form->addElement('file', 'user_upload_quiz', get_lang('File upload')); - $label = Display::return_icon('export_excel.png', get_lang('Download the Excel Template')). + $label = Display::getMdiIcon(ActionIcon::EXPORT_SPREADSHEET, 'ch-tool-icon', null, ICON_SIZE_SMALL, get_lang('Download the Excel Template')). get_lang('Download the Excel Template'); $link = ''.$label.''; $form->addElement('label', '', $link); diff --git a/public/main/glossary/index.php b/public/main/glossary/index.php index 9220140929..7c164fac83 100644 --- a/public/main/glossary/index.php +++ b/public/main/glossary/index.php @@ -5,6 +5,7 @@ use Chamilo\CoreBundle\Framework\Container; use Chamilo\CourseBundle\Entity\CGlossary; use ChamiloSession as Session; +use Chamilo\CoreBundle\Component\Utils\ActionIcon; /** * @author Christian Fasanando, initial version @@ -127,7 +128,7 @@ switch ($action) { 'add_glossary', [ 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')), api_get_self().'?'.api_get_cidreq() ), ] @@ -225,7 +226,7 @@ switch ($action) { 'edit_glossary', [ 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')), api_get_self().'?'.api_get_cidreq() ), ] diff --git a/public/main/gradebook/gradebook_display_certificate.php b/public/main/gradebook/gradebook_display_certificate.php index 41b904257b..d306949f4a 100644 --- a/public/main/gradebook/gradebook_display_certificate.php +++ b/public/main/gradebook/gradebook_display_certificate.php @@ -3,6 +3,8 @@ /* For licensing terms, see /license.txt */ use Chamilo\CoreBundle\Framework\Container; +use Chamilo\CoreBundle\Component\Utils\ActionIcon; +use Chamilo\CoreBundle\Component\Utils\ObjectIcon; require_once __DIR__.'/../inc/global.inc.php'; $current_course_tool = TOOL_GRADEBOOK; @@ -272,11 +274,11 @@ if (!empty($cats)) { $actions = ''; $actions .= Display::url( - Display::return_icon('tuning.png', get_lang('Generate certificates'), [], ICON_SIZE_MEDIUM), + Display::getMdiIcon(ObjectIcon::CERTIFICATE, 'ch-tool-icon', null, ICON_SIZE_MEDIUM, get_lang('Generate certificates')), $url.'&action=generate_all_certificates' ); $actions .= Display::url( - Display::return_icon('delete.png', get_lang('Delete all certificates'), [], ICON_SIZE_MEDIUM), + Display::getMdiIcon(ActionIcon::DELETE, 'ch-tool-icon', null, ICON_SIZE_MEDIUM, get_lang('Delete all certificates')), $url.'&action=delete_all_certificates' ); @@ -284,19 +286,19 @@ $hideCertificateExport = api_get_setting('hide_certificate_export_link'); if (count($certificate_list) > 0 && 'true' !== $hideCertificateExport) { $actions .= Display::url( - Display::return_icon('pdf.png', get_lang('Export all certificates to PDF'), [], ICON_SIZE_MEDIUM), + Display::getMdiIcon(ActionIcon::EXPORT_PDF, 'ch-tool-icon', null, ICON_SIZE_MEDIUM, get_lang('Export all certificates to PDF')), $url.'&action=export_all_certificates' ); if ($allowCustomCertificate) { $actions .= Display::url( - Display::return_icon('file_zip.png', get_lang('ExportAllCertificatesToZIP'), [], ICON_SIZE_MEDIUM), + Display::getMdiIcon(ActionIcon::EXPORT_ARCHIVE, 'ch-tool-icon', null, ICON_SIZE_MEDIUM, get_lang('ExportAllCertificatesToZIP')), $url.'&action=export_all_certificates_zip' ); } $actions .= Display::url( - Display::return_icon('notification_mail.png', get_lang('Send messageCertificateNotifications'), [], ICON_SIZE_MEDIUM), + Display::getMdiIcon(ActionIcon::SEND_MESSAGE, 'ch-tool-icon', null, ICON_SIZE_MEDIUM, get_lang('Send messageCertificateNotifications')), $url.'&action=show_notification_form' ); } @@ -336,14 +338,14 @@ if (0 == count($certificate_list)) { $url .= '&action=export'; $pdf = Display::url( - Display::return_icon('pdf.png', get_lang('Download')), + Display::getMdiIcon(ActionIcon::EXPORT_PDF, 'ch-tool-icon', null, ICON_SIZE_SMALL, get_lang('Download')), $url, ['target' => '_blank'] ); echo $pdf.PHP_EOL; echo ' - '.Display::return_icon('delete.png', get_lang('Delete')).' + '.Display::getMdiIcon(ActionIcon::DELETE, 'ch-tool-icon', null, ICON_SIZE_MEDIUM, get_lang('Delete')).' '.PHP_EOL; echo ''; } diff --git a/public/main/gradebook/gradebook_edit_all.php b/public/main/gradebook/gradebook_edit_all.php index aa03bf7e7e..a5beda3c9c 100644 --- a/public/main/gradebook/gradebook_edit_all.php +++ b/public/main/gradebook/gradebook_edit_all.php @@ -5,6 +5,8 @@ /** * @author Julio Montoya - fixes in order to use gradebook models + some code cleaning */ +use Chamilo\CoreBundle\Component\Utils\ActionIcon; + require_once __DIR__.'/../inc/global.inc.php'; $this_section = SECTION_COURSES; $current_course_tool = TOOL_GRADEBOOK; @@ -280,11 +282,12 @@ if (!isset($_GET['exportpdf']) && !isset($_GET['export_certificate'])) { } $actions = ' - '.Display::return_icon( - 'back.png', - get_lang('Assessment home'), - '', - ICON_SIZE_MEDIUM + '.Display::getMdiIcon( + ActionIcon::BACK, + 'ch-tool-icon', + null, + ICON_SIZE_MEDIUM, + get_lang('Assessment home') ).' '; diff --git a/public/main/gradebook/gradebook_view_result.php b/public/main/gradebook/gradebook_view_result.php index a31a6718e4..ba4f627be6 100644 --- a/public/main/gradebook/gradebook_view_result.php +++ b/public/main/gradebook/gradebook_view_result.php @@ -2,6 +2,8 @@ /* For licensing terms, see /license.txt */ +use Chamilo\CoreBundle\Component\Utils\ActionIcon; + require_once __DIR__.'/../inc/global.inc.php'; require_once __DIR__.'/lib/fe/exportgradebook.php'; @@ -147,11 +149,12 @@ if (isset($_GET['action'])) { Display::display_header(); $items[] = [ 'url' => $backUrl, - 'content' => Display::return_icon( - 'back.png', - get_lang('Back'), - [], - ICON_SIZE_MEDIUM + 'content' => Display::getMdiIcon( + ActionIcon::BACK, + 'ch-tool-icon', + null, + ICON_SIZE_MEDIUM, + get_lang('Back') ), ]; echo Display::actions($items); diff --git a/public/main/gradebook/lib/be/category.class.php b/public/main/gradebook/lib/be/category.class.php index 85af8c026c..487c62e742 100644 --- a/public/main/gradebook/lib/be/category.class.php +++ b/public/main/gradebook/lib/be/category.class.php @@ -5,6 +5,7 @@ use Chamilo\CoreBundle\Entity\Course; use Chamilo\CoreBundle\Entity\GradebookCategory; use ChamiloSession as Session; +use Chamilo\CoreBundle\Component\Utils\ActionIcon; /** * Class Category @@ -2143,12 +2144,7 @@ class Category implements GradebookItem ); $exportToPDF = Display::url( - Display::return_icon( - 'pdf.png', - get_lang('Export to PDF'), - [], - ICON_SIZE_MEDIUM - ), + Display::getMdiIcon(ActionIcon::EXPORT_PDF, 'ch-tool-icon', null, ICON_SIZE_MEDIUM, get_lang('Export to PDF')), "$url&action=export" ); diff --git a/public/main/gradebook/lib/fe/dataform.class.php b/public/main/gradebook/lib/fe/dataform.class.php index a012adf355..72833e1410 100644 --- a/public/main/gradebook/lib/fe/dataform.class.php +++ b/public/main/gradebook/lib/fe/dataform.class.php @@ -2,6 +2,8 @@ /* For licensing terms, see /license.txt */ +use Chamilo\CoreBundle\Component\Utils\ActionIcon; + /** * Extends FormValidator with import and export forms. * @@ -90,7 +92,7 @@ class DataForm extends FormValidator $this->addElement( 'radio', 'file_type', - Display::return_icon('info3.gif', get_lang('To export, you must lock the evaluation.')), + Display::getMdiIcon(ActionIcon::VIEW_DETAILS, 'ch-tool-icon', null, ICON_SIZE_SMALL, get_lang('To export, you must lock the evaluation.')), 'PDF (Portable Document Format)', 'pdf', ['disabled'] diff --git a/public/main/gradebook/lib/fe/flatviewtable.class.php b/public/main/gradebook/lib/fe/flatviewtable.class.php index cc3b00e71a..41c783a148 100644 --- a/public/main/gradebook/lib/fe/flatviewtable.class.php +++ b/public/main/gradebook/lib/fe/flatviewtable.class.php @@ -6,6 +6,7 @@ set_time_limit(0); use CpChart\Cache as pCache; use CpChart\Data as pData; use CpChart\Image as pImage; +use Chamilo\CoreBundle\Component\Utils\ActionIcon; /** * Class FlatViewTable @@ -349,19 +350,21 @@ class FlatViewTable extends SortableTable .'?selectcat='.Security::remove_XSS($_GET['selectcat']) .'&offset='.(($this->offset) - GRADEBOOK_ITEM_LIMIT) .(isset($_GET['search']) ? '&search='.Security::remove_XSS($_GET['search']) : '').'">' - .Display::return_icon( - 'action_prev.png', - get_lang('Previous page'), - [], - ICON_SIZE_MEDIUM + .Display::getMdiIcon( + ActionIcon::PREVIOUS, + 'ch-tool-icon', + null, + ICON_SIZE_MEDIUM, + get_lang('Previous page') ) .''; } else { - $header .= Display::return_icon( - 'action_prev_na.png', - get_lang('Previous page'), - [], - ICON_SIZE_MEDIUM + $header .= Display::getMdiIcon( + ActionIcon::PREVIOUS, + 'ch-tool-icon-disabled', + null, + ICON_SIZE_MEDIUM, + get_lang('Previous page') ); } $header .= ' '; @@ -374,14 +377,15 @@ class FlatViewTable extends SortableTable .'?selectcat='.Security::remove_XSS($_GET['selectcat']) .'&offset='.($this->offset + GRADEBOOK_ITEM_LIMIT) .(isset($_GET['search']) ? '&search='.Security::remove_XSS($_GET['search']) : '').'">' - .Display::return_icon('action_next.png', get_lang('Next page'), [], ICON_SIZE_MEDIUM) + .Display::getMdiIcon(ActionIcon::NEXT, 'ch-tool-icon', null, ICON_SIZE_MEDIUM, get_lang('Next page')) .''; } else { - $header .= Display::return_icon( - 'action_next_na.png', - get_lang('Next page'), - [], - ICON_SIZE_MEDIUM + $header .= Display::getMdiIcon( + ActionIcon::NEXT, + 'ch-tool-icon-disabled', + null, + ICON_SIZE_MEDIUM, + get_lang('Next page') ); } $header .= ''; diff --git a/public/main/gradebook/lib/fe/gradebooktable.class.php b/public/main/gradebook/lib/fe/gradebooktable.class.php index 679bb71d86..122c285698 100644 --- a/public/main/gradebook/lib/fe/gradebooktable.class.php +++ b/public/main/gradebook/lib/fe/gradebooktable.class.php @@ -3,6 +3,7 @@ /* For licensing terms, see license.txt */ use Chamilo\CoreBundle\Component\Utils\ActionIcon; +use Chamilo\CoreBundle\Component\Utils\StateIcon; use ChamiloSession as Session; use CpChart\Cache as pCache; use CpChart\Data as pData; @@ -694,8 +695,11 @@ class GradebookTable extends SortableTable ] ); } else { - $label = Display::return_icon( - 'warning.png', + $label = Display::getMdiIcon( + StateIcon::WARNING, + 'ch-tool-icon', + null, + ICON_SIZE_SMALL, sprintf(get_lang('The sum of all weights of activities must be %s'), $categoryWeight) ); $total = Display::label($totalWeight.' / '.$categoryWeight, 'warning'); diff --git a/public/main/gradebook/lib/fe/resulttable.class.php b/public/main/gradebook/lib/fe/resulttable.class.php index de7abf450f..b66a7fffa5 100644 --- a/public/main/gradebook/lib/fe/resulttable.class.php +++ b/public/main/gradebook/lib/fe/resulttable.class.php @@ -1,6 +1,9 @@ evaluation->get_id().'&'.api_get_cidreq().'">'. - Display::return_icon('edit.png', get_lang('Edit'), '', '22').''; + Display::getMdiIcon(ActionIcon::EDIT, 'ch-tool-icon', null, ICON_SIZE_SMALL, get_lang('Edit')).''; } } else { $editColumn .= ''. - Display::return_icon('edit.png', get_lang('Edit'), '', '22').''; + Display::getMdiIcon(ActionIcon::EDIT, 'ch-tool-icon', null, ICON_SIZE_SMALL, get_lang('Edit')).''; } $editColumn .= ' '. - Display::return_icon('delete.png', get_lang('Delete'), '', '22').''; + Display::getMdiIcon(ActionIcon::DELETE, 'ch-tool-icon', null, ICON_SIZE_SMALL, get_lang('Delete')).''; } if (null == $this->evaluation->get_course_code()) { $editColumn .= ' '; - $editColumn .= Display::return_icon('delete.png', get_lang('Delete')); + $editColumn .= Display::getMdiIcon(ActionIcon::DELETE, 'ch-tool-icon', null, ICON_SIZE_SMALL, get_lang('Delete')); $editColumn .= ''; $editColumn .= ' '; - $editColumn .= Display::return_icon('statistics.gif', get_lang('Statistics')); + $editColumn .= Display::getMdiIcon(ToolIcon::TRACKING, 'ch-tool-icon', null, ICON_SIZE_SMALL, get_lang('Statistics')); $editColumn .= ''; } @@ -266,7 +269,7 @@ class ResultTable extends SortableTable if (null != $doc_url) { $editColumn .= ' '; - $editColumn .= Display::return_icon('link.gif', get_lang('Open document')).''; + $editColumn .= Display::getMdiIcon(ToolIcon::LINK, 'ch-tool-icon', null, ICON_SIZE_SMALL, get_lang('Open document')).''; } } diff --git a/public/main/gradebook/user_stats.php b/public/main/gradebook/user_stats.php index f4391343a3..e323c40c9f 100644 --- a/public/main/gradebook/user_stats.php +++ b/public/main/gradebook/user_stats.php @@ -2,6 +2,8 @@ /* For licensing terms, see /license.txt */ +use Chamilo\CoreBundle\Component\Utils\ActionIcon; + require_once __DIR__.'/../inc/global.inc.php'; api_block_anonymous_users(); @@ -105,11 +107,12 @@ if (!empty($categoryId)) { 'name' => get_lang('List View'), ]; $actions .= ''. - Display::return_icon( - 'back.png', - get_lang('Back to').' '.get_lang('List View'), - '', - ICON_SIZE_MEDIUM + Display::getMdiIcon( + ActionIcon::BACK, + 'ch-tool-icon', + null, + ICON_SIZE_MEDIUM, + get_lang('Back to').' '.get_lang('List View') ). ''; } @@ -120,11 +123,11 @@ if (!empty($evaluationId)) { 'name' => get_lang('Assessment details'), ]; $actions .= ' - '.Display::return_icon('back.png', get_lang('Back toScore'), '', ICON_SIZE_MEDIUM).''; + '.Display::getMdiIcon(ActionIcon::BACK, 'ch-tool-icon', null, ICON_SIZE_MEDIUM, get_lang('Back toScore')).''; } $actions .= ' -'.Display::return_icon('pdf.png', get_lang('Export to PDF'), '', ICON_SIZE_MEDIUM).''; +'.Display::getMdiIcon(ActionIcon::EXPORT_PDF, 'ch-tool-icon', null, ICON_SIZE_MEDIUM, get_lang('Export to PDF')).''; $actions .= '
'; diff --git a/public/main/help/faq.php b/public/main/help/faq.php index 0803d437a4..2638714cea 100644 --- a/public/main/help/faq.php +++ b/public/main/help/faq.php @@ -4,13 +4,15 @@ /** * This script displays a help window. */ +use Chamilo\CoreBundle\Component\Utils\ActionIcon; + require_once __DIR__.'/../inc/global.inc.php'; $help_name = isset($_GET['open']) ? Security::remove_XSS($_GET['open']) : null; Display::display_header(get_lang('Frequently Asked Question')); if (api_is_platform_admin()) { - echo ' '.Display::return_icon('edit.png').''; + echo ' '.Display::getMdiIcon(ActionIcon::EDIT, 'ch-tool-icon', null, ICON_SIZE_SMALL).''; } echo Display::page_header(get_lang('Frequently Asked Question')); diff --git a/public/main/inc/ajax/course_home.ajax.php b/public/main/inc/ajax/course_home.ajax.php index 4596267a2e..a8768d4cc0 100644 --- a/public/main/inc/ajax/course_home.ajax.php +++ b/public/main/inc/ajax/course_home.ajax.php @@ -6,6 +6,8 @@ /** * Responses to AJAX calls. */ +use Chamilo\CoreBundle\Component\Utils\ObjectIcon; + $action = $_GET['a']; switch ($action) { @@ -105,17 +107,17 @@ switch ($action) { if (empty($lp_item['modified_on'])) { $lp_date = api_get_local_time($lp_item['created_on']); - $image = 'new.gif'; + $image = ObjectIcon::STAR; $label = get_lang('Course added'); } else { $lp_date = api_get_local_time($lp_item['modified_on']); - $image = 'moderator_star.png'; + $image = ObjectIcon::STAR_EMPTY; $label = get_lang('Learning path updated'); } $icons = ''; if (strtotime($last_date) < strtotime($lp_date)) { - $icons = Display::return_icon($image, get_lang('Since your latest visit').': '.$label.' - '.$lp_date); + $icons = Display::getMdiIcon($image, 'ch-tool-icon', null, ICON_SIZE_SMALL, get_lang('Since your latest visit').': '.$label.' - '.$lp_date); } if (!empty($lp_item['published_on'])) { @@ -252,7 +254,7 @@ switch ($action) { } if (strtotime($last_date) < strtotime($lp_date)) { - $icons = Display::return_icon($image, get_lang('Since your latest visit').': '.$label.' - '.$lp_date); + $icons = Display::getMdiIcon($image, 'ch-tool-icon', null, ICON_SIZE_SMALL, get_lang('Since your latest visit').': '.$label.' - '.$lp_date); } if (!empty($lp_item['published_on'])) { @@ -391,7 +393,7 @@ switch ($action) { } $icons = ''; if (strtotime($last_date) < strtotime($lp_date)) { - $icons = Display::return_icon($image, get_lang('Since your latest visit').': '.$label.' - '.$lp_date); + $icons = Display::getMdiIcon($image, 'ch-tool-icon', null, ICON_SIZE_SMALL, get_lang('Since your latest visit').': '.$label.' - '.$lp_date); } if (!empty($lp_item['published_on'])) { $date = substr($lp_item['published_on'], 0, 10); diff --git a/public/main/inc/ajax/dropbox.ajax.php b/public/main/inc/ajax/dropbox.ajax.php index 44203d7733..a61f368852 100644 --- a/public/main/inc/ajax/dropbox.ajax.php +++ b/public/main/inc/ajax/dropbox.ajax.php @@ -4,6 +4,8 @@ /** * Responses to AJAX calls for the document upload. */ +use Chamilo\CoreBundle\Component\Utils\StateIcon; + require_once __DIR__.'/../global.inc.php'; require_once api_get_path(SYS_CODE_PATH).'dropbox/dropbox_functions.inc.php'; @@ -61,13 +63,19 @@ switch ($action) { $json['url'] = api_get_path(WEB_CODE_PATH).'dropbox/index.php?'.api_get_cidreq(); $json['size'] = format_file_size($result->filesize); $json['type'] = api_htmlentities($file['type']); - $json['result'] = Display::return_icon( - 'accept.png', + $json['result'] = Display::getMdiIcon( + StateIcon::COMPLETE, + 'ch-tool-icon', + null, + ICON_SIZE_SMALL, get_lang('Uploaded.') ); } else { - $json['result'] = Display::return_icon( - 'exclamation.png', + $json['result'] = Display::getMdiIcon( + StateIcon::WARNING, + 'ch-tool-icon', + null, + ICON_SIZE_SMALL, get_lang('Error') ); } diff --git a/public/main/inc/ajax/link.ajax.php b/public/main/inc/ajax/link.ajax.php index 5e85e561f3..6706fb397f 100644 --- a/public/main/inc/ajax/link.ajax.php +++ b/public/main/inc/ajax/link.ajax.php @@ -4,6 +4,8 @@ /** * Responses to AJAX calls. */ +use Chamilo\CoreBundle\Component\Utils\StateIcon; + require_once __DIR__.'/../global.inc.php'; api_protect_course_script(true); @@ -17,18 +19,20 @@ switch ($action) { $result = \Link::checkUrl($url); if ($result) { - echo Display::return_icon( - 'check-circle.png', - get_lang('Validate'), + echo Display::getMdiIcon( + StateIcon::COMPLETE, + 'ch-tool-icon', null, - ICON_SIZE_TINY + ICON_SIZE_TINY, + get_lang('Validate') ); } else { - echo Display::return_icon( - 'closed-circle.png', - get_lang('Wrong'), + echo Display::getMdiIcon( + StateIcon::WARNING, + 'ch-tool-icon', null, - ICON_SIZE_TINY + ICON_SIZE_TINY, + get_lang('Wrong') ); } } diff --git a/public/main/inc/ajax/model.ajax.php b/public/main/inc/ajax/model.ajax.php index ae7399d2eb..2a0bdc8028 100644 --- a/public/main/inc/ajax/model.ajax.php +++ b/public/main/inc/ajax/model.ajax.php @@ -4,6 +4,10 @@ use Chamilo\CoreBundle\Framework\Container; use ChamiloSession as Session; +use Chamilo\CoreBundle\Component\Utils\ActionIcon; +use Chamilo\CoreBundle\Component\Utils\ToolIcon; +use Chamilo\CoreBundle\Component\Utils\ObjectIcon; +use Chamilo\CoreBundle\Component\Utils\StateIcon; require_once __DIR__.'/../global.inc.php'; @@ -1861,7 +1865,7 @@ switch ($action) { $result = []; if (!empty($sessions)) { - $pdfIcon = Display::return_icon('pdf.png', get_lang('CertificateOfAchievement'), [], ICON_SIZE_SMALL); + $pdfIcon = Display::getMdiIcon(ActionIcon::EXPORT_PDF, 'ch-tool-icon', null, ICON_SIZE_SMALL, get_lang('CertificateOfAchievement')); foreach ($sessions as $session) { $sessionEntity = api_get_session_entity($session['id']); if (api_drh_can_access_all_session_content()) { @@ -1904,11 +1908,11 @@ switch ($action) { ['target' => '_blank'] ); $detailButtons[] = Display::url( - Display::return_icon('works.png', get_lang('WorksReport')), + Display::getMdiIcon(ObjectIcon::ASSIGNMENT, 'ch-tool-icon', null, ICON_SIZE_SMALL, get_lang('WorksReport')), api_get_path(WEB_CODE_PATH).'my_space/works_in_session_report.php?session='.$session['id'] ); $detailButtons[] = Display::url( - Display::return_icon('2rightarrow.png'), + Display::getMdiIcon(ActionIcon::VIEW_DETAILS, 'ch-tool-icon', null, ICON_SIZE_SMALL,), api_get_path(WEB_CODE_PATH).'my_space/course.php?sid='.$session['id'] ); @@ -2259,19 +2263,21 @@ switch ($action) { ); if (!empty($item['certif_min_score']) && !empty($item['document_id'])) { - $item['certificates'] = Display::return_icon( - 'accept.png', - get_lang('With Certificate'), - [], - ICON_SIZE_SMALL + $item['certificates'] = Display::getMdiIcon( + StateIcon::COMPLETE, + 'ch-tool-icon', + null, + ICON_SIZE_SMALL, + get_lang('With Certificate') ); $item['has_certificates'] = '1'; } else { - $item['certificates'] = Display::return_icon( - 'warning.png', - get_lang('No certificate'), - [], - ICON_SIZE_SMALL + $item['certificates'] = Display::getMdiIcon( + StateIcon::WARNING, + 'ch-tool-icon', + null, + ICON_SIZE_SMALL, + get_lang('No certificate') ); $item['has_certificates'] = '0'; } @@ -2390,12 +2396,18 @@ switch ($action) { $result = $obj->getAllGrid($sidx, $sord, $start, $limit); $new_result = []; if (!empty($result)) { - $checkIcon = Display::return_icon( - 'check-circle.png', + $checkIcon = Display::getMdiIcon( + ActionIcon::ACCEPT, + 'ch-tool-icon', + null, + ICON_SIZE_SMALL, get_lang('Yes') ); - $timesIcon = Display::return_icon( - 'closed-circle.png', + $timesIcon = Display::getMdiIcon( + ActionIcon::REJECT, + 'ch-tool-icon', + null, + ICON_SIZE_SMALL, get_lang('No') ); foreach ($result as $item) { @@ -2569,11 +2581,11 @@ switch ($action) { )) { $url = 'class.php?action=remove_class_from_course&id='.$group['id'].'&'.api_get_cidreq( ).'&id_session='.api_get_session_id(); - $icon = Display::return_icon('delete.png', get_lang('Remove')); + $icon = Display::getMdiIcon(ActionIcon::DELETE, 'ch-tool-icon', null, ICON_SIZE_SMALL, get_lang('Remove')); } else { $url = 'class.php?action=add_class_to_course&id='.$group['id'].'&'.api_get_cidreq( ).'&type=not_registered'; - $icon = Display::return_icon('add.png', get_lang('Add')); + $icon = Display::getMdiIcon(ActionIcon::ADD, 'ch-tool-icon', null, ICON_SIZE_SMALL, get_lang('Add')); } switch ($group['group_type']) { @@ -2592,7 +2604,7 @@ switch ($action) { if ($isAllow) { if ($obj->allowTeachers() && $group['author_id'] == $currentUserId) { $group['actions'] .= Display::url( - Display::return_icon('statistics.png', get_lang('Statistics')), + Display::getMdiIcon(ToolIcon::TRACKING, 'ch-tool-icon', null, ICON_SIZE_SMALL, get_lang('Statistics')), $urlUserGroup.'&id='.$group['id'] ).' '; } diff --git a/public/main/inc/ajax/session.ajax.php b/public/main/inc/ajax/session.ajax.php index aca9b31d9f..726f1f45c1 100644 --- a/public/main/inc/ajax/session.ajax.php +++ b/public/main/inc/ajax/session.ajax.php @@ -3,6 +3,7 @@ /* For licensing terms, see /license.txt */ use Chamilo\CoreBundle\Entity\User; +use Chamilo\CoreBundle\Component\Utils\ActionIcon; /** * Responses to AJAX calls. @@ -329,12 +330,12 @@ switch ($action) { ."
"; $row[] = Display::url( - Display::return_icon('save.png', get_lang('Download')), + Display::getMdiIcon(ActionIcon::SAVE_FORM, 'ch-tool-icon', null, ICON_SIZE_SMALL, get_lang('Download')), $downloadUrl ) .PHP_EOL .Display::url( - Display::return_icon('delete.png', get_lang('Delete')), + Display::getMdiIcon(ActionIcon::DELETE, 'ch-tool-icon', null, ICON_SIZE_SMALL, get_lang('Delete')), $deleteUrl, [ 'class' => 'delete_document', diff --git a/public/main/inc/ajax/work.ajax.php b/public/main/inc/ajax/work.ajax.php index a1266ff5eb..bbe9da689f 100644 --- a/public/main/inc/ajax/work.ajax.php +++ b/public/main/inc/ajax/work.ajax.php @@ -3,6 +3,7 @@ /* For licensing terms, see /license.txt */ use Chamilo\CoreBundle\Framework\Container; +use Chamilo\CoreBundle\Component\Utils\StateIcon; /** * Responses to AJAX calls. @@ -125,8 +126,11 @@ switch ($action) { $json['url'] = $url; $json['size'] = ''; //$json['type'] = api_htmlentities($result['filetype']); - $json['result'] = Display::return_icon( - 'accept.png', + $json['result'] = Display::getMdiIcon( + StateIcon::COMPLETE, + 'ch-tool-icon', + null, + ICON_SIZE_SMALL, get_lang('Uploaded..') ); } else { @@ -200,18 +204,20 @@ switch ($action) { } if (isset($result['url'])) { - $json['result'] = Display::return_icon( - 'accept.png', - get_lang('Uploaded..'), - [], - ICON_SIZE_TINY + $json['result'] = Display::getMdiIcon( + StateIcon::COMPLETE, + 'ch-tool-icon', + null, + ICON_SIZE_TINY, + get_lang('Uploaded..') ); } else { - $json['result'] = Display::return_icon( - 'exclamation.png', - get_lang('Error'), - [], - ICON_SIZE_TINY + $json['result'] = Display::getMdiIcon( + StateIcon::WARNING, + 'ch-tool-icon', + null, + ICON_SIZE_TINY, + get_lang('Error') ); }