Skip to content

Commit

Permalink
MDL-77105 block_recentlyaccesseditems: Add 'nofilter' class
Browse files Browse the repository at this point in the history
Add the `.nofilter` class for activity icons when the icon URL's
`filtericon` parameter is not set, so they get rendered as they are on
the recently accessed items block.
  • Loading branch information
junpataleta committed Mar 27, 2023
1 parent 5b1dacc commit 894a6ab
Showing 1 changed file with 5 additions and 4 deletions.
Expand Up @@ -51,17 +51,18 @@ protected static function define_related() {
protected function get_other_values(renderer_base $output) {
global $CFG;
require_once($CFG->libdir.'/modinfolib.php');

$iconurl = get_fast_modinfo($this->data->courseid)->cms[$this->data->cmid]->get_icon_url();
$iconclass = $iconurl->get_param('filtericon') ? '' : 'nofilter';
return array(
'viewurl' => (new moodle_url('/mod/'.$this->data->modname.'/view.php',
array('id' => $this->data->cmid)))->out(false),
'courseviewurl' => (new moodle_url('/course/view.php', array('id' => $this->data->courseid)))->out(false),
'icon' => \html_writer::img(
get_fast_modinfo($this->data->courseid)->cms[$this->data->cmid]->get_icon_url(),
$iconurl,
get_string('pluginname', $this->data->modname),
['title' => get_string('pluginname', $this->data->modname), 'class' => 'icon']
['title' => get_string('pluginname', $this->data->modname), 'class' => "icon $iconclass"]
),
'purpose' => plugin_supports('mod', $this->data->modname, FEATURE_MOD_PURPOSE, MOD_PURPOSE_OTHER)
'purpose' => plugin_supports('mod', $this->data->modname, FEATURE_MOD_PURPOSE, MOD_PURPOSE_OTHER),
);
}

Expand Down

0 comments on commit 894a6ab

Please sign in to comment.