From b9b409cfc3c789445699129b6194d0950a14f3ec Mon Sep 17 00:00:00 2001 From: Damyon Wiese Date: Wed, 1 Mar 2017 14:09:40 +0800 Subject: [PATCH] MDL-40759 icons: Peer review fixes (all minor) --- admin/tool/lp/templates/comment_area.mustache | 2 +- admin/tool/usertours/lib.php | 2 +- admin/user.php | 2 +- admin/user/user_bulk_cohortadd.php | 3 +-- admin/user/user_bulk_display.php | 3 +-- blocks/course_overview/renderer.php | 3 ++- comment/comment.js | 1 - course/format/renderer.php | 2 +- enrol/manual/lib.php | 1 - .../classes/external/stored_file_exporter.php | 3 --- filter/emoticon/tests/filter_test.php | 2 +- lib/amd/build/icon_system_fontawesome.min.js | 2 +- lib/amd/src/icon_system.js | 2 +- lib/amd/src/icon_system_fontawesome.js | 6 ++--- lib/amd/src/icon_system_standard.js | 2 +- lib/classes/output/external.php | 2 -- lib/classes/output/icon_system.php | 24 +++++++++++++++++++ lib/classes/output/icon_system_font.php | 2 ++ .../output/icon_system_fontawesome.php | 23 +++++++++++------- lib/classes/output/icon_system_standard.php | 2 ++ .../moodle-editor_atto-plugin-debug.js | 1 - .../moodle-editor_atto-plugin.js | 1 - .../src/editor/js/editor-plugin-buttons.js | 1 - lib/externallib.php | 3 +-- lib/outputlib.php | 1 - lib/outputrenderers.php | 9 +++---- lib/templates/pix_icon.mustache | 2 +- lib/tests/filter_manager_test.php | 9 +++---- lib/tests/weblib_format_text_test.php | 13 +++++----- .../moodle-core-dragdrop-debug.js | 3 +-- .../moodle-core-dragdrop-min.js | 4 ++-- .../moodle-core-dragdrop.js | 3 +-- lib/yui/src/dragdrop/js/dragdrop.js | 3 +-- mnet/service/enrol/course.php | 2 +- mod/assign/overrides.php | 4 ++-- mod/book/lib.php | 2 +- mod/data/lib.php | 22 ++++++++++++++++- mod/feedback/yui/dragdrop/dragdrop.js | 2 +- mod/scorm/lib.php | 22 +++++++++++++++++ question/renderer.php | 2 +- theme/boost/lib.php | 1 - theme/boost/scss/moodle/icons.scss | 17 ++++--------- 42 files changed, 131 insertions(+), 85 deletions(-) diff --git a/admin/tool/lp/templates/comment_area.mustache b/admin/tool/lp/templates/comment_area.mustache index dbe63e528e355..bd49f8767244f 100644 --- a/admin/tool/lp/templates/comment_area.mustache +++ b/admin/tool/lp/templates/comment_area.mustache @@ -55,7 +55,7 @@
{{^notoggle}} - {{#pix}}{{collapsediconkey}}, {{linktext}}{{/pix}}{{linktext}} + {{#pix}}{{collapsediconkey}}, core, {{linktext}}{{/pix}}{{linktext}} {{#displaytotalcount}} ({{count}}) {{/displaytotalcount}} diff --git a/admin/tool/usertours/lib.php b/admin/tool/usertours/lib.php index f2777034309da..9c4c0777cf70c 100644 --- a/admin/tool/usertours/lib.php +++ b/admin/tool/usertours/lib.php @@ -82,6 +82,6 @@ function tool_usertours_get_fontawesome_icon_map() { return [ 'tool_usertours:t/export' => 'fa-download', 'tool_usertours:i/reload' => 'fa-refresh', - 'tool_usertours:filler' => 'fa-spacer', + 'tool_usertours:t/filler' => 'fa-spacer', ]; } diff --git a/admin/user.php b/admin/user.php index b4e14ca4fce50..b1317274f02cb 100644 --- a/admin/user.php +++ b/admin/user.php @@ -187,7 +187,7 @@ } else { $columnicon = ($dir == "ASC") ? "sort_asc" : "sort_desc"; } - $columnicon = $OUTPUT->pix_icon('t/' . $columnicon, '', 'core', ['class' => 'iconsort']); + $columnicon = $OUTPUT->pix_icon('t/' . $columnicon, get_string($columndir), 'core', ['class' => 'iconsort']); } $$column = "".$string[$column]."$columnicon"; diff --git a/admin/user/user_bulk_cohortadd.php b/admin/user/user_bulk_cohortadd.php index c2bbd7aea9b13..ff84479f98814 100644 --- a/admin/user/user_bulk_cohortadd.php +++ b/admin/user/user_bulk_cohortadd.php @@ -114,10 +114,9 @@ function sort_compare($a, $b) { } else { $columndir = ($dir == 'asc') ? 'desc' : 'asc'; $icon = 't/down'; - $iconstr = 'movedown'; + $iconstr = $columndir; if ($dir != 'asc') { $icon = 't/up'; - $iconstr = 'moveup'; } $columnicon = ' ' . $OUTPUT->pix_icon($icon, get_string($iconstr)); } diff --git a/admin/user/user_bulk_display.php b/admin/user/user_bulk_display.php index 3ca89227db2f1..dd7956629b342 100644 --- a/admin/user/user_bulk_display.php +++ b/admin/user/user_bulk_display.php @@ -58,10 +58,9 @@ function sort_compare($a, $b) { } else { $columndir = $dir == 'asc' ? 'desc' : 'asc'; $icon = 't/down'; - $iconstr = 'movedown'; + $iconstr = $columndir; if ($dir != 'asc') { $icon = 't/up'; - $iconstr = 'moveup'; } $columnicon = ' ' . $OUTPUT->pix_icon($icon, get_string($iconstr)); } diff --git a/blocks/course_overview/renderer.php b/blocks/course_overview/renderer.php index 22f974ccb0da5..78c8b0ef33a32 100644 --- a/blocks/course_overview/renderer.php +++ b/blocks/course_overview/renderer.php @@ -75,7 +75,8 @@ public function course_overview($courses, $overviews) { $moveurl = new moodle_url('/blocks/course_overview/move.php', array('sesskey' => sesskey(), 'moveto' => 0, 'courseid' => $movingcourseid)); // Create move icon, so it can be used. - $movetofirsticon = $this->output->pix_icon('movehere', get_string('movetofirst', 'block_course_overview', $courses[$movingcourseid]->fullname)); + $name = $courses[$movingcourseid]->fullname; + $movetofirsticon = $this->output->pix_icon('movehere', get_string('movetofirst', 'block_course_overview', $name)); $moveurl = html_writer::link($moveurl, $movetofirsticon); $html .= html_writer::tag('div', $moveurl, array('class' => 'movehere')); } diff --git a/comment/comment.js b/comment/comment.js index 446e4f9e8a77e..dfb7e8f30639b 100644 --- a/comment/comment.js +++ b/comment/comment.js @@ -339,7 +339,6 @@ M.core_comment = { Templates.renderPix('t/delete', 'core', M.util.get_string('deletecomment', 'moodle')).then(function(html) { Y.all('div.comment-delete a').set('innerHTML', html); }).catch(Notification.exception); - }); }, register_pagination: function() { diff --git a/course/format/renderer.php b/course/format/renderer.php index 020d4b0d2a06b..da25b20b067db 100644 --- a/course/format/renderer.php +++ b/course/format/renderer.php @@ -162,7 +162,7 @@ protected function section_right_content($section, $course, $onsectionpage) { * @return string HTML to output. */ protected function section_left_content($section, $course, $onsectionpage) { - $o = $this->output->spacer(); + $o = ''; if ($section->section != 0) { // Only in the non-general sections. diff --git a/enrol/manual/lib.php b/enrol/manual/lib.php index 743cfd730bc16..f41dae344ce3a 100644 --- a/enrol/manual/lib.php +++ b/enrol/manual/lib.php @@ -730,4 +730,3 @@ public function edit_instance_validation($data, $files, $instance, $context) { } } - diff --git a/files/classes/external/stored_file_exporter.php b/files/classes/external/stored_file_exporter.php index 93fce21ede680..1cc24061c85aa 100644 --- a/files/classes/external/stored_file_exporter.php +++ b/files/classes/external/stored_file_exporter.php @@ -123,9 +123,6 @@ protected static function define_other_properties() { 'icon' => array( 'type' => PARAM_RAW, ), - 'iconurl' => array( - 'type' => PARAM_URL, - ), 'timecreatedformatted' => array( 'type' => PARAM_RAW ), diff --git a/filter/emoticon/tests/filter_test.php b/filter/emoticon/tests/filter_test.php index fab2e365238f5..8cb2ee3d9ec90 100644 --- a/filter/emoticon/tests/filter_test.php +++ b/filter/emoticon/tests/filter_test.php @@ -54,7 +54,7 @@ public function test_filter_emoticon_formats() { $this->assertEquals($expected, $filter->filter('(grr)', $options)); // And texts matching target formats are filtered. - $expected = ''; + $expected = 'angry'; $options = array('originalformat' => FORMAT_HTML); // Only FORMAT_HTML is filtered, see {@link testable_filter_emoticon}. $this->assertEquals($expected, $filter->filter('(grr)', $options)); } diff --git a/lib/amd/build/icon_system_fontawesome.min.js b/lib/amd/build/icon_system_fontawesome.min.js index 3eb59416a7c59..63502bce7f960 100644 --- a/lib/amd/build/icon_system_fontawesome.min.js +++ b/lib/amd/build/icon_system_fontawesome.min.js @@ -1 +1 @@ -define(["core/icon_system","jquery","core/ajax","core/mustache","core/localstorage"],function(a,b,c,d,e){var f=null,g=null,h=function(){a.apply(this,arguments)};return h.prototype=Object.create(a.prototype),h.prototype.init=function(){if(f)return b.when(this);var a=e.get("core/iconmap-fontawesome");return a&&(a=JSON.parse(a)),a?(f=a,b.when(this)):(null===g&&(g=c.call([{methodname:"core_output_load_fontawesome_icon_map",args:[]}],!0,!1)[0]),g.then(function(a){return f={},b.each(a,function(a,b){f[b.component+"/"+b.pix]=b.to}.bind(this)),e.set("core/iconmap-fontawesome",JSON.stringify(f)),this}.bind(this)))},h.prototype.renderIcon=function(a,b,c,e){var g=f[b+"/"+a];"undefined"==typeof g&&(g=b+"/"+a);var h={key:g,title:c,alt:c};return d.render(e,h)},h.prototype.getTemplateName=function(){return"core/pix_icon_fontawesome"},h}); \ No newline at end of file +define(["core/icon_system","jquery","core/ajax","core/mustache","core/localstorage"],function(a,b,c,d,e){var f=null,g=null,h=function(){a.apply(this,arguments)};return h.prototype=Object.create(a.prototype),h.prototype.init=function(){if(f)return b.when(this);var a=e.get("core/iconmap-fontawesome");return a&&(a=JSON.parse(a)),a?(f=a,b.when(this)):(null===g&&(g=c.call([{methodname:"core_output_load_fontawesome_icon_map",args:[]}],!0,!1)[0]),g.then(function(a){return f={},b.each(a,function(a,b){f[b.component+"/"+b.pix]=b.to}),e.set("core/iconmap-fontawesome",JSON.stringify(f)),this}.bind(this)))},h.prototype.renderIcon=function(a,b,c,e){var g=f[b+"/"+a];"undefined"==typeof g&&(g=b+"/"+a);var h={key:g,title:c,alt:c};return d.render(e,h)},h.prototype.getTemplateName=function(){return"core/pix_icon_fontawesome"},h}); \ No newline at end of file diff --git a/lib/amd/src/icon_system.js b/lib/amd/src/icon_system.js index 1d28046cccee4..cb6c997284cd7 100644 --- a/lib/amd/src/icon_system.js +++ b/lib/amd/src/icon_system.js @@ -57,7 +57,7 @@ define(['jquery'], function($) { * @return {String} * @method renderIcon */ - IconSystem.prototype.renderIcon = function(key, component, title, template) { //eslint-disable-line no-unused-vars + IconSystem.prototype.renderIcon = function(key, component, title, template) { // eslint-disable-line no-unused-vars throw new Error('Abstract function not implemented.'); }; diff --git a/lib/amd/src/icon_system_fontawesome.js b/lib/amd/src/icon_system_fontawesome.js index fbceef47124a7..ac7d7109d0ab7 100644 --- a/lib/amd/src/icon_system_fontawesome.js +++ b/lib/amd/src/icon_system_fontawesome.js @@ -39,7 +39,7 @@ define(['core/icon_system', 'jquery', 'core/ajax', 'core/mustache', 'core/locals * Prefetch resources so later calls to renderIcon can be resolved synchronously. * * @method init - * @return Promise + * @return {Promise} */ IconSystemFontawesome.prototype.init = function() { if (staticMap) { @@ -67,7 +67,7 @@ define(['core/icon_system', 'jquery', 'core/ajax', 'core/mustache', 'core/locals staticMap = {}; $.each(map, function(index, value) { staticMap[value.component + '/' + value.pix] = value.to; - }.bind(this)); + }); LocalStorage.set('core/iconmap-fontawesome', JSON.stringify(staticMap)); return this; }.bind(this)); @@ -83,7 +83,7 @@ define(['core/icon_system', 'jquery', 'core/ajax', 'core/mustache', 'core/locals * @return {String} * @method renderIcon */ - IconSystemFontawesome.prototype.renderIcon = function(key, component, title, template) { //eslint-disable-line no-unused-vars + IconSystemFontawesome.prototype.renderIcon = function(key, component, title, template) { // eslint-disable-line no-unused-vars var mappedIcon = staticMap[component + '/' + key]; if (typeof mappedIcon === "undefined") { mappedIcon = component + '/' + key; diff --git a/lib/amd/src/icon_system_standard.js b/lib/amd/src/icon_system_standard.js index 119a1865f7f29..d876c8adb8b1f 100644 --- a/lib/amd/src/icon_system_standard.js +++ b/lib/amd/src/icon_system_standard.js @@ -42,7 +42,7 @@ define(['core/icon_system', 'core/url', 'core/mustache'], * @return {String} * @method renderIcon */ - IconSystemStandard.prototype.renderIcon = function(key, component, title, template) { //eslint-disable-line no-unused-vars + IconSystemStandard.prototype.renderIcon = function(key, component, title, template) { // eslint-disable-line no-unused-vars var url = CoreUrl.imageUrl(key, component); var templatecontext = { diff --git a/lib/classes/output/external.php b/lib/classes/output/external.php index 132ff1c235a87..45d9779cf5cc3 100644 --- a/lib/classes/output/external.php +++ b/lib/classes/output/external.php @@ -107,11 +107,9 @@ public static function load_fontawesome_icon_map_parameters() { /** * Return a mapping of icon names to icons. * - * @param string $system * @return array the mapping */ public static function load_fontawesome_icon_map() { - $instance = icon_system::instance(icon_system::FONTAWESOME); $map = $instance->get_icon_name_map(); diff --git a/lib/classes/output/icon_system.php b/lib/classes/output/icon_system.php index 6c132c2ff3ab2..bad766f563233 100644 --- a/lib/classes/output/icon_system.php +++ b/lib/classes/output/icon_system.php @@ -28,6 +28,8 @@ use renderer_base; use pix_icon; +defined('MOODLE_INTERNAL') || die(); + /** * Class allowing different systems for mapping and rendering icons. * @@ -42,15 +44,37 @@ * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later */ abstract class icon_system { + /** + * @const STANDARD Default icon system. + */ const STANDARD = '\\core\\output\\icon_system_standard'; + /** + * @const FONTAWESOME Default icon system. + */ const FONTAWESOME = '\\core\\output\\icon_system_fontawesome'; + /** + * @var \core\output\icon_system $instance The cached default instance + */ private static $instance = null; + + /** + * @var array $map A cached mapping of moodle icons to other icons + */ private $map = null; + /** + * Constructor + */ private function __construct() { } + /** + * Factory method + * + * @param $type Either a specific type, or null to get the default type. + * @return \core\output\icon_system + */ public final static function instance($type = null) { global $PAGE; diff --git a/lib/classes/output/icon_system_font.php b/lib/classes/output/icon_system_font.php index 71c8b7a7682cd..08a8273dd6626 100644 --- a/lib/classes/output/icon_system_font.php +++ b/lib/classes/output/icon_system_font.php @@ -25,6 +25,8 @@ namespace core\output; +defined('MOODLE_INTERNAL') || die(); + /** * Class allowing different systems for mapping and rendering icons. * diff --git a/lib/classes/output/icon_system_fontawesome.php b/lib/classes/output/icon_system_fontawesome.php index b1f4c308725de..8fe0865df6d84 100644 --- a/lib/classes/output/icon_system_fontawesome.php +++ b/lib/classes/output/icon_system_fontawesome.php @@ -28,6 +28,8 @@ use renderer_base; use pix_icon; +defined('MOODLE_INTERNAL') || die(); + /** * Class allowing different systems for mapping and rendering icons. * @@ -43,6 +45,11 @@ */ class icon_system_fontawesome extends icon_system_font { + /** + * @var array $map Cached map of moodle icon names to font awesome icon names. + */ + private $map = []; + public function get_core_icon_map() { return [ 'core:docs' => 'fa-info-circle', @@ -89,7 +96,7 @@ public function get_core_icon_map() { 'core:e/delete' => 'fa-minus', 'core:e/delete_table' => 'fa-minus', 'core:e/document_properties' => 'fa-info', - 'core:e/emoticons' => 'fa-meh-o', + 'core:e/emoticons' => 'fa-smile-o', 'core:e/find_replace' => 'fa-search-plus', 'core:e/forward' => 'fa-arrow-right', 'core:e/fullpage' => 'fa-arrows-alt', @@ -241,7 +248,7 @@ public function get_core_icon_map() { 'core:i/completion-manual-enabled' => 'fa-square-o', 'core:i/completion-manual-y' => 'fa-check-square', 'core:i/completion-manual-n' => 'fa-square-o', - 'core:i/completion-self' => 'fa-user-o', + 'core:i/completion_self' => 'fa-user-o', 'core:i/lock' => 'fa-lock', 'core:i/courseevent' => 'fa-calendar', 'core:i/course' => 'fa-globe', @@ -252,10 +259,10 @@ public function get_core_icon_map() { 'core:i/duration' => 'fa-clock-o', 'core:i/edit' => 'fa-pencil', 'core:i/email' => 'fa-envelope', - 'core:i/enrolmentsuspended' => 'fa-user-circle', + 'core:i/enrolmentsuspended' => 'fa-pause', 'core:i/enrolusers' => 'fa-user-plus', 'core:i/expired' => 'fa-exclamation text-warning', - 'core:i/export' => 'fa-level-down', + 'core:i/export' => 'fa-download', 'core:i/files' => 'fa-file', 'core:i/filter' => 'fa-filter', 'core:i/flagged' => 'fa-flag', @@ -270,7 +277,7 @@ public function get_core_icon_map() { 'core:i/groups' => 'fa-user-circle', 'core:i/groupv' => 'fa-user-circle-o', 'core:i/hide' => 'fa-eye', - 'core:i/heirarchylock' => 'fa-lock', + 'core:i/hierarchylock' => 'fa-lock', 'core:i/import' => 'fa-level-up', 'core:i/info' => 'fa-info', 'core:i/invalid' => 'fa-exclamation text-danger', @@ -289,7 +296,7 @@ public function get_core_icon_map() { 'core:i/moodle_host' => 'fa-graduation-cap', 'core:i/move_2d' => 'fa-arrows', 'core:i/navigationitem' => 'fa-angle-right', - 'core:i/ns_red_mark' => 'fa-remove', + 'core:i/ne_red_mark' => 'fa-remove', 'core:i/new' => 'fa-plus', 'core:i/news' => 'fa-newspaper-o', 'core:i/nosubcat' => 'fa-plus-square-o', @@ -324,7 +331,7 @@ public function get_core_icon_map() { 'core:i/settings' => 'fa-cogs', 'core:i/show' => 'fa-eye-slash', 'core:i/siteevent' => 'fa-share-alt', - 'core:i/starrating' => 'fa-star', + 'core:i/star-rating' => 'fa-star', 'core:i/stats' => 'fa-line-chart', 'core:i/switch' => 'fa-exchange', 'core:i/switchrole' => 'fa-user-secret', @@ -418,8 +425,6 @@ public function get_core_icon_map() { ]; } - private $map = []; - /** * Overridable function to get a mapping of all icons. * Default is to do no mapping. diff --git a/lib/classes/output/icon_system_standard.php b/lib/classes/output/icon_system_standard.php index 064ec88761f75..8119a2d68126c 100644 --- a/lib/classes/output/icon_system_standard.php +++ b/lib/classes/output/icon_system_standard.php @@ -28,6 +28,8 @@ use renderer_base; use pix_icon; +defined('MOODLE_INTERNAL') || die(); + /** * Standard icon rendering. No mapping - img tags used. * diff --git a/lib/editor/atto/yui/build/moodle-editor_atto-plugin/moodle-editor_atto-plugin-debug.js b/lib/editor/atto/yui/build/moodle-editor_atto-plugin/moodle-editor_atto-plugin-debug.js index f347384211972..92d935548b6cb 100644 --- a/lib/editor/atto/yui/build/moodle-editor_atto-plugin/moodle-editor_atto-plugin-debug.js +++ b/lib/editor/atto/yui/build/moodle-editor_atto-plugin/moodle-editor_atto-plugin-debug.js @@ -543,7 +543,6 @@ EditorPluginButtons.prototype = { button.one(CSS.MENUEXPAND).append(iconhtml); }); }); - // Append it to the group. group.append(button); diff --git a/lib/editor/atto/yui/build/moodle-editor_atto-plugin/moodle-editor_atto-plugin.js b/lib/editor/atto/yui/build/moodle-editor_atto-plugin/moodle-editor_atto-plugin.js index 0fcb571fc85b7..a62656cbc7d81 100644 --- a/lib/editor/atto/yui/build/moodle-editor_atto-plugin/moodle-editor_atto-plugin.js +++ b/lib/editor/atto/yui/build/moodle-editor_atto-plugin/moodle-editor_atto-plugin.js @@ -541,7 +541,6 @@ EditorPluginButtons.prototype = { button.one(CSS.MENUEXPAND).append(iconhtml); }); }); - // Append it to the group. group.append(button); diff --git a/lib/editor/atto/yui/src/editor/js/editor-plugin-buttons.js b/lib/editor/atto/yui/src/editor/js/editor-plugin-buttons.js index aa33101bbbc76..82218b0849fad 100644 --- a/lib/editor/atto/yui/src/editor/js/editor-plugin-buttons.js +++ b/lib/editor/atto/yui/src/editor/js/editor-plugin-buttons.js @@ -393,7 +393,6 @@ EditorPluginButtons.prototype = { button.one(CSS.MENUEXPAND).append(iconhtml); }); }); - // Append it to the group. group.append(button); diff --git a/lib/externallib.php b/lib/externallib.php index 90f0484adb4b4..896a175e54154 100644 --- a/lib/externallib.php +++ b/lib/externallib.php @@ -205,6 +205,7 @@ public static function call_external_function($function, $args, $ajaxonly=false) throw new moodle_exception('servicenotavailable', 'webservice'); } + // Do not allow access to write or delete webservices as a public user. if ($externalfunctioninfo->loginrequired) { if (defined('NO_MOODLE_COOKIES') && NO_MOODLE_COOKIES && !PHPUNIT_TEST) { throw new moodle_exception('servicenotavailable', 'webservice'); @@ -215,8 +216,6 @@ public static function call_external_function($function, $args, $ajaxonly=false) require_sesskey(); } } - // Do not allow access to write or delete webservices as a public user. - // Validate params, this also sorts the params properly, we need the correct order in the next part. $callable = array($externalfunctioninfo->classname, 'validate_parameters'); $params = call_user_func($callable, diff --git a/lib/outputlib.php b/lib/outputlib.php index 88b0d8c7d0781..86ee87c3a0572 100644 --- a/lib/outputlib.php +++ b/lib/outputlib.php @@ -124,7 +124,6 @@ function theme_get_locked_theme_for_device($device) { return $CFG->config_php_settings[$themeconfigname]; } - /** * This class represents the configuration variables of a Moodle theme. * diff --git a/lib/outputrenderers.php b/lib/outputrenderers.php index d33dda1d03b29..464e2912898ed 100644 --- a/lib/outputrenderers.php +++ b/lib/outputrenderers.php @@ -2048,12 +2048,10 @@ public function image_icon($pix, $alt, $component='moodle', array $attributes = /** * Renders a pix_icon widget and returns the HTML to display it. * - * @param pix_icon $icon + * @param image_icon $icon * @return string HTML fragment */ protected function render_image_icon(image_icon $icon) { - global $PAGE; - $system = \core\output\icon_system::instance(\core\output\icon_system::STANDARD); return $system->render_pix_icon($this, $icon); } @@ -2082,8 +2080,6 @@ public function pix_icon($pix, $alt, $component='moodle', array $attributes = nu * @return string HTML fragment */ protected function render_pix_icon(pix_icon $icon) { - global $PAGE; - $system = \core\output\icon_system::instance(); return $system->render_pix_icon($this, $icon); } @@ -2095,7 +2091,8 @@ protected function render_pix_icon(pix_icon $icon) { * @return string HTML fragment */ protected function render_pix_emoticon(pix_emoticon $emoticon) { - return $this->render_pix_icon($emoticon); + $system = \core\output\icon_system::instance(\core\output\icon_system::STANDARD); + return $system->render_pix_icon($this, $emoticon); } /** diff --git a/lib/templates/pix_icon.mustache b/lib/templates/pix_icon.mustache index 62f92a39d108b..6174c00a95bd0 100644 --- a/lib/templates/pix_icon.mustache +++ b/lib/templates/pix_icon.mustache @@ -35,7 +35,7 @@ { "attributes": [ { "name": "src", "value": "https://moodle.org/logo/moodle-logo.svg" }, - { "name": "class", "value": "iconsmall" }, + { "name": "extraclasses", "value": "iconsmall" }, {"name": "alt", "value": "Alt text for icon"} ] } diff --git a/lib/tests/filter_manager_test.php b/lib/tests/filter_manager_test.php index 816bd95a21512..cf987110275a9 100644 --- a/lib/tests/filter_manager_test.php +++ b/lib/tests/filter_manager_test.php @@ -54,8 +54,7 @@ protected function filter_text($text, $skipfilters) { public function test_filter_normal() { $this->resetAfterTest(); filter_set_global_state('emoticon', TEXTFILTER_ON); - $this->assertRegExp('~^

' . - '

$~', + $this->assertRegExp('~^

smile

$~', $this->filter_text('

:-)

', array())); } @@ -69,8 +68,7 @@ public function test_one_filter_disabled() { public function test_disabling_other_filter_does_not_break_it() { $this->resetAfterTest(); filter_set_global_state('emoticon', TEXTFILTER_ON); - $this->assertRegExp('~^

' . - '

$~', + $this->assertRegExp('~^

smile

$~', $this->filter_text('

:-)

', array('urltolink'))); } @@ -78,8 +76,7 @@ public function test_one_filter_of_two_disabled() { $this->resetAfterTest(); filter_set_global_state('emoticon', TEXTFILTER_ON); filter_set_global_state('urltolink', TEXTFILTER_ON); - $this->assertRegExp('~^

' . - ' http://google.com/

$~', + $this->assertRegExp('~^

smile http://google.com/

$~', $this->filter_text('

:-) http://google.com/

', array('glossary', 'urltolink'))); } } diff --git a/lib/tests/weblib_format_text_test.php b/lib/tests/weblib_format_text_test.php index dfaf83efd7416..23b2b3b4f1a2f 100644 --- a/lib/tests/weblib_format_text_test.php +++ b/lib/tests/weblib_format_text_test.php @@ -37,8 +37,8 @@ class core_weblib_format_text_testcase extends advanced_testcase { public function test_format_text_format_html() { $this->resetAfterTest(); filter_set_global_state('emoticon', TEXTFILTER_ON); - $this->assertRegExp('~^

' . - '

$~', + $this->assertRegExp('~^

smile

$~', format_text('

:-)

', FORMAT_HTML)); } @@ -67,8 +67,9 @@ public function test_format_text_format_plain_no_filters() { public function test_format_text_format_markdown() { $this->resetAfterTest(); filter_set_global_state('emoticon', TEXTFILTER_ON); - $this->assertRegExp('~^

' . - '

\n$~', + $this->assertRegExp('~^

smile' . + '

\n$~', format_text('*:-)*', FORMAT_MARKDOWN)); } @@ -83,8 +84,8 @@ public function test_format_text_format_moodle() { $this->resetAfterTest(); filter_set_global_state('emoticon', TEXTFILTER_ON); $this->assertRegExp('~^

' . - '' . - '

$~', + 'smile

$~', format_text('

:-)

', FORMAT_MOODLE)); } diff --git a/lib/yui/build/moodle-core-dragdrop/moodle-core-dragdrop-debug.js b/lib/yui/build/moodle-core-dragdrop/moodle-core-dragdrop-debug.js index 076db63fb1100..19d0fe903cc43 100644 --- a/lib/yui/build/moodle-core-dragdrop/moodle-core-dragdrop-debug.js +++ b/lib/yui/build/moodle-core-dragdrop/moodle-core-dragdrop-debug.js @@ -144,7 +144,6 @@ Y.extend(DRAGDROP, Y.Base, { // Make the accessible drag/drop respond to a single click. this.listeners.push(Y.one(Y.config.doc.body).delegate('click', this.global_keydown, '.' + MOVEICON.cssclass, this)); - }, /** @@ -186,7 +185,7 @@ Y.extend(DRAGDROP, Y.Base, { } dragelement.appendChild(dragicon); }); - }.bind(this)); + }); return dragelement; }, diff --git a/lib/yui/build/moodle-core-dragdrop/moodle-core-dragdrop-min.js b/lib/yui/build/moodle-core-dragdrop/moodle-core-dragdrop-min.js index ac90c75a44306..63bbd2c9012a6 100644 --- a/lib/yui/build/moodle-core-dragdrop/moodle-core-dragdrop-min.js +++ b/lib/yui/build/moodle-core-dragdrop/moodle-core-dragdrop-min.js @@ -1,2 +1,2 @@ -YUI.add("moodle-core-dragdrop",function(e,t){var n={pix:"i/move_2d",largepix:"i/dragdrop",component:"moodle",cssclass:"moodle-core-dragdrop-draghandle"},r=function(){r.superclass.constructor.apply(this,arguments)};e.extend(r,e.Base,{goingup:null,absgoingup:null,samenodeclass:null,parentnodeclass:null,samenodelabel:null,parentnodelabel:null,groups:[],lastdroptarget:null,listeners:null,initializer:function(){this.listeners=[],this.listeners.push(e.DD.DDM.on("drag:start",this.global_drag_start,this)),this.listeners.push(e.DD.DDM.on("drag:end",this.global_drag_end,this)),this.listeners.push(e.DD.DDM.on("drag:drag",this.global_drag_drag,this)),this.listeners.push(e.DD.DDM.on("drop:over",this.global_drop_over,this)),this.listeners.push(e.DD.DDM.on("drop:hit",this.global_drop_hit,this)),this.listeners.push(e.DD.DDM.on("drag:dropmiss",this.global_drag_dropmiss,this)),this.listeners.push(e.one(e.config.doc.body).delegate("key",this.global_keydown,"down:32, enter, esc","."+n.cssclass,this)),this.listeners.push(e.one(e.config.doc.body).delegate("click",this.global_keydown,"."+n.cssclass,this))},destructor:function(){(new e.EventHandle(this.listeners)).detach()},get_drag_handle:function(t,r,i){var s=e.Node.create("").addClass(r).setAttribute("title",t).setAttribute("tabIndex",0).setAttribute("data-draggroups",this.groups).setAttribute("role","button");return s.addClass(n.cssclass),window.require(["core/templates"],function(t){t.renderPix("i/move_2d","core").then(function(t){var n=e.Node.create(t);n.setStyle("cursor","move"),typeof i!="undefined"&&n.addClass(i),s.appendChild(n)})}.bind(this)),s},lock_drag_handle:function(e,t){e.removeHandle("."+t)},unlock_drag_handle:function(e,t){e.addHandle("."+t),e.get("activeHandle").focus()},ajax_failure:function(e){var t={name:e.status+" "+e.statusText,message:e.responseText};return new M.core.exception(t)},in_group:function(t){var n=!1;return e.each(this.groups,function(e){t._groups[e]&&(n=!0)},this),n},global_drag_start:function(e){var t=e.target;if(!this.in_group(t))return;this.originalstyle=t.get("node").getAttribute("style"),t.get("node").setStyle("opacity",".25"),t.get("dragNode").setStyles({opacity:".75",borderColor:t.get("node").getStyle("borderColor"),backgroundColor:t.get("node").getStyle("backgroundColor")}),t.get("dragNode").empty(),this.drag_start(e)},global_drag_end:function(e){var t=e.target;if(!this.in_group(t))return;t.get("node").setAttribute("style",this.originalstyle),this.drag_end(e)},global_drag_drag:function(e){var t=e.target,n=e.info;if(!this.in_group(t))return;n.start[1]n.xy[1]&&(this.absgoingup=!1),n.delta[1]<0?this.goingup=!0:n.delta[1]>0&&(this.goingup=!1),this.drag_drag(e)},global_drop_over:function(e){if(!e.drop||!e.drop.inGroup(this.groups))return;var t=e.drag.get("node"),n=e.drop.get("node");this.lastdroptarget=e.drop;if(n.hasClass(this.samenodeclass)){var r;this.goingup?r="before":r="after",n.insert(t,r)}else(n.hasClass(this.parentnodeclass)||n.test('[data-droptarget="1"]'))&&!n.contains(t)&&(this.goingup?n.append(t):n.prepend(t));this.drop_over(e)},global_drag_dropmiss:function(e){e.drag=e.target,e.drop=this.lastdroptarget;if(!this.in_group(e.drag))return;if(!e.drop||!e.drop.inGroup(this.groups))return;this.drag_dropmiss(e)},global_drop_hit:function(e){if(!e.drop||!e.drop.inGroup(this.groups))return;this.drop_hit(e)},find_element_text:function(t){var n="";n=t.get("aria-label")||"";if(n.length>0)return n;var r=t.get("aria-labelledby");if(r){var i=e.one("#"+r);if(i&&i.get("text").length>0)return i.get("text")}var s=t.all("h2, h3, h4, h5, span:not(.actions):not(.menu-action-text), p, div.no-overflow, div.dimmed_text");return s.each(function(){n===""&&e.Lang.trim(this.get("text"))!==""&&(n=this.get("text"))}),n!==""?n:M.util.get_string("emptydragdropregion","moodle")},global_start_keyboard_drag:function(t,n,r){M.core.dragdrop.keydragcontainer=r,M.core.dragdrop.keydraghandle=n;var i=this.find_element_text(r),s=M.util.get_string("movecontent","moodle",i),o=e.Node.create("");o.addClass("dragdrop-keyboard-drag");var u,a,f,l=e.all("."+this.samenodeclass+", ."+this.parentnodeclass);l.each(function(t){var n=!1,s=t,l=t.getAttribute("class").split(" ").join(", .");if(t.drop&&t.drop.inGroup(this.groups)&&t.drop.get("node")!==r&&t.next(l)!==r)n=!0;else{var c=t.getAttribute("data-draggroups").split(" "),h,p;for(h=0;h"),a=e.Node.create(""),i=this.find_element_text(s),this.samenodelabel&&t.hasClass(this.samenodeclass)?f=M.util.get_string(this.samenodelabel.identifier,this.samenodelabel.component,i):this.parentnodelabel&&t.hasClass(this.parentnodeclass)?f=M.util.get_string(this.parentnodelabel.identifier,this.parentnodelabel.component,i):f=M.util.get_string("tocontent","moodle",i),a.setContent(f),a.setAttribute("data-drop-target",t.get("id")),a.setAttribute("tabindex","0"),a.on("click",this.global_keyboard_drop,this),a.on("key",this.global_keyboard_drop,"down:enter,32",this),u.append(a),o.append(u))},this),M.core.dragdrop.dropui=new M.core.dialogue({headerContent:s,bodyContent:o,draggable:!0,visible:!0,center:!0,modal:!0}),M.core.dragdrop.dropui.after("visibleChange",function(e){e.prevVal&&!e.newVal&&this.global_cancel_keyboard_drag()},this),o.one("a")&&o.one("a").focus()},simulated_drag_drop_event:function(e,t){var n=function(e){this.node=e};n.prototype.get=function(e){return e==="node"||e==="dragNode"||e==="dropNode"?this.node:e==="activeHandle"?this.node.one(".editing_move"):null},n.prototype.inGroup=function(){return!0},n.prototype.addHandle=function(){},n.prototype.removeHandle=function(){},this.drop=new n(t),this.drag=new n(e),this.target=this.drop},global_keyboard_drop:function(t){var n=M.core.dragdrop.keydragcontainer,r=e.one("#"+t.target.getAttribute("data-drop-target"));M.core -.dragdrop.dropui.hide(),t.preventDefault();var i=new this.simulated_drag_drop_event(n,n),s=new this.simulated_drag_drop_event(n,r);this.drag_start(i),this.global_drop_over(s),r.hasClass(this.parentnodeclass)&&r.contains(n)&&r.prepend(n),this.global_drop_hit(s)},global_cancel_keyboard_drag:function(){M.core.dragdrop.keydragcontainer&&(M.core.dragdrop.keydraghandle.focus(),M.core.dragdrop.keydragcontainer=null),M.core.dragdrop.dropui&&M.core.dragdrop.dropui.destroy()},global_keydown:function(e){var t=e.target.ancestor("."+n.cssclass,!0),r,i;if(t===null)return;if(e.keyCode===27){this.global_cancel_keyboard_drag(),e.preventDefault();return}if(!t.hasClass(n.cssclass))return;if(e.keyCode!==13&&e.keyCode!==32&&e.type!=="click")return;i=t.getAttribute("data-draggroups").split(" ");var s,o,u=!1;for(s=0;s").addClass(r).setAttribute("title",t).setAttribute("tabIndex",0).setAttribute("data-draggroups",this.groups).setAttribute("role","button");return s.addClass(n.cssclass),window.require(["core/templates"],function(t){t.renderPix("i/move_2d","core").then(function(t){var n=e.Node.create(t);n.setStyle("cursor","move"),typeof i!="undefined"&&n.addClass(i),s.appendChild(n)})}),s},lock_drag_handle:function(e,t){e.removeHandle("."+t)},unlock_drag_handle:function(e,t){e.addHandle("."+t),e.get("activeHandle").focus()},ajax_failure:function(e){var t={name:e.status+" "+e.statusText,message:e.responseText};return new M.core.exception(t)},in_group:function(t){var n=!1;return e.each(this.groups,function(e){t._groups[e]&&(n=!0)},this),n},global_drag_start:function(e){var t=e.target;if(!this.in_group(t))return;this.originalstyle=t.get("node").getAttribute("style"),t.get("node").setStyle("opacity",".25"),t.get("dragNode").setStyles({opacity:".75",borderColor:t.get("node").getStyle("borderColor"),backgroundColor:t.get("node").getStyle("backgroundColor")}),t.get("dragNode").empty(),this.drag_start(e)},global_drag_end:function(e){var t=e.target;if(!this.in_group(t))return;t.get("node").setAttribute("style",this.originalstyle),this.drag_end(e)},global_drag_drag:function(e){var t=e.target,n=e.info;if(!this.in_group(t))return;n.start[1]n.xy[1]&&(this.absgoingup=!1),n.delta[1]<0?this.goingup=!0:n.delta[1]>0&&(this.goingup=!1),this.drag_drag(e)},global_drop_over:function(e){if(!e.drop||!e.drop.inGroup(this.groups))return;var t=e.drag.get("node"),n=e.drop.get("node");this.lastdroptarget=e.drop;if(n.hasClass(this.samenodeclass)){var r;this.goingup?r="before":r="after",n.insert(t,r)}else(n.hasClass(this.parentnodeclass)||n.test('[data-droptarget="1"]'))&&!n.contains(t)&&(this.goingup?n.append(t):n.prepend(t));this.drop_over(e)},global_drag_dropmiss:function(e){e.drag=e.target,e.drop=this.lastdroptarget;if(!this.in_group(e.drag))return;if(!e.drop||!e.drop.inGroup(this.groups))return;this.drag_dropmiss(e)},global_drop_hit:function(e){if(!e.drop||!e.drop.inGroup(this.groups))return;this.drop_hit(e)},find_element_text:function(t){var n="";n=t.get("aria-label")||"";if(n.length>0)return n;var r=t.get("aria-labelledby");if(r){var i=e.one("#"+r);if(i&&i.get("text").length>0)return i.get("text")}var s=t.all("h2, h3, h4, h5, span:not(.actions):not(.menu-action-text), p, div.no-overflow, div.dimmed_text");return s.each(function(){n===""&&e.Lang.trim(this.get("text"))!==""&&(n=this.get("text"))}),n!==""?n:M.util.get_string("emptydragdropregion","moodle")},global_start_keyboard_drag:function(t,n,r){M.core.dragdrop.keydragcontainer=r,M.core.dragdrop.keydraghandle=n;var i=this.find_element_text(r),s=M.util.get_string("movecontent","moodle",i),o=e.Node.create("
    ");o.addClass("dragdrop-keyboard-drag");var u,a,f,l=e.all("."+this.samenodeclass+", ."+this.parentnodeclass);l.each(function(t){var n=!1,s=t,l=t.getAttribute("class").split(" ").join(", .");if(t.drop&&t.drop.inGroup(this.groups)&&t.drop.get("node")!==r&&t.next(l)!==r)n=!0;else{var c=t.getAttribute("data-draggroups").split(" "),h,p;for(h=0;h"),a=e.Node.create(""),i=this.find_element_text(s),this.samenodelabel&&t.hasClass(this.samenodeclass)?f=M.util.get_string(this.samenodelabel.identifier,this.samenodelabel.component,i):this.parentnodelabel&&t.hasClass(this.parentnodeclass)?f=M.util.get_string(this.parentnodelabel.identifier,this.parentnodelabel.component,i):f=M.util.get_string("tocontent","moodle",i),a.setContent(f),a.setAttribute("data-drop-target",t.get("id")),a.setAttribute("tabindex","0"),a.on("click",this.global_keyboard_drop,this),a.on("key",this.global_keyboard_drop,"down:enter,32",this),u.append(a),o.append(u))},this),M.core.dragdrop.dropui=new M.core.dialogue({headerContent:s,bodyContent:o,draggable:!0,visible:!0,center:!0,modal:!0}),M.core.dragdrop.dropui.after("visibleChange",function(e){e.prevVal&&!e.newVal&&this.global_cancel_keyboard_drag()},this),o.one("a")&&o.one("a").focus()},simulated_drag_drop_event:function(e,t){var n=function(e){this.node=e};n.prototype.get=function(e){return e==="node"||e==="dragNode"||e==="dropNode"?this.node:e==="activeHandle"?this.node.one(".editing_move"):null},n.prototype.inGroup=function(){return!0},n.prototype.addHandle=function(){},n.prototype.removeHandle=function(){},this.drop=new n(t),this.drag=new n(e),this.target=this.drop},global_keyboard_drop:function(t){var n=M.core.dragdrop.keydragcontainer,r=e.one("#"+t.target.getAttribute("data-drop-target"));M.core.dragdrop +.dropui.hide(),t.preventDefault();var i=new this.simulated_drag_drop_event(n,n),s=new this.simulated_drag_drop_event(n,r);this.drag_start(i),this.global_drop_over(s),r.hasClass(this.parentnodeclass)&&r.contains(n)&&r.prepend(n),this.global_drop_hit(s)},global_cancel_keyboard_drag:function(){M.core.dragdrop.keydragcontainer&&(M.core.dragdrop.keydraghandle.focus(),M.core.dragdrop.keydragcontainer=null),M.core.dragdrop.dropui&&M.core.dragdrop.dropui.destroy()},global_keydown:function(e){var t=e.target.ancestor("."+n.cssclass,!0),r,i;if(t===null)return;if(e.keyCode===27){this.global_cancel_keyboard_drag(),e.preventDefault();return}if(!t.hasClass(n.cssclass))return;if(e.keyCode!==13&&e.keyCode!==32&&e.type!=="click")return;i=t.getAttribute("data-draggroups").split(" ");var s,o,u=!1;for(s=0;sheader(); // course name -$icon = $OUTPUT->pix_icon('i/course', get_string('category')); +$icon = $OUTPUT->pix_icon('i/course', get_string('category')); echo $OUTPUT->heading($icon . s($course->fullname)); // collapsible course summary diff --git a/mod/assign/overrides.php b/mod/assign/overrides.php index d4bc66204ba0b..4a7c6894a7d47 100644 --- a/mod/assign/overrides.php +++ b/mod/assign/overrides.php @@ -200,7 +200,7 @@ // Move up. if ($override->sortorder > 1) { $iconstr .= '' . + '&id=' . $override->id .'&action=movegroupoverride&dir=up&sesskey='.sesskey().'">' . $OUTPUT->pix_icon('t/up', get_string('moveup')) . ' '; } else { $iconstr .= $OUTPUT->spacer() . ' '; @@ -209,7 +209,7 @@ // Move down. if ($override->sortorder < $overridecountgroup) { $iconstr .= '' . + '&id=' . $override->id . '&action=movegroupoverride&dir=down&sesskey='.sesskey().'">' . $OUTPUT->pix_icon('t/down', get_string('movedown')) . ' '; } else { $iconstr .= $OUTPUT->spacer() . ' '; diff --git a/mod/book/lib.php b/mod/book/lib.php index 6c732ed2f5c0a..7f1fb35d17caf 100644 --- a/mod/book/lib.php +++ b/mod/book/lib.php @@ -679,7 +679,7 @@ function mod_book_get_fontawesome_icon_map() { 'mod_book:chapter' => 'fa-bookmark-o', 'mod_book:nav_prev' => 'fa-arrow-left', 'mod_book:nav_prev_dis' => 'fa-angle-left', - 'mod_book:nav-sep' => 'fa-minus', + 'mod_book:nav_sep' => 'fa-minus', 'mod_book:add' => 'fa-plus', 'mod_book:nav_next' => 'fa-arrow-right', 'mod_book:nav_next_dis' => 'fa-angle-right', diff --git a/mod/data/lib.php b/mod/data/lib.php index b709334510154..566790eb353b4 100644 --- a/mod/data/lib.php +++ b/mod/data/lib.php @@ -504,7 +504,7 @@ function image() { $params = array('d'=>$this->data->id, 'fid'=>$this->field->id, 'mode'=>'display', 'sesskey'=>sesskey()); $link = new moodle_url('/mod/data/field.php', $params); $str = ''; - $str = $OUTPUT->pix_icon('field/' . $this->type, $this->type, 'data'); + $str .= $OUTPUT->pix_icon('field/' . $this->type, $this->type, 'data'); $str .= ''; return $str; } @@ -4130,3 +4130,23 @@ function data_view($data, $course, $cm, $context) { $completion = new completion_info($course); $completion->set_module_viewed($cm); } + +/** + * Get icon mapping for font-awesome. + */ +function mod_data_get_fontawesome_icon_map() { + return [ + 'mod_data:field/checkbox' => 'fa-check-square-o', + 'mod_data:field/date' => 'fa-calendar-o', + 'mod_data:field/file' => 'fa-file', + 'mod_data:field/latlong' => 'fa-globe', + 'mod_data:field/menu' => 'fa-bars', + 'mod_data:field/multimenu' => 'fa-bars', + 'mod_data:field/number' => 'fa-hashtag', + 'mod_data:field/picture' => 'fa-picture-o', + 'mod_data:field/radiobutton' => 'fa-circle-o', + 'mod_data:field/textarea' => 'fa-font', + 'mod_data:field/text' => 'fa-i-cursor', + 'mod_data:field/url' => 'fa-link', + ]; +} diff --git a/mod/feedback/yui/dragdrop/dragdrop.js b/mod/feedback/yui/dragdrop/dragdrop.js index 1b5638950cc58..c1cfaca3bbd02 100644 --- a/mod/feedback/yui/dragdrop/dragdrop.js +++ b/mod/feedback/yui/dragdrop/dragdrop.js @@ -21,7 +21,7 @@ YUI.add('moodle-mod_feedback-dragdrop', function(Y) { var groups = ['feedbackitem']; - handletitle = M.util.get_string('move_item', 'feedback'); + var handletitle = M.util.get_string('move_item', 'feedback'); //Get the list of li's in the lists and add the drag handle. basenode = Y.Node.one(CSS.DRAGLIST); diff --git a/mod/scorm/lib.php b/mod/scorm/lib.php index c24f25785f9b6..b5a5bd09ccf5f 100644 --- a/mod/scorm/lib.php +++ b/mod/scorm/lib.php @@ -1527,3 +1527,25 @@ function scorm_check_updates_since(cm_info $cm, $from, $filter = array()) { } return $updates; } + +/** + * Get icon mapping for font-awesome. + */ +function mod_scorm_get_fontawesome_icon_map() { + return [ + 'mod_scorm:assetc' => 'fa-archive-o', + 'mod_scorm:asset' => 'fa-archive-o', + 'mod_scorm:browsed' => 'fa-book', + 'mod_scorm:completed' => 'fa-check-square-o', + 'mod_scorm:failed' => 'fa-times', + 'mod_scorm:incomplete' => 'fa-pencil-square-o', + 'mod_scorm:minus' => 'fa-minus', + 'mod_scorm:notattempted' => 'fa-square-o', + 'mod_scorm:passed' => 'fa-check', + 'mod_scorm:plus' => 'fa-plus', + 'mod_scorm:popdown' => 'fa-window-close-o', + 'mod_scorm:popup' => 'fa-window-restore', + 'mod_scorm:suspend' => 'fa-pause', + 'mod_scorm:wait' => 'fa-clock-o', + ]; +} diff --git a/question/renderer.php b/question/renderer.php index 4b7ebc2349811..c862de1cfaa79 100644 --- a/question/renderer.php +++ b/question/renderer.php @@ -45,7 +45,7 @@ public function qtype_icon($qtype) { $qtype = question_bank::get_qtype($qtype, false); $namestr = $qtype->local_name(); - return $this->pix_icon('icon', $namestr, $qtype->plugin_name(), array('title' => $namestr)); + return $this->image_icon('icon', $namestr, $qtype->plugin_name(), array('title' => $namestr)); } /** diff --git a/theme/boost/lib.php b/theme/boost/lib.php index 41cbf44c157bd..e662f64c93950 100644 --- a/theme/boost/lib.php +++ b/theme/boost/lib.php @@ -106,4 +106,3 @@ function theme_boost_get_pre_scss($theme) { return $scss; } - diff --git a/theme/boost/scss/moodle/icons.scss b/theme/boost/scss/moodle/icons.scss index 05a9061abecb2..1e1033c1c027f 100644 --- a/theme/boost/scss/moodle/icons.scss +++ b/theme/boost/scss/moodle/icons.scss @@ -9,6 +9,10 @@ padding: 0; box-sizing: content-box; margin-right: 0.5rem; + + &.spacer { + margin-right: 0; + } } $icon-color: $body-color !default; @@ -18,7 +22,7 @@ a .icon { } .navbar-dark a .icon { - color: $navbar-dark-color ! important; + color: $navbar-dark-color !important; /* stylelint-disable-line declaration-no-important */ } a:first-of-type > .icon, @@ -46,17 +50,6 @@ span:first-of-type > .icon { } } -// Fix the space between the dropdown icon and the caret. -.action-menu { - .dropdown-toggle { - .icon { - // Use a negative margin on the icon to ensure that the dropdown toggle - // is an icon and not just text in which case the margin is needed. - margin-right: -$caret-width; - } - } -} - // YUI 2 Tree View icons must not have a margin left. .ygtvcell .icon { margin-left: 0 !important; /* stylelint-disable-line declaration-no-important */