mirror of
https://github.com/moodle/moodle.git
synced 2025-04-15 13:33:52 +02:00
MDL-77105 block_recentlyaccesseditems: Add 'nofilter' class
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.
This commit is contained in:
parent
cf09a7f253
commit
b78978dac6
@ -51,17 +51,18 @@ class recentlyaccesseditems_item_exporter extends \core\external\exporter {
|
||||
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),
|
||||
);
|
||||
}
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user