From 6a4f1c2f476bd58cc0b89bbcd128a6feefac1054 Mon Sep 17 00:00:00 2001 From: Julio Date: Mon, 13 Sep 2021 10:49:55 +0200 Subject: [PATCH] Minor - fix icons use {{ 'pencil' | mdi_icon }} in tpls --- public/main/course_progress/index.php | 4 ++-- public/main/exercise/exercise_result.php | 2 +- public/main/forum/forumfunction.inc.php | 2 +- public/main/forum/viewthread.php | 4 ++-- .../main/gradebook/lib/be/category.class.php | 6 +++--- public/main/gradebook/my_certificates.php | 2 +- public/main/inc/ajax/sequence.ajax.php | 2 +- public/main/inc/lib/display.lib.php | 5 +++-- .../main/inc/lib/internationalization.lib.php | 4 ++-- public/main/inc/lib/link.lib.php | 6 +++--- public/main/link/index.html | 7 ------- public/main/lp/scorm.class.php | 2 +- public/main/survey/fillsurvey.php | 2 +- public/main/survey/preview.php | 2 +- .../course_progress/progress.html.twig | 8 ++++---- .../partials/result_exercise.html.twig | 11 +++++++---- .../template/default/forum/list.html.twig | 2 +- .../template/default/glossary/list.html.twig | 4 ++-- .../tracking_course_overview.html.twig | 19 ++++++++++++++----- .../partials/tracking_user_overview.html.twig | 2 +- .../default/my_space/user_details.html.twig | 2 +- .../template/default/skill/criteria.html.twig | 4 +++- .../default/social/user_block.html.twig | 2 +- .../user_portal/list_courses.html.twig | 4 ++-- .../user_portal/list_sessions.html.twig | 2 +- public/main/work/work_list_all.php | 2 +- 26 files changed, 60 insertions(+), 52 deletions(-) delete mode 100644 public/main/link/index.html diff --git a/public/main/course_progress/index.php b/public/main/course_progress/index.php index 4f9ab114b5..cd7b4de2b6 100644 --- a/public/main/course_progress/index.php +++ b/public/main/course_progress/index.php @@ -222,7 +222,7 @@ switch ($action) { // Display form $form = new FormValidator('thematic_add', 'POST', 'index.php?action=thematic_add&'.api_get_cidreq()); if ('thematic_edit' === $action) { - $form->addElement('header', '', get_lang('Edit thematic section')); + $form->addHeader(get_lang('Edit thematic section')); } $form->addHidden('sec_token', $token); @@ -524,7 +524,7 @@ switch ($action) { $last_done_thematic_advance = null; if ($thematicEntity) { $thematic_data[$thematicId] = $thematicEntity; - $data['total_average_of_advances'] = $thematicManager->get_average_of_advances_by_thematic($thematicId); + $data['total_average_of_advances'] = $thematicManager->get_average_of_advances_by_thematic($thematicEntity); } else { $thematic_data = $thematicManager->getThematicList($course, $session); //$max_thematic_item = $thematicManager->get_max_thematic_item($course, $session); diff --git a/public/main/exercise/exercise_result.php b/public/main/exercise/exercise_result.php index 434f69e803..2aa33ae94d 100644 --- a/public/main/exercise/exercise_result.php +++ b/public/main/exercise/exercise_result.php @@ -153,7 +153,7 @@ if ('embeddable' !== $origin) { 'learnpath_item_id' => $learnpath_item_id, 'learnpath_item_view_id' => $learnpath_item_view_id, ]), - 'far fa-edit', + 'pencil', 'info' ); } diff --git a/public/main/forum/forumfunction.inc.php b/public/main/forum/forumfunction.inc.php index 30dbfb5a17..32880ae1c7 100644 --- a/public/main/forum/forumfunction.inc.php +++ b/public/main/forum/forumfunction.inc.php @@ -6139,7 +6139,7 @@ function getPostStatus(CForum $forum, array $row, bool $addWrapper = true): stri break; case CForumPost::STATUS_WAITING_MODERATION: $label = get_lang('Waiting for moderation'); - $icon = 'warning'; + $icon = 'alert'; $buttonType = 'warning'; break; diff --git a/public/main/forum/viewthread.php b/public/main/forum/viewthread.php index 5022c6c4d2..a81e3b0efd 100644 --- a/public/main/forum/viewthread.php +++ b/public/main/forum/viewthread.php @@ -472,7 +472,7 @@ foreach ($posts as $post) { $editButton = Display::toolbarButton( get_lang('Edit'), $editUrl, - 'pencil-alt', + 'pencil', 'default' ); } @@ -642,7 +642,7 @@ foreach ($posts as $post) { 'post' => $post['post_id'], 'action' => 'quote', ]), - 'quote-left', + 'comment-quote', 'success', ['id' => "quote-post-{$post['post_id']}"] ); diff --git a/public/main/gradebook/lib/be/category.class.php b/public/main/gradebook/lib/be/category.class.php index dc28d822cb..eafee074bf 100644 --- a/public/main/gradebook/lib/be/category.class.php +++ b/public/main/gradebook/lib/be/category.class.php @@ -2070,7 +2070,7 @@ class Category implements GradebookItem 'badge_link' => Display::toolbarButton( get_lang('Export badges'), api_get_path(WEB_CODE_PATH)."gradebook/get_badges.php?user=$user_id", - 'external-link' + 'open-in-new' ), ]; } @@ -2159,7 +2159,7 @@ class Category implements GradebookItem $html['badge_link'] = Display::toolbarButton( get_lang('Export badges'), api_get_path(WEB_CODE_PATH)."gradebook/get_badges.php?user=$user_id", - 'external-link' + 'open-in-new' ); } @@ -2409,7 +2409,7 @@ class Category implements GradebookItem $downloadLink = Display::toolbarButton( get_lang('Download certificate in PDF'), $certificate['pdf_url'], - 'file-pdf-o' + 'file-pdf-box' ); $viewLink = $certificate['certificate_link']; diff --git a/public/main/gradebook/my_certificates.php b/public/main/gradebook/my_certificates.php index 06da41d8e2..04e9c27167 100644 --- a/public/main/gradebook/my_certificates.php +++ b/public/main/gradebook/my_certificates.php @@ -54,7 +54,7 @@ if ('true' === api_get_setting('allow_public_certificates')) { Display::toolbarButton( get_lang('Search certificates'), api_get_path(WEB_CODE_PATH).'gradebook/search.php', - 'search', + 'magnify', 'info' ) ); diff --git a/public/main/inc/ajax/sequence.ajax.php b/public/main/inc/ajax/sequence.ajax.php index 915b564139..6ab7e23c80 100644 --- a/public/main/inc/ajax/sequence.ajax.php +++ b/public/main/inc/ajax/sequence.ajax.php @@ -101,7 +101,7 @@ switch ($action) { $linkDelete = Display::toolbarButton( get_lang('Delete'), '#', - 'trash', + 'delete', 'default', [ 'class' => 'delete_vertex btn btn-block btn-xs', diff --git a/public/main/inc/lib/display.lib.php b/public/main/inc/lib/display.lib.php index 931ece1024..664f6ff785 100644 --- a/public/main/inc/lib/display.lib.php +++ b/public/main/inc/lib/display.lib.php @@ -2377,9 +2377,10 @@ class Display if (!empty($type)) { $buttonClass = "btn btn-$type"; } - $icon = self::tag('i', null, ['class' => "fa fa-$icon fa-fw", 'aria-hidden' => 'true']); + //$icon = self::tag('i', null, ['class' => "fa fa-$icon fa-fw", 'aria-hidden' => 'true']); + $icon = self::getMdiIcon($icon); $attributes['class'] = isset($attributes['class']) ? "$buttonClass {$attributes['class']}" : $buttonClass; - $attributes['title'] = isset($attributes['title']) ? $attributes['title'] : $text; + $attributes['title'] = $attributes['title'] ?? $text; if (!$includeText) { $text = ''.$text.''; diff --git a/public/main/inc/lib/internationalization.lib.php b/public/main/inc/lib/internationalization.lib.php index 1ecbaa29ec..b14784c36a 100644 --- a/public/main/inc/lib/internationalization.lib.php +++ b/public/main/inc/lib/internationalization.lib.php @@ -844,9 +844,9 @@ function api_utf8_encode($string, $from_encoding = 'UTF-8') /** * Converts a given string from UTF-8 encoding to a specified encoding. * - * @param string $string the string being converted + * @param string $string the string being converted * @param string $toEncoding (optional) The encoding that $string is being converted to. - * If it is omitted, the platform character set is assumed. + * If it is omitted, the platform character set is assumed. * * @return string Returns the converted string. * This function is aimed at replacing the function utf8_decode() for human-language strings. diff --git a/public/main/inc/lib/link.lib.php b/public/main/inc/lib/link.lib.php index 75aa953edd..cb9db06ae2 100644 --- a/public/main/inc/lib/link.lib.php +++ b/public/main/inc/lib/link.lib.php @@ -994,7 +994,7 @@ class Link extends Model $toolbar .= Display::toolbarButton( '', $url, - 'pencil-alt', + 'pencil', 'secondary btn-sm', [ 'title' => $title, @@ -1027,7 +1027,7 @@ class Link extends Model $toolbar .= Display::toolbarButton( '', $urlVisibility, - 'eye-slash', + 'eye-off', 'secondary btn-sm', [ 'title' => $title, @@ -1070,7 +1070,7 @@ class Link extends Model $toolbar .= Display::toolbarButton( '', $url, - 'trash', + 'delete', 'secondary btn-sm', [ 'onclick' => $event, diff --git a/public/main/link/index.html b/public/main/link/index.html deleted file mode 100644 index 8e2f1bc022..0000000000 --- a/public/main/link/index.html +++ /dev/null @@ -1,7 +0,0 @@ - - - - - - - \ No newline at end of file diff --git a/public/main/lp/scorm.class.php b/public/main/lp/scorm.class.php index 50b202d2c4..92bafc6fd0 100644 --- a/public/main/lp/scorm.class.php +++ b/public/main/lp/scorm.class.php @@ -473,7 +473,7 @@ class scorm extends learnpath $lpToCheck = null, $allowHtaccess = false ) { - $this->debug= 100; + $this->debug = 100; if ($this->debug) { error_log( 'In scorm::import_package('.print_r($zipFileInfo, true).',"'.$currentDir.'") method' diff --git a/public/main/survey/fillsurvey.php b/public/main/survey/fillsurvey.php index 5604b59403..2c819bb91a 100644 --- a/public/main/survey/fillsurvey.php +++ b/public/main/survey/fillsurvey.php @@ -642,7 +642,7 @@ if (isset($_POST['finish_survey'])) { echo Display::toolbarButton( get_lang('Return to Course Homepage'), api_get_course_url($courseInfo['real_id']), - 'home' + 'home-outline' ); } diff --git a/public/main/survey/preview.php b/public/main/survey/preview.php index e42b00b1fd..c9f3e74330 100644 --- a/public/main/survey/preview.php +++ b/public/main/survey/preview.php @@ -278,7 +278,7 @@ $form->display(); echo Display::toolbarButton( get_lang('Return to Course Homepage'), api_get_course_url($courseInfo['real_id']), - 'home' + 'home-outline' ); Display::display_footer(); diff --git a/public/main/template/default/course_progress/progress.html.twig b/public/main/template/default/course_progress/progress.html.twig index 7d6a287f95..791f97072e 100644 --- a/public/main/template/default/course_progress/progress.html.twig +++ b/public/main/template/default/course_progress/progress.html.twig @@ -88,7 +88,7 @@ - + {{ 'pencil' | mdi_icon }} {% endif %} @@ -112,7 +112,7 @@ - + {{ 'plus-circle' | mdi_icon }} {% endif %} @@ -134,13 +134,13 @@ - + {{ 'pencil' | mdi_icon }} - + {{ 'delete' | mdi_icon }} diff --git a/public/main/template/default/exercise/partials/result_exercise.html.twig b/public/main/template/default/exercise/partials/result_exercise.html.twig index a4830f7b0c..5ff5895c65 100644 --- a/public/main/template/default/exercise/partials/result_exercise.html.twig +++ b/public/main/template/default/exercise/partials/result_exercise.html.twig @@ -27,27 +27,30 @@
{{ 'Username'|get_lang }} - {{ data.username }} + {{ 'account' | mdi_icon }} {{ data.username }}
{% if data.start_date %}
{{ 'StartDate'|get_lang }} - {{ data.start_date }} + {{ 'calendar' | mdi_icon }} + {{ data.start_date }}
{% endif %} {% if data.duration %}
{{ 'Duration'|get_lang }} - {{ data.duration }} + {{ 'alarm' | mdi_icon }} + {{ data.duration }}
{% endif %} {% if data.ip %}
{{ 'IP'|get_lang }} - {{ data.ip }} + {{ 'laptop' | mdi_icon }} + {{ data.ip }}
{% endif %} diff --git a/public/main/template/default/forum/list.html.twig b/public/main/template/default/forum/list.html.twig index 227db570de..d30e4540f0 100644 --- a/public/main/template/default/forum/list.html.twig +++ b/public/main/template/default/forum/list.html.twig @@ -113,7 +113,7 @@ {% if subitem.last_poster_id is not empty %}
- + {{ 'comment' | mdi_icon }} {{ subitem.last_poster_date }} « {{ subitem.last_post_title }} » {{ "By"|trans }} diff --git a/public/main/template/default/glossary/list.html.twig b/public/main/template/default/glossary/list.html.twig index 73e00fbe62..ecc8022a0e 100644 --- a/public/main/template/default/glossary/list.html.twig +++ b/public/main/template/default/glossary/list.html.twig @@ -7,12 +7,12 @@ diff --git a/public/main/template/default/my_space/partials/tracking_course_overview.html.twig b/public/main/template/default/my_space/partials/tracking_course_overview.html.twig index cda4ac3c8d..7912787a1e 100644 --- a/public/main/template/default/my_space/partials/tracking_course_overview.html.twig +++ b/public/main/template/default/my_space/partials/tracking_course_overview.html.twig @@ -22,7 +22,8 @@
- {{ data.time_spent }} + {{ 'alarm' | mdi_icon }} + {{ data.time_spent }}
{{ 'TimeSpentInTheCourse'|get_lang }} @@ -64,28 +65,36 @@ {{ 'TotalNumberOfMessages'|get_lang }}
- + + {{ 'comment' | mdi_icon }} + {{ data.number_message }}
{{ 'TotalNumberOfAssignments'|get_lang }}
- + + {{ 'pencil' | mdi_icon }} + {{ data.number_assignments }}
{{ 'TotalExercisesAnswered'|get_lang }}
- + + {{ 'file' | mdi_icon }} + {{ data.questions_answered }}
{{ 'LatestLogin'|get_lang }}
- + + {{ 'alarm' | mdi_icon }} + {{ data.last_login }}
diff --git a/public/main/template/default/my_space/partials/tracking_user_overview.html.twig b/public/main/template/default/my_space/partials/tracking_user_overview.html.twig index bdab6d5633..59095c85fb 100644 --- a/public/main/template/default/my_space/partials/tracking_user_overview.html.twig +++ b/public/main/template/default/my_space/partials/tracking_user_overview.html.twig @@ -32,7 +32,7 @@
- + {{ 'alarm' | mdi_icon }} {{ course.time_spent }}
- + {{ 'pencil' | mdi_icon }} {{ user_extra.tools.tasks }}
{{ 'Assignments'|trans }} diff --git a/public/main/template/default/skill/criteria.html.twig b/public/main/template/default/skill/criteria.html.twig index 365a517bad..27d7569994 100644 --- a/public/main/template/default/skill/criteria.html.twig +++ b/public/main/template/default/skill/criteria.html.twig @@ -7,7 +7,9 @@

{{ skill_info.name }}

{% if skill_info.short_code %} -

{{ skill_info.short_code }}

+

+ {{ 'shield' | mdi_icon }} + {{ skill_info.short_code }}

{% endif %}
diff --git a/public/main/template/default/social/user_block.html.twig b/public/main/template/default/social/user_block.html.twig index f1eda19ebc..6105ed87c1 100644 --- a/public/main/template/default/social/user_block.html.twig +++ b/public/main/template/default/social/user_block.html.twig @@ -13,7 +13,7 @@ title="{{ "Edit"|get_lang }}" href="{{ url('index') }}main/admin/user_edit.php?user_id={{ user.id }}" > - + {{ 'pencil' | mdi_icon }}
{% endif %} diff --git a/public/main/template/default/user_portal/list_courses.html.twig b/public/main/template/default/user_portal/list_courses.html.twig index cb4e3aa31b..1c3fb529ed 100644 --- a/public/main/template/default/user_portal/list_courses.html.twig +++ b/public/main/template/default/user_portal/list_courses.html.twig @@ -36,12 +36,12 @@
{% if item.document == '' %} - + {{ 'pencil' | mdi_icon }} {% else %} diff --git a/public/main/template/default/user_portal/list_sessions.html.twig b/public/main/template/default/user_portal/list_sessions.html.twig index cb74052c3e..ba422201bc 100644 --- a/public/main/template/default/user_portal/list_sessions.html.twig +++ b/public/main/template/default/user_portal/list_sessions.html.twig @@ -18,7 +18,7 @@ {% endif %} diff --git a/public/main/work/work_list_all.php b/public/main/work/work_list_all.php index 7051172a8e..936d299ee8 100644 --- a/public/main/work/work_list_all.php +++ b/public/main/work/work_list_all.php @@ -231,7 +231,7 @@ if (api_is_allowed_to_session_edit(false, true) && !empty($workId) && !$isDrhOfC */ $url = api_get_path(WEB_CODE_PATH). 'work/work_list_all.php?'.api_get_cidreq().'&id='.$workId.'&action=delete_correction'; - $actionsLeft .= Display::toolbarButton(get_lang('Delete all corrections'), $url, 'trash', 'danger'); + $actionsLeft .= Display::toolbarButton(get_lang('Delete all corrections'), $url, 'delete', 'danger'); } echo Display::toolbarAction('toolbar-worklist', [$actionsLeft]);