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 .= "
';
$html .= ' ';
- $html .= Display::getMdiIcon('paperclip');
+ $html .= Display::getMdiIcon(ObjectIcon::ATTACHMENT, 'ch-tool-icon', null, ICON_SIZE_SMALL);
$html .= ' '.$attachment->getFilename().' ';
$html .= ' - ';
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 .= '';
foreach ($list as $teacher) {
$html .= '';
- $html .= Display::return_icon('teacher.png', '', null, ICON_SIZE_TINY);
+ $html .= Display::getMdiIcon(ObjectIcon::TEACHER, 'ch-tool-icon', null, ICON_SIZE_TINY);
$html .= ' '.$teacher;
$html .= ' ';
}
@@ -2198,11 +2200,12 @@ class CourseManager
foreach ($course_coachs as $coachs) {
$html .= Display::tag(
'li',
- Display::return_icon(
- 'teacher.png',
- get_lang('Coach'),
+ Display::getMdiIcon(
+ ObjectIcon::TEACHER,
+ 'ch-tool-icon',
null,
- ICON_SIZE_TINY
+ ICON_SIZE_TINY,
+ get_lang('Coach')
).' '.$coachs
);
}
@@ -3168,19 +3171,22 @@ class CourseManager
ENT_QUOTES,
$charset
)).'\')) return false;">';
- $data .= Display::return_icon(
- 'delete.gif',
- get_lang('Delete'),
- ['style' => 'vertical-align:middle;float:right;']
+ $data .= Display::getMdiIcon(
+ ActionIcon::DELETE,
+ 'ch-tool-icon',
+ 'vertical-align:middle;float:right;',
+ ICON_SIZE_SMALL,
+ get_lang('Delete')
);
$data .= ' ';
//edit
$data .= '';
- $data .= Display::return_icon(
- 'edit.png',
- get_lang('Edit'),
- ['style' => 'vertical-align:middle;float:right; padding-right:4px;'],
- ICON_SIZE_SMALL
+ $data .= Display::getMdiIcon(
+ ActionIcon::EDIT,
+ 'ch-tool-icon',
+ 'vertical-align:middle;float:right; padding-right:4px;',
+ ICON_SIZE_SMALL,
+ get_lang('Edit')
);
$data .= ' ';
}
@@ -3547,12 +3553,11 @@ class CourseManager
$params['status'] = $course_info['status'];
$params['category'] = $course_info['categoryName'];
$params['category_code'] = $course_info['categoryCode'];
- $params['icon'] = Display::return_icon(
- 'drawing-pin.png',
+ $params['icon'] = Display::getMdiIcon(
+ ObjectIcon::PIN,
+ 'ch-tool-icon',
null,
- null,
- ICON_SIZE_LARGE,
- null
+ ICON_SIZE_LARGE
);
if ('true' == api_get_setting('display_coursecode_in_courselist')) {
@@ -3873,13 +3878,11 @@ class CourseManager
// Show a hyperlink to the course, unless the course is closed and user is not course admin.
$session_url = '';
$params = [];
- $params['icon'] = Display::return_icon(
- 'session.png',
- null,
- [],
- ICON_SIZE_LARGE,
+ $params['icon'] = Display::getMdiIcon(
+ ObjectIcon::SESSION,
+ 'ch-tool-icon',
null,
- true
+ ICON_SIZE_LARGE
);
$params['real_id'] = $course_info['real_id'];
$params['visibility'] = $course_info['visibility'];
@@ -3942,10 +3945,10 @@ class CourseManager
if (!empty($thumbnails)) {
$params['html_image'] = Display::img($thumbnails, $course_info['name'], ['class' => 'img-responsive']);
} else {
- $params['html_image'] = Display::return_icon(
- 'session.png',
- $course_info['name'],
- ['class' => 'img-responsive'],
+ $params['html_image'] = Display::getMdiIcon(
+ ObjectIcon::SESSION,
+ 'ch-tool-icon img-responsive',
+ null,
ICON_SIZE_LARGE,
$course_info['name']
);
@@ -6123,11 +6126,12 @@ class CourseManager
$course_info['status'] = $course['status'];
// New code displaying the user's status in respect to this course.
- $status_icon = Display::return_icon(
- 'blackboard.png',
- $course_info['title'],
- [],
- ICON_SIZE_LARGE
+ $status_icon = Display::getMdiIcon(
+ 'account-key',
+ 'ch-tool-icon',
+ null,
+ ICON_SIZE_LARGE,
+ $course_info['title']
);
$params = [];
@@ -6135,9 +6139,9 @@ class CourseManager
if (api_is_platform_admin()) {
if ($loadDirs) {
- $params['right_actions'] .= ''.Display::return_icon('folder.png', get_lang('Documents'), ['align' => 'absmiddle'], ICON_SIZE_SMALL).' ';
+ $params['right_actions'] .= ''.Display::getMdiIcon(ObjectIcon::FOLDER, 'ch-tool-icon', 'align: absmiddle;', ICON_SIZE_SMALL, get_lang('Documents')).' ';
$params['right_actions'] .= ''.
- Display::return_icon('edit.png', get_lang('Edit'), ['align' => 'absmiddle'], ICON_SIZE_SMALL).
+ Display::getMdiIcon(ActionIcon::EDIT, 'ch-tool-icon', 'align: absmiddle;', ICON_SIZE_SMALL, get_lang('Edit')).
' ';
$params['right_actions'] .= Display::div(
'',
@@ -6155,7 +6159,7 @@ class CourseManager
if (Course::CLOSED != $course_info['visibility']) {
if ($loadDirs) {
$params['right_actions'] .= ''.
- Display::return_icon('folder.png', get_lang('Documents'), ['align' => 'absmiddle'], ICON_SIZE_SMALL).' ';
+ Display::getMdiIcon(ObjectIcon::FOLDER, 'ch-tool-icon', 'align: absmiddle;', ICON_SIZE_SMALL, get_lang('Documents')).'';
$params['right_actions'] .= Display::div(
'',
[
diff --git a/public/main/inc/lib/course_category.lib.php b/public/main/inc/lib/course_category.lib.php
index 0417d8ed81..70cea72727 100644
--- a/public/main/inc/lib/course_category.lib.php
+++ b/public/main/inc/lib/course_category.lib.php
@@ -5,6 +5,8 @@
use Chamilo\CoreBundle\Entity\Asset;
use Chamilo\CoreBundle\Entity\CourseCategory as CourseCategoryEntity;
use Chamilo\CoreBundle\Framework\Container;
+use Chamilo\CoreBundle\Component\Utils\ActionIcon;
+use Chamilo\CoreBundle\Component\Utils\ObjectIcon;
class CourseCategory
{
@@ -15,7 +17,7 @@ class CourseCategory
*
* @return array
*/
- public static function getCategory(string $categoryCode = null)
+ public static function getCategory(string $categoryCode = null): array
{
if (!empty($categoryCode)) {
$table = Database::get_main_table(TABLE_MAIN_CATEGORY);
@@ -381,25 +383,10 @@ class CourseCategory
$row++;
$mainUrl = api_get_path(WEB_CODE_PATH).'admin/course_category.php?category='.$categoryCode;
- $editIcon = Display::return_icon(
- 'edit.png',
- get_lang('Edit'),
- null,
- ICON_SIZE_SMALL
- );
- $exportIcon = Display::return_icon('export_csv.png', get_lang('ExportAsCSV'), '');
- $deleteIcon = Display::return_icon(
- 'delete.png',
- get_lang('Delete'),
- null,
- ICON_SIZE_SMALL
- );
- $moveIcon = Display::return_icon(
- 'up.png',
- get_lang('Up in same level'),
- null,
- ICON_SIZE_SMALL
- );
+ $editIcon = Display::getMdiIcon(ActionIcon::EDIT, 'ch-tool-icon', null, ICON_SIZE_SMALL, get_lang('Edit'));
+ $exportIcon = Display::getMdiIcon(ActionIcon::EXPORT_CSV, 'ch-tool-icon', null, ICON_SIZE_SMALL, get_lang('ExportAsCSV'), '');
+ $deleteIcon = Display::getMdiIcon(ActionIcon::DELETE, 'ch-tool-icon', null, ICON_SIZE_SMALL, get_lang('Delete'));
+ $moveIcon = Display::getMdiIcon(ActionIcon::UP, 'ch-tool-icon', null, ICON_SIZE_SMALL, get_lang('Up in same level'));
$urlId = api_get_current_access_url_id();
foreach ($categories as $category) {
@@ -435,11 +422,12 @@ class CourseCategory
$url = api_get_path(WEB_CODE_PATH).'admin/course_category.php?id='.$categoryId;
$title = Display::url(
- Display::return_icon(
- 'folder_document.gif',
- get_lang('Open this category'),
+ Display::getMdiIcon(
+ ObjectIcon::FOLDER,
+ 'ch-tool-icon',
null,
- ICON_SIZE_SMALL
+ ICON_SIZE_SMALL,
+ get_lang('Open this category')
).' '.$category->getName().' ('.$code.')',
$url
);
diff --git a/public/main/inc/lib/diagnoser.lib.php b/public/main/inc/lib/diagnoser.lib.php
index 96b9f0545e..2584c6484f 100644
--- a/public/main/inc/lib/diagnoser.lib.php
+++ b/public/main/inc/lib/diagnoser.lib.php
@@ -2,6 +2,9 @@
/* For licensing terms, see /license.txt */
+use Chamilo\CoreBundle\Component\Utils\ActionIcon;
+use Chamilo\CoreBundle\Component\Utils\ObjectIcon;
+
/**
* Class Diagnoser
* Class that is responsible for generating diagnostic information about the system.
@@ -843,8 +846,8 @@ class Diagnoser
$res = $connection->query('SELECT id, code, directory, disk_quota, last_visit FROM course ORDER BY last_visit DESC, code LIMIT 500');
$systemPath = api_get_path(SYS_COURSE_PATH);
$webPath = api_get_path(WEB_COURSE_PATH);
- $courseHomeIcon = Display::return_icon('home.png', get_lang('CourseHome'));
- $courseEditIcon = Display::return_icon('edit.png', get_lang('Edit'));
+ $courseHomeIcon = Display::getMdiIcon(ObjectIcon::HOME, 'ch-tool-icon', null, ICON_SIZE_SMALL, get_lang('CourseHome'));
+ $courseEditIcon = Display::getMdiIcon(ActionIcon::EDIT, 'ch-tool-icon', null, ICON_SIZE_SMALL, get_lang('Edit'));
$windows = api_is_windows_os();
$courseEditPath = api_get_path(WEB_CODE_PATH).'admin/course_edit.php?id=';
while ($row = $res->fetch()) {
diff --git a/public/main/inc/lib/extra_field.lib.php b/public/main/inc/lib/extra_field.lib.php
index 3e94b0f2f5..78b1f65057 100644
--- a/public/main/inc/lib/extra_field.lib.php
+++ b/public/main/inc/lib/extra_field.lib.php
@@ -7,7 +7,7 @@ use Chamilo\CoreBundle\Entity\ExtraField as EntityExtraField;
use Chamilo\CoreBundle\Entity\ExtraFieldRelTag;
use Chamilo\CoreBundle\Entity\Tag;
use Chamilo\CoreBundle\Framework\Container;
-
+use Chamilo\CoreBundle\Component\Utils\ActionIcon;
class ExtraField extends Model
{
public const FIELD_TYPE_TEXT = 1;
@@ -1676,7 +1676,7 @@ class ExtraField extends Model
);
$linkToDelete = ' '.Display::url(
- Display::return_icon('delete.png', get_lang('Delete')),
+ Display::getMdiIcon(ActionIcon::DELETE, 'ch-tool-icon', null, ICON_SIZE_SMALL, get_lang('Delete')),
'javascript:void(0)',
['id' => $deleteId]
);
@@ -2109,20 +2109,10 @@ class ExtraField extends Model
public function display()
{
$actions = '';
- $actions .= Display::return_icon(
- 'back.png',
- get_lang('Back to').' '.get_lang('Administration'),
- '',
- ICON_SIZE_MEDIUM
- );
+ $actions .= Display::getMdiIcon(ActionIcon::BACK, 'ch-tool-icon', null, ICON_SIZE_MEDIUM, get_lang('Back to').' '.get_lang('Administration'));
$actions .= ' ';
$actions .= '';
- $actions .= Display::return_icon(
- 'add_user_fields.png',
- get_lang('Add'),
- '',
- ICON_SIZE_MEDIUM
- );
+ $actions .= Display::getMdiIcon(ActionIcon::ADD, 'ch-tool-icon', null, ICON_SIZE_MEDIUM, get_lang('Add'));
$actions .= ' ';
echo Display::toolbarAction('toolbar', [$actions]);
@@ -2406,8 +2396,8 @@ class ExtraField 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)
);
diff --git a/public/main/inc/lib/extra_field_option.lib.php b/public/main/inc/lib/extra_field_option.lib.php
index 9ff676f080..bbef4a6c12 100644
--- a/public/main/inc/lib/extra_field_option.lib.php
+++ b/public/main/inc/lib/extra_field_option.lib.php
@@ -4,6 +4,7 @@
use Chamilo\CoreBundle\Entity\ExtraFieldOptions;
use Chamilo\CoreBundle\Framework\Container;
+use Chamilo\CoreBundle\Component\Utils\ActionIcon;
/**
* Handles the extra fields for various objects (users, sessions, courses).
@@ -683,7 +684,7 @@ class ExtraFieldOption extends Model
echo '';
echo Display::grid_html('extra_field_options');
}
diff --git a/public/main/inc/lib/glossary.lib.php b/public/main/inc/lib/glossary.lib.php
index 00b3c56048..7d4ea423ff 100644
--- a/public/main/inc/lib/glossary.lib.php
+++ b/public/main/inc/lib/glossary.lib.php
@@ -6,6 +6,9 @@ use Chamilo\CoreBundle\Framework\Container;
use Chamilo\CourseBundle\Entity\CGlossary;
use ChamiloSession as Session;
use Doctrine\ORM\NoResultException;
+use Chamilo\CoreBundle\Component\Utils\ActionIcon;
+use Chamilo\CoreBundle\Component\Utils\ObjectIcon;
+use Chamilo\CoreBundle\Component\Utils\StateIcon;
/**
* Class GlossaryManager
@@ -471,40 +474,30 @@ class GlossaryManager
$actionsLeft = '';
$url = api_get_path(WEB_CODE_PATH).'glossary/index.php?'.api_get_cidreq();
if (api_is_allowed_to_edit(null, true)) {
- $addIcon = Display::return_icon(
- 'new_glossary_term.png',
- get_lang('Add new glossary term'),
- '',
- ICON_SIZE_MEDIUM
- );
+ $addIcon = Display::getMdiIcon(ActionIcon::ADD, 'ch-tool-icon', null, ICON_SIZE_MEDIUM, get_lang('Add new glossary term'));
$actionsLeft .= ''.$addIcon.' ';
}
if (api_is_allowed_to_edit(null, true)) {
$actionsLeft .= ''.
- Display::return_icon('import.png', get_lang('Import glossary'), '', ICON_SIZE_MEDIUM).' ';
+ Display::getMdiIcon(ActionIcon::IMPORT_ARCHIVE, 'ch-tool-icon', null, ICON_SIZE_MEDIUM, get_lang('Import glossary')).'';
}
if (!api_is_anonymous()) {
$actionsLeft .= ''.
- Display::return_icon('save.png', get_lang('Export'), '', ICON_SIZE_MEDIUM).' ';
+ Display::getMdiIcon(ActionIcon::SAVE_FORM, 'ch-tool-icon', null, ICON_SIZE_MEDIUM, get_lang('Export')).'';
}
if ('table' === $view || !isset($view)) {
$actionsLeft .= ''.
- Display::return_icon('view_detailed.png', get_lang('List view'), '', ICON_SIZE_MEDIUM).' ';
+ Display::getMdiIcon(StateIcon::DETAILED_VIEW, 'ch-tool-icon', null, ICON_SIZE_MEDIUM, get_lang('List view')).'';
} else {
$actionsLeft .= ''.
- Display::return_icon('view_text.png', get_lang('Table view'), '', ICON_SIZE_MEDIUM).' ';
+ Display::getMdiIcon(StateIcon::LIST_VIEW, 'ch-tool-icon', null, ICON_SIZE_MEDIUM, get_lang('Table view')).'';
}
if (api_is_allowed_to_edit(true, true, true)) {
- $exportIcon = Display::return_icon(
- 'export_to_documents.png',
- get_lang('Export latest version of this page to Documents'),
- [],
- ICON_SIZE_MEDIUM
- );
+ $exportIcon = Display::getMdiIcon(ActionIcon::EXPORT_DOC, 'ch-tool-icon', null, ICON_SIZE_MEDIUM, get_lang('Export latest version of this page to Documents'));
$actionsLeft .= Display::url(
$exportIcon,
$url.'&'.http_build_query(['action' => 'export_documents'])
@@ -518,12 +511,12 @@ class GlossaryManager
if (!api_is_allowed_to_edit(true, true, true)) {
if ('ASC' === $orderList) {
$actionsLeft .= Display::url(
- Display::return_icon('falling.png', get_lang('Sort Descending'), [], ICON_SIZE_MEDIUM),
+ Display::getMdiIcon(ActionIcon::DOWN, 'ch-tool-icon', null, ICON_SIZE_MEDIUM, get_lang('Sort Descending')),
$url.'&'.http_build_query(['order' => 'DESC'])
);
} else {
$actionsLeft .= Display::url(
- Display::return_icon('upward.png', get_lang('Sort Ascending'), [], ICON_SIZE_MEDIUM),
+ Display::getMdiIcon(ActionIcon::UP, 'ch-tool-icon', null, ICON_SIZE_MEDIUM, get_lang('Sort Ascending')),
$url.'&'.http_build_query(['order' => 'ASC'])
);
}
@@ -570,7 +563,7 @@ class GlossaryManager
if (api_is_allowed_to_edit(true, true)) {
$content .= Display::noDataView(
get_lang('Glossary'),
- Display::return_icon('glossary.png', '', [], 64),
+ Display::getMdiIcon(ObjectIcon::GLOSSARY, 'ch-tool-icon', null, ICON_SIZE_BIG),
get_lang('Add glossary'),
$url.'&'.http_build_query(['action' => 'addglossary'])
);
@@ -815,7 +808,7 @@ class GlossaryManager
{
$glossary_id = $row[2];
$return = ''.
- Display::return_icon('edit.png', get_lang('Edit'), '', 22).' ';
+ Display::getMdiIcon(ActionIcon::EDIT, 'ch-tool-icon', null, ICON_SIZE_SMALL, get_lang('Edit')).'';
$repo = Container::getGlossaryRepository();
/** @var CGlossary $glossaryData */
$glossaryData = $repo->find($glossary_id);
@@ -824,7 +817,7 @@ class GlossaryManager
$return .= ''.
- Display::return_icon('delete.png', get_lang('Delete'), '', 22).' ';
+ Display::getMdiIcon(ActionIcon::DELETE, 'ch-tool-icon', null, ICON_SIZE_SMALL, get_lang('Delete')).'';
/*
* if ($glossaryData->getSessionId() == api_get_session_id()) {
} else {
diff --git a/public/main/inc/lib/grade_model.lib.php b/public/main/inc/lib/grade_model.lib.php
index 1b21b1a686..a8a4d1fe63 100644
--- a/public/main/inc/lib/grade_model.lib.php
+++ b/public/main/inc/lib/grade_model.lib.php
@@ -1,6 +1,8 @@
';
echo ''.
- Display::return_icon('back.png', get_lang('Back'), '', ICON_SIZE_MEDIUM).' ';
+ Display::getMdiIcon(ActionIcon::BACK, 'ch-tool-icon', null, ICON_SIZE_MEDIUM, get_lang('Back')).'';
echo ''.
- Display::return_icon('add.png', get_lang('Add'), '', ICON_SIZE_MEDIUM).' ';
+ Display::getMdiIcon(ActionIcon::ADD, 'ch-tool-icon', null, ICON_SIZE_MEDIUM, get_lang('Add')).'';
echo '';
echo Display::grid_html('grade_model');
}
diff --git a/public/main/inc/lib/link.lib.php b/public/main/inc/lib/link.lib.php
index cab6d6988d..fd67d235a7 100644
--- a/public/main/inc/lib/link.lib.php
+++ b/public/main/inc/lib/link.lib.php
@@ -5,6 +5,9 @@
use Chamilo\CoreBundle\Framework\Container;
use Chamilo\CourseBundle\Entity\CLink;
use Chamilo\CourseBundle\Entity\CLinkCategory;
+use Chamilo\CoreBundle\Component\Utils\ActionIcon;
+use Chamilo\CoreBundle\Component\Utils\ObjectIcon;
+use Chamilo\CoreBundle\Component\Utils\StateIcon;
/**
* Function library for the links tool.
@@ -881,12 +884,7 @@ class Link extends Model
$user = api_get_user_entity();
$i = 1;
$linksAdded = [];
- $iconLink = Display::return_icon(
- 'url.png',
- get_lang('Link'),
- null,
- ICON_SIZE_SMALL
- );
+ $iconLink = Display::getMdiIcon(ActionIcon::LINK, 'ch-tool-icon', null, ICON_SIZE_SMALL, get_lang('Link'));
foreach ($links as $link) {
$linkId = $link->getIid();
$resourceLink = $link->getFirstResourceLink();
@@ -1079,57 +1077,63 @@ class Link extends Model
$categoryId = $category->getIid();
$token = null;
$tools = ''.
- Display:: return_icon(
- 'edit.png',
- get_lang('Edit'),
- [],
- ICON_SIZE_SMALL
+ Display::getMdiIcon(
+ ActionIcon::EDIT,
+ 'ch-tool-icon',
+ null,
+ ICON_SIZE_SMALL,
+ get_lang('Edit')
).' ';
// DISPLAY MOVE UP COMMAND only if it is not the top link.
if (0 != $currentCategory) {
$tools .= ''.
- Display:: return_icon(
- 'up.png',
- get_lang('Up'),
- [],
- ICON_SIZE_SMALL
+ Display::getMdiIcon(
+ ActionIcon::UP,
+ 'ch-tool-icon',
+ null,
+ ICON_SIZE_SMALL,
+ get_lang('Up')
).' ';
} else {
- $tools .= Display:: return_icon(
- 'up_na.png',
- get_lang('Up'),
- [],
- ICON_SIZE_SMALL
+ $tools .= Display::getMdiIcon(
+ ActionIcon::UP,
+ 'ch-tool-icon-disabled',
+ null,
+ ICON_SIZE_SMALL,
+ get_lang('Up')
).'';
}
// DISPLAY MOVE DOWN COMMAND only if it is not the bottom link.
if ($currentCategory < $countCategories - 1) {
$tools .= ''.
- Display:: return_icon(
- 'down.png',
- get_lang('down'),
- [],
- ICON_SIZE_SMALL
+ Display::getMdiIcon(
+ ActionIcon::DOWN,
+ 'ch-tool-icon',
+ null,
+ ICON_SIZE_SMALL,
+ get_lang('down')
).' ';
} else {
- $tools .= Display:: return_icon(
- 'down_na.png',
- get_lang('down'),
- [],
- ICON_SIZE_SMALL
- ).'';
+ $tools .= Display::getMdiIcon(
+ ActionIcon::DOWN,
+ 'ch-tool-icon-disabled',
+ null,
+ ICON_SIZE_SMALL,
+ get_lang('down')
+ ).'';
}
$tools .= '".
- 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')
).' ';
return $tools;
@@ -1365,31 +1369,21 @@ Do you really want to delete this category and its links ?')."')) return false;\
if (api_is_allowed_to_edit(null, true)) {
$actions .= ''.
- Display::return_icon('new_link.png', get_lang('Add a link'), '', ICON_SIZE_MEDIUM).' ';
+ Display::getMdiIcon(ActionIcon::ADD, 'ch-tool-icon', null, ICON_SIZE_MEDIUM, get_lang('Add a link')).'';
$actions .= ''.
- Display::return_icon('new_folder.png', get_lang('Add a category'), '', ICON_SIZE_MEDIUM).' ';
+ Display::getMdiIcon(ActionIcon::CREATE_CATEGORY, 'ch-tool-icon', null, ICON_SIZE_MEDIUM, get_lang('Add a category')).'';
}
if (!empty($countCategories)) {
$actions .= '';
- $actions .= Display::return_icon(
- 'forum_listview.png',
- get_lang('List View'),
- '',
- ICON_SIZE_MEDIUM
- ).' ';
+ $actions .= Display::getMdiIcon(StateIcon::LIST_VIEW, 'ch-tool-icon', null, ICON_SIZE_MEDIUM, get_lang('List View')).' ';
$actions .= '';
- $actions .= Display::return_icon(
- 'forum_nestedview.png',
- get_lang('Nested View'),
- '',
- ICON_SIZE_MEDIUM
- ).' ';
+ $actions .= Display::getMdiIcon(StateIcon::NESTED_VIEW, 'ch-tool-icon', null, ICON_SIZE_MEDIUM, get_lang('Nested View')).'';
}
$actions .= 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')),
api_get_self().'?'.api_get_cidreq().'&action=export'
);
$toolbar = Display::toolbarAction('toolbar', [$actions]);
@@ -1430,25 +1424,25 @@ Do you really want to delete this category and its links ?')."')) return false;\
$strVisibility = ''.
- 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')).'';
} elseif (!$isVisible) {
$visibilityClass = 'text-muted';
$strVisibility = ' '.
- 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')).'';
}
$header = '';
if ($showChildren) {
$header .= '';
- $header .= Display::return_icon('forum_nestedview.png');
+ $header .= Display::getMdiIcon(StateIcon::NESTED_VIEW, 'ch-tool-icon', null, ICON_SIZE_SMALL);
} else {
$header .= ' ';
- $header .= Display::return_icon('forum_listview.png');
+ $header .= Display::getMdiIcon(StateIcon::LIST_VIEW, 'ch-tool-icon', null, ICON_SIZE_SMALL);
}
$header .= Security::remove_XSS($category->getCategoryTitle()).' ';
@@ -1481,7 +1475,7 @@ Do you really want to delete this category and its links ?')."')) return false;\
if (empty($content) && api_is_allowed_to_edit()) {
$content .= Display::noDataView(
get_lang('Links'),
- Display::return_icon('links.png', '', [], 64),
+ Display::getMdiIcon(ObjectIcon::LINK, 'ch-tool-icon', null, ICON_SIZE_BIG),
get_lang('Add links'),
api_get_self().'?'.api_get_cidreq().'&'.http_build_query(['action' => 'addlink'])
);
diff --git a/public/main/inc/lib/notebook.lib.php b/public/main/inc/lib/notebook.lib.php
index 7999a1c814..0ffba2bc97 100644
--- a/public/main/inc/lib/notebook.lib.php
+++ b/public/main/inc/lib/notebook.lib.php
@@ -4,6 +4,7 @@
use Chamilo\CoreBundle\Framework\Container;
use Chamilo\CourseBundle\Entity\CNotebook;
use ChamiloSession as Session;
+use Chamilo\CoreBundle\Component\Utils\ActionIcon;
/**
* This class provides methods for the notebook management.
@@ -189,21 +190,22 @@ class NotebookManager
if (!api_is_anonymous()) {
if (0 == $sessionId || api_is_allowed_to_session_edit(false, true)) {
echo ''.
- Display::return_icon('new_note.png', get_lang('Add new note in my personal notebook'), '', '32').
+ Display::getMdiIcon(ActionIcon::ADD, 'ch-tool-icon', null, ICON_SIZE_MEDIUM, get_lang('Add new note in my personal notebook')).
' ';
}
}
echo ''.
- Display::return_icon('notes_order_by_date_new.png', get_lang('Sort by date created'), '', '32').
+ Display::getMdiIcon(ActionIcon::SORT_DATE, 'ch-tool-icon', null, ICON_SIZE_MEDIUM, get_lang('Sort by date created')).
' ';
echo ''.
- Display::return_icon('notes_order_by_date_mod.png', get_lang('Sort by date last modified'), '', '32').
+ Display::getMdiIcon(ActionIcon::SORT_DATE, 'ch-tool-icon', null, ICON_SIZE_MEDIUM, get_lang('Sort by date last modified')).
' ';
echo ''.
- Display::return_icon('notes_order_by_title.png', get_lang('Sort by title'), '', '32').' ';
+ Display::getMdiIcon(ActionIcon::SORT_ALPHA, 'ch-tool-icon', null, ICON_SIZE_MEDIUM, get_lang('Sort by title')).
+ '';
echo '';
$notebookView = Session::read('notebook_view');
@@ -242,11 +244,11 @@ class NotebookManager
}
$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')).'';
$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')).'';
echo Display::panel(
$row['description'],
diff --git a/public/main/inc/lib/plugin.lib.php b/public/main/inc/lib/plugin.lib.php
index cedae0c423..459c182fad 100644
--- a/public/main/inc/lib/plugin.lib.php
+++ b/public/main/inc/lib/plugin.lib.php
@@ -2,6 +2,7 @@
/* See license terms in /license.txt */
use ChamiloSession as Session;
+use Chamilo\CoreBundle\Component\Utils\ToolIcon;
/**
* Class AppPlugin.
@@ -708,11 +709,12 @@ class AppPlugin
ICON_SIZE_SMALL
);
} else {
- $icon = Display::return_icon(
- 'plugins.png',
- Security::remove_XSS($pluginTitle),
- '',
- ICON_SIZE_SMALL
+ $icon = Display::getMdiIcon(
+ ToolIcon::PLUGIN,
+ 'ch-tool-icon',
+ null,
+ ICON_SIZE_SMALL,
+ Security::remove_XSS($pluginTitle)
);
}
diff --git a/public/main/inc/lib/promotion.lib.php b/public/main/inc/lib/promotion.lib.php
index d42118732f..a0f8f5a454 100644
--- a/public/main/inc/lib/promotion.lib.php
+++ b/public/main/inc/lib/promotion.lib.php
@@ -3,6 +3,8 @@
/* For licensing terms, see /license.txt */
use Chamilo\CoreBundle\Entity\Promotion as PromotionEntity;
+use Chamilo\CoreBundle\Component\Utils\ActionIcon;
+use Chamilo\CoreBundle\Component\Utils\ObjectIcon;
/**
* Class Promotion
@@ -163,27 +165,12 @@ class Promotion extends Model
public function display()
{
$actions = ''.
- Display::return_icon(
- 'back.png',
- get_lang('Back'),
- '',
- '32'
- )
+ Display::getMdiIcon(ActionIcon::BACK, 'ch-tool-icon', null, ICON_SIZE_MEDIUM, get_lang('Back'))
.' ';
$actions .= ''.
- Display::return_icon(
- 'new_promotion.png',
- get_lang('Add'),
- '',
- '32'
- ).' ';
+ Display::getMdiIcon(ActionIcon::ADD, 'ch-tool-icon', null, ICON_SIZE_MEDIUM, get_lang('Add')).'';
$actions .= ''.
- Display::return_icon(
- 'new_session.png',
- get_lang('Add a training session'),
- '',
- '32'
- ).' ';
+ Display::getMdiIcon(ObjectIcon::SESSION, 'ch-tool-icon', null, ICON_SIZE_MEDIUM, get_lang('Add a training session')).'';
echo Display::toolbarAction('promotion_actions', [$actions]);
echo Display::grid_html('promotions');
diff --git a/public/main/inc/lib/sessionmanager.lib.php b/public/main/inc/lib/sessionmanager.lib.php
index 8028adf6ba..a057f827f0 100644
--- a/public/main/inc/lib/sessionmanager.lib.php
+++ b/public/main/inc/lib/sessionmanager.lib.php
@@ -17,6 +17,9 @@ use Chamilo\CourseBundle\Entity\CSurvey;
use ExtraField as ExtraFieldModel;
use Monolog\Logger;
use Symfony\Component\HttpFoundation\File\UploadedFile;
+use Chamilo\CoreBundle\Component\Utils\ActionIcon;
+use Chamilo\CoreBundle\Component\Utils\ObjectIcon;
+use Chamilo\CoreBundle\Component\Utils\StateIcon;
/**
* This is the session library for Chamilo
@@ -697,18 +700,8 @@ class SessionManager
return $sessions[0]['total_rows'];
}
- $activeIcon = Display::return_icon(
- 'accept.png',
- get_lang('Active'),
- [],
- ICON_SIZE_SMALL
- );
- $inactiveIcon = Display::return_icon(
- 'error.png',
- get_lang('Inactive'),
- [],
- ICON_SIZE_SMALL
- );
+ $activeIcon = Display::getMdiIcon(StateIcon::ACTIVE, 'ch-tool-icon', null, ICON_SIZE_SMALL, get_lang('Active'));
+ $inactiveIcon = Display::getMdiIcon(StateIcon::INACTIVE, 'ch-tool-icon', null, ICON_SIZE_SMALL, get_lang('Inactive'));
foreach ($sessions as $session) {
$session_id = $session['id'];
@@ -735,7 +728,7 @@ class SessionManager
// ofaj
$session['teachers'] = '';
if (!empty($teachers)) {
- $session['teachers'] = Display::return_icon('teacher.png', addslashes($teachers));
+ $session['teachers'] = Display::getMdiIcon(ObjectIcon::TEACHER, 'ch-tool-icon', null, ICON_SIZE_SMALL, addslashes($teachers));
}
}
$url = api_get_path(WEB_CODE_PATH).'session/resume_session.php?id_session='.$session['id'];
@@ -896,8 +889,8 @@ class SessionManager
}
}
- $activeIcon = Display::return_icon('accept.png', get_lang('active'));
- $inactiveIcon = Display::return_icon('error.png', get_lang('inactive'));
+ $activeIcon = Display::getMdiIcon(StateIcon::ACTIVE, 'ch-tool-icon', null, ICON_SIZE_SMALL, get_lang('active'));
+ $inactiveIcon = Display::getMdiIcon(StateIcon::INACTIVE, 'ch-tool-icon', null, ICON_SIZE_SMALL, get_lang('inactive'));
foreach ($sessions as $session) {
if ($showCountUsers) {
@@ -9122,19 +9115,9 @@ class SessionManager
$result = Database::query($query);
- $acceptIcon = Display::return_icon(
- 'accept.png',
- get_lang('Active'),
- [],
- ICON_SIZE_SMALL
- );
+ $acceptIcon = Display::getMdiIcon(StateIcon::ACTIVE, 'ch-tool-icon', null, ICON_SIZE_SMALL, get_lang('Active'));
- $errorIcon = Display::return_icon(
- 'error.png',
- get_lang('Inactive'),
- [],
- ICON_SIZE_SMALL
- );
+ $errorIcon = Display::getMdiIcon(StateIcon::INACTIVE, 'ch-tool-icon', null, ICON_SIZE_SMALL, get_lang('Inactive'));
$formatted_sessions = [];
if (Database::num_rows($result)) {
diff --git a/public/main/inc/lib/social.lib.php b/public/main/inc/lib/social.lib.php
index b07eb9706f..511bde8b2b 100644
--- a/public/main/inc/lib/social.lib.php
+++ b/public/main/inc/lib/social.lib.php
@@ -11,6 +11,9 @@ use Chamilo\CourseBundle\Entity\CForumThread;
use ChamiloSession as Session;
use Laminas\Feed\Reader\Entry\Rss;
use Laminas\Feed\Reader\Reader;
+use Chamilo\CoreBundle\Component\Utils\ActionIcon;
+use Chamilo\CoreBundle\Component\Utils\ObjectIcon;
+use Chamilo\CoreBundle\Component\Utils\StateIcon;
/**
* Class SocialManager.
@@ -455,7 +458,7 @@ class SocialManager extends UserManager
$iconRss = '';
if (!empty($feed)) {
$iconRss = Display::url(
- Display::return_icon('social_rss.png', '', [], 22),
+ Display::getMdiIcon('rss', 'ch-tool-icon', null, ICON_SIZE_SMALL),
Security::remove_XSS($feed['rssfeeds']),
['target' => '_blank']
);
@@ -593,12 +596,12 @@ class SocialManager extends UserManager
$lastname = $user_info['lastname'];
$firstname = $user_info['firstname'];
$completeName = $firstname.', '.$lastname;
- $user_rol = 1 == $user_info['status'] ? Display::return_icon('teacher.png', get_lang('Trainer'), null, ICON_SIZE_TINY) : Display::return_icon('user.png', get_lang('Learner'), null, ICON_SIZE_TINY);
+ $user_rol = 1 == $user_info['status'] ? Display::getMdiIcon(ObjectIcon::TEACHER, 'ch-tool-icon', null, ICON_SIZE_TINY, get_lang('Trainer')) : Display::getMdiIcon(ObjectIcon::USER, 'ch-tool-icon', null, ICON_SIZE_TINY, get_lang('Learner'));
$status_icon_chat = null;
if (isset($user_info['user_is_online_in_chat']) && 1 == $user_info['user_is_online_in_chat']) {
- $status_icon_chat = Display::return_icon('online.png', get_lang('Online'));
+ $status_icon_chat = Display::getMdiIcon(StateIcon::ONLINE, 'ch-tool-icon', null, ICON_SIZE_SMALL, get_lang('Online'));
} else {
- $status_icon_chat = Display::return_icon('offline.png', get_lang('Offline'));
+ $status_icon_chat = Display::getMdiIcon(StateIcon::OFFLINE, 'ch-tool-icon', null, ICON_SIZE_SMALL, get_lang('Offline'));
}
$userPicture = $user_info['avatar'];
@@ -1161,10 +1164,10 @@ class SocialManager extends UserManager
$name_user = api_get_person_name($friend['firstName'], $friend['lastName']);
$user_info_friend = api_get_user_info($friend['friend_user_id'], true);
- $statusIcon = Display::return_icon('statusoffline.png', get_lang('Offline'));
+ $statusIcon = Display::getMdiIcon(StateIcon::OFFLINE, 'ch-tool-icon', null, ICON_SIZE_SMALL, get_lang('Offline'));
$status = 0;
if (!empty($user_info_friend['user_is_online_in_chat'])) {
- $statusIcon = Display::return_icon('statusonline.png', get_lang('Online'));
+ $statusIcon = Display::getMdiIcon(StateIcon::ONLINE, 'ch-tool-icon', null, ICON_SIZE_SMALL, get_lang('Online'));
$status = 1;
}
@@ -2012,7 +2015,7 @@ class SocialManager extends UserManager
if ($canEdit) {
$htmlDelete = Display::url(
- Display::getMdiIcon('delete'),
+ Display::getMdiIcon(ActionIcon::DELETE, 'ch-tool-icon', null, ICON_SIZE_SMALL),
'javascript:void(0)',
[
'id' => 'message_'.$message['id'],
diff --git a/public/main/inc/lib/statistics.lib.php b/public/main/inc/lib/statistics.lib.php
index 94dd37efcd..d888959e99 100644
--- a/public/main/inc/lib/statistics.lib.php
+++ b/public/main/inc/lib/statistics.lib.php
@@ -3,6 +3,7 @@
use Chamilo\CoreBundle\Component\Utils\ChamiloApi;
use Chamilo\CoreBundle\Entity\UserRelUser;
+use Chamilo\CoreBundle\Component\Utils\ActionIcon;
/**
* This class provides some functions for statistics.
@@ -1345,7 +1346,7 @@ class Statistics
if (!empty($result)) {
$actions = Display::url(
- Display::return_icon('excel.png', get_lang('ExportToXls'), [], ICON_SIZE_MEDIUM),
+ Display::getMdiIcon(ActionIcon::EXPORT_SPREADSHEET, 'ch-tool-icon', null, ICON_SIZE_MEDIUM, get_lang('ExportToXls')),
api_get_self().'?'.http_build_query(
[
'report' => 'logins_by_date',
diff --git a/public/main/inc/lib/template.lib.php b/public/main/inc/lib/template.lib.php
index fa7adf025c..3c767abb62 100644
--- a/public/main/inc/lib/template.lib.php
+++ b/public/main/inc/lib/template.lib.php
@@ -8,6 +8,7 @@ use Chamilo\CoreBundle\Entity\User;
use Chamilo\CoreBundle\Framework\Container;
use Symfony\Component\Filesystem\Exception\FileNotFoundException;
use Symfony\Component\HttpFoundation\Response;
+use Chamilo\CoreBundle\Component\Utils\ToolIcon;
/**
* Class Template.
@@ -183,7 +184,7 @@ class Template
$help = Security::remove_XSS($help);
$content = '';
$content .= Display::url(
- Display::return_icon('help.png', get_lang('Help'), null, ICON_SIZE_LARGE),
+ Display::getMdiIcon(ToolIcon::HELP, 'ch-tool-icon', null, ICON_SIZE_LARGE, get_lang('Help')),
api_get_path(WEB_CODE_PATH).'help/help.php?open='.$help,
[
'class' => 'ajax',
@@ -998,12 +999,7 @@ class Template
{
//@todo move this in the template
$rightFloatMenu = '';
- $iconBug = Display::return_icon(
- 'bug.png',
- get_lang('Report a bug'),
- [],
- ICON_SIZE_LARGE
- );
+ $iconBug = Display::getMdiIcon(ToolIcon::BUG_REPORT, 'ch-tool-icon', null, ICON_SIZE_LARGE, get_lang('Report a bug'));
if ('true' === api_get_setting('show_link_bug_notification') && $this->user_is_logged_in) {
$rightFloatMenu = '
@@ -1017,12 +1013,7 @@ class Template
) {
// by default is project_id = 1
$defaultProjectId = 1;
- $iconTicket = Display::return_icon(
- 'help.png',
- get_lang('Ticket'),
- [],
- ICON_SIZE_LARGE
- );
+ $iconTicket = Display::getMdiIcon(ToolIcon::HELP, 'ch-tool-icon', null, ICON_SIZE_LARGE, get_lang('Ticket'));
$courseInfo = api_get_course_info();
$courseParams = '';
if (!empty($courseInfo)) {
diff --git a/public/main/inc/lib/thematic.lib.php b/public/main/inc/lib/thematic.lib.php
index 680b499306..5035c90755 100644
--- a/public/main/inc/lib/thematic.lib.php
+++ b/public/main/inc/lib/thematic.lib.php
@@ -9,6 +9,7 @@ use Chamilo\CourseBundle\Entity\CAttendance;
use Chamilo\CourseBundle\Entity\CThematic;
use Chamilo\CourseBundle\Entity\CThematicAdvance;
use Chamilo\CourseBundle\Entity\CThematicPlan;
+use Chamilo\CoreBundle\Component\Utils\ActionIcon;
/**
* Provides functions for thematic option inside attendance tool.
@@ -516,11 +517,11 @@ class Thematic
$actions = '';
$actions .= ' '.
- Display::return_icon('edit.png', get_lang('Edit'), '', 22).' ';
+ Display::getMdiIcon(ActionIcon::EDIT, 'ch-tool-icon', null, ICON_SIZE_SMALL, get_lang('Edit')).'';
$actions .= '
'.
- Display::return_icon('delete.png', get_lang('Delete'), '', 22).' ';
+ 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.