mirror of
https://github.com/moodle/moodle.git
synced 2025-01-18 22:08:20 +01:00
MDL-54065 gradebook: correctly display module icon
This commit is contained in:
parent
6a74e76fb8
commit
bc6a7431a2
@ -1477,9 +1477,16 @@ class grade_structure {
|
||||
if ($is_outcome) {
|
||||
$icon->pix = 'i/outcomes';
|
||||
$icon->title = s(get_string('outcome', 'grades'));
|
||||
} else {
|
||||
$modinfo = get_fast_modinfo($element['object']->courseid);
|
||||
$module = $element['object']->itemmodule;
|
||||
$instanceid = $element['object']->iteminstance;
|
||||
if (isset($modinfo->instances[$module][$instanceid])) {
|
||||
$icon->url = $modinfo->instances[$module][$instanceid]->get_icon_url();
|
||||
} else {
|
||||
$icon->pix = 'icon';
|
||||
$icon->component = $element['object']->itemmodule;
|
||||
}
|
||||
$icon->title = s(get_string('modulename', $element['object']->itemmodule));
|
||||
}
|
||||
} else if ($element['object']->itemtype == 'manual') {
|
||||
@ -1504,6 +1511,8 @@ class grade_structure {
|
||||
if ($spacerifnone) {
|
||||
$outputstr = $OUTPUT->spacer() . ' ';
|
||||
}
|
||||
} else if (isset($icon->url)) {
|
||||
$outputstr = html_writer::img($icon->url, $icon->title, $icon->attributes);
|
||||
} else {
|
||||
$outputstr = $OUTPUT->pix_icon($icon->pix, $icon->title, $icon->component, $icon->attributes);
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user