diff --git a/public/main/auth/profile.php b/public/main/auth/profile.php index c39d8a0a2b..9da38390e7 100644 --- a/public/main/auth/profile.php +++ b/public/main/auth/profile.php @@ -4,6 +4,7 @@ use Chamilo\CoreBundle\Entity\User; use ChamiloSession as Session; use Chamilo\CoreBundle\Component\Utils\ActionIcon; +use Chamilo\CoreBundle\Component\Utils\ToolIcon; /** * This file displays the user's profile, @@ -661,9 +662,9 @@ if ($allowSocialTool) { if ('true' === api_get_setting('extended_profile')) { if ('true' === api_get_setting('allow_message_tool')) { $actions .= ''. - Display::return_icon('shared_profile.png', get_lang('View shared profile')).''; + Display::getMdiIcon(ToolIcon::SHARED_PROFILE, 'ch-tool-icon', null, ICON_SIZE_SMALL, get_lang('View shared profile')).''; $actions .= ''. - Display::return_icon('inbox.png', get_lang('Messages')).''; + Display::getMdiIcon(ToolIcon::MESSAGE, 'ch-tool-icon', null, ICON_SIZE_SMALL, get_lang('Messages')).''; } $show = isset($_GET['show']) ? '&show='.Security::remove_XSS($_GET['show']) : ''; diff --git a/public/main/calendar/agenda_js.php b/public/main/calendar/agenda_js.php index 3935603fb3..9783a3cb2d 100644 --- a/public/main/calendar/agenda_js.php +++ b/public/main/calendar/agenda_js.php @@ -2,6 +2,8 @@ /* For licensing terms, see /license.txt */ +use Chamilo\CoreBundle\Component\Utils\ActionIcon; + // use anonymous mode when accessing this course tool $use_anonymous = true; $typeList = ['personal', 'course', 'admin', 'platform']; @@ -107,37 +109,19 @@ if ('en' === $region_value) { } $tpl->assign('region_value', $region_value); -$export_icon = Display::return_icon( - 'export.png', - null, - null, - null, - null, - true, - false -); -$export_icon_low = Display::return_icon( - 'export_low_fade.png', - null, - null, - null, - null, - true, - false -); -$export_icon_high = Display::return_icon( - 'export_high_fade.png', - null, - null, - null, - null, - true, - false -); +$export_icon = ActionIcon::EXPORT_ARCHIVE; +$export_icon_low = ActionIcon::EXPORT_ARCHIVE; +$export_icon_high = ActionIcon::EXPORT_ARCHIVE; $tpl->assign( 'export_ical_confidential_icon', - Display::return_icon($export_icon_high, get_lang('Export in iCal format as confidential event')) + Display::getMdiIcon( + $export_icon_high, + 'ch-tool-icon', + null, + ICON_SIZE_SMALL, + get_lang('Export in iCal format as confidential event') + ) ); $actions = $agenda->displayActions('calendar', $userId); diff --git a/public/main/exercise/exercise.class.php b/public/main/exercise/exercise.class.php index 054b5c9f91..eddfc6229f 100644 --- a/public/main/exercise/exercise.class.php +++ b/public/main/exercise/exercise.class.php @@ -8445,10 +8445,10 @@ class Exercise $answerUsed = (int) $array['used']; $answerMissing = (int) $array['missing'] - $answerUsed; for ($i = 1; $i <= $answerUsed; $i++) { - $html .= Display::return_icon('attempt-check.png'); + $html .= Display::getMdiIcon(StateIcon::COMPLETE, 'ch-tool-icon', null, ICON_SIZE_SMALL); } for ($i = 1; $i <= $answerMissing; $i++) { - $html .= Display::return_icon('attempt-nocheck.png'); + $html .= Display::getMdiIcon(StateIcon::INCOMPLETE, 'ch-tool-icon', null, ICON_SIZE_SMALL); } $ribbon = '
' diff --git a/public/main/exercise/exercise_submit.php b/public/main/exercise/exercise_submit.php index c8d9740746..5b797bd799 100644 --- a/public/main/exercise/exercise_submit.php +++ b/public/main/exercise/exercise_submit.php @@ -1299,13 +1299,11 @@ if ($allowBlockCategory && } } } - $saveIcon = Display::return_icon( - 'save.png', - '', - [], - ICON_SIZE_SMALL, - false, - true + $saveIcon = Display::getMdiIcon( + ActionIcon::SAVE_FORM, + 'ch-tool-icon', + null, + ICON_SIZE_SMALL ); $loading = Display::getMdiIcon('loading', 'animate-spin'); diff --git a/public/main/exercise/fill_blanks.class.php b/public/main/exercise/fill_blanks.class.php index 50bf060cb3..f6bd11a9c5 100644 --- a/public/main/exercise/fill_blanks.class.php +++ b/public/main/exercise/fill_blanks.class.php @@ -2,6 +2,8 @@ /* For licensing terms, see /license.txt */ +use Chamilo\CoreBundle\Component\Utils\StateIcon; + /** * Class FillBlanks. * @@ -1221,10 +1223,10 @@ class FillBlanks extends Question } $style = 'feedback-green'; - $iconAnswer = Display::return_icon('attempt-check.png', get_lang('Correct'), null, ICON_SIZE_SMALL); + $iconAnswer = Display::getMdiIcon(StateIcon::COMPLETE, 'ch-tool-icon', null, ICON_SIZE_SMALL, get_lang('Correct')); if (!$right) { $style = 'feedback-red'; - $iconAnswer = Display::return_icon('attempt-nocheck.png', get_lang('Incorrect'), null, ICON_SIZE_SMALL); + $iconAnswer = Display::getMdiIcon(StateIcon::INCOMPLETE, 'ch-tool-icon', null, ICON_SIZE_SMALL, get_lang('Incorrect')); } $correctAnswerHtml = ''; diff --git a/public/main/exercise/hotspot_admin.inc.php b/public/main/exercise/hotspot_admin.inc.php index 5acdb346f3..b7a5e05e91 100644 --- a/public/main/exercise/hotspot_admin.inc.php +++ b/public/main/exercise/hotspot_admin.inc.php @@ -3,6 +3,7 @@ /* For licensing terms, see /license.txt */ use ChamiloSession as Session; +use Chamilo\CoreBundle\Component\Utils\ActionIcon; /** * This script allows to manage answers. It is included from the @@ -563,7 +564,7 @@ if (isset($modifyAnswers)) { Display::tag( 'h3', - get_lang('Question').': '.$questionName.Display::return_icon('info3.gif', strip_tags(get_lang('To create a hotspot: select a shape next to the colour, and draw the hotspot. To move a hotspot, select the colour, click another spot in the image, and draw the hotspot. To add a hotspot: click the Add hotspot button. To close a polygon shape: right click and select Close polygon.'))) + get_lang('Question').': '.$questionName.Display::getMdiIcon(ActionIcon::INFORMATION, 'ch-tool-icon', null, ICON_SIZE_SMALL, strip_tags(get_lang('To create a hotspot: select a shape next to the colour, and draw the hotspot. To move a hotspot, select the colour, click another spot in the image, and draw the hotspot. To add a hotspot: click the Add hotspot button. To close a polygon shape: right click and select Close polygon.'))) ); if (!empty($msgErr)) { diff --git a/public/main/gradebook/lib/GradebookUtils.php b/public/main/gradebook/lib/GradebookUtils.php index dd686d1add..8fe2057921 100644 --- a/public/main/gradebook/lib/GradebookUtils.php +++ b/public/main/gradebook/lib/GradebookUtils.php @@ -2,8 +2,9 @@ /* For licensing terms, see /license.txt */ -use Chamilo\CoreBundle\Component\Utils\ActionIcon; use Chamilo\CoreBundle\Entity\Session; +use Chamilo\CoreBundle\Component\Utils\ActionIcon; +use Chamilo\CoreBundle\Component\Utils\StateIcon; /** * Class GradebookUtils. @@ -229,21 +230,28 @@ class GradebookUtils $modify_icons = null; if (false === $show_message) { - $visibility_icon = (0 == $cat->is_visible()) ? 'invisible' : 'visible'; + $visibility_icon = (0 == $cat->is_visible()) ? ActionIcon::INVISIBLE : ActionIcon::VISIBLE; $visibility_command = (0 == $cat->is_visible()) ? 'set_visible' : 'set_invisible'; $modify_icons .= ''. - Display::return_icon( - 'view_more_stats.gif', - get_lang('Show'), + Display::getMdiIcon( + ActionIcon::VIEW_MORE, + 'ch-tool-icon', '', - ICON_SIZE_SMALL + ICON_SIZE_SMALL, + get_lang('Show') ). ''; if (!api_is_allowed_to_edit(null, true)) { $modify_icons .= Display::url( - Display::getMdiIcon('chart-box', 'ch-tool-icon', null, ICON_SIZE_SMALL, get_lang('List View')), + Display::getMdiIcon( + StateIcon::LIST_VIEW, + 'ch-tool-icon', + null, + ICON_SIZE_SMALL, + get_lang('List View') + ), 'personal_stats.php?'.http_build_query([ 'selectcat' => $cat->get_id(), ]).'&'.api_get_cidreq(), @@ -294,11 +302,12 @@ class GradebookUtils $modify_icons .= ''. Display::getMdiIcon('format-list-text', 'ch-tool-icon', null, ICON_SIZE_SMALL, get_lang('List View')).''; $modify_icons .= ' '. - Display::return_icon( - $visibility_icon.'.png', - get_lang('Visible'), - '', - ICON_SIZE_SMALL + Display::getMdiIcon( + $visibility_icon, + 'ch-tool-icon', + null, + ICON_SIZE_SMALL, + get_lang('Visible') ).''; if ($cat->is_locked() && !api_is_platform_admin()) { @@ -329,7 +338,7 @@ class GradebookUtils $courseParams = api_get_cidreq_params($eval->getCourseId(), $eval->getSessionId()); if (false === $message_eval && api_is_allowed_to_edit(null, true)) { - $visibility_icon = 0 == $eval->is_visible() ? 'invisible' : 'visible'; + $visibility_icon = 0 == $eval->is_visible() ? ActionIcon::INVISIBLE : ActionIcon::VISIBLE; $visibility_command = 0 == $eval->is_visible() ? 'set_visible' : 'set_invisible'; if ($is_locked && !api_is_platform_admin()) { $modify_icons = Display::getMdiIcon(ActionIcon::EDIT, 'ch-tool-icon-disabled', null, ICON_SIZE_SMALL, get_lang('Edit')); @@ -340,28 +349,24 @@ class GradebookUtils } $modify_icons .= ' '. - Display::return_icon( - $visibility_icon.'.png', - get_lang('Visible'), - '', - ICON_SIZE_SMALL + Display::getMdiIcon( + $visibility_icon, + 'ch-tool-icon', + null, + ICON_SIZE_SMALL, + get_lang('Visible') ). ''; if (api_is_allowed_to_edit(null, true)) { $modify_icons .= ' '. - Display::return_icon( - 'history.png', - get_lang('Assessment history'), - '', - ICON_SIZE_SMALL - ). + Display::getMdiIcon(ActionIcon::VIEW_DETAILS, 'ch-tool-icon', null, ICON_SIZE_SMALL, get_lang('Assessment history')). ''; $allowStats = ('true' === api_get_setting('gradebook.allow_gradebook_stats')); if ($allowStats) { $modify_icons .= Display::url( - Display::return_icon('reload.png', get_lang('Generate statistics')), + Display::getMdiIcon(ActionIcon::REFRESH, 'ch-tool-icon', null, ICON_SIZE_SMALL, get_lang('Generate statistics')), api_get_self().'?itemId='.$eval->get_id().'&action=generate_eval_stats&selectcat='.$selectcat.'&'.$courseParams ); } @@ -401,7 +406,7 @@ class GradebookUtils $courseParams = api_get_cidreq_params($link->getCourseId(), $link->get_session_id()); if (false === $message_link) { - $visibility_icon = 0 == $link->is_visible() ? 'invisible' : 'visible'; + $visibility_icon = 0 == $link->is_visible() ? ActionIcon::INVISIBLE : ActionIcon::VISIBLE; $visibility_command = 0 == $link->is_visible() ? 'set_visible' : 'set_invisible'; if ($is_locked && !api_is_platform_admin()) { @@ -412,27 +417,29 @@ class GradebookUtils ''; } $modify_icons .= ' '. - Display::return_icon( - $visibility_icon.'.png', + Display::getMdiIcon( + $visibility_icon, + 'ch-tool-icon', + null, + ICON_SIZE_SMALL, get_lang('Visible'), - '', - ICON_SIZE_SMALL ). ''; $modify_icons .= ' '. - Display::return_icon( - 'history.png', - get_lang('Assessment history'), - '', - ICON_SIZE_SMALL + Display::getMdiIcon( + ActionIcon::VIEW_DETAILS, + 'ch-tool-icon', + null, + ICON_SIZE_SMALL, + get_lang('Assessment history') ). ''; $allowStats = ('true' === api_get_setting('gradebook.allow_gradebook_stats')); if ($allowStats && LINK_EXERCISE == $link->get_type()) { $modify_icons .= Display::url( - Display::return_icon('reload.png', get_lang('Generate statistics')), + Display::getMdiIcon(ActionIcon::REFRESH, 'ch-tool-icon', null, ICON_SIZE_SMALL, get_lang('Generate statistics')), api_get_self().'?itemId='.$link->get_id().'&action=generate_link_stats&selectcat='.$selectcat.'&'.$courseParams ); } @@ -772,7 +779,7 @@ class GradebookUtils $print .= Display::div( Display::url( - Display::return_icon('printmgr.gif', get_lang('Print')), + Display::getMdiIcon(ActionIcon::PRINT, 'ch-tool-icon', null, ICON_SIZE_SMALL, get_lang('Print')), 'javascript:void()', ['onclick' => 'window.print();'] ), diff --git a/public/main/inc/ajax/sequence.ajax.php b/public/main/inc/ajax/sequence.ajax.php index 6ab7e23c80..cbe850928d 100644 --- a/public/main/inc/ajax/sequence.ajax.php +++ b/public/main/inc/ajax/sequence.ajax.php @@ -69,7 +69,7 @@ switch ($action) { api_protect_admin_script(); $showDelete = isset($_REQUEST['show_delete']) ? $_REQUEST['show_delete'] : false; - $image = Display::return_icon('item-sequence.png', null, null, ICON_SIZE_LARGE); + $image = Display::getMdiIcon('notebook', 'ch-tool-icon', null, ICON_SIZE_LARGE); if (empty($id)) { exit; diff --git a/public/main/inc/lib/CoursesAndSessionsCatalog.class.php b/public/main/inc/lib/CoursesAndSessionsCatalog.class.php index 8b79c10ab0..96e45c288b 100644 --- a/public/main/inc/lib/CoursesAndSessionsCatalog.class.php +++ b/public/main/inc/lib/CoursesAndSessionsCatalog.class.php @@ -4,6 +4,7 @@ use Chamilo\CoreBundle\Entity\ExtraField; use Chamilo\CoreBundle\Entity\User; use Doctrine\ORM\Query\Expr\Join; +use Chamilo\CoreBundle\Component\Utils\ObjectIcon; /** * @todo change class name @@ -1335,11 +1336,12 @@ class CoursesAndSessionsCatalog */ public static function getSessionIcon($sessionName) { - return Display::return_icon( - 'window_list.png', - $sessionName, + return Display::getMdiIcon( + ObjectIcon::SESSION, + 'ch-tool-icon', null, - ICON_SIZE_MEDIUM + ICON_SIZE_MEDIUM, + $sessionName ); } diff --git a/public/main/inc/lib/document.lib.php b/public/main/inc/lib/document.lib.php index 53d71bff04..98d2e82d01 100644 --- a/public/main/inc/lib/document.lib.php +++ b/public/main/inc/lib/document.lib.php @@ -9,6 +9,7 @@ use Chamilo\CoreBundle\Entity\User; use Chamilo\CoreBundle\Framework\Container; use Chamilo\CourseBundle\Entity\CDocument; use ChamiloSession as Session; +use Chamilo\CoreBundle\Component\Utils\ObjectIcon; /** * Class DocumentManager @@ -2335,7 +2336,7 @@ class DocumentManager $nodeRepository = $repo->getResourceNodeRepository(); $move = get_lang('Move'); $icon = ''; - $folderIcon = Display::return_icon('lp_folder.png'); + $folderIcon = Display::getMdiIcon(ObjectIcon::CHAPTER, 'ch-tool-icon', null, ICON_SIZE_SMALL); $options = [ 'decorate' => true, diff --git a/public/main/inc/lib/formvalidator/Element/DatePicker.php b/public/main/inc/lib/formvalidator/Element/DatePicker.php index b9155ed9bb..fa6e332591 100644 --- a/public/main/inc/lib/formvalidator/Element/DatePicker.php +++ b/public/main/inc/lib/formvalidator/Element/DatePicker.php @@ -2,6 +2,8 @@ /* For licensing terms, see /license.txt */ +use Chamilo\CoreBundle\Component\Utils\ToolIcon; + /** * Form element to select a date. */ @@ -131,7 +133,7 @@ class DatePicker extends HTML_QuickForm_text altField: '#{$id}_alt', altFormat: \"".get_lang('MM dd, yy')."\", showOn: 'both', - buttonImage: '".Display::return_icon('attendance.png', null, [], ICON_SIZE_TINY, true, true)."', + buttonImage: '".Display::getMdiIcon(ToolIcon::ATTENDANCE, 'ch-tool-icon', null, ICON_SIZE_TINY)."', buttonImageOnly: true, buttonText: '".get_lang('Select date')."', changeMonth: true, diff --git a/public/main/inc/lib/formvalidator/FormValidator.class.php b/public/main/inc/lib/formvalidator/FormValidator.class.php index 1eb39f5600..dd50badad1 100644 --- a/public/main/inc/lib/formvalidator/FormValidator.class.php +++ b/public/main/inc/lib/formvalidator/FormValidator.class.php @@ -1800,7 +1800,7 @@ EOT; if (!empty($urlToRedirect)) { $redirectCondition = "window.location.replace('$urlToRedirect'); "; } - $icon = Display::return_icon('file_txt.gif'); + $icon = Display::getMdiIcon('text-box-outline', 'ch-tool-icon', null, ICON_SIZE_SMALL); $this->addHtml("