Skip to content

Commit

Permalink
MDL-77105 mod_lti: Add 'nofilter' class for custom tool icons
Browse files Browse the repository at this point in the history
Add a '.nofilter' class when rendering custom tool icons in order
to render them as is and without CSS filter on the activity chooser.
  • Loading branch information
junpataleta committed Mar 27, 2023
1 parent 82db828 commit fd95396
Showing 1 changed file with 9 additions and 1 deletion.
10 changes: 9 additions & 1 deletion mod/lti/locallib.php
Expand Up @@ -2323,7 +2323,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;
Expand Down

0 comments on commit fd95396

Please sign in to comment.