diff --git a/public/main/gradebook/lib/GradebookUtils.php b/public/main/gradebook/lib/GradebookUtils.php index 0dc9ccb93c..43e3b080a2 100644 --- a/public/main/gradebook/lib/GradebookUtils.php +++ b/public/main/gradebook/lib/GradebookUtils.php @@ -2,6 +2,7 @@ /* For licensing terms, see /license.txt */ +use Chamilo\CoreBundle\Component\Utils\ActionIcon; use Chamilo\CoreBundle\Entity\Session; /** @@ -242,12 +243,7 @@ class GradebookUtils if (!api_is_allowed_to_edit(null, true)) { $modify_icons .= Display::url( - Display::return_icon( - 'statistics.png', - get_lang('List View'), - '', - ICON_SIZE_SMALL - ), + Display::getMdiIcon('chart-box', 'ch-tool-icon', null, ICON_SIZE_SMALL, get_lang('List View')), 'personal_stats.php?'.http_build_query([ 'selectcat' => $cat->get_id(), ]).'&'.api_get_cidreq(), @@ -269,54 +265,34 @@ class GradebookUtils if ($cat->is_locked()) { if (api_is_platform_admin()) { $modify_icons .= ' '. - Display::return_icon('lock.png', get_lang('Unlock evaluation.'), '', ICON_SIZE_SMALL).''; + Display::getMdiIcon(ActionIcon::LOCK, 'ch-tool-icon', null, ICON_SIZE_SMALL, get_lang('Unlock evaluation.')).''; } else { $modify_icons .= ' '. - Display::return_icon('lock_na.png', get_lang('This assessment has been locked. You cannot unlock it. If you really need to unlock it, please contact the platform administrator, explaining the reason why you would need to do that (it might otherwise be considered as fraud attempt).'), '', ICON_SIZE_SMALL).''; + Display::getMdiIcon(ActionIcon::LOCK, 'ch-tool-icon-disabled', null, ICON_SIZE_SMALL, get_lang('This assessment has been locked. You cannot unlock it. If you really need to unlock it).')).''; } - $modify_icons .= ' '.Display::return_icon('pdf.png', get_lang('Export to PDF'), '', ICON_SIZE_SMALL).''; + $modify_icons .= ' '.Display::getMdiIcon(ActionIcon::EXPORT_PDF, 'ch-tool-icon', null, ICON_SIZE_SMALL, get_lang('Export to PDF')).''; } else { $modify_icons .= ' '. - Display::return_icon('unlock.png', get_lang('Lock evaluation'), '', ICON_SIZE_SMALL).''; + Display::getMdiIcon(ActionIcon::UNLOCK, 'ch-tool-icon', null, ICON_SIZE_SMALL, get_lang('Lock evaluation')).''; $modify_icons .= ' '. - Display::return_icon('pdf_na.png', get_lang('Export to PDF'), '', ICON_SIZE_SMALL).''; + Display::getMdiIcon(ActionIcon::EXPORT_PDF, 'ch-tool-icon-disabled', null, ICON_SIZE_SMALL, get_lang('Export to PDF')).''; } } if (empty($grade_model_id) || -1 == $grade_model_id) { if ($cat->is_locked() && !api_is_platform_admin()) { - $modify_icons .= Display::return_icon( - 'edit_na.png', - get_lang('Edit'), - '', - ICON_SIZE_SMALL - ); + $modify_icons .= Display::getMdiIcon(ActionIcon::EDIT, 'ch-tool-icon-disabled', null, ICON_SIZE_SMALL, get_lang('Edit')); } else { $modify_icons .= ''. - 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')).''; } } $modify_icons .= ''. - Display::return_icon( - 'percentage.png', - get_lang('Weight in Report'), - '', - ICON_SIZE_SMALL - ).''; + Display::getMdiIcon('percent-box', 'ch-tool-icon', null, ICON_SIZE_SMALL, get_lang('Weight in Report')).''; $modify_icons .= ''. - Display::return_icon( - 'statistics.png', - get_lang('List View'), - '', - ICON_SIZE_SMALL - ).''; + Display::getMdiIcon('format-list-text', 'ch-tool-icon', null, ICON_SIZE_SMALL, get_lang('List View')).''; $modify_icons .= ' '. Display::return_icon( $visibility_icon.'.png', @@ -326,20 +302,10 @@ class GradebookUtils ).''; if ($cat->is_locked() && !api_is_platform_admin()) { - $modify_icons .= Display::return_icon( - 'delete_na.png', - get_lang('Delete all'), - '', - ICON_SIZE_SMALL - ); + $modify_icons .= Display::getMdiIcon(ActionIcons::DELETE, 'ch-tool-icon-disabled', null, ICON_SIZE_SMALL, get_lang('Delete all')); } else { $modify_icons .= ' '. - Display::return_icon( - 'delete.png', - get_lang('Delete all'), - '', - ICON_SIZE_SMALL - ). + Display::getMdiIcon(ActionItems::DELETE, 'ch-tool-icon', null, ICON_SIZE_SMALL, get_lang('Delete all')). ''; } } @@ -366,20 +332,10 @@ class GradebookUtils $visibility_icon = 0 == $eval->is_visible() ? 'invisible' : 'visible'; $visibility_command = 0 == $eval->is_visible() ? 'set_visible' : 'set_invisible'; if ($is_locked && !api_is_platform_admin()) { - $modify_icons = Display::return_icon( - 'edit_na.png', - get_lang('Edit'), - '', - ICON_SIZE_SMALL - ); + $modify_icons = Display::getMdiIcon(ActionIcon::EDIT, 'ch-tool-icon-disabled', null, ICON_SIZE_SMALL, get_lang('Edit')); } else { $modify_icons = ''. - 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')). ''; } @@ -413,20 +369,10 @@ class GradebookUtils if ($is_locked && !api_is_platform_admin()) { $modify_icons .= ' '. - Display::return_icon( - 'delete_na.png', - get_lang('Delete'), - '', - ICON_SIZE_SMALL - ); + Display::getMdiIcon(ActionIcon::DELETE, 'ch-tool-icon-disabled', null, ICON_SIZE_SMALL, get_lang('Delete')); } else { $modify_icons .= ' '. - 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')). ''; } @@ -459,20 +405,10 @@ class GradebookUtils $visibility_command = 0 == $link->is_visible() ? 'set_visible' : 'set_invisible'; if ($is_locked && !api_is_platform_admin()) { - $modify_icons = Display::return_icon( - 'edit_na.png', - get_lang('Edit'), - '', - ICON_SIZE_SMALL - ); + $modify_icons = Display::getMdiIcon(ActionIcon::EDIT, 'ch-tool-icon-disabled', null, ICON_SIZE_SMALL, get_lang('Edit')); } else { $modify_icons = ''. - 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')). ''; } $modify_icons .= ' '. @@ -504,23 +440,13 @@ class GradebookUtils //If a work is added in a gradebook you can only delete the link in the work tool if ($is_locked && !api_is_platform_admin()) { $modify_icons .= ' '. - Display::return_icon( - 'delete_na.png', - get_lang('Delete'), - '', - ICON_SIZE_SMALL - ); + Display::getMdiIcon(ActionIcon::DELETE, 'ch-tool-icon-disabled', null, ICON_SIZE_SMALL, get_lang('Delete')); } else { $modify_icons .= ' '. - 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')). ''; } diff --git a/public/main/gradebook/lib/fe/displaygradebook.php b/public/main/gradebook/lib/fe/displaygradebook.php index f4080c7051..71ce345b07 100644 --- a/public/main/gradebook/lib/fe/displaygradebook.php +++ b/public/main/gradebook/lib/fe/displaygradebook.php @@ -2,6 +2,8 @@ /* For licensing terms, see /license.txt */ +use Chamilo\CoreBundle\Component\Utils\ActionIcon; + /** * Class DisplayGradebook. */ @@ -20,36 +22,36 @@ class DisplayGradebook if (api_is_allowed_to_edit(null, true)) { if ('statistics' !== $page) { $links[] = ''. - 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')) .''; if ('view_result' === $page) { if ((null != $evalobj->get_course_code()) && !$evalobj->has_results()) { $links[] = ' - '.Display::return_icon('evaluation_rate.png', get_lang('Grade learners'), '', ICON_SIZE_MEDIUM).''; + '.Display::getMdiIcon(ActionIcon::GRADE, 'ch-tool-icon', null, ICON_SIZE_MEDIUM, get_lang('Grade learners')).''; } if (api_is_platform_admin() || false == $evalobj->is_locked()) { $links[] = ''. - Display::return_icon('import_evaluation.png', get_lang('Import marks'), '', ICON_SIZE_MEDIUM).''; + Display::getMdiIcon(ActionIcon::ARCHIVE_IMPORT, 'ch-tool-icon', null, ICON_SIZE_MEDIUM, get_lang('Import marks')).''; } if ($evalobj->has_results()) { $links[] = ''. - Display::return_icon('export_evaluation.png', get_lang('PDF Report'), '', ICON_SIZE_MEDIUM).''; + Display::getMdiIcon(ActionIcon::EXPORT_PDF, 'ch-tool-icon', null, ICON_SIZE_MEDIUM, get_lang('PDF Report')).''; if (api_is_platform_admin() || false == $evalobj->is_locked()) { $links[] = ''. - Display::return_icon('edit.png', get_lang('Grade learners'), '', ICON_SIZE_MEDIUM).''; + Display::getMdiIcon(ActionIcon::EDIT, 'ch-tool-icon', null, ICON_SIZE_MEDIUM, get_lang('Grade learners')).''; $links[] = ''. - Display::return_icon('delete.png', get_lang('Delete marks'), '', ICON_SIZE_MEDIUM).''; + Display::getMdiIcon(ActionIcon::DELETE, 'ch-tool-icon', null, ICON_SIZE_MEDIUM, get_lang('Delete marks')).''; } } $links[] = ''. - Display::return_icon('printer.png', get_lang('Print'), '', ICON_SIZE_MEDIUM).''; + Display::getMdiIcon(ActionIcon::PRINT, 'ch-tool-icon', null, ICON_SIZE_MEDIUM, get_lang('Print')).''; } } else { $links[] = ' '. - 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')).''; } } @@ -111,12 +113,7 @@ class DisplayGradebook if ('statistics' != $page) { if (api_is_allowed_to_edit(null, true)) { $links[] = ' '. - Display::return_icon( - 'statistics.png', - get_lang('Graphical view'), - '', - ICON_SIZE_MEDIUM - ).''; + Display::getMdiIcon('chart-box', 'ch-tool-icon', null, ICON_SIZE_MEDIUM, get_lang('Graphical view')).''; } } @@ -142,7 +139,7 @@ class DisplayGradebook $url = 'gradebook_flatview.php'; } $header .= ''. - 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')).''; $pageNum = isset($_GET['flatviewlist_page_nr']) ? (int) $_GET['flatviewlist_page_nr'] : null; $perPage = isset($_GET['flatviewlist_per_page']) ? (int) $_GET['flatviewlist_per_page'] : null; @@ -155,12 +152,7 @@ class DisplayGradebook ]); $header .= 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')), $exportCsvUrl ); @@ -171,12 +163,7 @@ class DisplayGradebook ]); $header .= Display::url( - Display::return_icon( - 'export_excel.png', - get_lang('Excel export'), - '', - ICON_SIZE_MEDIUM - ), + Display::getMdiIcon(ActionIcon::EXPORT_SPREADSHEET, 'ch-tool-icon', null, ICON_SIZE_MEDIUM, get_lang('Excel export')), $exportXlsUrl ); @@ -187,12 +174,7 @@ class DisplayGradebook ]); $header .= Display::url( - Display::return_icon( - 'export_doc.png', - get_lang('Export as .doc'), - '', - ICON_SIZE_MEDIUM - ), + Display::getMdiIcon(ActionIcon::EXPORT_DOC, 'ch-tool-icon', null, ICON_SIZE_MEDIUM, get_lang('Export as .doc')), $exportDocUrl ); @@ -202,12 +184,7 @@ class DisplayGradebook ]); $header .= Display::url( - Display::return_icon( - 'printer.png', - get_lang('Print'), - '', - ICON_SIZE_MEDIUM - ), + Display::getMdiIcon(ActionIcon::PRINT, 'ch-tool-icon', null, ICON_SIZE_MEDIUM, get_lang('Print')), $exportPrintUrl, ['target' => '_blank'] ); @@ -221,12 +198,7 @@ class DisplayGradebook ]); $header .= 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')), $exportPdfUrl ); @@ -344,11 +316,12 @@ class DisplayGradebook $header .= '