diff --git a/public/main/forum/editpost.php b/public/main/forum/editpost.php index 67ee9c61e2..2fb8349eb5 100644 --- a/public/main/forum/editpost.php +++ b/public/main/forum/editpost.php @@ -6,6 +6,7 @@ use Chamilo\CoreBundle\Framework\Container; use Chamilo\CourseBundle\Entity\CForum; use Chamilo\CourseBundle\Entity\CForumPost; use Chamilo\CourseBundle\Entity\CForumThread; +use Chamilo\CoreBundle\Component\Utils\ActionIcon; /** * These files are a complete rework of the forum. The database structure is @@ -194,7 +195,7 @@ $htmlHeadXtra[] = << JS; @@ -248,30 +249,15 @@ if ('learnpath' !== $origin) { //$actions .= ''.search_link().''; if ('group' === $origin) { $actions .= ''. - Display::return_icon( - 'back.png', - get_lang('Back to').' '.get_lang('Groups'), - '', - ICON_SIZE_MEDIUM - ). + Display::getMdiIcon(ActionIcon::BACK, 'ch-tool-icon', null, ICON_SIZE_MEDIUM, get_lang('Back to').' '.get_lang('Groups')). ''; } else { $actions .= ''. - Display::return_icon( - 'back.png', - get_lang('Back toForumOverview'), - '', - ICON_SIZE_MEDIUM - ). + Display::getMdiIcon(ActionIcon::BACK, 'ch-tool-icon', null, ICON_SIZE_MEDIUM, get_lang('Back toForumOverview')). ''; } $actions .= ''. - Display::return_icon( - 'forum.png', - get_lang('Back toForum'), - '', - ICON_SIZE_MEDIUM - ). + Display::getMdiIcon('comment-quote', 'ch-tool-icon', null, ICON_SIZE_MEDIUM, get_lang('Back toForum')). ''; echo Display::toolbarAction('toolbar', [$actions]); } diff --git a/public/main/forum/editthread.php b/public/main/forum/editthread.php index 53ef5d7080..7167a1d56b 100644 --- a/public/main/forum/editthread.php +++ b/public/main/forum/editthread.php @@ -4,6 +4,8 @@ use Chamilo\CoreBundle\Framework\Container; use Chamilo\CourseBundle\Entity\CForum; +use Chamilo\CoreBundle\Component\Utils\ActionIcon; + /** * Edit a Forum Thread. @@ -200,7 +202,7 @@ $htmlHeadXtra[] = << JS; @@ -208,7 +210,7 @@ JS; // Action links $actions = [ Display::url( - Display::return_icon('back.png', get_lang('Back to forum'), '', ICON_SIZE_MEDIUM), + Display::getMdiIcon(ActionIcon::BACK, 'ch-tool-icon', null, ICON_SIZE_MEDIUM, get_lang('Back to forum')), 'viewforum.php?forum='.$forumId.'&'.$cidreq ), search_link(), diff --git a/public/main/forum/forumfunction.inc.php b/public/main/forum/forumfunction.inc.php index 99f5f2a2b8..bb62b7ed38 100644 --- a/public/main/forum/forumfunction.inc.php +++ b/public/main/forum/forumfunction.inc.php @@ -19,6 +19,8 @@ use Chamilo\CourseBundle\Entity\CLpItem; use ChamiloSession as Session; use Doctrine\Common\Collections\Criteria; use Symfony\Component\HttpFoundation\File\UploadedFile; +use Chamilo\CoreBundle\Component\Utils\ActionIcon; + /** * @todo convert this library into a class @@ -918,7 +920,7 @@ function returnVisibleInvisibleIcon( } } $html .= 'action=invisible&content='.$content.'&id='.$id.'">'. - Display::return_icon('visible.png', get_lang('MakeInvisible'), [], ICON_SIZE_SMALL).''; + Display::getMdiIcon(ActionIcon::VISIBLE, 'ch-tool-icon', null, ICON_SIZE_SMALL, get_lang('MakeInvisible')).''; } if (0 == $current_visibility_status) { $html .= ''. - Display::return_icon('invisible.png', get_lang('Make Visible'), [], ICON_SIZE_SMALL).''; + Display::getMdiIcon(ActionIcon::INVISIBLE, 'ch-tool-icon', null, ICON_SIZE_SMALL, get_lang('Make Visible')).''; } return $html; @@ -952,13 +954,14 @@ function returnLockUnlockIcon( //check if the forum is blocked due if ('thread' === $content) { if (api_resource_is_locked_by_gradebook($id, LINK_FORUM_THREAD)) { - return $html.Display::return_icon( - 'lock_na.png', + return $html.Display::getMdiIcon( + ActionIcon::LOCK, + 'ch-tool-icon-disabled', + '', + ICON_SIZE_SMALL, get_lang( 'This option is not available because this activity is contained by an assessment, which is currently locked. To unlock the assessment, ask your platform administrator.' - ), - [], - ICON_SIZE_SMALL + ) ); } } @@ -970,7 +973,7 @@ function returnLockUnlockIcon( } } $html .= 'action=unlock&content='.$content.'&id='.$id.'">'. - Display::return_icon('lock.png', get_lang('Unlock'), [], ICON_SIZE_SMALL).''; + Display::getMdiIcon(ActionIcon::LOCK, 'ch-tool-icon', null, ICON_SIZE_SMALL, get_lang('Unlock')).''; } if ('0' == $current_lock_status) { $html .= ''. - Display::return_icon('unlock.png', get_lang('Lock'), [], ICON_SIZE_SMALL).''; + Display::getMdiIcon(ActionIcon::UNLOCK, 'ch-tool-icon', null, ICON_SIZE_SMALL, get_lang('Lock')).''; } return $html; @@ -1017,10 +1020,10 @@ function returnUpDownIcon(string $content, int $id, array $list): string $return_value = ''. - Display::return_icon('up.png', get_lang('Move up'), [], ICON_SIZE_SMALL).''; + Display::getMdiIcon(ActionIcon::UP, 'ch-tool-icon', null, ICON_SIZE_SMALL, get_lang('Move up')).''; } else { $return_value = Display::url( - Display::return_icon('up_na.png', '-', [], ICON_SIZE_SMALL), + Display::getMdiIcon(ActionIcon::UP, 'ch-tool-icon-disabled', null, ICON_SIZE_SMALL, ''), 'javascript:void(0)' ); } @@ -1029,10 +1032,10 @@ function returnUpDownIcon(string $content, int $id, array $list): string $return_value .= ''. - Display::return_icon('down.png', get_lang('Move down'), [], ICON_SIZE_SMALL).''; + Display::getMdiIcon(ActionIcon::DOWN, 'ch-tool-icon', null, ICON_SIZE_SMALL, get_lang('Move down')).''; } else { $return_value = Display::url( - Display::return_icon('down_na.png', '-', [], ICON_SIZE_SMALL), + Display::getMdiIcon(ActionIcon::DOWN, 'ch-tool-icon-disabled', null, ICON_SIZE_SMALL, ''), 'javascript:void(0)' ); } @@ -1483,7 +1486,6 @@ function get_thread_users_details(int $thread_id) AND course_user.relation_type <> ".COURSE_RELATION_TYPE_RRHH." AND p.thread_id = $thread_id AND course_user.status != '1' AND - p.c_id = $course_id AND course_user.c_id = $course_id $orderby"; } @@ -3381,7 +3383,6 @@ function handle_mail_cue($content, $id) $sql = "SELECT users.firstname, users.lastname, users.id as user_id, users.email, posts.forum_id FROM $table_mailcue mailcue, $table_posts posts, $table_users users WHERE - posts.c_id = $course_id AND mailcue.c_id = $course_id AND posts.thread_id = $id AND posts.post_notification = '1' AND @@ -4000,7 +4001,7 @@ function search_link() $origin = api_get_origin(); if ('learnpath' != $origin) { $return = ' '; - $return .= Display::return_icon('search.png', get_lang('Search'), '', ICON_SIZE_MEDIUM).''; + $return .= Display::getMdiIcon('magnify-plus-outline ', 'ch-tool-icon', null, ICON_SIZE_SMALL, get_lang('Search')).''; if (!empty($_GET['search'])) { $return .= ': '.Security::remove_XSS($_GET['search']).' '; @@ -4012,7 +4013,7 @@ function search_link() } } $url .= implode('&', $url_parameter); - $return .= ''.Display::return_icon('delete.gif', get_lang('Clean search results')).''; + $return .= ''.Display::getMdiIcon(ActionIcon::DELETE, 'ch-tool-icon', '', ICON_SIZE_SMALL, get_lang('Clean search results')).''; } } @@ -4638,20 +4639,20 @@ function get_thread_user_post(Course $course, $thread_id, $user_id) /** * This function get the name of an thread by id. * - * @param int $thread_id + * @param int $threadId * * @return string * * @author Christian Fasanando * @author Julio Montoya Adding security */ -function get_name_thread_by_id($thread_id) +function get_name_thread_by_id(int $threadId): string { - $t_forum_thread = Database::get_course_table(TABLE_FORUM_THREAD); + $tForumThread = Database::get_course_table(TABLE_FORUM_THREAD); $course_id = api_get_course_int_id(); $sql = "SELECT thread_title - FROM $t_forum_thread - WHERE c_id = $course_id AND iid = '".(int) $thread_id."' "; + FROM $tForumThread + WHERE iid = $threadId"; $result = Database::query($sql); $row = Database::fetch_array($result); @@ -4700,12 +4701,7 @@ function get_all_post_from_user(int $user_id, int $courseId): string $post_counter = count($post_list); if (is_array($post_list) && count($post_list) > 0) { $hand_forums .= '
'; - $hand_forums .= Display::return_icon( - 'thread.png', - get_lang('Thread'), - '', - ICON_SIZE_MEDIUM - ); + $hand_forums .= Display::getMdiIcon('format-quote-open', 'ch-tool-icon', null, ICON_SIZE_SMALL, get_lang('Thread')); $hand_forums .= ' '.Security::remove_XSS($thread->getThreadTitle(), STUDENT); $hand_forums .= '
'; @@ -4724,7 +4720,7 @@ function get_all_post_from_user(int $user_id, int $courseId): string $forum_results .= '
'; $forum_results .= '

'; $forum_results .= '
'. - Display::return_icon('forum.gif', get_lang('Forum')).' '.Security::remove_XSS($forum->getForumTitle(), STUDENT). + Display::getMdiIcon('comment-quote', 'ch-tool-icon', '', ICON_SIZE_SMALL, get_lang('Forum')).' '.Security::remove_XSS($forum->getForumTitle(), STUDENT). '
'. get_lang('See forum').' @@ -5061,16 +5057,16 @@ function getAttachedFiles( // Check if $row is consistent if ($attachment) { // Set result as success and bring delete URL - $json['result'] = Display::return_icon('accept.png', get_lang('Uploaded.')); + $json['result'] = Display::getMdiIcon('check-circle', 'ch-tool-icon', null, ICON_SIZE_SMALL, get_lang('Uploaded.')); $url = api_get_path(WEB_CODE_PATH).'forum/viewthread.php?'.api_get_cidreq().'&action=delete_attach&forum='.$forumId.'&thread='.$threadId.'&id_attach='.$row['iid']; $json['delete'] = Display::url( - 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')), $url, ['class' => 'deleteLink'] ); } else { // If not, set an exclamation result - $json['result'] = Display::return_icon('exclamation.png', get_lang('Error')); + $json['result'] = Display::getMdiIcon('close-circle', 'ch-tool-icon', null, ICON_SIZE_SMALL, get_lang('Error')); } // Store array data into $_SESSION $_SESSION['forum']['upload_file'][$courseId][$json['id']] = $json; diff --git a/public/main/forum/forumqualify.php b/public/main/forum/forumqualify.php index 476e238fa5..189613706e 100644 --- a/public/main/forum/forumqualify.php +++ b/public/main/forum/forumqualify.php @@ -5,6 +5,8 @@ use Chamilo\CoreBundle\Framework\Container; use Chamilo\CourseBundle\Entity\CForum; use Chamilo\CourseBundle\Entity\CForumThread; +use Chamilo\CoreBundle\Component\Utils\ActionIcon; + /** * @todo fix all this qualify files avoid including files, use classes POO jmontoya @@ -339,7 +341,7 @@ if (isset($rows)) { echo ''; $realname = $attachment_list['path']; $user_filename = $attachment_list['filename']; - echo Display::return_icon('attachment.gif', get_lang('Attachment')); + echo Display::getMdiIcon('paperclip', 'ch-tool-icon', '', ICON_SIZE_SMALL, get_lang('Attachment')); echo ' '.$user_filename.' '; diff --git a/public/main/forum/index.php b/public/main/forum/index.php index 9e74fa4b4c..1361308478 100644 --- a/public/main/forum/index.php +++ b/public/main/forum/index.php @@ -4,6 +4,7 @@ use Chamilo\CourseBundle\Entity\CForumPost; use ChamiloSession as Session; +use Chamilo\CoreBundle\Component\Utils\ActionIcon; /** * These files are a complete rework of the forum. The database structure is @@ -204,11 +205,12 @@ if (!empty($_GET['lp_id']) || !empty($_POST['lp_id'])) { $url = '../lp/lp_controller.php?'.api_get_cidreq() ."&gradebook=&action=add_item&type=step&lp_id='.$lp_id.'#resource_tab-5"; $actionLeft .= Display::url( - Display::return_icon( - 'back.png', - get_lang('Back to').' '.get_lang('Learning paths'), + Display::getMdiIcon( + ActionIcon::BACK, + 'ch-tool-icon', null, - ICON_SIZE_MEDIUM + ICON_SIZE_MEDIUM, + get_lang('Back to').' '.get_lang('Learning paths') ), $url ); @@ -217,23 +219,13 @@ if (!empty($_GET['lp_id']) || !empty($_POST['lp_id'])) { if (api_is_allowed_to_edit(false, true)) { if (is_array($forumCategories) && !empty($forumCategories)) { $actionLeft .= Display::url( - Display::return_icon( - 'new_forum.png', - get_lang('Add a forum'), - null, - ICON_SIZE_MEDIUM - ), + Display::getMdiIcon('comment-quote', 'ch-tool-icon', null, ICON_SIZE_MEDIUM, get_lang('Add a forum')), api_get_self().'?'.api_get_cidreq().'&action=add_forum&lp_id='.$lp_id ); } $actionLeft .= Display::url( - Display::return_icon( - 'new_folder.png', - get_lang('Add a forumCategory'), - null, - ICON_SIZE_MEDIUM - ), + Display::getMdiIcon('folder-multiple-plus', 'ch-tool-icon', null, ICON_SIZE_MEDIUM, get_lang('Add a forumCategory')), api_get_self().'?'.api_get_cidreq().'&action=add_category&lp_id='.$lp_id ); } @@ -346,12 +338,7 @@ if (is_array($forumCategories)) { ) { $tools .= ''.Display::return_icon( - 'edit.png', - get_lang('Edit'), - [], - ICON_SIZE_SMALL - ) + .'">'.Display::getMdiIcon(ActionIcon::EDIT, 'ch-tool-icon', null, ICON_SIZE_SMALL, get_lang('Edit')) .''; $tools .= '" - .Display::return_icon( - 'delete.png', - get_lang('Delete'), - [], - ICON_SIZE_SMALL - ) + .Display::getMdiIcon(ActionIcon::DELETE, 'ch-tool-icon', null, ICON_SIZE_SMALL, get_lang('Delete')) .''; $tools .= returnVisibleInvisibleIcon( 'forumcategory', @@ -542,7 +524,7 @@ if (is_array($forumCategories)) { if (api_is_allowed_to_edit(false, true)) { $toolActions .= '' - .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')) .''; $toolActions .= '" - .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')) .''; $toolActions .= returnVisibleInvisibleIcon( diff --git a/public/main/forum/newthread.php b/public/main/forum/newthread.php index 6f39fad81a..14a4494e79 100644 --- a/public/main/forum/newthread.php +++ b/public/main/forum/newthread.php @@ -4,6 +4,7 @@ use Chamilo\CoreBundle\Framework\Container; use Chamilo\CourseBundle\Entity\CForum; +use Chamilo\CoreBundle\Component\Utils\ActionIcon; /** * These files are a complete rework of the forum. The database structure is @@ -223,7 +224,7 @@ Display::display_header(); //$actions ''.search_link().''; $actions = ''. - Display::return_icon('back.png', get_lang('Back to forum'), '', ICON_SIZE_MEDIUM).''; + Display::getMdiIcon(ActionIcon::BACK, 'ch-tool-icon', null, ICON_SIZE_MEDIUM, get_lang('Back to forum')).''; echo Display::toolbarAction('toolbar', [$actions]); // Set forum attachment data into $_SESSION diff --git a/public/main/forum/reply.php b/public/main/forum/reply.php index f70ed188f1..502a76318b 100644 --- a/public/main/forum/reply.php +++ b/public/main/forum/reply.php @@ -5,6 +5,7 @@ use Chamilo\CoreBundle\Framework\Container; use Chamilo\CourseBundle\Entity\CForum; use Chamilo\CourseBundle\Entity\CForumThread; +use Chamilo\CoreBundle\Component\Utils\ActionIcon; /** * These files are a complete rework of the forum. The database structure is @@ -204,7 +205,7 @@ $htmlHeadXtra[] = << JS; @@ -239,12 +240,7 @@ Display::display_header(); if ('learnpath' !== $origin) { //$actionsLeft = ''.search_link().''; $actionsLeft = ''; - $actionsLeft .= Display::return_icon( - 'back.png', - get_lang('Back to thread'), - '', - ICON_SIZE_MEDIUM - ).''; + $actionsLeft .= Display::getMdiIcon(ActionIcon::BACK, 'ch-tool-icon', null, ICON_SIZE_MEDIUM, get_lang('Back to thread')).''; echo Display::toolbarAction('toolbar', [$actionsLeft]); } diff --git a/public/main/forum/viewforum.php b/public/main/forum/viewforum.php index cee02ee991..177f7c668c 100644 --- a/public/main/forum/viewforum.php +++ b/public/main/forum/viewforum.php @@ -5,6 +5,8 @@ use Chamilo\CoreBundle\Framework\Container; use Chamilo\CourseBundle\Entity\CForum; use Chamilo\CourseBundle\Entity\CForumPost; +use Chamilo\CoreBundle\Component\Utils\ActionIcon; +use Chamilo\CoreBundle\Component\Utils\ToolIcon; require_once __DIR__.'/../inc/global.inc.php'; @@ -240,7 +242,7 @@ if ('liststd' === $my_action && $qualificationBlock .= ''; $max_qualify = showQualify('2', $userId, $_GET['id']); $counter = 0; - $icon = Display::return_icon('quiz.png', get_lang('Grade activity')); + $icon = Display::getMdiIcon(ActionIcon::GRADE, 'ch-tool-icon', null, ICON_SIZE_SMALL, get_lang('Grade activity')); if (Database::num_rows($student_list) > 0) { while ($row_student_list = Database::fetch_array($student_list)) { $userInfo = api_get_user_info($row_student_list['id']); @@ -290,12 +292,12 @@ $actions = ''; if ('learnpath' !== $origin) { if (!empty($groupId)) { $actions .= '' - .Display::return_icon('back.png', get_lang('Back to') + .Display::getMdiIcon(ActionIcon::BACK, 'ch-tool-icon', null, ICON_SIZE_SMALL, get_lang('Back to') .' '.get_lang('Groups'), '', ICON_SIZE_MEDIUM).''; } else { $actions .= ''.search_link().''; $actions .= '' - .Display::return_icon('back.png', get_lang('Back toForumOverview'), '', ICON_SIZE_MEDIUM) + .Display::getMdiIcon(ActionIcon::BACK, 'ch-tool-icon', null, ICON_SIZE_MEDIUM, get_lang('Back toForumOverview')) .''; } } @@ -312,7 +314,7 @@ if (api_is_allowed_to_edit(false, true) || if (!api_is_anonymous() && !api_is_invitee()) { $actions .= '' - .Display::return_icon('new_thread.png', get_lang('Create thread'), '', ICON_SIZE_MEDIUM) + .Display::getMdiIcon('format-quote-open', 'ch-tool-icon', null, ICON_SIZE_MEDIUM, get_lang('Create thread')) .''; } } else { @@ -321,12 +323,7 @@ if (api_is_allowed_to_edit(false, true) || } $descriptionForum = $forumEntity->getForumComment(); -$iconForum = Display::return_icon( - 'forum_yellow.png', - get_lang('Forum'), - null, - ICON_SIZE_MEDIUM -); +$iconForum = Display::getMdiIcon('comment-quote', 'ch-tool-icon', null, ICON_SIZE_MEDIUM, get_lang('Forum')); $header = ''; // The current forum @@ -426,14 +423,9 @@ if (is_array($threads)) { } $html .= '
' - .Display::return_icon('post-forum.png', null, null, ICON_SIZE_SMALL) + .Display::getMdiIcon('format-quote-open', 'ch-tool-icon', '', ICON_SIZE_SMALL, get_lang('Replies')) ." {$thread->getThreadReplies()} ".get_lang('Replies').'
'; - $html .= Display::return_icon( - 'post-forum.png', - null, - null, - ICON_SIZE_SMALL - ).' '.$thread->getThreadReplies().' '.get_lang('Views').'
'; + $html .= Display::getMdiIcon('format-quote-open', 'ch-tool-icon', '', ICON_SIZE_SMALL, get_lang('Views')).' '.$thread->getThreadReplies().' '.get_lang('Views').'
'; $html .= '
'; $last_post = null; if ($thread->getThreadLastPost()) { @@ -457,20 +449,15 @@ if (is_array($threads)) { .'&forum='.$forumId.'&thread=' .$thread->getIid() .'&id_attach='.$id_attach.'">' - .Display::return_icon('edit.png', get_lang('Edit'), [], ICON_SIZE_SMALL).''; + .Display::getMdiIcon(ActionIcon::EDIT, 'ch-tool-icon', null, ICON_SIZE_SMALL, get_lang('Edit')).''; if (api_resource_is_locked_by_gradebook($thread->getIid(), LINK_FORUM_THREAD)) { - $iconsEdit .= Display::return_icon( - 'delete_na.png', - get_lang('This option is not available because this activity is contained by an assessment, which is currently locked. To unlock the assessment, ask your platform administrator.'), - [], - ICON_SIZE_SMALL - ); + $iconsEdit .= Display::getMdiIcon(ActionIcon::DELETE, 'ch-tool-icon-disabled', null, ICON_SIZE_SMALL, get_lang('This option is not available because this activity is contained by an assessment')); } else { $iconsEdit .= '" - .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')).''; } $iconsEdit .= returnVisibleInvisibleIcon( @@ -492,29 +479,28 @@ if (is_array($threads)) { ] ); $iconsEdit .= '' - .Display::return_icon('move.png', get_lang('Move Thread'), [], ICON_SIZE_SMALL) + .Display::getMdiIcon(ActionIcon::MOVE, 'ch-tool-icon', null, ICON_SIZE_SMALL, get_lang('Move Thread')) .''; } } - $iconnotify = 'notification_mail_na.png'; + $disable = true; if (is_array( isset($_SESSION['forum_notification']['thread']) ? $_SESSION['forum_notification']['thread'] : null ) ) { if (in_array($threadId, $_SESSION['forum_notification']['thread'])) { - $iconnotify = 'notification_mail.png'; + $disable = false; } } - $icon_liststd = 'user.png'; if (!api_is_anonymous() && api_is_allowed_to_session_edit(false, true)) { $iconsEdit .= ''. - Display::return_icon($iconnotify, get_lang('Notify me')).''; + Display::getMdiIcon('email-alert', ($disable ? 'ch-tool-icon-disabled' : 'ch-tool-icon'), '', ICON_SIZE_SMALL, get_lang('Notify me')).''; } if (api_is_allowed_to_edit(null, true) && 'learnpath' != $origin) { $iconsEdit .= ''. - Display::return_icon($icon_liststd, get_lang('Learners list'), [], ICON_SIZE_SMALL) + Display::getMdiIcon(ToolIcon::MEMBER, 'ch-tool-icon', '', ICON_SIZE_SMALL, get_lang('Learners list')) .''; } $html .= $iconsEdit; diff --git a/public/main/forum/viewforumcategory.php b/public/main/forum/viewforumcategory.php index e8e5c5476f..f672225977 100755 --- a/public/main/forum/viewforumcategory.php +++ b/public/main/forum/viewforumcategory.php @@ -4,6 +4,8 @@ use Chamilo\CourseBundle\Entity\CForumPost; use ChamiloSession as Session; +use Chamilo\CoreBundle\Component\Utils\ActionIcon; +use Chamilo\CoreBundle\Component\Utils\ToolIcon; require_once __DIR__.'/../inc/global.inc.php'; @@ -123,12 +125,7 @@ if (!empty($_GET['lp_id']) || !empty($_POST['lp_id'])) { $url = '../lp/lp_controller.php?'.api_get_cidreq() ."&gradebook=&action=add_item&type=step&lp_id='.$lp_id.'#resource_tab-5"; $actionLeft .= Display::url( - Display::return_icon( - 'back.png', - get_lang('Back to').' '.get_lang('Learning paths'), - null, - ICON_SIZE_MEDIUM - ), + Display::getMdiIcon(ActionIcon::BACK, 'ch-tool-icon', '', ICON_SIZE_MEDIUM, get_lang('Back to').' '.get_lang('Learning paths')), $url ); } @@ -137,34 +134,19 @@ if (api_is_allowed_to_edit(false, true)) { $url = 'index.php?'.api_get_cidreq(); $actionLeft .= Display::url( - Display::return_icon( - 'back.png', - get_lang('Back to').' '.get_lang('Learning paths'), - null, - ICON_SIZE_MEDIUM - ), + Display::getMdiIcon(ActionIcon::BACK, 'ch-tool-icon', '', ICON_SIZE_MEDIUM, get_lang('Back to').' '.get_lang('Learning paths')), $url ); if (is_array($forumCategories) && !empty($forumCategories)) { $actionLeft .= Display::url( - Display::return_icon( - 'new_forum.png', - get_lang('Add a forum'), - null, - ICON_SIZE_MEDIUM - ), + Display::getMdiIcon(ToolIcon::FORUM, 'ch-tool-icon', null, ICON_SIZE_MEDIUM, get_lang('Add a forum')), api_get_self().'?'.api_get_cidreq().'&action=add_forum&lp_id='.$lp_id ); } $actionLeft .= Display::url( - Display::return_icon( - 'new_folder.png', - get_lang('Add a forumCategory'), - null, - ICON_SIZE_MEDIUM - ), + Display::getMdiIcon(ActionIcon::FOLDER_CREATE, 'ch-tool-icon', null, ICON_SIZE_MEDIUM, get_lang('Add a forumCategory')), api_get_self().'?'.api_get_cidreq().'&action=add_category&lp_id='.$lp_id ); } @@ -212,12 +194,7 @@ if (is_array($forumCategories)) { ) { $tools .= ''.Display::return_icon( - 'edit.png', - get_lang('Edit'), - [], - ICON_SIZE_SMALL - ) + .'">'.Display::getMdiIcon(ActionIcon::EDIT, 'ch-tool-icon', null, ICON_SIZE_SMALL, get_lang('Edit')) .''; $tools .= '" - .Display::return_icon( - 'delete.png', - get_lang('Delete'), - [], - ICON_SIZE_SMALL - ) + .Display::getMdiIcon(ActionIcon::DELETE, 'ch-tool-icon', null, ICON_SIZE_SMALL, get_lang('Delete')) .''; $tools .= returnVisibleInvisibleIcon( 'forumcategory', @@ -336,7 +308,7 @@ if (is_array($forumCategories)) { if (api_is_allowed_to_edit(false, true)) { $toolActions .= '' - .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')) .''; $toolActions .= '" - .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')) .''; $toolActions .= returnVisibleInvisibleIcon( diff --git a/public/main/forum/viewthread.php b/public/main/forum/viewthread.php index 15728c761b..2b2db11d03 100644 --- a/public/main/forum/viewthread.php +++ b/public/main/forum/viewthread.php @@ -7,6 +7,8 @@ use Chamilo\CourseBundle\Entity\CForum; use Chamilo\CourseBundle\Entity\CForumAttachment; use Chamilo\CourseBundle\Entity\CForumPost; use Chamilo\CourseBundle\Entity\CForumThread; +use Chamilo\CoreBundle\Component\Utils\ActionIcon; +use Chamilo\CoreBundle\Component\Utils\ToolIcon; require_once __DIR__.'/../inc/global.inc.php'; @@ -295,7 +297,7 @@ if ('learnpath' === $origin) { $actions = ''.search_link().''; if ('learnpath' != $origin) { $actions .= '' - .Display::return_icon('back.png', get_lang('Back to forum'), '', ICON_SIZE_MEDIUM).''; + .Display::getMdiIcon(ActionIcon::BACK, 'ch-tool-icon', null, ICON_SIZE_MEDIUM, get_lang('Back to forum')).''; } // The reply to thread link should only appear when the forum_category is @@ -313,14 +315,14 @@ if (($current_forum_category && // back link inside lp if ('learnpath' == $origin && !empty($threadId)) { $actions .= '' - .Display::return_icon('back.png', get_lang('Back to forum'), '', ICON_SIZE_MEDIUM).''; + .Display::getMdiIcon(ActionIcon::BACK, 'ch-tool-icon', null, ICON_SIZE_MEDIUM, get_lang('Back to forum')).''; } // reply link if (!api_is_anonymous() && api_is_allowed_to_session_edit(false, true)) { $actions .= '' - .Display::return_icon('reply_thread.png', get_lang('Reply to this thread'), '', ICON_SIZE_MEDIUM) + .Display::getMdiIcon('reply', 'ch-tool-icon', null, ICON_SIZE_MEDIUM, get_lang('Reply to this thread')) .''; } // new thread link @@ -437,7 +439,7 @@ foreach ($posts as $post) { $editUrl = api_get_path(WEB_CODE_PATH).'forum/editpost.php?'.api_get_cidreq(); $editUrl .= "&forum=$forumId&thread=$threadId&post={$post['post_id']}&id_attach=$id_attach"; $iconEdit .= "" - .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')) .''; $editButton = Display::toolbarButton( @@ -464,7 +466,7 @@ foreach ($posts as $post) { ] ); $iconEdit .= Display::url( - 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')), $deleteUrl, [ 'onclick' => "javascript:if(!confirm('" @@ -501,7 +503,7 @@ foreach ($posts as $post) { if ($count > 0) { $iconEdit .= ''.Display::return_icon('move.png', get_lang('Move post'), [], ICON_SIZE_SMALL).''; + .'">'.Display::getMdiIcon(ActionIcon::MOVE, 'ch-tool-icon', null, ICON_SIZE_SMALL, get_lang('Move post')).''; } } @@ -563,7 +565,7 @@ foreach ($posts as $post) { ."&forum=$forumId&thread=$threadId&action=list&post={$post['post_id']}" ."&user={$userId}&user_id={$userId}" ."&idtextqualify=$current_qualify_thread" - .'" >'.Display::return_icon('quiz.png', get_lang('Grade activity')).''; + .'" >'.Display::getMdiIcon(ToolIcon::QUIZ, 'ch-tool-icon', null, ICON_SIZE_SMALL, get_lang('Grade activity')).''; } } } @@ -666,7 +668,7 @@ foreach ($posts as $post) { 'AW:', 'Aw:', ]; - $replace = ''.Display::getMdiIcon('reply').''; + $replace = ''.Display::getMdiIcon('reply', 'ch-tool-icon', '', ICON_SIZE_SMALL).''; $post['post_title'] = str_replace($search, $replace, Security::remove_XSS($post['post_title'])); // The post title @@ -685,7 +687,7 @@ foreach ($posts as $post) { $repo = Container::getForumAttachmentRepository(); /** @var CForumAttachment $attachment */ foreach ($attachments as $attachment) { - $post['post_attachments'] .= Display::getMdiIcon('paperclip'); + $post['post_attachments'] .= Display::getMdiIcon('paperclip', 'ch-tool-icon', '', ICON_SIZE_SMALL); $url = $repo->getResourceFileDownloadUrl($attachment).'?'.api_get_cidreq(); $post['post_attachments'] .= Display::url($attachment->getFilename(), $url); $post['post_attachments'] .= ''.$attachment->getComment().''; @@ -697,7 +699,7 @@ foreach ($posts as $post) { .$attachment->getIid().'&forum='.$forumId.'&thread='.$threadId.'&post='.$post['post_id'] .'" 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')).'
'; + .Display::getMdiIcon('delete', 'ch-tool-icon', null, ICON_SIZE_SMALL, get_lang('Delete')).'
'; } } }