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
@ -1478,8 +1478,15 @@ class grade_structure {
|
|||||||
$icon->pix = 'i/outcomes';
|
$icon->pix = 'i/outcomes';
|
||||||
$icon->title = s(get_string('outcome', 'grades'));
|
$icon->title = s(get_string('outcome', 'grades'));
|
||||||
} else {
|
} else {
|
||||||
$icon->pix = 'icon';
|
$modinfo = get_fast_modinfo($element['object']->courseid);
|
||||||
$icon->component = $element['object']->itemmodule;
|
$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));
|
$icon->title = s(get_string('modulename', $element['object']->itemmodule));
|
||||||
}
|
}
|
||||||
} else if ($element['object']->itemtype == 'manual') {
|
} else if ($element['object']->itemtype == 'manual') {
|
||||||
@ -1504,6 +1511,8 @@ class grade_structure {
|
|||||||
if ($spacerifnone) {
|
if ($spacerifnone) {
|
||||||
$outputstr = $OUTPUT->spacer() . ' ';
|
$outputstr = $OUTPUT->spacer() . ' ';
|
||||||
}
|
}
|
||||||
|
} else if (isset($icon->url)) {
|
||||||
|
$outputstr = html_writer::img($icon->url, $icon->title, $icon->attributes);
|
||||||
} else {
|
} else {
|
||||||
$outputstr = $OUTPUT->pix_icon($icon->pix, $icon->title, $icon->component, $icon->attributes);
|
$outputstr = $OUTPUT->pix_icon($icon->pix, $icon->title, $icon->component, $icon->attributes);
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user