mirror of
https://github.com/moodle/moodle.git
synced 2025-03-14 04:30:15 +01:00
Merge branch 'MDL-36881-m' of git://github.com/andrewnicols/moodle
This commit is contained in:
commit
5126bab95c
@ -1144,7 +1144,8 @@ function get_module_metadata($course, $modnames, $sectionreturn = null) {
|
||||
// NOTE: this is legacy stuff, module subtypes are very strongly discouraged!!
|
||||
$gettypesfunc = $modname.'_get_types';
|
||||
if (function_exists($gettypesfunc)) {
|
||||
if ($types = $gettypesfunc()) {
|
||||
$types = $gettypesfunc();
|
||||
if (is_array($types) && count($types) > 0) {
|
||||
$group = new stdClass();
|
||||
$group->name = $modname;
|
||||
$group->icon = $OUTPUT->pix_icon('icon', '', $modname, array('class' => 'icon'));
|
||||
@ -1193,7 +1194,11 @@ function get_module_metadata($course, $modnames, $sectionreturn = null) {
|
||||
$module->archetype = plugin_supports('mod', $modname, FEATURE_MOD_ARCHETYPE, MOD_ARCHETYPE_OTHER);
|
||||
$modlist[$course->id][$modname] = $module;
|
||||
}
|
||||
$return[$modname] = $modlist[$course->id][$modname];
|
||||
if (isset($modlist[$course->id][$modname])) {
|
||||
$return[$modname] = $modlist[$course->id][$modname];
|
||||
} else {
|
||||
debugging("Invalid module metadata configuration for {$modname}");
|
||||
}
|
||||
}
|
||||
|
||||
return $return;
|
||||
|
Loading…
x
Reference in New Issue
Block a user