MDL-77105 mod_lti: Add 'nofilter' class for custom tool icons

Add a '.nofilter' class when rendering custom tool icons in order
to render them as is and without CSS filter on the activity chooser.
This commit is contained in:
Jun Pataleta
2023-03-27 14:00:38 +08:00
parent 538e17e199
commit 67f739499b
+9 -1
View File
@@ -2387,7 +2387,15 @@ function lti_get_configured_types($courseid, $sectionreturn = 0) {
$type->help = clean_param($trimmeddescription, PARAM_NOTAGS);
$type->helplink = get_string('modulename_shortcut_link', 'lti');
}
$type->icon = html_writer::empty_tag('img', ['src' => get_tool_type_icon_url($ltitype), 'alt' => '', 'class' => 'icon']);
$iconurl = get_tool_type_icon_url($ltitype);
$iconclass = '';
if ($iconurl !== $OUTPUT->image_url('monologo', 'lti')->out()) {
// Do not filter the icon if it is not the default LTI activity icon.
$iconclass = 'nofilter';
}
$type->icon = html_writer::empty_tag('img', ['src' => $iconurl, 'alt' => '', 'class' => "icon $iconclass"]);
$type->link = new moodle_url('/course/modedit.php', array('add' => 'lti', 'return' => 0, 'course' => $courseid,
'sr' => $sectionreturn, 'typeid' => $ltitype->id));
$types[] = $type;