diff --git a/public/main/inc/lib/AnnouncementManager.php b/public/main/inc/lib/AnnouncementManager.php index 07b0bc6ea5..36214aa600 100644 --- a/public/main/inc/lib/AnnouncementManager.php +++ b/public/main/inc/lib/AnnouncementManager.php @@ -2,7 +2,6 @@ /* For licensing terms, see /license.txt */ -use Chamilo\CoreBundle\Component\Utils\ActionIcon; use Chamilo\CoreBundle\Entity\AbstractResource; use Chamilo\CoreBundle\Entity\ExtraField as ExtraFieldEntity; use Chamilo\CoreBundle\Entity\ExtraFieldValues; @@ -11,6 +10,9 @@ use Chamilo\CoreBundle\Framework\Container; use Chamilo\CoreBundle\Security\Authorization\Voter\ResourceNodeVoter; use Chamilo\CourseBundle\Entity\CAnnouncement; use Chamilo\CourseBundle\Entity\CAnnouncementAttachment; +use Chamilo\CoreBundle\Component\Utils\ActionIcon; +use Chamilo\CoreBundle\Component\Utils\ObjectIcon; +use Chamilo\CoreBundle\Component\Utils\StateIcon; /** * Include file with functions for the announcements module. @@ -496,25 +498,25 @@ class AnnouncementManager (1 === (int) api_get_course_setting('allow_user_edit_announcement') && !api_is_anonymous()) ) { $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')).""; - $image_visibility = 'invisible'; + $image_visibility = StateIcon::INACTIVE; $alt_visibility = get_lang('Visible'); $setNewStatus = 'visible'; if ($isVisible) { - $image_visibility = 'visible'; + $image_visibility = StateIcon::ACTIVE; $alt_visibility = get_lang('Hide'); $setNewStatus = 'invisible'; } $modify_icons .= "". - Display::return_icon($image_visibility.'.png', $alt_visibility, '', ICON_SIZE_SMALL).""; + Display::getMdiIcon($image_visibility, 'ch-tool-icon', null, ICON_SIZE_SMALL, $alt_visibility).""; if (api_is_allowed_to_edit(false, true)) { $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')). ""; } $html .= "$modify_icons"; @@ -563,18 +565,13 @@ class AnnouncementManager $url = $repo->getResourceFileDownloadUrl($attachment).'?'.api_get_cidreq(); $html .= ''; $html .= '
'; - $html .= Display::getMdiIcon('paperclip'); + $html .= Display::getMdiIcon(ObjectIcon::ATTACHMENT, 'ch-tool-icon', null, ICON_SIZE_SMALL); $html .= ' '.$attachment->getFilename().' '; $html .= ' - '.$attachment->getComment().''; if (api_is_allowed_to_edit(false, true)) { $url = $deleteUrl."&id_attach=".$attachmentId."&sec_token=".$stok; $html .= Display::url( - Display::return_icon( - 'delete.png', - get_lang('Delete'), - '', - 16 - ), + Display::getMdiIcon(ActionIcon::DELETE, 'ch-tool-icon', null, ICON_SIZE_TINY, get_lang('Delete')), $url ); } @@ -1407,8 +1404,8 @@ class AnnouncementManager $displayed = []; $actionUrl = api_get_path(WEB_CODE_PATH).'announcements/announcements.php?'.api_get_cidreq(); - $emailIcon = ''; - $attachmentIcon = ''; + $emailIcon = Display::getMdiIcon(StateIcon::MAIL_NOTIFICATION, 'ch-tool-icon', null, ICON_SIZE_SMALL, get_lang('Announcement sent by e-mail')); + $attachmentIcon = Display::getMdiIcon(ObjectIcon::ATTACHMENT, 'ch-tool-icon', null, ICON_SIZE_SMALL, get_lang('Attachment')); $editIcon = Display::getMdiIcon( ActionIcon::EDIT, @@ -1620,7 +1617,7 @@ class AnnouncementManager $iterator++; } else { $modify_icons = Display::url( - Display::return_icon('default.png'), + Display::getMdiIcon(ObjectIcon::DEFAULT, 'ch-tool-icon', null, ICON_SIZE_SMALL), $actionUrl.'&action=view&id='.$announcementId ); } diff --git a/public/main/inc/lib/ExerciseCategoryManager.php b/public/main/inc/lib/ExerciseCategoryManager.php index e7aa2ffb9a..aa76c53780 100644 --- a/public/main/inc/lib/ExerciseCategoryManager.php +++ b/public/main/inc/lib/ExerciseCategoryManager.php @@ -3,6 +3,7 @@ use Chamilo\CoreBundle\Framework\Container; use Chamilo\CourseBundle\Entity\CExerciseCategory; +use Chamilo\CoreBundle\Component\Utils\ActionIcon; /** * Class ExtraFieldValue @@ -176,8 +177,8 @@ class ExerciseCategoryManager extends Model public function getJqgridActionLinks($token) { //With this function we can add actions to the jgrid (edit, delete, etc) - $editIcon = Display::return_icon('edit.png', get_lang('Edit'), '', ICON_SIZE_SMALL); - $deleteIcon = Display::return_icon('delete.png', get_lang('Delete'), '', ICON_SIZE_SMALL); + $editIcon = Display::getMdiIcon(ActionIcon::EDIT, 'ch-tool-icon', null, ICON_SIZE_SMALL, get_lang('Edit')); + $deleteIcon = Display::getMdiIcon(ActionIcon::DELETE, 'ch-tool-icon', null, ICON_SIZE_SMALL, get_lang('Delete')); $confirmMessage = addslashes( api_htmlentities(get_lang('Please confirm your choice'), ENT_QUOTES) ); @@ -258,20 +259,10 @@ JAVASCRIPT; // Action links $content = '
'; $content .= ''; - $content .= Display::return_icon( - 'back.png', - get_lang('Back to').' '.get_lang('Administration'), - '', - ICON_SIZE_MEDIUM - ); + $content .= Display::getMdiIcon(ActionIcon::BACK, 'ch-tool-icon', null, ICON_SIZE_MEDIUM, get_lang('Back to').' '.get_lang('Administration')); $content .= ''; $content .= ''; - $content .= Display::return_icon( - 'add.png', - get_lang('Add'), - '', - ICON_SIZE_MEDIUM - ); + $content .= Display::getMdiIcon(ActionIcon::ADD, 'ch-tool-icon', null, ICON_SIZE_MEDIUM, get_lang('Add')); $content .= ''; $content .= '
'; diff --git a/public/main/inc/lib/MailTemplateManager.php b/public/main/inc/lib/MailTemplateManager.php index c35e888573..dfec341831 100644 --- a/public/main/inc/lib/MailTemplateManager.php +++ b/public/main/inc/lib/MailTemplateManager.php @@ -2,6 +2,7 @@ /* For licensing terms, see /license.txt */ use Symfony\Component\Finder\Finder; +use Chamilo\CoreBundle\Component\Utils\ActionIcon; /** * Class MailTemplateManager. @@ -53,20 +54,10 @@ class MailTemplateManager extends Model // Action links $html = '
'; $html .= ''. - Display::return_icon( - 'back.png', - get_lang('Back'), - '', - '32' - ) + Display::getMdiIcon(ActionIcon::BACK, 'ch-tool-icon', null, ICON_SIZE_MEDIUM, get_lang('Back')) .''; $html .= ''. - Display::return_icon( - 'add.png', - get_lang('Add'), - '', - '32' - ).''; + Display::getMdiIcon(ActionIcon::ADD, 'ch-tool-icon', null, ICON_SIZE_MEDIUM, get_lang('Add')).''; $html .= '
'; $html .= Display::grid_html('mail_template'); diff --git a/public/main/inc/lib/ScheduledAnnouncement.php b/public/main/inc/lib/ScheduledAnnouncement.php index 09b0cbc007..8e8cb5cb39 100644 --- a/public/main/inc/lib/ScheduledAnnouncement.php +++ b/public/main/inc/lib/ScheduledAnnouncement.php @@ -4,6 +4,7 @@ use Chamilo\CoreBundle\Entity\Session; use Chamilo\CoreBundle\Entity\User; +use Chamilo\CoreBundle\Component\Utils\ActionIcon; /** * Config setting: @@ -62,14 +63,14 @@ class ScheduledAnnouncement extends Model // action links $action = '
'; $action .= 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_path(WEB_CODE_PATH).'session/resume_session.php?id_session='.$sessionId ); $action .= ''. - Display::return_icon('add.png', get_lang('Add'), '', ICON_SIZE_MEDIUM).''; + Display::getMdiIcon(ActionIcon::ADD, 'ch-tool-icon', null, ICON_SIZE_MEDIUM, get_lang('Add')).''; $action .= ''. - Display::return_icon('tuning.png', get_lang('Send pending announcements manually'), '', ICON_SIZE_MEDIUM). + Display::getMdiIcon(ActionIcon::SEND_MESSAGE, 'ch-tool-icon', null, ICON_SIZE_MEDIUM, get_lang('Send pending announcements manually')). ''; $action .= '
'; diff --git a/public/main/inc/lib/SkillModel.php b/public/main/inc/lib/SkillModel.php index ba6c0acad6..0ac368104d 100644 --- a/public/main/inc/lib/SkillModel.php +++ b/public/main/inc/lib/SkillModel.php @@ -24,6 +24,7 @@ use Chamilo\CourseBundle\Entity\CStudentPublication; use Chamilo\CourseBundle\Entity\CSurvey; use Fhaculty\Graph\Graph; use Fhaculty\Graph\Vertex; +use Chamilo\CoreBundle\Component\Utils\ActionIcon; class SkillModel extends Model { @@ -1839,12 +1840,7 @@ class SkillModel extends Model public function getToolBar() { $toolbar = Display::url( - Display::return_icon( - 'back.png', - get_lang('Manage skills'), - null, - ICON_SIZE_MEDIUM - ), + Display::getMdiIcon(ActionIcon::BACK, 'ch-tool-icon', null, ICON_SIZE_MEDIUM, get_lang('Manage skills')), api_get_path(WEB_CODE_PATH).'skills/skill_list.php' ); diff --git a/public/main/inc/lib/TicketManager.php b/public/main/inc/lib/TicketManager.php index 3c0a2fc20c..7fea2535fb 100644 --- a/public/main/inc/lib/TicketManager.php +++ b/public/main/inc/lib/TicketManager.php @@ -12,6 +12,7 @@ use Chamilo\CoreBundle\Entity\User; use Chamilo\CoreBundle\Framework\Container; use Chamilo\CourseBundle\Entity\CLp; use Symfony\Component\HttpFoundation\File\UploadedFile; +use Chamilo\CoreBundle\Component\Utils\ObjectIcon; /** * Class TicketManager. @@ -958,26 +959,28 @@ class TicketManager switch ($row['source']) { case self::SOURCE_PRESENTIAL: - $img_source = 'icons/32/user.png'; + $img_source = ObjectIcon::USER; break; case self::SOURCE_EMAIL: - $img_source = 'icons/32/mail.png'; + $img_source = ObjectIcon::EMAIL; break; case self::SOURCE_PHONE: - $img_source = 'icons/32/event.png'; + $img_source = ObjectIcon::PHONE; break; default: - $img_source = 'icons/32/ticket.png'; + $img_source = ObjectIcon::TICKET; break; } $row['start_date'] = Display::dateToStringAgoAndLongDate($row['start_date']); $row['sys_lastedit_datetime'] = Display::dateToStringAgoAndLongDate($row['sys_lastedit_datetime']); - $icon = Display::return_icon( + $icon = Display::getMdiIcon( $img_source, + 'ch-tool-icon', + 'margin-right: 10px; float: left;', + ICON_SIZE_SMALL, get_lang('Information'), - ['style' => 'margin-right: 10px; float: left;'] ); $icon .= ''.$row['code'].''; @@ -1281,7 +1284,7 @@ class TicketManager message.ticket_id = '$ticketId' "; $result = Database::query($sql); $ticket['messages'] = []; - $attach_icon = Display::return_icon('attachment.gif', ''); + $attach_icon = Display::getMdiIcon(ObjectIcon::ATTACHMENT, 'ch-tool-icon', null, ICON_SIZE_SMALL); while ($row = Database::fetch_assoc($result)) { $message = $row; diff --git a/public/main/inc/lib/agenda.lib.php b/public/main/inc/lib/agenda.lib.php index 6a5c4ba0b5..93fa083f95 100644 --- a/public/main/inc/lib/agenda.lib.php +++ b/public/main/inc/lib/agenda.lib.php @@ -10,6 +10,9 @@ use Chamilo\CourseBundle\Entity\CCalendarEvent; use Chamilo\CourseBundle\Entity\CCalendarEventAttachment; use Chamilo\CourseBundle\Entity\CGroup; use Symfony\Component\HttpFoundation\File\UploadedFile; +use Chamilo\CoreBundle\Component\Utils\ActionIcon; +use Chamilo\CoreBundle\Component\Utils\ObjectIcon; + /** * Class Agenda. @@ -1649,7 +1652,10 @@ class Agenda $event['attachment'] = ''; if (!empty($attachmentList)) { $icon = Display::getMdiIcon( - 'paperclip' + ObjectIcon::ATTACHMENT, + 'ch-tool-icon', + null, + ICON_SIZE_SMALL ); /** @var CCalendarEventAttachment $attachment */ foreach ($attachmentList as $attachment) { @@ -2546,11 +2552,11 @@ class Agenda $actionsLeft = ''; $actionsLeft .= Display::url( - Display::return_icon('calendar.png', get_lang('Calendar'), [], ICON_SIZE_MEDIUM), + Display::getMdiIcon(ObjectIcon::AGENDA, 'ch-tool-icon', null, ICON_SIZE_MEDIUM, get_lang('Calendar')), $codePath."calendar/agenda_js.php?type={$this->type}&$cidReq" ); $actionsLeft .= Display::url( - Display::return_icon('week.png', get_lang('Agenda list'), [], ICON_SIZE_MEDIUM), + Display::getMdiIcon(ObjectIcon::AGENDA_WEEK, 'ch-tool-icon', null, ICON_SIZE_MEDIUM, get_lang('Agenda list')), $codePath."calendar/agenda_list.php?type={$this->type}&$cidReq" ); @@ -2564,12 +2570,12 @@ class Agenda ) ) { $actionsLeft .= Display::url( - Display::return_icon('new_event.png', get_lang('Add event'), [], ICON_SIZE_MEDIUM), + Display::getMdiIcon(ObjectIcon::AGENDA_EVENT, 'ch-tool-icon', null, ICON_SIZE_MEDIUM, get_lang('Add event')), $codePath."calendar/agenda.php?action=add&type={$this->type}&$cidReq" ); $actionsLeft .= Display::url( - Display::return_icon('import_calendar.png', get_lang('Outlook import'), [], ICON_SIZE_MEDIUM), + Display::getMdiIcon(ActionIcon::IMPORT_ARCHIVE, 'ch-tool-icon', null, ICON_SIZE_MEDIUM, get_lang('Outlook import')), $codePath."calendar/agenda.php?action=importical&type={$this->type}&$cidReq" ); @@ -2596,13 +2602,13 @@ class Agenda if ('personal' === $this->type && !api_is_anonymous()) { $actionsLeft .= Display::url( - Display::return_icon('1day.png', get_lang('Sessions plan calendar'), [], ICON_SIZE_MEDIUM), + Display::getMdiIcon(ObjectIcon::AGENDA_PLAN, 'ch-tool-icon', null, ICON_SIZE_MEDIUM, get_lang('Sessions plan calendar')), $codePath."calendar/planification.php" ); if (api_is_student_boss() || api_is_platform_admin()) { $actionsLeft .= Display::url( - Display::return_icon('calendar-user.png', get_lang('MyStudentsSchedule'), [], ICON_SIZE_MEDIUM), + Display::getMdiIcon(ObjectIcon::AGENDA_USER_EVENT, 'ch-tool-icon', null, ICON_SIZE_MEDIUM, get_lang('MyStudentsSchedule')), $codePath.'my_space/calendar_plan.php' ); } @@ -3321,7 +3327,7 @@ class Agenda if (($curday > 0) && ($curday <= $numberofdays[$month])) { $bgcolor = $class = 'class="days_week"'; $dayheader = Display::div( - $curday, + strval($curday), ['class' => 'agenda_day'] ); if (($curday == $today['mday']) && ($year == $today['year']) && ($month == $today['mon'])) { @@ -3359,48 +3365,40 @@ class Agenda switch ($value['calendar_type']) { case 'personal': $bg_color = '#D0E7F4'; - $icon = Display::return_icon( - 'user.png', - get_lang('Personal agenda'), - [], - ICON_SIZE_SMALL - ); + $icon = Display::getMdiIcon(ObjectIcon::USER, 'ch-tool-icon', null, ICON_SIZE_SMALL, get_lang('Personal agenda')); break; case 'global': $bg_color = '#FFBC89'; - $icon = Display::return_icon( - 'view_remove.png', - get_lang('Platform event'), - [], - ICON_SIZE_SMALL - ); + $icon = Display::getMdiIcon(ObjectIcon::AGENDA_PLATFORM_EVENT, 'ch-tool-icon', null, ICON_SIZE_SMALL, get_lang('Platform event')); break; case 'course': $bg_color = '#CAFFAA'; - $icon_name = 'course.png'; + $icon_name = ObjectIcon::COURSE; if (!empty($value['session_id'])) { - $icon_name = 'session.png'; + $icon_name = ObjectIcon::SESSION; } if ($show_content) { $icon = Display::url( - Display::return_icon( + Display::getMdiIcon( $icon_name, + 'ch-tool-icon', + null, + ICON_SIZE_SMALL, $value['course_name'].' '.get_lang( 'Course' - ), - [], - ICON_SIZE_SMALL + ) ), $value['url'] ); } else { - $icon = Display::return_icon( + $icon = Display::getMdiIcon( $icon_name, + 'ch-tool-icon', + null, + ICON_SIZE_SMALL, $value['course_name'].' '.get_lang( 'Course' - ), - [], - ICON_SIZE_SMALL + ) ); } break; diff --git a/public/main/inc/lib/api.lib.php b/public/main/inc/lib/api.lib.php index c6d2e15060..bd200c1752 100644 --- a/public/main/inc/lib/api.lib.php +++ b/public/main/inc/lib/api.lib.php @@ -20,6 +20,8 @@ use Symfony\Component\Routing\Generator\UrlGeneratorInterface; use Symfony\Component\Security\Core\User\UserInterface; use ZipStream\Option\Archive; use ZipStream\ZipStream; +use Chamilo\CoreBundle\Component\Utils\ActionIcon; +use Chamilo\CoreBundle\Component\Utils\ObjectIcon; /** * This is a code library for Chamilo. @@ -2188,14 +2190,11 @@ function api_format_course_array(Course $course = null) $courseData['about_url'] = $coursePath.$courseData['real_id'].'/about'; $courseData['add_teachers_to_sessions_courses'] = $course->isAddTeachersToSessionsCourses(); - $image = Display::return_icon( - 'course.png', + $image = Display::getMdiIcon( + ObjectIcon::COURSE, + 'ch-tool-icon', null, - null, - ICON_SIZE_BIG, - null, - true, - false + ICON_SIZE_BIG ); $illustration = Container::getIllustrationRepository()->getIllustrationUrl($course); @@ -2529,11 +2528,12 @@ function api_get_session_image($sessionId, User $user) if (!$user->hasRole('ROLE_STUDENT')) { // Check whether is not a student if ($sessionId > 0) { - $image = '  '.Display::return_icon( - 'star.png', - get_lang('Session-specific resource'), - ['align' => 'absmiddle'], - ICON_SIZE_SMALL + $image = '  '.Display::getMdiIcon( + ObjectIcon::STAR, + 'ch-tool-icon', + 'align:absmiddle;', + ICON_SIZE_SMALL, + get_lang('Session-specific resource') ); } } @@ -3811,10 +3811,12 @@ function api_time_to_hms($seconds, $space = ':', $showSeconds = true, $roundMinu if (-1 == $seconds) { return get_lang('Unknown'). - Display::return_icon( - 'info2.gif', - get_lang('The datas about this user were registered when the calculation of time spent on the platform wasn\'t possible.'), - ['align' => 'absmiddle', 'hspace' => '3px'] + Display::getMdiIcon( + ActionIcon::INFORMATION, + 'ch-tool-icon', + 'align: absmiddle; hspace: 3px', + ICON_SIZE_SMALL, + get_lang('The datas about this user were registered when the calculation of time spent on the platform wasn\'t possible.') ); } diff --git a/public/main/inc/lib/attendance.lib.php b/public/main/inc/lib/attendance.lib.php index 51a845303c..8512dbb9b7 100644 --- a/public/main/inc/lib/attendance.lib.php +++ b/public/main/inc/lib/attendance.lib.php @@ -10,6 +10,9 @@ use Chamilo\CourseBundle\Entity\CAttendance; use Chamilo\CourseBundle\Entity\CAttendanceCalendar; use Chamilo\CourseBundle\Entity\CAttendanceSheetLog; use Doctrine\Common\Collections\Criteria; +use Chamilo\CoreBundle\Component\Utils\ActionIcon; +use Chamilo\CoreBundle\Component\Utils\ObjectIcon; +use Chamilo\CoreBundle\Component\Utils\StateIcon; class Attendance { @@ -212,40 +215,40 @@ class Attendance $actions .= '
'; if (api_is_platform_admin()) { $actions .= ''. - 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')).' '; // Visible if (1 == $active) { $actions .= ''. - Display::return_icon('visible.png', get_lang('Hide'), [], ICON_SIZE_SMALL).''; + Display::getMdiIcon(StateIcon::ACTIVE, 'ch-tool-icon', null, ICON_SIZE_SMALL, get_lang('Hide')).''; } else { $actions .= ''. - Display::return_icon('invisible.png', get_lang('Show'), [], ICON_SIZE_SMALL).''; + Display::getMdiIcon(StateIcon::INACTIVE, 'ch-tool-icon', null, ICON_SIZE_SMALL, get_lang('Show')).''; $row[2] = ''.$attendance->getDescription().''; } if ('true' === $allowDelete) { $actions .= ''. - 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')).''; } } else { $is_locked_attendance = self::is_locked_attendance($id); if ($is_locked_attendance) { - $actions .= Display::return_icon('edit_na.png', get_lang('Edit')).' '; - $actions .= Display::return_icon('visible.png', get_lang('Hide')); + $actions .= Display::getMdiIcon(ActionIcon::EDIT, 'ch-tool-icon-disabled', null, ICON_SIZE_SMALL, get_lang('Edit')).' '; + $actions .= Display::getMdiIcon(StateIcon::ACTIVE, 'ch-tool-icon', null, ICON_SIZE_SMALL, get_lang('Hide')); } else { $actions .= ''. - 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')).' '; if (1 == $active) { $actions .= ' '. - Display::return_icon('visible.png', get_lang('Hide'), [], ICON_SIZE_SMALL).''; + Display::getMdiIcon(StateIcon::ACTIVE, 'ch-tool-icon', null, ICON_SIZE_SMALL, get_lang('Hide')).''; } else { $actions .= ' '. - Display::return_icon('invisible.png', get_lang('Show'), [], ICON_SIZE_SMALL).''; + Display::getMdiIcon(StateIcon::INACTIVE, 'ch-tool-icon', null, ICON_SIZE_SMALL, get_lang('Show')).''; $row[2] = ''.$attendance->getDescription().''; } if ('true' === $allowDelete) { $actions .= ' '. - 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')).''; } } } @@ -264,15 +267,15 @@ class Attendance $actions .= ' '. - Display::return_icon('unlock.png', get_lang('Lock attendance')).''; + Display::getMdiIcon(ActionIcon::UNLOCK, 'ch-tool-icon', null, ICON_SIZE_SMALL, get_lang('Lock attendance')).''; } else { if (api_is_platform_admin()) { $actions .= ' '. - Display::return_icon('lock.png', get_lang('Unlock attendance')).''; + Display::getMdiIcon(ActionIcon::LOCK, 'ch-tool-icon', null, ICON_SIZE_SMALL, get_lang('Unlock attendance')).''; } else { - $actions .= ' '.Display::return_icon('locked_na.png', get_lang('Locked attendance')); + $actions .= ' '.Display::getMdiIcon(ActionIcon::LOCK, 'ch-tool-icon-disabled', null, ICON_SIZE_SMALL, get_lang('Locked attendance')); } } } @@ -2580,12 +2583,12 @@ class Attendance $actionsLeft = ''. - Display::return_icon('attendance_calendar.png', get_lang('Attendance calendar'), '', ICON_SIZE_MEDIUM). + Display::getMdiIcon(ObjectIcon::AGENDA, 'ch-tool-icon', null, ICON_SIZE_MEDIUM, get_lang('Attendance calendar')). ''; $actionsLeft .= ''. - 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')).''; $actionsRight = $form->returnForm(); $content .= Display::toolbarAction('toolbar-attendance', [$actionsLeft, $actionsRight]); @@ -2677,11 +2680,7 @@ class Attendance $time = $calendar['time']; $datetime = '
'.$date.' - '.$time.'
'; - $img_lock = Display::return_icon( - 'lock-closed.png', - get_lang('Unlock date'), - ['class' => 'img_lock', 'id' => 'datetime_column_'.$calendarId] - ); + $img_lock = Display::getMdiIcon(ActionIcon::LOCK, 'ch-tool-icon', null, ICON_SIZE_SMALL, get_lang('Unlock date')); if (!empty($calendar['done_attendance'])) { $datetime = '
'.$date.' - '.$time.'
'; @@ -2695,11 +2694,7 @@ class Attendance id="hidden_input_'.$calendarId.'" name="hidden_input[]" value="'.$calendarId.'" />'; $disabled_check = ''; - $img_lock = Display::return_icon( - 'lock-closed.png', - get_lang('Lock date'), - ['class' => 'img_unlock', 'id' => 'datetime_column_'.$calendarId] - ); + $img_lock = Display::getMdiIcon(ActionIcon::LOCK, 'ch-tool-icon', null, ICON_SIZE_SMALL, get_lang('Lock date')); } $result .= ''; @@ -2725,12 +2720,7 @@ class Attendance } else { $result = ' '; - $result .= Display::return_icon( - 'attendance_calendar.png', - get_lang('Attendance calendar'), - '', - ICON_SIZE_MEDIUM - ).' '.get_lang('Go to the attendance calendar'); + $result .= Display::getMdiIcon(ObjectIcon::AGENDA, 'ch-tool-icon', null, ICON_SIZE_MEDIUM, get_lang('Attendance calendar')).' '.get_lang('Go to the attendance calendar'); $result .= ''; } @@ -2791,26 +2781,16 @@ class Attendance value="'.$user['user_id'].'" '.$disabled.' '.$checked.' />'; $form .= ''; } else { - $form .= $presence ? Display::return_icon( - 'checkbox_on.png', - get_lang('Assistance'), - null, - ICON_SIZE_TINY - ) : Display::return_icon( - 'checkbox_off.png', - get_lang('Assistance'), - null, - ICON_SIZE_TINY - ); + $form .= $presence ? Display::getMdiIcon(StateIcon::CHECKBOX_MARKED, 'ch-tool-icon', null, ICON_SIZE_TINY, get_lang('Assistance')) : Display::getMdiIcon(StateIcon::CHECKBOX_BLANK, 'ch-tool-icon', null, ICON_SIZE_TINY, get_lang('Assistance')); } } else { switch ($presence) { case 1: - $form .= Display::return_icon('accept.png', get_lang('Attended')); + $form .= Display::getMdiIcon(StateIcon::CHECKBOX_BLANK, 'ch-tool-icon', null, ICON_SIZE_SMALL, get_lang('Attended')); break; case 0: - $form .= Display::return_icon('exclamation.png', get_lang('Not attended')); + $form .= Display::getMdiIcon(StateIcon::CHECKBOX_MARKED, 'ch-tool-icon', null, ICON_SIZE_SMALL, get_lang('Not attended')); break; case -1: @@ -2894,7 +2874,7 @@ class Attendance $class = 'row_odd'; } - $check = $presence['presence'] ? Display::return_icon('checkbox_on.png', get_lang('Assistance'), null, ICON_SIZE_TINY) : Display::return_icon('checkbox_off.png', get_lang('Assistance'), null, ICON_SIZE_TINY); + $check = $presence['presence'] ? Display::getMdiIcon(StateIcon::CHECKBOX_MARKED, 'ch-tool-icon', null, ICON_SIZE_TINY, get_lang('Assistance')) : Display::getMdiIcon(StateIcon::CHECKBOX_BLANK, 'ch-tool-icon', null, ICON_SIZE_TINY, get_lang('Assistance')); $content .= ' '.$check.'  '.$presence['date_time'].' diff --git a/public/main/inc/lib/banner.lib.php b/public/main/inc/lib/banner.lib.php index e0fbdcb8a6..a242e7899f 100644 --- a/public/main/inc/lib/banner.lib.php +++ b/public/main/inc/lib/banner.lib.php @@ -3,6 +3,7 @@ use Chamilo\CoreBundle\Component\Utils\ChamiloApi; use ChamiloSession as Session; +use Chamilo\CoreBundle\Component\Utils\ObjectIcon; /** * Code. @@ -125,7 +126,7 @@ function returnNotificationMenu() ) { $html .= '
  • ' - .Display::return_icon('user.png', get_lang('Users online'), [], ICON_SIZE_TINY) + .Display::getMdiIcon(ObjectIcon::USER, 'ch-tool-icon', null, ICON_SIZE_TINY, get_lang('Users online')) .' '.$number.'
  • '; } @@ -138,7 +139,7 @@ function returnNotificationMenu() ) { $html .= '
  • ' - .Display::return_icon('course.png', get_lang('Users online').' '.get_lang('in this course'), [], ICON_SIZE_TINY) + .Display::getMdiIcon(ObjectIcon::COURSE, 'ch-tool-icon', null, ICON_SIZE_SMALL, get_lang('Users online').' '.get_lang('in this course'), [], ICON_SIZE_TINY) .' '.$number_online_in_course.'
  • '; } @@ -150,7 +151,7 @@ function returnNotificationMenu() $numberOnlineInSession = getOnlineUsersInSessionCount($sessionId); $html .= '
  • ' - .Display::return_icon('session.png', get_lang('Online in my sessions'), [], ICON_SIZE_TINY) + .Display::getMdiIcon(ObjectIcon::SESSION, 'ch-tool-icon', null, ICON_SIZE_TINY, get_lang('Online in my sessions')) .' '.$numberOnlineInSession.'
  • '; } } @@ -357,29 +358,26 @@ function return_breadcrumb($interbreadcrumb, $language_file, $nameTools) switch (api_get_setting('breadcrumbs_course_homepage')) { case 'get_lang': - $itemTitle = Display::return_icon( - 'home.png', - get_lang('Course home'), - [], - ICON_SIZE_TINY - ); + $itemTitle = Display::getMdiIcon(ObjectIcon::HOME, 'ch-tool-icon', null, ICON_SIZE_TINY, get_lang('Course home')); break; case 'course_code': - $itemTitle = Display::return_icon( - 'home.png', - $courseInfo['official_code'], - [], - ICON_SIZE_TINY + $itemTitle = Display::getMdiIcon( + ObjectIcon::HOME, + 'ch-tool-icon', + null, + ICON_SIZE_TINY, + $courseInfo['official_code'] ) .' '.$courseInfo['official_code']; break; case 'session_name_and_course_title': default: - $itemTitle = Display::return_icon( - 'home.png', - $courseInfo['name'].$sessionName, - [], - ICON_SIZE_TINY + $itemTitle = Display::getMdiIcon( + ObjectIcon::HOME, + 'ch-tool-icon', + null, + ICON_SIZE_TINY, + $courseInfo['name'].$sessionName ) .' '.$course_title.$sessionName; diff --git a/public/main/inc/lib/career.lib.php b/public/main/inc/lib/career.lib.php index d67676e1d6..69d8463d00 100644 --- a/public/main/inc/lib/career.lib.php +++ b/public/main/inc/lib/career.lib.php @@ -4,6 +4,7 @@ use Chamilo\CoreBundle\Entity\Career as CareerEntity; use Fhaculty\Graph\Graph; use Fhaculty\Graph\Vertex; +use Chamilo\CoreBundle\Component\Utils\ActionIcon; class Career extends Model { @@ -76,10 +77,10 @@ class Career extends Model public function display() { $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')).''; if (api_is_platform_admin()) { $actions .= ''. - Display::return_icon('new_career.png', get_lang('Add'), '', ICON_SIZE_MEDIUM).''; + Display::getMdiIcon(ActionIcon::ADD, 'ch-tool-icon', null, ICON_SIZE_MEDIUM, get_lang('Add')).''; } $html = Display::toolbarAction('career_actions', [$actions]); $html .= Display::grid_html('careers'); diff --git a/public/main/inc/lib/course.lib.php b/public/main/inc/lib/course.lib.php index 3d394cbff8..e17c3e5d83 100644 --- a/public/main/inc/lib/course.lib.php +++ b/public/main/inc/lib/course.lib.php @@ -16,6 +16,8 @@ use Chamilo\CourseBundle\Component\CourseCopy\CourseRestorer; use Chamilo\CourseBundle\Entity\CGroup; use ChamiloSession as Session; use Doctrine\Common\Collections\Criteria; +use Chamilo\CoreBundle\Component\Utils\ActionIcon; +use Chamilo\CoreBundle\Component\Utils\ObjectIcon; /** * Class CourseManager. @@ -2091,7 +2093,7 @@ class CourseManager $html .= '
    '; + Display::getMdiIcon(ActionIcon::DELETE, 'ch-tool-icon', null, ICON_SIZE_SMALL, get_lang('Delete')).''; $data[] = [$i, $thematic_advance[1], $thematic_advance[2], $thematic_advance[3], $actions]; $i++; // } diff --git a/public/main/inc/lib/tracking.lib.php b/public/main/inc/lib/tracking.lib.php index a5dd3e3002..9c68113554 100644 --- a/public/main/inc/lib/tracking.lib.php +++ b/public/main/inc/lib/tracking.lib.php @@ -16,6 +16,8 @@ use CpChart\Cache as pCache; use CpChart\Data as pData; use CpChart\Image as pImage; use ExtraField as ExtraFieldModel; +use Chamilo\CoreBundle\Component\Utils\ActionIcon; +use Chamilo\CoreBundle\Component\Utils\StateIcon; /** * Class Tracking. @@ -218,13 +220,25 @@ class Tracking $extend_all = 0; if (!empty($extendedAll)) { $extend_all_link = Display::url( - Display::return_icon('view_less_stats.gif', get_lang('Hide all attempts')), + Display::getMdiIcon( + ActionIcon::VIEW_LESS, + 'ch-tool-icon', + null, + ICON_SIZE_SMALL, + get_lang('Hide all attempts') + ), api_get_self().'?action=stats'.$url_suffix ); $extend_all = 1; } else { $extend_all_link = Display::url( - Display::return_icon('view_more_stats.gif', get_lang('Show all attempts')), + Display::getMdiIcon( + ActionIcon::VIEW_MORE, + 'ch-tool-icon', + null, + ICON_SIZE_SMALL, + get_lang('Show all attempts') + ), api_get_self().'?action=stats&extend_all=1'.$url_suffix ); } @@ -405,7 +419,12 @@ class Tracking $extend_link = ''; if (!empty($inter_num)) { $extend_link = Display::url( - Display::getMdiIcon('eye', 'ch-tool-icon', null, 22, get_lang('Hide attempt view') + Display::getMdiIcon( + ActionIcon::VISIBLE, + 'ch-tool-icon', + null, + ICON_SIZE_SMALL, + get_lang('Hide attempt view') ), api_get_self().'?action=stats&fold_id='.$my_item_id.$url_suffix ); @@ -476,27 +495,51 @@ class Tracking // The extend button for this attempt has been clicked. $extend_this_attempt = 1; $extend_attempt_link = Display::url( - Display::getMdiIcon('eye', 'ch-tool-icon', null, 22, get_lang('Hide attempt view')), + Display::getMdiIcon( + ActionIcon::VISIBLE, + 'ch-tool-icon', + null, + ICON_SIZE_SMALL, + get_lang('Hide attempt view') + ), api_get_self().'?action=stats&extend_id='.$my_item_id.'&fold_attempt_id='.$row['iv_id'].$url_suffix ); if ($accessToPdfExport) { $extend_attempt_link .= ' '. Display::url( - Display::getMdiIcon('file-pdf-box', 'ch-tool-icon', null, 22, get_lang('Export to PDF')), + Display::getMdiIcon( + ActionIcon::EXPORT_PDF, + 'ch-tool-icon', + null, + ICON_SIZE_SMALL, + get_lang('Export to PDF') + ), api_get_self().'?action=export_stats&extend_id='.$my_item_id.'&extend_attempt_id='.$row['iv_id'].$url_suffix, ['class' => 'export'] ); } } else { // Same case if fold_attempt_id is set, so not implemented explicitly. - // The extend button for this attempt has not been clicked. + // The "extend" button for this attempt has not been clicked. $extend_attempt_link = Display::url( - Display::getMdiIcon('eye-off', 'ch-tool-icon', null, 22, get_lang('Extend attempt view')), + Display::getMdiIcon( + ActionIcon::INVISIBLE, + 'ch-tool-icon', + null, + ICON_SIZE_SMALL, + get_lang('Extend attempt view') + ), api_get_self().'?action=stats&extend_id='.$my_item_id.'&extend_attempt_id='.$row['iv_id'].$url_suffix ); if ($accessToPdfExport) { $extend_attempt_link .= ' '. Display::url( - Display::getMdiIcon('file-pdf-box', 'ch-tool-icon', null, 22, get_lang('Export to PDF')), + Display::getMdiIcon( + ActionIcon::EXPORT_PDF, + 'ch-tool-icon', + null, + ICON_SIZE_SMALL, + get_lang('Export to PDF') + ), api_get_self().'?action=export_stats&extend_id='.$my_item_id.'&extend_attempt_id='.$row['iv_id'].$url_suffix, ['class' => 'export'] ); @@ -551,7 +594,12 @@ class Tracking if ('dir' !== $row['item_type']) { if (!$is_allowed_to_edit && $result_disabled_ext_all) { - $view_score = Display::getMdiIcon('eye-off', 'ch-tool-icon', null, 22, get_lang('Results hidden by the exercise setting') + $view_score = Display::getMdiIcon( + ActionIcon::INVISIBLE, + 'ch-tool-icon', + null, + ICON_SIZE_SMALL, + get_lang('Results hidden by the exercise setting') ); } else { switch ($row['item_type']) { @@ -712,14 +760,26 @@ class Tracking // The extend button for this attempt has been clicked. $extend_this_attempt = 1; $extend_attempt_link = Display::url( - Display::getMdiIcon('eye', 'ch-tool-icon', null, 22, get_lang('Hide attempt view')), + Display::getMdiIcon( + ActionIcon::VISIBLE, + 'ch-tool-icon', + null, + ICON_SIZE_SMALL, + get_lang('Hide attempt view') + ), api_get_self().'?action=stats&extend_id='.$my_item_id.'&fold_attempt_id='.$row['iv_id'].$url_suffix ); } else { // Same case if fold_attempt_id is set, so not implemented explicitly. // The "Extend" button for this attempt has not been clicked. $extend_attempt_link = Display::url( - Display::getMdiIcon('eye-off', 'ch-tool-icon', null, 22, get_lang('Extend attempt view')), + Display::getMdiIcon( + ActionIcon::INVISIBLE, + 'ch-tool-icon', + null, + ICON_SIZE_SMALL, + get_lang('Extend attempt view') + ), api_get_self().'?action=stats&extend_id='.$my_item_id.'&extend_attempt_id='.$row['iv_id'].$url_suffix ); } @@ -733,7 +793,13 @@ class Tracking $extend_link = ''; if ($inter_num > 1) { $extend_link = Display::url( - Display::getMdiIcon('eye-off', 'ch-tool-icon', null, 22, get_lang('Extend attempt view')), + Display::getMdiIcon( + ActionIcon::INVISIBLE, + 'ch-tool-icon', + null, + ICON_SIZE_SMALL, + get_lang('Extend attempt view') + ), api_get_self().'?action=stats&extend_id='.$my_item_id.'&extend_attempt_id='.$row['iv_id'].$url_suffix ); } @@ -906,8 +972,11 @@ class Tracking ) { $showRowspan = true; $correct_test_link = Display::url( - Display::return_icon( - 'view_less_stats.gif', + Display::getMdiIcon( + ActionIcon::VIEW_LESS, + 'ch-tool-icon', + null, + ICON_SIZE_SMALL, get_lang('Hide all attempts') ), api_get_self().'?action=stats'.$my_url_suffix.'&sid='.$sessionId.'&lp_item_id='.$my_id.'#'.$linkId, @@ -915,8 +984,11 @@ class Tracking ); } else { $correct_test_link = Display::url( - Display::return_icon( - 'view_more_stats.gif', + Display::getMdiIcon( + ActionIcon::VIEW_MORE, + 'ch-tool-icon', + null, + ICON_SIZE_SMALL, get_lang( 'Show all attemptsByExercise' ) @@ -954,7 +1026,12 @@ class Tracking $scoreItem = null; if ('quiz' === $row['item_type']) { if (!$is_allowed_to_edit && $result_disabled_ext_all) { - $scoreItem .= Display::getMdiIcon('eye-off', 'ch-tool-icon', null, 22, get_lang('Results hidden by the exercise setting') + $scoreItem .= Display::getMdiIcon( + ActionIcon::INVISIBLE, + 'ch-tool-icon', + null, + ICON_SIZE_SMALL, + get_lang('Results hidden by the exercise setting') ); } else { $scoreItem .= ExerciseLib::show_score($score, $maxscore, false); @@ -1096,11 +1173,12 @@ class Tracking $time_attemp = api_format_time($row_attempts['exe_duration'], 'js'); } if (!$is_allowed_to_edit && $result_disabled_ext_all) { - $view_score = Display::return_icon( - 'invisible.png', - get_lang( - 'Results hidden by the exercise setting' - ) + $view_score = Display::getMdiIcon( + ActionIcon::INVISIBLE, + 'ch-tool-icon', + null, + ICON_SIZE_SMALL, + get_lang('Results hidden by the exercise setting') ); } else { // Show only float when need it @@ -1241,7 +1319,13 @@ class Tracking $total_time = str_replace('NaN', '00'.$h.'00\'00"', $total_time); if (!$is_allowed_to_edit && $result_disabled_ext_all) { - $final_score = Display::getMdiIcon('eye-off', 'ch-tool-icon', null, 22, get_lang('Results hidden by the exercise setting')); + $final_score = Display::getMdiIcon( + ActionIcon::INVISIBLE, + 'ch-tool-icon', + null, + ICON_SIZE_SMALL, + get_lang('Results hidden by the exercise setting') + ); $finalScoreToCsv = get_lang('Results hidden by the exercise setting'); } else { if (is_numeric($total_score)) { @@ -2080,7 +2164,12 @@ class Tracking $url = api_get_path(WEB_CODE_PATH). 'announcements/announcements.php?action=add&remind_inactive='.$student_id.'&cid='.$courseInfo['real_id']; $icon = ' - '.Display::getMdiIcon('alert').' + '.Display::getMdiIcon( + StateIcon::WARNING, + 'ch-tool-icon', + null, + ICON_SIZE_SMALL + ).' '; } @@ -4645,7 +4734,7 @@ class Tracking 'book-open-page-variant', 'ch-tool-icon', null, - 22, + ICON_SIZE_SMALL, get_lang('My courses') ).' '.get_lang('My courses') ); @@ -4775,11 +4864,23 @@ class Tracking empty($_GET['session_id']) ) { $detailsLink .= ''; - $detailsLink .= Display::getMdiIcon('fast-forward-outline', 'ch-tool-icon', null, 22, get_lang('Details')); + $detailsLink .= Display::getMdiIcon( + 'fast-forward-outline', + 'ch-tool-icon', + null, + ICON_SIZE_SMALL, + get_lang('Details') + ); $detailsLink .= ''; } else { $detailsLink .= ''; - $detailsLink .= Display::getMdiIcon('fast-forward-outline', 'ch-tool-icon', null, 22, get_lang('Details')); + $detailsLink .= Display::getMdiIcon( + 'fast-forward-outline', + 'ch-tool-icon', + null, + ICON_SIZE_SMALL, + get_lang('Details') + ); $detailsLink .= ''; } @@ -4916,7 +5017,13 @@ class Tracking ); } - $sessionIcon = Display::getMdiIcon('google-classroom', 'ch-tool-icon', null, 22, get_lang('Course sessions')); + $sessionIcon = Display::getMdiIcon( + 'google-classroom', + 'ch-tool-icon', + null, + ICON_SIZE_SMALL, + get_lang('Course sessions') + ); $anchor = Display::url('', '', ['name' => 'course_session_header']); $html .= $anchor.Display::page_subheader( @@ -5012,13 +5119,24 @@ class Tracking if (isset($_GET['session_id']) && $my_session_id == $_GET['session_id']) { $icon = Display::url( - Display::getMdiIcon('fast-forward-outline', 'ch-tool-icon', null, 22, get_lang('Details') + Display::getMdiIcon( + 'fast-forward-outline', + 'ch-tool-icon', + null, + ICON_SIZE_SMALL, + get_lang('Details') ), api_get_self().'?session_id='.$my_session_id.'#course_session_list' ); } else { $icon = Display::url( - Display::getMdiIcon('fast-forward-outline', 'ch-tool-icon', null, 22, get_lang('Details')), + Display::getMdiIcon( + 'fast-forward-outline', + 'ch-tool-icon', + null, + ICON_SIZE_SMALL, + get_lang('Details') + ), api_get_self().'?session_id='.$my_session_id.'#course_session_list' ); } @@ -5073,10 +5191,12 @@ class Tracking ], 'score' => [ get_lang('Score'). - Display::return_icon( - 'info3.gif', - get_lang('Average of tests in Learning Paths'), - ['align' => 'absmiddle', 'hspace' => '3px'] + Display::getMdiIcon( + ActionIcon::INFORMATION, + 'ch-tool-icon', + null, + ICON_SIZE_SMALL, + get_lang('Average of tests in Learning Paths') ), ], 'best_score' => [ @@ -5236,14 +5356,14 @@ class Tracking $_GET['session_id'] == $session_id_from_get ) { $details = Display::url( - Display::getMdiIcon('fast-forward-outline', 'ch-tool-icon', null, 22, get_lang('Details')), + Display::getMdiIcon('fast-forward-outline', 'ch-tool-icon', null, ICON_SIZE_SMALL, get_lang('Details')), '#course_session_data' ); } else { $url = api_get_self(). '?course='.$course_code.'&session_id='.$session_id_from_get.$extra_params.'#course_session_data'; $details = Display::url( - Display::getMdiIcon('fast-forward-outline', 'ch-tool-icon', null, 22, get_lang('Details') + Display::getMdiIcon('fast-forward-outline', 'ch-tool-icon', null, ICON_SIZE_SMALL, get_lang('Details') ), $url ); @@ -5335,11 +5455,13 @@ class Tracking '.get_lang('Ranking').' '.get_lang('Best result in course').' '.get_lang('Statistics').' ' - .Display::return_icon( - 'info3.gif', - get_lang('In case of multiple attempts, only shows the best result of each learner'), - ['align' => 'absmiddle', 'hspace' => '3px'] - ). + .Display::getMdiIcon( + ActionIcon::INFORMATION, + 'ch-tool-icon', + null, + ICON_SIZE_SMALL, + get_lang('In case of multiple attempts') + ). ' @@ -7550,7 +7672,13 @@ class Tracking get_lang('BestAttempt'), get_lang('Ranking'), get_lang('BestResultInCourse'), - get_lang('Statistics').Display::return_icon('info3.gif', get_lang('OnlyBestResultsPerStudent')), + get_lang('Statistics').Display::getMdiIcon( + ActionIcon::INFORMATION, + 'ch-tool-icon', + null, + ICON_SIZE_SMALL, + get_lang('OnlyBestResultsPerStudent') + ), ] ); @@ -8784,8 +8912,13 @@ class TrackingCourseLog $url = $urlBase.'&student='.$user['user_id']; $user['link'] = '
    - '.Display::getMdiIcon('fast-forward-outline', 'ch-tool-icon', null, 32, get_lang('Details')).' -
    '; + '.Display::getMdiIcon( + 'fast-forward-outline', + 'ch-tool-icon', + null, + ICON_SIZE_MEDIUM, + get_lang('Details') + ).''; // store columns in array $users $user_row = []; @@ -8998,8 +9131,13 @@ class TrackingCourseLog
    - '.Display::getMdiIcon('fast-forward-outline', 'ch-tool-icon', null, 22, get_lang('Details')).' - + '.Display::getMdiIcon( + 'fast-forward-outline', + 'ch-tool-icon', + null, + ICON_SIZE_SMALL, + get_lang('Details') + ).'
    '; // store columns in array $users @@ -9030,37 +9168,37 @@ class TrackingCourseLog public static function actionsLeft($current, $sessionId = 0, $addWrapper = true) { $usersLink = Display::url( - Display::getMdiIcon('account', 'ch-tool-icon', null, 32, get_lang('Report on learners')), + Display::getMdiIcon('account', 'ch-tool-icon', null, ICON_SIZE_MEDIUM, get_lang('Report on learners')), 'courseLog.php?'.api_get_cidreq(true, false) ); $groupsLink = Display::url( - Display::getMdiIcon('account-group', 'ch-tool-icon', null, 32, get_lang('Group reporting')), + Display::getMdiIcon('account-group', 'ch-tool-icon', null, ICON_SIZE_MEDIUM, get_lang('Group reporting')), 'course_log_groups.php?'.api_get_cidreq() ); $resourcesLink = ''; /*$resourcesLink = Display::url( - Display::getMdiIcon('chart-box', 'ch-tool-icon', null, 32, get_lang('Report on resource')), + Display::getMdiIcon('chart-box', 'ch-tool-icon', null, ICON_SIZE_MEDIUM, get_lang('Report on resource')), 'course_log_resources.php?'.api_get_cidreq(true, false) );*/ $courseLink = Display::url( - Display::getMdiIcon('book-open-page-variant ', 'ch-tool-icon', null, 32, get_lang('Course report')), + Display::getMdiIcon('book-open-page-variant ', 'ch-tool-icon', null, ICON_SIZE_MEDIUM, get_lang('Course report')), 'course_log_tools.php?'.api_get_cidreq(true, false) ); $examLink = Display::url( - Display::getMdiIcon('chart-box', 'ch-tool-icon', null, 32, get_lang('Exam tracking')), + Display::getMdiIcon('chart-box', 'ch-tool-icon', null, ICON_SIZE_MEDIUM, get_lang('Exam tracking')), api_get_path(WEB_CODE_PATH).'tracking/exams.php?'.api_get_cidreq() ); $eventsLink = Display::url( - Display::getMdiIcon('security', 'ch-tool-icon', null, 32, get_lang('Audit report')), + Display::getMdiIcon('security', 'ch-tool-icon', null, ICON_SIZE_MEDIUM, get_lang('Audit report')), api_get_path(WEB_CODE_PATH).'tracking/course_log_events.php?'.api_get_cidreq() ); $lpLink = Display::url( - Display::getMdiIcon('map-marker-path', 'ch-tool-icon', null, 32, get_lang('CourseLPsGenericStats')), + Display::getMdiIcon('map-marker-path', 'ch-tool-icon', null, ICON_SIZE_MEDIUM, get_lang('CourseLPsGenericStats')), api_get_path(WEB_CODE_PATH).'tracking/lp_report.php?'.api_get_cidreq() ); @@ -9073,7 +9211,7 @@ class TrackingCourseLog $checkExport = $attendance->getAttendanceLogin($startDate, $endDate); if (false !== $checkExport) { $attendanceLink = Display::url( - Display::getMdiIcon('av-timer', 'ch-tool-icon', null, 32, get_lang('Logins')), + Display::getMdiIcon('av-timer', 'ch-tool-icon', null, ICON_SIZE_MEDIUM, get_lang('Logins')), api_get_path(WEB_CODE_PATH).'attendance/index.php?'.api_get_cidreq().'&action=calendar_logins' ); } @@ -9082,51 +9220,51 @@ class TrackingCourseLog switch ($current) { case 'users': $usersLink = Display::url( - Display::getMdiIcon('account', 'ch-tool-icon-disabled', null, 32, get_lang('Report on learners')), + Display::getMdiIcon('account', 'ch-tool-icon-disabled', null, ICON_SIZE_MEDIUM, get_lang('Report on learners')), '#' ); break; case 'groups': $groupsLink = Display::url( - Display::getMdiIcon('account-group', 'ch-tool-icon-disabled', null, 32, get_lang('Group reporting')), + Display::getMdiIcon('account-group', 'ch-tool-icon-disabled', null, ICON_SIZE_MEDIUM, get_lang('Group reporting')), '#' ); break; case 'courses': $courseLink = Display::url( - Display::getMdiIcon('book-open-page-variant', 'ch-tool-icon-disabled', null, 32, get_lang('Course report')), + Display::getMdiIcon('book-open-page-variant', 'ch-tool-icon-disabled', null, ICON_SIZE_MEDIUM, get_lang('Course report')), '#' ); break; case 'resources': $resourcesLink = Display::url( - Display::getMdiIcon('package-variant-closed', 'ch-tool-icon-disabled', null, 32, get_lang('Report on resource')), + Display::getMdiIcon('package-variant-closed', 'ch-tool-icon-disabled', null, ICON_SIZE_MEDIUM, get_lang('Report on resource')), '#' ); break; case 'exams': $examLink = Display::url( - Display::getMdiIcon('order-bool-ascending-variant', 'ch-tool-icon-disabled', null, 32, get_lang('Exam tracking')), + Display::getMdiIcon('order-bool-ascending-variant', 'ch-tool-icon-disabled', null, ICON_SIZE_MEDIUM, get_lang('Exam tracking')), '#' ); break; case 'logs': $eventsLink = Display::url( - Display::getMdiIcon('security', 'ch-tool-icon-disabled', null, 32, get_lang('Audit report')), + Display::getMdiIcon('security', 'ch-tool-icon-disabled', null, ICON_SIZE_MEDIUM, get_lang('Audit report')), '#' ); break; case 'attendance': if (!empty($sessionId)) { $attendanceLink = Display::url( - Display::getMdiIcon('av-timer', 'ch-tool-icon-disabled', null, 32, get_lang('Logins')), + Display::getMdiIcon('av-timer', 'ch-tool-icon-disabled', null, ICON_SIZE_MEDIUM, get_lang('Logins')), '#' ); } break; case 'lp': $lpLink = Display::url( - Display::getMdiIcon('map-marker-path', 'ch-tool-icon-disabled', null, 32, get_lang('CourseLPsGenericStats')), + Display::getMdiIcon('map-marker-path', 'ch-tool-icon-disabled', null, ICON_SIZE_MEDIUM, get_lang('CourseLPsGenericStats')), '#' ); break; diff --git a/public/main/inc/lib/usergroup.lib.php b/public/main/inc/lib/usergroup.lib.php index fbaf364371..195cddceba 100644 --- a/public/main/inc/lib/usergroup.lib.php +++ b/public/main/inc/lib/usergroup.lib.php @@ -6,6 +6,7 @@ use Chamilo\CoreBundle\Entity\ResourceFile; use Chamilo\CoreBundle\Entity\Usergroup; use Chamilo\CoreBundle\Framework\Container; use Symfony\Component\HttpFoundation\File\UploadedFile; +use Chamilo\CoreBundle\Component\Utils\ActionIcon; /** * Class UserGroup. @@ -331,24 +332,25 @@ class UserGroupModel extends Model $actions = ''; if (api_is_platform_admin()) { $actions .= ''. - 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') ). ''; } $actions .= ''. - Display::return_icon('new_class.png', get_lang('Add classes'), '', ICON_SIZE_MEDIUM). + Display::getMdiIcon(ActionIcon::ADD, 'ch-tool-icon', null, ICON_SIZE_MEDIUM, get_lang('Add classes')). ''; $actions .= Display::url( - Display::return_icon('import_csv.png', get_lang('Import'), [], ICON_SIZE_MEDIUM), + Display::getMdiIcon(ActionIcon::IMPORT_ARCHIVE, 'ch-tool-icon', null, ICON_SIZE_MEDIUM, get_lang('Import')), 'usergroup_import.php' ); $actions .= Display::url( - Display::return_icon('export_csv.png', get_lang('Export'), [], ICON_SIZE_MEDIUM), + Display::getMdiIcon(ActionIcon::EXPORT_CSV, 'ch-tool-icon', null, ICON_SIZE_MEDIUM, get_lang('Export')), 'usergroup_export.php' ); $html .= Display::toolbarAction('toolbar', [$actions]); @@ -367,11 +369,23 @@ class UserGroupModel extends Model $courseInfo = api_get_course_info(); if (empty($courseInfo)) { echo ''. - Display::return_icon('back.png', get_lang('Back to').' '.get_lang('Administration'), '', '32'). + Display::getMdiIcon( + ActionIcon::BACK, + 'ch-tool-icon', + null, + ICON_SIZE_MEDIUM, + get_lang('Back to').' '.get_lang('Administration') + ). ''; } else { echo Display::url( - Display::return_icon('back.png', get_lang('Back to').' '.get_lang('Administration'), '', '32'), + Display::getMdiIcon( + ActionIcon::BACK, + 'ch-tool-icon', + null, + ICON_SIZE_MEDIUM, + get_lang('Back to').' '.get_lang('Administration') + ), api_get_path(WEB_CODE_PATH).'user/class.php?'.api_get_cidreq() ); } @@ -2547,7 +2561,7 @@ class UserGroupModel extends Model case GROUP_USER_PERMISSION_ADMIN: $relation_group_title = get_lang('I am an admin'); $links .= '
  • '. - Display::return_icon('group_edit.png', get_lang('Edit this group')).get_lang('Edit this group').'
  • '; + Display::getMdiIcon(ActionIcon::EDIT, 'ch-tool-icon', null, ICON_SIZE_MEDIUM, get_lang('Edit this group')).get_lang('Edit this group').''; $links .= '
  • '. Display::return_icon('waiting_list.png', get_lang('Waiting list')).get_lang('Waiting list').'
  • '; $links .= '
  • '. diff --git a/public/main/inc/lib/webservices/Rest.php b/public/main/inc/lib/webservices/Rest.php index f3bd1d6a1a..3b722650dc 100644 --- a/public/main/inc/lib/webservices/Rest.php +++ b/public/main/inc/lib/webservices/Rest.php @@ -11,6 +11,7 @@ use Chamilo\CoreBundle\Framework\Container; use Chamilo\CourseBundle\Entity\CLpCategory; use Chamilo\CourseBundle\Entity\CNotebook; use Chamilo\CourseBundle\Repository\CNotebookRepository; +use Chamilo\CoreBundle\Component\Utils\ObjectIcon; /** * Class RestApi. @@ -2018,7 +2019,7 @@ class Rest extends WebService "modules" => [], ]; - $quizIcon = Display::return_icon('quiz.png', '', [], ICON_SIZE_SMALL, false, true); + $quizIcon = Display::getMdiIcon(ObjectIcon::TEST, 'ch-tool-icon', null, ICON_SIZE_SMALL); $json['modules'] = array_map( function (array $exercise) use ($quizIcon) { diff --git a/public/main/inc/lib/zombie/zombie_report.class.php b/public/main/inc/lib/zombie/zombie_report.class.php index 915af27cf0..4d2cb237a7 100644 --- a/public/main/inc/lib/zombie/zombie_report.class.php +++ b/public/main/inc/lib/zombie/zombie_report.class.php @@ -1,5 +1,9 @@ returnForm(); diff --git a/public/main/portfolio/add_item.php b/public/main/portfolio/add_item.php index 799c29e03c..c94a3e9c41 100644 --- a/public/main/portfolio/add_item.php +++ b/public/main/portfolio/add_item.php @@ -2,6 +2,7 @@ /* For licensing terms, see /license.txt */ use Chamilo\CoreBundle\Entity\Portfolio; +use Chamilo\CoreBundle\Component\Utils\ActionIcon; $categories = $em ->getRepository('ChamiloCoreBundle:PortfolioCategory') @@ -58,7 +59,7 @@ $interbreadcrumb[] = [ ]; $actions[] = 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')), $baseUrl ); $content = $form->returnForm(); diff --git a/public/main/portfolio/edit_category.php b/public/main/portfolio/edit_category.php index 39e1d239fa..3d27df2185 100644 --- a/public/main/portfolio/edit_category.php +++ b/public/main/portfolio/edit_category.php @@ -1,6 +1,8 @@ getId()}"); if ('true' === api_get_setting('editor.save_titles_as_html')) { $form->addHtmlEditor('title', get_lang('Title'), true, false, ['ToolbarSet' => 'TitleAsHtml']); @@ -39,7 +41,7 @@ $interbreadcrumb[] = [ 'url' => $baseUrl, ]; $actions[] = 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')), $baseUrl ); $content = $form->returnForm(); diff --git a/public/main/portfolio/edit_item.php b/public/main/portfolio/edit_item.php index 991e0f442a..3bd950c491 100644 --- a/public/main/portfolio/edit_item.php +++ b/public/main/portfolio/edit_item.php @@ -1,6 +1,8 @@ getRepository('ChamiloCoreBundle:PortfolioCategory') ->findBy([ @@ -52,7 +54,7 @@ $interbreadcrumb[] = [ 'url' => $baseUrl, ]; $actions[] = 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')), $baseUrl ); $content = $form->returnForm(); diff --git a/public/main/portfolio/list.php b/public/main/portfolio/list.php index 578c7d59db..0ea63e12a6 100644 --- a/public/main/portfolio/list.php +++ b/public/main/portfolio/list.php @@ -1,23 +1,27 @@ getId()) { if ($allowEdit) { $actions[] = Display::url( - Display::return_icon('add.png', get_lang('Add'), [], ICON_SIZE_MEDIUM), + Display::getMdiIcon(ActionIcon::ADD, 'ch-tool-icon', null, ICON_SIZE_MEDIUM, get_lang('Add')), $baseUrl.'action=add_item' ); $actions[] = Display::url( - Display::return_icon('folder.png', get_lang('Add category'), [], ICON_SIZE_MEDIUM), + Display::getMdiIcon(ObjectIcon::FOLDER, 'ch-tool-icon', null, ICON_SIZE_MEDIUM, get_lang('Add category')), $baseUrl.'action=add_category' ); $actions[] = Display::url( - Display::return_icon('shared_setting.png', get_lang('Preview'), [], ICON_SIZE_MEDIUM), + Display::getMdiIcon(ToolIcon::SETTINGS, 'ch-tool-icon', null, ICON_SIZE_MEDIUM, get_lang('Preview')), $baseUrl.'preview=&user='.$user->getId() ); } else { $actions[] = Display::url( - Display::return_icon('shared_setting_na.png', get_lang('Preview'), [], ICON_SIZE_MEDIUM), + Display::getMdiIcon(ToolIcon::SETTINGS, 'ch-tool-icon-disabled', null, ICON_SIZE_MEDIUM, get_lang('Preview')), $baseUrl ); } diff --git a/public/main/work/work.lib.php b/public/main/work/work.lib.php index a7b1c6274e..239fc7440a 100644 --- a/public/main/work/work.lib.php +++ b/public/main/work/work.lib.php @@ -11,6 +11,9 @@ use Chamilo\CourseBundle\Entity\CStudentPublication; use Chamilo\CourseBundle\Entity\CStudentPublicationAssignment; use Chamilo\CourseBundle\Entity\CStudentPublicationComment; use ChamiloSession as Session; +use Chamilo\CoreBundle\Component\Utils\ActionIcon; +use Chamilo\CoreBundle\Component\Utils\ObjectIcon; +use Chamilo\CoreBundle\Component\Utils\StateIcon; /** * @author Thomas, Hugues, Christophe - original version @@ -42,7 +45,7 @@ function displayWorkActionLinks($id, $action, $isTutor) if (!empty($id)) { $output .= ''. - Display::return_icon('back.png', get_lang('Back to Assignments list'), '', ICON_SIZE_MEDIUM). + Display::getMdiIcon(ActionIcon::BACK, 'ch-tool-icon', null, ICON_SIZE_MEDIUM, get_lang('Back to Assignments list')). ''; } @@ -52,24 +55,14 @@ function displayWorkActionLinks($id, $action, $isTutor) // Create dir if (empty($id)) { $output .= ''; - $output .= Display::return_icon( - 'new_work.png', - get_lang('Create assignment'), - '', - ICON_SIZE_MEDIUM - ); + $output .= Display::getMdiIcon(ActionIcon::ADD, 'ch-tool-icon', null, ICON_SIZE_MEDIUM, get_lang('Create assignment')); $output .= ''; } } if (api_is_allowed_to_edit(null, true) && 'learnpath' !== $origin && 'list' === $action) { $output .= ''. - Display::return_icon( - 'listwork.png', - get_lang('View students'), - '', - ICON_SIZE_MEDIUM - ). + Display::getMdiIcon(StateIcon::LIST_VIEW, 'ch-tool-icon', null, ICON_SIZE_MEDIUM, get_lang('View students')). ''; } @@ -1270,7 +1263,7 @@ function getWorkListStudent( $studentPublications = $qb->getQuery()->getResult(); $urlOthers = api_get_path(WEB_CODE_PATH).'work/work_list_others.php?'.api_get_cidreq().'&id='; //while ($work = Database::fetch_array($result, 'ASSOC')) { - $icon = Display::return_icon('work.png'); + $icon = Display::getMdiIcon(ObjectIcon::ASSIGNMENT, 'ch-tool-icon', null, ICON_SIZE_SMALL); /** @var CStudentPublication $studentPublication */ foreach ($studentPublications as $studentPublication) { @@ -1325,7 +1318,7 @@ function getWorkListStudent( $work['title'] = Display::url($title, $url.'&id='.$workId); $work['others'] = Display::url( - Display::return_icon('group.png', get_lang('Others')), + Display::getMdiIcon(ObjectIcon::GROUP, 'ch-tool-icon', null, ICON_SIZE_SMALL, get_lang('Others')), $urlOthers.$workId ); $works[] = $work; @@ -1485,7 +1478,7 @@ function getAllWorkListStudent( continue; }*/ - $work['type'] = Display::return_icon('work.png'); + $work['type'] = Display::getMdiIcon(ObjectIcon::ASSIGNMENT, 'ch-tool-icon', null, ICON_SIZE_SMALL); $work['expires_on'] = empty($work['expires_on']) ? null : api_get_local_time($work['expires_on']); if (empty($work['title'])) { @@ -1629,7 +1622,7 @@ function getWorkListTeacher( $blockEdition = ('true' === api_get_setting('work.block_student_publication_edition')); //while ($work = Database::fetch_array($result, 'ASSOC')) { - $icon = Display::return_icon('work.png'); + $icon = Display::getMdiIcon(ObjectIcon::ASSIGNMENT, 'ch-tool-icon', null, ICON_SIZE_SMALL); /** @var CStudentPublication $studentPublication */ foreach ($studentPublications as $studentPublication) { $workId = $studentPublication->getIid(); @@ -1662,19 +1655,19 @@ function getWorkListTeacher( //$visibility = api_get_item_visibility($courseInfo, 'work', $workId, $session_id); $isVisible = $studentPublication->isVisible($course, $session); if ($isVisible) { - $icon = 'visible.png'; + $icon = ActionIcon::VISIBLE; $text = get_lang('Visible'); $action = 'invisible'; $class = ''; } else { - $icon = 'invisible.png'; + $icon = ActionIcon::INVISIBLE; $text = get_lang('invisible'); $action = 'visible'; $class = 'muted'; } $visibilityLink = Display::url( - Display::return_icon($icon, $text, [], ICON_SIZE_SMALL), + Display::getMdiIcon($icon, 'ch-tool-icon', null, ICON_SIZE_SMALL, $text), api_get_path(WEB_CODE_PATH).'work/work.php?id='.$workId.'&action='.$action.'&'.api_get_cidreq() ); @@ -1687,34 +1680,24 @@ function getWorkListTeacher( $editLink = ''; } else { $editLink = Display::url( - 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')), api_get_path(WEB_CODE_PATH).'work/edit_work.php?id='.$workId.'&'.api_get_cidreq() ); } $correctionLink = ' '.Display::url( - Display::return_icon('upload_package.png', get_lang('Upload corrections'), '', ICON_SIZE_SMALL), + Display::getMdiIcon(ActionIcon::UPLOAD, 'ch-tool-icon', null, ICON_SIZE_SMALL, get_lang('Upload corrections')), api_get_path(WEB_CODE_PATH).'work/upload_corrections.php?'.api_get_cidreq().'&id='.$workId ).' '; if ($countUniqueAttempts > 0) { $downloadLink = Display::url( - Display::return_icon( - 'save_pack.png', - get_lang('Save'), - [], - ICON_SIZE_SMALL - ), + Display::getMdiIcon(ActionIcon::SAVE_FORM, 'ch-tool-icon', null, ICON_SIZE_SMALL, get_lang('Save')), api_get_path(WEB_CODE_PATH).'work/downloadfolder.inc.php?id='.$workId.'&'.api_get_cidreq() ); } else { $downloadLink = Display::url( - Display::return_icon( - 'save_pack_na.png', - get_lang('Save'), - [], - ICON_SIZE_SMALL - ), + Display::getMdiIcon(ActionIcon::SAVE_FORM, 'ch-tool-icon-disabled', null, ICON_SIZE_SMALL, get_lang('Save')), '#' ); } @@ -1870,16 +1853,11 @@ function get_work_user_list_from_documents( $urlView = api_get_path(WEB_CODE_PATH).'work/view.php?'.api_get_cidreq(); $urlDownload = api_get_path(WEB_CODE_PATH).'work/download.php?'.api_get_cidreq(); - $editIcon = Display::return_icon('edit.png', get_lang('Edit')); - $addIcon = Display::return_icon('add.png', get_lang('Add')); - $deleteIcon = Display::return_icon('delete.png', get_lang('Delete')); - $viewIcon = Display::return_icon('default.png', get_lang('View')); - $saveIcon = Display::return_icon( - 'save.png', - get_lang('Save'), - [], - ICON_SIZE_SMALL - ); + $editIcon = Display::getMdiIcon(ActionIcon::EDIT, 'ch-tool-icon', null, ICON_SIZE_SMALL, get_lang('Edit')); + $addIcon = Display::getMdiIcon(ActionIcon::ADD, 'ch-tool-icon', null, ICON_SIZE_SMALL, get_lang('Add')); + $deleteIcon = Display::getMdiIcon(ActionIcon::DELETE, 'ch-tool-icon', null, ICON_SIZE_SMALL, get_lang('Delete')); + $viewIcon = Display::getMdiIcon(ObjectIcon::DEFAULT, 'ch-tool-icon', null, ICON_SIZE_SMALL, get_lang('View')); + $saveIcon = Display::getMdiIcon(ActionIcon::SAVE_FORM, 'ch-tool-icon', null, ICON_SIZE_SMALL, get_lang('Save')); $allowEdition = 1 == api_get_course_setting('student_delete_own_publication'); $workList = []; @@ -2137,39 +2115,19 @@ function get_work_user_list( $loadingText = addslashes(get_lang('Loading')); $uploadedText = addslashes(get_lang('Uploaded.')); $failsUploadText = addslashes(get_lang('No file was uploaded..')); - $failsUploadIcon = Display::return_icon( - 'closed-circle.png', - '', - [], + $failsUploadIcon = Display::getMdiIcon( + StateIcon::INCOMPLETE, + 'ch-tool-icon', + null, ICON_SIZE_TINY ); - $saveIcon = Display::return_icon( - 'save.png', - get_lang('Save'), - [], - ICON_SIZE_SMALL - ); + $saveIcon = Display::getMdiIcon(ActionIcon::SAVE_FORM, 'ch-tool-icon', null, ICON_SIZE_SMALL, get_lang('Save')); - $correctionIcon = Display::return_icon( - 'check-circle.png', - get_lang('Correction'), - null, - ICON_SIZE_SMALL - ); + $correctionIcon = Display::getMdiIcon(ActionIcon::ACCEPT, 'ch-tool-icon', null, ICON_SIZE_SMALL, get_lang('Correction')); - $correctionIconSmall = Display::return_icon( - 'check-circle.png', - get_lang('Correction'), - null, - ICON_SIZE_TINY - ); + $correctionIconSmall = Display::getMdiIcon(ActionIcon::ACCEPT, 'ch-tool-icon', null, ICON_SIZE_TINY, get_lang('Correction')); - $rateIcon = Display::return_icon( - 'rate_work.png', - get_lang('Correct and rate'), - [], - ICON_SIZE_SMALL - ); + $rateIcon = Display::getMdiIcon(ActionIcon::GRADE, 'ch-tool-icon', null, ICON_SIZE_SMALL, get_lang('Correct and rate')); $blockEdition = ('true' === api_get_setting('work.block_student_publication_edition')); $blockScoreEdition = ('true' === api_get_setting('work.block_student_publication_score_edition')); @@ -2327,7 +2285,7 @@ function get_work_user_list( $action .= ''. - Display::return_icon('export_doc.png', get_lang('Export to .doc'), [], ICON_SIZE_SMALL).' '; + Display::getMdiIcon(ActionIcon::EXPORT_DOC, 'ch-tool-icon', null, ICON_SIZE_SMALL, get_lang('Export to .doc')).' '; } $alreadyUploaded = ''; @@ -2346,7 +2304,7 @@ function get_work_user_list( >
    '.addslashes(get_lang('Click or drop one file here')).' - '.Display::return_icon('upload_file.png', get_lang('Correction'), [], ICON_SIZE_TINY).' + '.Display::getMdiIcon(ActionIcon::UPLOAD, 'ch-tool-icon', null, ICON_SIZE_TINY, get_lang('Correction')).' '.$alreadyUploaded.'
    @@ -2389,14 +2347,9 @@ function get_work_user_list( if ($locked) { if ($qualification_exists) { - $action .= Display::return_icon( - 'edit_na.png', - get_lang('Correct and rate'), - [], - ICON_SIZE_SMALL - ); + $action .= Display::getMdiIcon(ActionIcon::EDIT, 'ch-tool-icon-disabled', null, ICON_SIZE_SMALL, get_lang('Correct and rate')); } else { - $action .= Display::return_icon('edit_na.png', get_lang('Comment'), [], ICON_SIZE_SMALL); + $action .= Display::getMdiIcon(ActionIcon::EDIT, 'ch-tool-icon-disabled', null, ICON_SIZE_SMALL, get_lang('Comment')); } } else { if ($blockEdition && !api_is_platform_admin()) { @@ -2406,12 +2359,12 @@ function get_work_user_list( $editLink = ''. - 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')).''; } else { $editLink = ''. - 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')).''; } } $action .= $editLink; @@ -2419,17 +2372,12 @@ function get_work_user_list( if ($assignment->getContainsFile()) { if ($locked) { - $action .= Display::return_icon( - 'move_na.png', - get_lang('Move'), - [], - ICON_SIZE_SMALL - ); + $action .= Display::getMdiIcon(ActionIcon::MOVE, 'ch-tool-icon-disabled', null, ICON_SIZE_SMALL, get_lang('Move')); } else { $action .= ''. - 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')).''; } } @@ -2437,30 +2385,30 @@ function get_work_user_list( $action .= ''. - Display::return_icon('visible.png', get_lang('invisible'), [], ICON_SIZE_SMALL). + Display::getMdiIcon(ActionIcon::INVISIBLE, 'ch-tool-icon', null, ICON_SIZE_SMALL, get_lang('invisible')). ''; } else { $action .= ''. - Display::return_icon('invisible.png', get_lang('Visible'), [], ICON_SIZE_SMALL). + Display::getMdiIcon(ActionIcon::VISIBLE, 'ch-tool-icon', null, ICON_SIZE_SMALL, get_lang('Visible')). ' '; } if ($locked) { - $action .= Display::return_icon('delete_na.png', get_lang('Delete'), '', ICON_SIZE_SMALL); + $action .= Display::getMdiIcon(ActionIcon::DELETE, 'ch-tool-icon-disabled', null, ICON_SIZE_SMALL, get_lang('Delete')); } else { $action .= ''. - 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')).''; } } elseif ($is_author && (empty($qualificatorId) || 0 == $qualificatorId)) { $action .= ''. - Display::return_icon('default.png', get_lang('View'), [], ICON_SIZE_SMALL). + Display::getMdiIcon(ObjectIcon::DEFAULT, 'ch-tool-icon', null, ICON_SIZE_SMALL, get_lang('View')). ''; if (1 == $studentDeleteOwnPublication) { @@ -2468,20 +2416,20 @@ function get_work_user_list( $action .= ''. - Display::return_icon('edit.png', get_lang('Comment'), [], ICON_SIZE_SMALL). + Display::getMdiIcon(ActionIcon::EDIT, 'ch-tool-icon', null, ICON_SIZE_SMALL, get_lang('Comment')). ''; } $action .= ' '. - 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')).''; } } else { $action .= ''. - Display::return_icon('default.png', get_lang('View'), [], ICON_SIZE_SMALL). + Display::getMdiIcon(ObjectIcon::DEFAULT, 'ch-tool-icon', null, ICON_SIZE_SMALL, get_lang('View')). ''; } @@ -2668,39 +2616,19 @@ function getAllWork( $loadingText = addslashes(get_lang('Loading')); $uploadedText = addslashes(get_lang('Uploaded')); $failsUploadText = addslashes(get_lang('UplNoFileUploaded')); - $failsUploadIcon = Display::return_icon( - 'closed-circle.png', - '', - [], + $failsUploadIcon = Display::getMdiIcon( + StateIcon::INCOMPLETE, + 'ch-tool-icon', + null, ICON_SIZE_TINY ); - $saveIcon = Display::return_icon( - 'save.png', - get_lang('Save'), - [], - ICON_SIZE_SMALL - ); + $saveIcon = Display::getMdiIcon(ActionIcon::SAVE_FORM, 'ch-tool-icon', null, ICON_SIZE_SMALL, get_lang('Save')); - $correctionIcon = Display::return_icon( - 'check-circle.png', - get_lang('Correction'), - null, - ICON_SIZE_SMALL - ); + $correctionIcon = Display::getMdiIcon(ActionIcon::ACCEPT, 'ch-tool-icon', null, ICON_SIZE_SMALL, get_lang('Correction')); - $correctionIconSmall = Display::return_icon( - 'check-circle.png', - get_lang('Correction'), - null, - ICON_SIZE_TINY - ); + $correctionIconSmall = Display::getMdiIcon(ActionIcon::ACCEPT, 'ch-tool-icon', null, ICON_SIZE_TINY, get_lang('Correction')); - $rateIcon = Display::return_icon( - 'rate_work.png', - get_lang('CorrectAndRate'), - [], - ICON_SIZE_SMALL - ); + $rateIcon = Display::getMdiIcon(ActionIcon::GRADE, 'ch-tool-icon', null, ICON_SIZE_SMALL, get_lang('CorrectAndRate')); $parentList = []; $blockEdition = ('true' === api_get_setting('work.block_student_publication_edition')); $blockScoreEdition = ('true' === api_get_setting('work.block_student_publication_score_edition')); @@ -2805,7 +2733,7 @@ function getAllWork( $feedback .= ' '; } $feedback .= Display::url( - $count.' '.Display::getMdiIcon('comment-multiple-outline'), + $count.' '.Display::getMdiIcon('comment-multiple-outline', 'ch-tool-icon', null, ICON_SIZE_SMALL), $url.'view.php?'.$cidReq.'&id='.$item_id ); } @@ -2862,7 +2790,7 @@ function getAllWork( $action .= ''. - Display::return_icon('export_doc.png', get_lang('ExportToDoc'), [], ICON_SIZE_SMALL).' '; + Display::getMdiIcon(ActionIcon::EXPORT_DOC, 'ch-tool-icon', null, ICON_SIZE_SMALL, get_lang('ExportToDoc')).' '; } $alreadyUploaded = ''; @@ -2880,7 +2808,7 @@ function getAllWork( >
    '.addslashes(get_lang('ClickOrDropOneFileHere')).' - '.Display::return_icon('upload_file.png', get_lang('Correction'), [], ICON_SIZE_TINY).' + '.Display::getMdiIcon(ActionIcon::UPLOAD, 'ch-tool-icon', null, ICON_SIZE_TINY, get_lang('Correction')).' '.$alreadyUploaded.'
    @@ -2923,20 +2851,15 @@ function getAllWork( if ($locked) { if ($qualification_exists) { - $action .= Display::return_icon( - 'edit_na.png', - get_lang('CorrectAndRate'), - [], - ICON_SIZE_SMALL - ); + $action .= Display::getMdiIcon(ActionIcon::EDIT, 'ch-tool-icon-disabled', null, ICON_SIZE_SMALL, get_lang('CorrectAndRate')); } else { - $action .= Display::return_icon('edit_na.png', get_lang('Comment'), [], ICON_SIZE_SMALL); + $action .= Display::getMdiIcon(ActionIcon::EDIT, 'ch-tool-icon-disabled', null, ICON_SIZE_SMALL, get_lang('Comment')); } } else { if ($blockEdition && !api_is_platform_admin()) { $editLink = ''; } else { - $editIcon = Display::return_icon('edit.png', get_lang('Edit'), [], ICON_SIZE_SMALL); + $editIcon = Display::getMdiIcon(ActionIcon::EDIT, 'ch-tool-icon', null, ICON_SIZE_SMALL, get_lang('Edit')); if ($qualification_exists) { $editLink = ''. - 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')).''; } }*/ /*if ($work['accepted'] == '1') { $action .= ''. - Display::return_icon('visible.png', get_lang('Invisible'), [], ICON_SIZE_SMALL).''; + Display::getMdiIcon(ActionIcon::INVISIBLE, 'ch-tool-icon', null, ICON_SIZE_SMALL, get_lang('Invisible')).''; } else { $action .= ''. - Display::return_icon('invisible.png', get_lang('Visible'), [], ICON_SIZE_SMALL).' '; + Display::getMdiIcon(ActionIcon::VISIBLE, 'ch-tool-icon', null, ICON_SIZE_SMALL, get_lang('Visible')).' '; }*/ /*if ($locked) { - $action .= Display::return_icon('delete_na.png', get_lang('Delete'), '', ICON_SIZE_SMALL); + $action .= Display::getMdiIcon(ActionIcon::DELETE, 'ch-tool-icon-disabled', null, ICON_SIZE_SMALL, get_lang('Delete')); } else { $action .= ''. - 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')).''; }*/ } elseif ($is_author && (empty($work['qualificator_id']) || 0 == $work['qualificator_id'])) { $action .= ''. - Display::return_icon('default.png', get_lang('View'), [], ICON_SIZE_SMALL).''; + Display::getMdiIcon(ObjectIcon::DEFAULT, 'ch-tool-icon', null, ICON_SIZE_SMALL, get_lang('View')).''; if (1 == api_get_course_setting('student_delete_own_publication')) { if (api_is_allowed_to_session_edit(false, true)) { $action .= ''. - Display::return_icon('edit.png', get_lang('Comment'), [], ICON_SIZE_SMALL).''; + Display::getMdiIcon(ActionIcon::EDIT, 'ch-tool-icon', null, ICON_SIZE_SMALL, get_lang('Comment')).''; } $action .= ' '. - 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')).''; } } else { $action .= ''. - Display::return_icon('default.png', get_lang('View'), [], ICON_SIZE_SMALL).''; + Display::getMdiIcon(ObjectIcon::DEFAULT, 'ch-tool-icon', null, ICON_SIZE_SMALL, get_lang('View')).''; } // Status.