Display: Use new icons in various tools

pull/5037/head
Yannick Warnier 2 years ago
parent 152de1c49b
commit 4d3fab33a5
  1. 29
      public/main/inc/lib/AnnouncementManager.php
  2. 19
      public/main/inc/lib/ExerciseCategoryManager.php
  3. 15
      public/main/inc/lib/MailTemplateManager.php
  4. 7
      public/main/inc/lib/ScheduledAnnouncement.php
  5. 8
      public/main/inc/lib/SkillModel.php
  6. 17
      public/main/inc/lib/TicketManager.php
  7. 58
      public/main/inc/lib/agenda.lib.php
  8. 34
      public/main/inc/lib/api.lib.php
  9. 70
      public/main/inc/lib/attendance.lib.php
  10. 36
      public/main/inc/lib/banner.lib.php
  11. 5
      public/main/inc/lib/career.lib.php
  12. 78
      public/main/inc/lib/course.lib.php
  13. 36
      public/main/inc/lib/course_category.lib.php
  14. 7
      public/main/inc/lib/diagnoser.lib.php
  15. 22
      public/main/inc/lib/extra_field.lib.php
  16. 3
      public/main/inc/lib/extra_field_option.lib.php
  17. 35
      public/main/inc/lib/glossary.lib.php
  18. 6
      public/main/inc/lib/grade_model.lib.php
  19. 108
      public/main/inc/lib/link.lib.php
  20. 14
      public/main/inc/lib/notebook.lib.php
  21. 12
      public/main/inc/lib/plugin.lib.php
  22. 23
      public/main/inc/lib/promotion.lib.php
  23. 37
      public/main/inc/lib/sessionmanager.lib.php
  24. 17
      public/main/inc/lib/social.lib.php
  25. 3
      public/main/inc/lib/statistics.lib.php
  26. 17
      public/main/inc/lib/template.lib.php
  27. 5
      public/main/inc/lib/thematic.lib.php
  28. 262
      public/main/inc/lib/tracking.lib.php
  29. 36
      public/main/inc/lib/usergroup.lib.php
  30. 3
      public/main/inc/lib/webservices/Rest.php
  31. 12
      public/main/inc/lib/zombie/zombie_report.class.php
  32. 5
      public/main/notebook/index.php
  33. 3
      public/main/portfolio/add_category.php
  34. 3
      public/main/portfolio/add_item.php
  35. 4
      public/main/portfolio/edit_category.php
  36. 4
      public/main/portfolio/edit_item.php
  37. 12
      public/main/portfolio/list.php
  38. 222
      public/main/work/work.lib.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 = "<a href=\"".$url."&action=modify&id=".$id."\">".
Display::return_icon('edit.png', get_lang('Edit'), '', ICON_SIZE_SMALL)."</a>";
Display::getMdiIcon(ActionIcon::EDIT, 'ch-tool-icon', null, ICON_SIZE_SMALL, get_lang('Edit'))."</a>";
$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 .= "<a
href=\"".$url."&action=set_visibility&status=".$setNewStatus."&id=".$id."&sec_token=".$stok."\">".
Display::return_icon($image_visibility.'.png', $alt_visibility, '', ICON_SIZE_SMALL)."</a>";
Display::getMdiIcon($image_visibility, 'ch-tool-icon', null, ICON_SIZE_SMALL, $alt_visibility)."</a>";
if (api_is_allowed_to_edit(false, true)) {
$modify_icons .= "<a
href=\"".$url."&action=delete&id=".$id."&sec_token=".$stok."\"
onclick=\"javascript:if(!confirm('".addslashes(api_htmlentities(get_lang('Please confirm your choice'), ENT_QUOTES))."')) return false;\">".
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')).
"</a>";
}
$html .= "<tr><th style='text-align:right'>$modify_icons</th></tr>";
@ -563,18 +565,13 @@ class AnnouncementManager
$url = $repo->getResourceFileDownloadUrl($attachment).'?'.api_get_cidreq();
$html .= '<tr><td>';
$html .= '<br/>';
$html .= Display::getMdiIcon('paperclip');
$html .= Display::getMdiIcon(ObjectIcon::ATTACHMENT, 'ch-tool-icon', null, ICON_SIZE_SMALL);
$html .= '<a href="'.$url.' "> '.$attachment->getFilename().' </a>';
$html .= ' - <span class="forum_attach_comment" >'.$attachment->getComment().'</span>';
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 = '<i class="fa fa-envelope-o" title="'.get_lang('Announcement sent by e-mail').'"></i>';
$attachmentIcon = '<i class="fa fa-paperclip" title="'.get_lang('Attachment').'"></i>';
$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
);
}

@ -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 = '<div class="actions">';
$content .= '<a href="'.api_get_path(WEB_CODE_PATH).'exercise/exercise.php?'.api_get_cidreq().'">';
$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 .= '</a>';
$content .= '<a href="'.api_get_self().'?action=add&'.api_get_cidreq().'">';
$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 .= '</a>';
$content .= '</div>';

@ -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 = '<div class="actions" style="margin-bottom:20px">';
$html .= '<a href="'.api_get_path(WEB_CODE_PATH).'admin">'.
Display::return_icon(
'back.png',
get_lang('Back'),
'',
'32'
)
Display::getMdiIcon(ActionIcon::BACK, 'ch-tool-icon', null, ICON_SIZE_MEDIUM, get_lang('Back'))
.'</a>';
$html .= '<a href="'.api_get_self().'?action=add">'.
Display::return_icon(
'add.png',
get_lang('Add'),
'',
'32'
).'</a>';
Display::getMdiIcon(ActionIcon::ADD, 'ch-tool-icon', null, ICON_SIZE_MEDIUM, get_lang('Add')).'</a>';
$html .= '</div>';
$html .= Display::grid_html('mail_template');

@ -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 = '<div class="actions" style="margin-bottom:20px">';
$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 .= '<a href="'.api_get_self().'?action=add&session_id='.$sessionId.'">'.
Display::return_icon('add.png', get_lang('Add'), '', ICON_SIZE_MEDIUM).'</a>';
Display::getMdiIcon(ActionIcon::ADD, 'ch-tool-icon', null, ICON_SIZE_MEDIUM, get_lang('Add')).'</a>';
$action .= '<a href="scheduled_announcement.php?action=run&session_id='.$sessionId.'">'.
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')).
'</a>';
$action .= '</div>';

@ -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'
);

@ -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 .= '<a href="ticket_details.php?ticket_id='.$row['id'].'">'.$row['code'].'</a>';
@ -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;

@ -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;

@ -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 = '&nbsp;&nbsp;'.Display::return_icon(
'star.png',
get_lang('Session-specific resource'),
['align' => 'absmiddle'],
ICON_SIZE_SMALL
$image = '&nbsp;&nbsp;'.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.')
);
}

@ -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 .= '<center>';
if (api_is_platform_admin()) {
$actions .= '<a href="index.php?'.api_get_cidreq().'&action=attendance_edit&attendance_id='.$id.'">'.
Display::return_icon('edit.png', get_lang('Edit'), [], ICON_SIZE_SMALL).'</a>&nbsp;';
Display::getMdiIcon(ActionIcon::EDIT, 'ch-tool-icon', null, ICON_SIZE_SMALL, get_lang('Edit')).'</a>&nbsp;';
// Visible
if (1 == $active) {
$actions .= '<a href="index.php?'.api_get_cidreq().'&action=attendance_set_invisible&attendance_id='.$id.'">'.
Display::return_icon('visible.png', get_lang('Hide'), [], ICON_SIZE_SMALL).'</a>';
Display::getMdiIcon(StateIcon::ACTIVE, 'ch-tool-icon', null, ICON_SIZE_SMALL, get_lang('Hide')).'</a>';
} else {
$actions .= '<a href="index.php?'.api_get_cidreq().'&action=attendance_set_visible&attendance_id='.$id.'">'.
Display::return_icon('invisible.png', get_lang('Show'), [], ICON_SIZE_SMALL).'</a>';
Display::getMdiIcon(StateIcon::INACTIVE, 'ch-tool-icon', null, ICON_SIZE_SMALL, get_lang('Show')).'</a>';
$row[2] = '<span class="muted">'.$attendance->getDescription().'</span>';
}
if ('true' === $allowDelete) {
$actions .= '<a href="index.php?'.api_get_cidreq().'&action=attendance_delete&attendance_id='.$id.'">'.
Display::return_icon('delete.png', get_lang('Delete'), [], ICON_SIZE_SMALL).'</a>';
Display::getMdiIcon(ActionIcon::DELETE, 'ch-tool-icon', null, ICON_SIZE_SMALL, get_lang('Delete')).'</a>';
}
} else {
$is_locked_attendance = self::is_locked_attendance($id);
if ($is_locked_attendance) {
$actions .= Display::return_icon('edit_na.png', get_lang('Edit')).'&nbsp;';
$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')).'&nbsp;';
$actions .= Display::getMdiIcon(StateIcon::ACTIVE, 'ch-tool-icon', null, ICON_SIZE_SMALL, get_lang('Hide'));
} else {
$actions .= '<a href="index.php?'.api_get_cidreq().'&action=attendance_edit&attendance_id='.$id.'">'.
Display::return_icon('edit.png', get_lang('Edit'), [], ICON_SIZE_SMALL).'</a>&nbsp;';
Display::getMdiIcon(ActionIcon::EDIT, 'ch-tool-icon', null, ICON_SIZE_SMALL, get_lang('Edit')).'</a>&nbsp;';
if (1 == $active) {
$actions .= ' <a href="index.php?'.api_get_cidreq().'&action=attendance_set_invisible&attendance_id='.$id.'">'.
Display::return_icon('visible.png', get_lang('Hide'), [], ICON_SIZE_SMALL).'</a>';
Display::getMdiIcon(StateIcon::ACTIVE, 'ch-tool-icon', null, ICON_SIZE_SMALL, get_lang('Hide')).'</a>';
} else {
$actions .= ' <a href="index.php?'.api_get_cidreq().'&action=attendance_set_visible&attendance_id='.$id.'">'.
Display::return_icon('invisible.png', get_lang('Show'), [], ICON_SIZE_SMALL).'</a>';
Display::getMdiIcon(StateIcon::INACTIVE, 'ch-tool-icon', null, ICON_SIZE_SMALL, get_lang('Show')).'</a>';
$row[2] = '<span class="muted">'.$attendance->getDescription().'</span>';
}
if ('true' === $allowDelete) {
$actions .= ' <a href="index.php?'.api_get_cidreq().'&action=attendance_delete&attendance_id='.$id.'">'.
Display::return_icon('delete.png', get_lang('Delete'), [], ICON_SIZE_SMALL).'</a>';
Display::getMdiIcon(ActionIcon::DELETE, 'ch-tool-icon', null, ICON_SIZE_SMALL, get_lang('Delete')).'</a>';
}
}
}
@ -264,15 +267,15 @@ class Attendance
$actions .= '&nbsp;<a
onclick="javascript:if(!confirm(\''.$message_alert.'\')) return false;"
href="index.php?'.api_get_cidreq().'&action=lock_attendance&attendance_id='.$id.'">'.
Display::return_icon('unlock.png', get_lang('Lock attendance')).'</a>';
Display::getMdiIcon(ActionIcon::UNLOCK, 'ch-tool-icon', null, ICON_SIZE_SMALL, get_lang('Lock attendance')).'</a>';
} else {
if (api_is_platform_admin()) {
$actions .= '&nbsp;<a
onclick="javascript:if(!confirm(\''.get_lang('Are you sure you want to unlock the attendance?').'\')) return false;"
href="index.php?'.api_get_cidreq().'&action=unlock_attendance&attendance_id='.$id.'">'.
Display::return_icon('lock.png', get_lang('Unlock attendance')).'</a>';
Display::getMdiIcon(ActionIcon::LOCK, 'ch-tool-icon', null, ICON_SIZE_SMALL, get_lang('Unlock attendance')).'</a>';
} else {
$actions .= '&nbsp;'.Display::return_icon('locked_na.png', get_lang('Locked attendance'));
$actions .= '&nbsp;'.Display::getMdiIcon(ActionIcon::LOCK, 'ch-tool-icon-disabled', null, ICON_SIZE_SMALL, get_lang('Locked attendance'));
}
}
}
@ -2580,12 +2583,12 @@ class Attendance
$actionsLeft = '<a
style="float:left;"
href="index.php?'.api_get_cidreq().'&action=calendar_list&attendance_id='.$attendanceId.'">'.
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')).
'</a>';
$actionsLeft .= '<a
id="pdf_export" style="float:left;"
href="index.php?'.api_get_cidreq().'&action=attendance_sheet_export_to_pdf&attendance_id='.$attendanceId.'&filter='.$default_filter.'&group_id='.$groupId.'">'.
Display::return_icon('pdf.png', get_lang('Export to PDF'), '', ICON_SIZE_MEDIUM).'</a>';
Display::getMdiIcon(ActionIcon::EXPORT_PDF, 'ch-tool-icon', null, ICON_SIZE_MEDIUM, get_lang('Export to PDF')).'</a>';
$actionsRight = $form->returnForm();
$content .= Display::toolbarAction('toolbar-attendance', [$actionsLeft, $actionsRight]);
@ -2677,11 +2680,7 @@ class Attendance
$time = $calendar['time'];
$datetime = '<div class="grey">'.$date.' - '.$time.'</div>';
$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 = '<div class="blue">'.$date.' - '.$time.'</div>';
@ -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 .= '<th>';
@ -2725,12 +2720,7 @@ class Attendance
} else {
$result = '<th width="2000px"><span>
<a href="index.php?'.api_get_cidreq().'&action=calendar_list&attendance_id='.$attendanceId.'">';
$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 .= '</a></span></th>';
}
@ -2791,26 +2781,16 @@ class Attendance
value="'.$user['user_id'].'" '.$disabled.' '.$checked.' />';
$form .= '<span class="anchor_'.$calendar['iid'].'"></span>';
} 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 .= '<tr class="'.$class.'">
<td>
'.$check.'&nbsp; '.$presence['date_time'].'

@ -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 .= '<li class="user-online"><a href="'.api_get_path(WEB_PATH).'whoisonline.php" target="_self" title="'
.get_lang('Users online').'" >'
.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.'</a></li>';
}
@ -138,7 +139,7 @@ function returnNotificationMenu()
) {
$html .= '<li class="user-online-course"><a href="'.api_get_path(WEB_PATH).'whoisonline.php?cidReq='.$courseInfo['sysCode']
.'" target="_self">'
.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.' </a></li>';
}
@ -150,7 +151,7 @@ function returnNotificationMenu()
$numberOnlineInSession = getOnlineUsersInSessionCount($sessionId);
$html .= '<li class="user-online-session">
<a href="'.api_get_path(WEB_PATH).'whoisonlinesession.php" target="_self">'
.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.'</a></li>';
}
}
@ -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;

@ -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 = '<a href="career_dashboard.php">'.
Display::return_icon('back.png', get_lang('Back'), '', ICON_SIZE_MEDIUM).'</a>';
Display::getMdiIcon(ActionIcon::BACK, 'ch-tool-icon', null, ICON_SIZE_MEDIUM, get_lang('Back')).'</a>';
if (api_is_platform_admin()) {
$actions .= '<a href="'.api_get_self().'?action=add">'.
Display::return_icon('new_career.png', get_lang('Add'), '', ICON_SIZE_MEDIUM).'</a>';
Display::getMdiIcon(ActionIcon::ADD, 'ch-tool-icon', null, ICON_SIZE_MEDIUM, get_lang('Add')).'</a>';
}
$html = Display::toolbarAction('career_actions', [$actions]);
$html .= Display::grid_html('careers');

@ -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 .= '<ul class="user-teacher">';
foreach ($list as $teacher) {
$html .= '<li>';
$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 .= '</li>';
}
@ -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 .= '</a> ';
//edit
$data .= '<a href="'.api_get_self().'?'.api_get_cidreq().'&description_id='.$description->id.'">';
$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 .= '</a> ';
}
@ -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'] .= '<a id="document_preview_'.$course_info['real_id'].'_0" class="document_preview" href="javascript:void(0);">'.Display::return_icon('folder.png', get_lang('Documents'), ['align' => 'absmiddle'], ICON_SIZE_SMALL).'</a>';
$params['right_actions'] .= '<a id="document_preview_'.$course_info['real_id'].'_0" class="document_preview" href="javascript:void(0);">'.Display::getMdiIcon(ObjectIcon::FOLDER, 'ch-tool-icon', 'align: absmiddle;', ICON_SIZE_SMALL, get_lang('Documents')).'</a>';
$params['right_actions'] .= '<a href="'.api_get_path(WEB_CODE_PATH).'course_info/infocours.php?cid='.$course['real_id'].'">'.
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')).
'</a>';
$params['right_actions'] .= Display::div(
'',
@ -6155,7 +6159,7 @@ class CourseManager
if (Course::CLOSED != $course_info['visibility']) {
if ($loadDirs) {
$params['right_actions'] .= '<a id="document_preview_'.$course_info['real_id'].'_0" class="document_preview" href="javascript:void(0);">'.
Display::return_icon('folder.png', get_lang('Documents'), ['align' => 'absmiddle'], ICON_SIZE_SMALL).'</a>';
Display::getMdiIcon(ObjectIcon::FOLDER, 'ch-tool-icon', 'align: absmiddle;', ICON_SIZE_SMALL, get_lang('Documents')).'</a>';
$params['right_actions'] .= Display::div(
'',
[

@ -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
);

@ -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()) {

@ -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 = '&nbsp;'.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 = '<a href="../admin/index.php">';
$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 .= '</a>';
$actions .= '<a href="'.api_get_self().'?action=add&type='.$this->type.'">';
$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 .= '</a>';
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)
);

@ -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 '<div class="actions">';
$field_id = isset($_REQUEST['field_id']) ? intval($_REQUEST['field_id']) : null;
echo '<a href="'.api_get_self().'?action=add&type='.$this->type.'&field_id='.$field_id.'">'.
Display::return_icon('add_user_fields.png', get_lang('Add'), '', ICON_SIZE_MEDIUM).'</a>';
Display::getMdiIcon(ActionIcon::ADD, 'ch-tool-icon', null, ICON_SIZE_MEDIUM, get_lang('Add')).'</a>';
echo '</div>';
echo Display::grid_html('extra_field_options');
}

@ -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 .= '<a href="'.$url.'&action=addglossary">'.$addIcon.'</a>';
}
if (api_is_allowed_to_edit(null, true)) {
$actionsLeft .= '<a href="'.$url.'&action=import">'.
Display::return_icon('import.png', get_lang('Import glossary'), '', ICON_SIZE_MEDIUM).'</a>';
Display::getMdiIcon(ActionIcon::IMPORT_ARCHIVE, 'ch-tool-icon', null, ICON_SIZE_MEDIUM, get_lang('Import glossary')).'</a>';
}
if (!api_is_anonymous()) {
$actionsLeft .= '<a id="export_opener" href="'.$url.'&action=export">'.
Display::return_icon('save.png', get_lang('Export'), '', ICON_SIZE_MEDIUM).'</a>';
Display::getMdiIcon(ActionIcon::SAVE_FORM, 'ch-tool-icon', null, ICON_SIZE_MEDIUM, get_lang('Export')).'</a>';
}
if ('table' === $view || !isset($view)) {
$actionsLeft .= '<a href="'.$url.'&action=changeview&view=list">'.
Display::return_icon('view_detailed.png', get_lang('List view'), '', ICON_SIZE_MEDIUM).'</a>';
Display::getMdiIcon(StateIcon::DETAILED_VIEW, 'ch-tool-icon', null, ICON_SIZE_MEDIUM, get_lang('List view')).'</a>';
} else {
$actionsLeft .= '<a href="'.$url.'&action=changeview&view=table">'.
Display::return_icon('view_text.png', get_lang('Table view'), '', ICON_SIZE_MEDIUM).'</a>';
Display::getMdiIcon(StateIcon::LIST_VIEW, 'ch-tool-icon', null, ICON_SIZE_MEDIUM, get_lang('Table view')).'</a>';
}
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 = '<a href="'.api_get_self().'?action=edit_glossary&glossary_id='.$glossary_id.'&'.api_get_cidreq().'&msg=edit">'.
Display::return_icon('edit.png', get_lang('Edit'), '', 22).'</a>';
Display::getMdiIcon(ActionIcon::EDIT, 'ch-tool-icon', null, ICON_SIZE_SMALL, get_lang('Edit')).'</a>';
$repo = Container::getGlossaryRepository();
/** @var CGlossary $glossaryData */
$glossaryData = $repo->find($glossary_id);
@ -824,7 +817,7 @@ class GlossaryManager
$return .= '<a
href="'.api_get_self().'?action=delete_glossary&glossary_id='.$glossary_id.'&'.api_get_cidreq().'"
onclick="return confirmation(\''.$glossaryTerm.'\');">'.
Display::return_icon('delete.png', get_lang('Delete'), '', 22).'</a>';
Display::getMdiIcon(ActionIcon::DELETE, 'ch-tool-icon', null, ICON_SIZE_SMALL, get_lang('Delete')).'</a>';
/*
* if ($glossaryData->getSessionId() == api_get_session_id()) {
} else {

@ -1,6 +1,8 @@
<?php
/* For licensing terms, see /license.txt */
use Chamilo\CoreBundle\Component\Utils\ActionIcon;
/**
* Class GradeModel.
*/
@ -50,9 +52,9 @@ class GradeModel extends Model
// action links
echo '<div class="actions" style="margin-bottom:20px">';
echo '<a href="grade_models.php">'.
Display::return_icon('back.png', get_lang('Back'), '', ICON_SIZE_MEDIUM).'</a>';
Display::getMdiIcon(ActionIcon::BACK, 'ch-tool-icon', null, ICON_SIZE_MEDIUM, get_lang('Back')).'</a>';
echo '<a href="'.api_get_self().'?action=add">'.
Display::return_icon('add.png', get_lang('Add'), '', ICON_SIZE_MEDIUM).'</a>';
Display::getMdiIcon(ActionIcon::ADD, 'ch-tool-icon', null, ICON_SIZE_MEDIUM, get_lang('Add')).'</a>';
echo '</div>';
echo Display::grid_html('grade_model');
}

@ -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 = '<a href="'.api_get_self().'?'.api_get_cidreq().'&sec_token='.$token.'&action=editcategory&id='.$categoryId.'&category_id='.$categoryId.'" title='.get_lang('Edit').'">'.
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')
).'</a>';
// DISPLAY MOVE UP COMMAND only if it is not the top link.
if (0 != $currentCategory) {
$tools .= '<a href="'.api_get_self().'?'.api_get_cidreq().'&sec_token='.$token.'&action=up&up='.$categoryId.'&category_id='.$categoryId.'" title="'.get_lang('Up').'">'.
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')
).'</a>';
} 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')
).'</a>';
}
// DISPLAY MOVE DOWN COMMAND only if it is not the bottom link.
if ($currentCategory < $countCategories - 1) {
$tools .= '<a href="'.api_get_self().'?'.api_get_cidreq().'&sec_token='.$token.'&action=down&down='.$categoryId.'&category_id='.$categoryId.'">'.
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')
).'</a>';
} else {
$tools .= Display:: return_icon(
'down_na.png',
get_lang('down'),
[],
ICON_SIZE_SMALL
).'</a>';
$tools .= Display::getMdiIcon(
ActionIcon::DOWN,
'ch-tool-icon-disabled',
null,
ICON_SIZE_SMALL,
get_lang('down')
).'</a>';
}
$tools .= '<a href="'.api_get_self().'?'.api_get_cidreq().'&sec_token='.$token.'&action=deletecategory&id='.$categoryId."&category_id=$categoryId\"
onclick=\"javascript: if(!confirm('".get_lang('When deleting a category, all links of this category are also deleted.
Do you really want to delete this category and its links ?')."')) return false;\">".
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')
).'</a>';
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 .= '<a
href="'.api_get_self().'?'.api_get_cidreq().'&action=addlink&category_id='.$categoryId.'">'.
Display::return_icon('new_link.png', get_lang('Add a link'), '', ICON_SIZE_MEDIUM).'</a>';
Display::getMdiIcon(ActionIcon::ADD, 'ch-tool-icon', null, ICON_SIZE_MEDIUM, get_lang('Add a link')).'</a>';
$actions .= '<a
href="'.api_get_self().'?'.api_get_cidreq().'&action=addcategory&category_id='.$categoryId.'">'.
Display::return_icon('new_folder.png', get_lang('Add a category'), '', ICON_SIZE_MEDIUM).'</a>';
Display::getMdiIcon(ActionIcon::CREATE_CATEGORY, 'ch-tool-icon', null, ICON_SIZE_MEDIUM, get_lang('Add a category')).'</a>';
}
if (!empty($countCategories)) {
$actions .= '<a href="'.api_get_self().'?'.api_get_cidreq().'&action=list&show=none">';
$actions .= Display::return_icon(
'forum_listview.png',
get_lang('List View'),
'',
ICON_SIZE_MEDIUM
).' </a>';
$actions .= Display::getMdiIcon(StateIcon::LIST_VIEW, 'ch-tool-icon', null, ICON_SIZE_MEDIUM, get_lang('List View')).' </a>';
$actions .= '<a href="'.api_get_self().'?'.api_get_cidreq().'&action=list&show=all">';
$actions .= Display::return_icon(
'forum_nestedview.png',
get_lang('Nested View'),
'',
ICON_SIZE_MEDIUM
).'</a>';
$actions .= Display::getMdiIcon(StateIcon::NESTED_VIEW, 'ch-tool-icon', null, ICON_SIZE_MEDIUM, get_lang('Nested View')).'</a>';
}
$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 = '<a
href="link.php?'.api_get_cidreq().'&sec_token='.$token.'&action=invisible&id='.$categoryItemId.'&scope='.TOOL_LINK_CATEGORY.'"
title="'.get_lang('Hide').'">'.
Display::return_icon('visible.png', get_lang('Hide'), [], ICON_SIZE_SMALL).'</a>';
Display::getMdiIcon(StateIcon::ACTIVE, 'ch-tool-icon', null, ICON_SIZE_SMALL, get_lang('Hide')).'</a>';
} elseif (!$isVisible) {
$visibilityClass = 'text-muted';
$strVisibility = ' <a
href="link.php?'.api_get_cidreq().'&sec_token='.$token.'&action=visible&id='.$categoryItemId.'&scope='.TOOL_LINK_CATEGORY.'"
title="'.get_lang('Show').'">'.
Display::return_icon('invisible.png', get_lang('Show'), [], ICON_SIZE_SMALL).'</a>';
Display::getMdiIcon(StateIcon::INACTIVE, 'ch-tool-icon', null, ICON_SIZE_SMALL, get_lang('Show')).'</a>';
}
$header = '';
if ($showChildren) {
$header .= '<a
class="'.$visibilityClass.'" href="'.api_get_self().'?'.api_get_cidreq().'&category_id=">';
$header .= Display::return_icon('forum_nestedview.png');
$header .= Display::getMdiIcon(StateIcon::NESTED_VIEW, 'ch-tool-icon', null, ICON_SIZE_SMALL);
} else {
$header .= '<a
class="'.$visibilityClass.'"
href="'.api_get_self().'?'.api_get_cidreq().'&category_id='.$categoryItemId.'">';
$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()).'</a>';
@ -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'])
);

@ -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 '<a href="index.php?'.api_get_cidreq().'&action=addnote">'.
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')).
'</a>';
}
}
echo '<a
href="index.php?'.api_get_cidreq().'&action=changeview&view=creation_date&direction='.$link_sort_direction.'">'.
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')).
'</a>';
echo '<a
href="index.php?'.api_get_cidreq().'&action=changeview&view=update_date&direction='.$link_sort_direction.'">'.
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')).
'</a>';
echo '<a href="index.php?'.api_get_cidreq().'&action=changeview&view=title&direction='.$link_sort_direction.'">'.
Display::return_icon('notes_order_by_title.png', get_lang('Sort by title'), '', '32').'</a>';
Display::getMdiIcon(ActionIcon::SORT_ALPHA, 'ch-tool-icon', null, ICON_SIZE_MEDIUM, get_lang('Sort by title')).
'</a>';
echo '</div>';
$notebookView = Session::read('notebook_view');
@ -242,11 +244,11 @@ class NotebookManager
}
$actions = '<a href="'.api_get_self().'?action=editnote&notebook_id='.$row['notebook_id'].'">'.
Display::return_icon('edit.png', get_lang('Edit'), '', ICON_SIZE_SMALL).'</a>';
Display::getMdiIcon(ActionIcon::EDIT, 'ch-tool-icon', null, ICON_SIZE_SMALL, get_lang('Edit')).'</a>';
$actions .= '<a
href="'.api_get_self().'?action=deletenote&notebook_id='.$row['notebook_id'].'"
onclick="return confirmation(\''.$row['title'].'\');">'.
Display::return_icon('delete.png', get_lang('Delete'), '', ICON_SIZE_SMALL).'</a>';
Display::getMdiIcon(ActionIcon::DELETE, 'ch-tool-icon', null, ICON_SIZE_SMALL, get_lang('Delete')).'</a>';
echo Display::panel(
$row['description'],

@ -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)
);
}

@ -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 = '<a href="career_dashboard.php">'.
Display::return_icon(
'back.png',
get_lang('Back'),
'',
'32'
)
Display::getMdiIcon(ActionIcon::BACK, 'ch-tool-icon', null, ICON_SIZE_MEDIUM, get_lang('Back'))
.'</a>';
$actions .= '<a href="'.api_get_self().'?action=add">'.
Display::return_icon(
'new_promotion.png',
get_lang('Add'),
'',
'32'
).'</a>';
Display::getMdiIcon(ActionIcon::ADD, 'ch-tool-icon', null, ICON_SIZE_MEDIUM, get_lang('Add')).'</a>';
$actions .= '<a href="'.api_get_path(WEB_CODE_PATH).'session/session_add.php">'.
Display::return_icon(
'new_session.png',
get_lang('Add a training session'),
'',
'32'
).'</a>';
Display::getMdiIcon(ObjectIcon::SESSION, 'ch-tool-icon', null, ICON_SIZE_MEDIUM, get_lang('Add a training session')).'</a>';
echo Display::toolbarAction('promotion_actions', [$actions]);
echo Display::grid_html('promotions');

@ -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)) {

@ -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'],

@ -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',

@ -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 = '<div class="help">';
$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 = '<div class="report">
<a href="https://github.com/chamilo/chamilo-lms/wiki/How-to-report-issues" target="_blank">
@ -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)) {

@ -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 .= '<a
href="index.php?'.api_get_cidreq().'&action=thematic_advance_edit&thematic_id='.$thematic_id.'&thematic_advance_id='.$thematic_advance[0].'">'.
Display::return_icon('edit.png', get_lang('Edit'), '', 22).'</a>';
Display::getMdiIcon(ActionIcon::EDIT, 'ch-tool-icon', null, ICON_SIZE_SMALL, get_lang('Edit')).'</a>';
$actions .= '<a
onclick="javascript:if(!confirm(\''.get_lang('Are you sure you want to delete').'\')) return false;"
href="index.php?'.api_get_cidreq().'&action=thematic_advance_delete&thematic_id='.$thematic_id.'&thematic_advance_id='.$thematic_advance[0].'">'.
Display::return_icon('delete.png', get_lang('Delete'), '', 22).'</a></center>';
Display::getMdiIcon(ActionIcon::DELETE, 'ch-tool-icon', null, ICON_SIZE_SMALL, get_lang('Delete')).'</a></center>';
$data[] = [$i, $thematic_advance[1], $thematic_advance[2], $thematic_advance[3], $actions];
$i++;
// }

@ -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 .= '&nbsp;'.
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 .= '&nbsp;'.
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 = '<a href="'.$url.'" title="'.get_lang('Remind inactive user').'">
'.Display::getMdiIcon('alert').'
'.Display::getMdiIcon(
StateIcon::WARNING,
'ch-tool-icon',
null,
ICON_SIZE_SMALL
).'
</a>';
}
@ -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 .= '<a href="#course_session_header">';
$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 .= '</a>';
} else {
$detailsLink .= '<a href="'.api_get_self().'?course='.$courseCode.$extra_params.'#course_session_header">';
$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 .= '</a>';
}
@ -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
<th>'.get_lang('Ranking').'</th>
<th>'.get_lang('Best result in course').'</th>
<th>'.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')
).
'</th>
</tr>
</thead>
@ -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'] = '<center><a href="'.$url.'">
'.Display::getMdiIcon('fast-forward-outline', 'ch-tool-icon', null, 32, get_lang('Details')).'
</a></center>';
'.Display::getMdiIcon(
'fast-forward-outline',
'ch-tool-icon',
null,
ICON_SIZE_MEDIUM,
get_lang('Details')
).'</a></center>';
// store columns in array $users
$user_row = [];
@ -8998,8 +9131,13 @@ class TrackingCourseLog
<center>
<a
href="../my_space/myStudents.php?student='.$user['user_id'].'&details=true&cid='.$courseId.'&origin=tracking_course&sid='.$sessionId.'">
'.Display::getMdiIcon('fast-forward-outline', 'ch-tool-icon', null, 22, get_lang('Details')).'
</a>
'.Display::getMdiIcon(
'fast-forward-outline',
'ch-tool-icon',
null,
ICON_SIZE_SMALL,
get_lang('Details')
).'</a>
</center>';
// 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;

@ -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 .= '<a href="../admin/index.php">'.
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')
).
'</a>';
}
$actions .= '<a href="'.api_get_self().'?action=add">'.
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')).
'</a>';
$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 '<a href="../admin/usergroups.php">'.
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')
).
'</a>';
} 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 .= '<li class="'.('group_edit' == $show ? 'active' : '').'"><a href="group_edit.php?id='.$group_id.'">'.
Display::return_icon('group_edit.png', get_lang('Edit this group')).get_lang('Edit this group').'</a></li>';
Display::getMdiIcon(ActionIcon::EDIT, 'ch-tool-icon', null, ICON_SIZE_MEDIUM, get_lang('Edit this group')).get_lang('Edit this group').'</a></li>';
$links .= '<li class="'.('member_list' == $show ? 'active' : '').'"><a href="group_waiting_list.php?id='.$group_id.'">'.
Display::return_icon('waiting_list.png', get_lang('Waiting list')).get_lang('Waiting list').'</a></li>';
$links .= '<li class="'.('invite_friends' == $show ? 'active' : '').'"><a href="group_invitation.php?id='.$group_id.'">'.

@ -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) {

@ -1,5 +1,9 @@
<?php
/* For licensing terms, see /license.txt */
use Chamilo\CoreBundle\Component\Utils\StateIcon;
/**
* Description of zombie_report.
*
@ -267,16 +271,14 @@ class ZombieReport implements Countable
{
$active = '1' == $active;
if ($active) {
$image = 'accept';
$image = StateIcon::COMPLETE;
$text = get_lang('Yes');
} else {
$image = 'error';
$image = StateIcon::INCOMPLETE;
$text = get_lang('No');
}
$result = Display::return_icon($image.'.png', $text);
return $result;
return Display::getMdiIcon($image, 'ch-tool-icon', null, ICON_SIZE_SMALL, $text);
}
public function format_status($status)

@ -2,6 +2,7 @@
/* For licensing terms, see /license.txt */
use ChamiloSession as Session;
use Chamilo\CoreBundle\Component\Utils\ActionIcon;
/**
* @author Christian Fasanando, initial version
@ -118,7 +119,7 @@ if ('addnote' === $action) {
'add_glossary',
[
Display::url(
Display::return_icon('back.png', get_lang('Back'), [], ICON_SIZE_MEDIUM),
Display::getMdiIcon(ActionIcon::BACK, 'ch-tool-icon', null, ICON_SIZE_MEDIUM, get_lang('Back')),
api_get_self().'?'.api_get_cidreq()
),
]
@ -181,7 +182,7 @@ if ('addnote' === $action) {
'add_glossary',
[
Display::url(
Display::return_icon('back.png', get_lang('Back'), [], ICON_SIZE_MEDIUM),
Display::getMdiIcon(ActionIcon::BACK, 'ch-tool-icon', null, ICON_SIZE_MEDIUM, get_lang('Back')),
api_get_self().'?'.api_get_cidreq()
),
]

@ -2,6 +2,7 @@
/* For licensing terms, see /license.txt */
use Chamilo\CoreBundle\Entity\PortfolioCategory;
use Chamilo\CoreBundle\Component\Utils\ActionIcon;
$form = new FormValidator('add_category', 'post', "$baseUrl&action=add_category");
if ('true' === api_get_setting('editor.save_titles_as_html')) {
@ -40,7 +41,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();

@ -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();

@ -1,6 +1,8 @@
<?php
/* For licensing terms, see /license.txt */
use Chamilo\CoreBundle\Component\Utils\ActionIcon;
$form = new FormValidator('edit_category', 'post', $baseUrl."action=edit_category&id={$category->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();

@ -1,6 +1,8 @@
<?php
/* For licensing terms, see /license.txt */
use Chamilo\CoreBundle\Component\Utils\ActionIcon;
$categories = $em
->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();

@ -1,23 +1,27 @@
<?php
/* For licensing terms, see /license.txt */
use Chamilo\CoreBundle\Component\Utils\ActionIcon;
use Chamilo\CoreBundle\Component\Utils\ObjectIcon;
use Chamilo\CoreBundle\Component\Utils\ToolIcon;
if ($currentUserId == $user->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
);
}

@ -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 .= '<a href="'.api_get_self().'?'.api_get_cidreq().'&id='.$my_back_id.'">'.
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')).
'</a>';
}
@ -52,24 +55,14 @@ function displayWorkActionLinks($id, $action, $isTutor)
// Create dir
if (empty($id)) {
$output .= '<a href="'.api_get_self().'?'.api_get_cidreq().'&action=create_dir">';
$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 .= '</a>';
}
}
if (api_is_allowed_to_edit(null, true) && 'learnpath' !== $origin && 'list' === $action) {
$output .= '<a id="open-view-list" href="#">'.
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')).
'</a>';
}
@ -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 = '&nbsp;'.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
).'&nbsp;';
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 .= '<a
href="'.$url.'work_list_all.php?'.api_get_cidreq().'&id='.$workId.'&action=export_to_doc&item_id='.$item_id.'"
title="'.get_lang('Export to .doc').'" >'.
Display::return_icon('export_doc.png', get_lang('Export to .doc'), [], ICON_SIZE_SMALL).'</a> ';
Display::getMdiIcon(ActionIcon::EXPORT_DOC, 'ch-tool-icon', null, ICON_SIZE_SMALL, get_lang('Export to .doc')).'</a> ';
}
$alreadyUploaded = '';
@ -2346,7 +2304,7 @@ function get_work_user_list(
>
<div id="progress_'.$item_id.'" class="text-center button-load">
'.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.'
</div>
<input id="file_'.$item_id.'" type="file" name="file" class="" multiple>
@ -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 = '<a
href="'.$url.'edit.php?'.api_get_cidreq().'&item_id='.$item_id.'&id='.$workId.'"
title="'.get_lang('Edit').'" >'.
Display::return_icon('edit.png', get_lang('Edit'), [], ICON_SIZE_SMALL).'</a>';
Display::getMdiIcon(ActionIcon::EDIT, 'ch-tool-icon', null, ICON_SIZE_SMALL, get_lang('Edit')).'</a>';
} else {
$editLink = '<a
href="'.$url.'edit.php?'.api_get_cidreq().'&item_id='.$item_id.'&id='.$workId.'"
title="'.get_lang('Edit').'">'.
Display::return_icon('edit.png', get_lang('Edit'), [], ICON_SIZE_SMALL).'</a>';
Display::getMdiIcon(ActionIcon::EDIT, 'ch-tool-icon', null, ICON_SIZE_SMALL, get_lang('Edit')).'</a>';
}
}
$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 .= '<a
href="'.$url.'work.php?'.api_get_cidreq().'&action=move&item_id='.$item_id.'&id='.$workId.'"
title="'.get_lang('Move').'">'.
Display::return_icon('move.png', get_lang('Move'), [], ICON_SIZE_SMALL).'</a>';
Display::getMdiIcon(ActionIcon::MOVE, 'ch-tool-icon', null, ICON_SIZE_SMALL, get_lang('Move')).'</a>';
}
}
@ -2437,30 +2385,30 @@ function get_work_user_list(
$action .= '<a
href="'.$url.'work_list_all.php?'.api_get_cidreq().'&id='.$workId.'&action=make_invisible&item_id='.$item_id.'"
title="'.get_lang('invisible').'" >'.
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')).
'</a>';
} else {
$action .= '<a
href="'.$url.'work_list_all.php?'.api_get_cidreq().'&id='.$workId.'&action=make_visible&item_id='.$item_id.'"
title="'.get_lang('Visible').'" >'.
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')).
'</a> ';
}
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 .= '<a
href="'.$url.'work_list_all.php?'.api_get_cidreq().'&id='.$workId.'&action=delete&item_id='.$item_id.'"
onclick="javascript:if(!confirm('."'".addslashes(api_htmlentities(get_lang('Please confirm your choice'), ENT_QUOTES))."'".')) return false;"
title="'.get_lang('Delete').'" >'.
Display::return_icon('delete.png', get_lang('Delete'), '', ICON_SIZE_SMALL).'</a>';
Display::getMdiIcon(ActionIcon::DELETE, 'ch-tool-icon', null, ICON_SIZE_SMALL, get_lang('Delete')).'</a>';
}
} elseif ($is_author && (empty($qualificatorId) || 0 == $qualificatorId)) {
$action .= '<a
href="'.$url.'view.php?'.api_get_cidreq().'&id='.$item_id.'"
title="'.get_lang('View').'">'.
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')).
'</a>';
if (1 == $studentDeleteOwnPublication) {
@ -2468,20 +2416,20 @@ function get_work_user_list(
$action .= '<a
href="'.$url.'edit.php?'.api_get_cidreq().'&item_id='.$item_id.'&id='.$workId.'"
title="'.get_lang('Edit').'">'.
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')).
'</a>';
}
$action .= ' <a
href="'.$url.'work_list.php?'.api_get_cidreq().'&action=delete&item_id='.$item_id.'&id='.$workId.'"
onclick="javascript:if(!confirm('."'".addslashes(api_htmlentities(get_lang('Please confirm your choice'), ENT_QUOTES))."'".')) return false;"
title="'.get_lang('Delete').'" >'.
Display::return_icon('delete.png', get_lang('Delete'), '', ICON_SIZE_SMALL).'</a>';
Display::getMdiIcon(ActionIcon::DELETE, 'ch-tool-icon', null, ICON_SIZE_SMALL, get_lang('Delete')).'</a>';
}
} else {
$action .= '<a
href="'.$url.'view.php?'.api_get_cidreq().'&id='.$item_id.'"
title="'.get_lang('View').'">'.
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')).
'</a>';
}
@ -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 .= '<a
href="'.$url.'work_list_all.php?'.$cidReq.'&id='.$workId.'&action=export_to_doc&item_id='.$item_id.'"
title="'.get_lang('ExportToDoc').'" >'.
Display::return_icon('export_doc.png', get_lang('ExportToDoc'), [], ICON_SIZE_SMALL).'</a> ';
Display::getMdiIcon(ActionIcon::EXPORT_DOC, 'ch-tool-icon', null, ICON_SIZE_SMALL, get_lang('ExportToDoc')).'</a> ';
}
$alreadyUploaded = '';
@ -2880,7 +2808,7 @@ function getAllWork(
>
<div id="progress_'.$item_id.'" class="text-center button-load">
'.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.'
</div>
<input id="file_'.$item_id.'" type="file" name="file" class="" multiple>
@ -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 = '<a
href="'.$url.'edit.php?'.$cidReq.'&item_id='.$item_id.'&id='.$work['parent_id'].'"
@ -2955,46 +2878,41 @@ function getAllWork(
/*if ($work['contains_file']) {
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 .= '<a href="'.$url.'work.php?'.$cidReq.'&action=move&item_id='.$item_id.'&id='.$work['parent_id'].'" title="'.get_lang('Move').'">'.
Display::return_icon('move.png', get_lang('Move'), [], ICON_SIZE_SMALL).'</a>';
Display::getMdiIcon(ActionIcon::MOVE, 'ch-tool-icon', null, ICON_SIZE_SMALL, get_lang('Move')).'</a>';
}
}*/
/*if ($work['accepted'] == '1') {
$action .= '<a href="'.$url.'work_list_all.php?'.$cidReq.'&id='.$workId.'&action=make_invisible&item_id='.$item_id.'" title="'.get_lang('Invisible').'" >'.
Display::return_icon('visible.png', get_lang('Invisible'), [], ICON_SIZE_SMALL).'</a>';
Display::getMdiIcon(ActionIcon::INVISIBLE, 'ch-tool-icon', null, ICON_SIZE_SMALL, get_lang('Invisible')).'</a>';
} else {
$action .= '<a href="'.$url.'work_list_all.php?'.$cidReq.'&id='.$workId.'&action=make_visible&item_id='.$item_id.'" title="'.get_lang('Visible').'" >'.
Display::return_icon('invisible.png', get_lang('Visible'), [], ICON_SIZE_SMALL).'</a> ';
Display::getMdiIcon(ActionIcon::VISIBLE, 'ch-tool-icon', null, ICON_SIZE_SMALL, get_lang('Visible')).'</a> ';
}*/
/*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 .= '<a href="'.$url.'work_list_all.php?'.$cidReq.'&id='.$workId.'&action=delete&item_id='.$item_id.'" onclick="javascript:if(!confirm('."'".addslashes(api_htmlentities(get_lang('ConfirmYourChoice'), ENT_QUOTES))."'".')) return false;" title="'.get_lang('Delete').'" >'.
Display::return_icon('delete.png', get_lang('Delete'), '', ICON_SIZE_SMALL).'</a>';
Display::getMdiIcon(ActionIcon::DELETE, 'ch-tool-icon', null, ICON_SIZE_SMALL, get_lang('Delete')).'</a>';
}*/
} elseif ($is_author && (empty($work['qualificator_id']) || 0 == $work['qualificator_id'])) {
$action .= '<a href="'.$url.'view.php?'.$cidReq.'&id='.$item_id.'" title="'.get_lang('View').'">'.
Display::return_icon('default.png', get_lang('View'), [], ICON_SIZE_SMALL).'</a>';
Display::getMdiIcon(ObjectIcon::DEFAULT, 'ch-tool-icon', null, ICON_SIZE_SMALL, get_lang('View')).'</a>';
if (1 == api_get_course_setting('student_delete_own_publication')) {
if (api_is_allowed_to_session_edit(false, true)) {
$action .= '<a href="'.$url.'edit.php?'.$cidReq.'&item_id='.$item_id.'&id='.$work['parent_id'].'" title="'.get_lang('Modify').'">'.
Display::return_icon('edit.png', get_lang('Comment'), [], ICON_SIZE_SMALL).'</a>';
Display::getMdiIcon(ActionIcon::EDIT, 'ch-tool-icon', null, ICON_SIZE_SMALL, get_lang('Comment')).'</a>';
}
$action .= ' <a href="'.$url.'work_list.php?'.$cidReq.'&action=delete&item_id='.$item_id.'&id='.$work['parent_id'].'" onclick="javascript:if(!confirm('."'".addslashes(api_htmlentities(get_lang('ConfirmYourChoice'), ENT_QUOTES))."'".')) return false;" title="'.get_lang('Delete').'" >'.
Display::return_icon('delete.png', get_lang('Delete'), '', ICON_SIZE_SMALL).'</a>';
Display::getMdiIcon(ActionIcon::DELETE, 'ch-tool-icon', null, ICON_SIZE_SMALL, get_lang('Delete')).'</a>';
}
} else {
$action .= '<a href="'.$url.'view.php?'.$cidReq.'&id='.$item_id.'" title="'.get_lang('View').'">'.
Display::return_icon('default.png', get_lang('View'), [], ICON_SIZE_SMALL).'</a>';
Display::getMdiIcon(ObjectIcon::DEFAULT, 'ch-tool-icon', null, ICON_SIZE_SMALL, get_lang('View')).'</a>';
}
// Status.

Loading…
Cancel
Save