Skip to content

Commit

Permalink
MDL-50391 format_singleactivity: fix activity_has_subtypes()
Browse files Browse the repository at this point in the history
  • Loading branch information
marinaglancy authored and aspark21 committed Aug 13, 2015
1 parent dda862a commit 3bacf55
Showing 1 changed file with 1 addition and 7 deletions.
8 changes: 1 addition & 7 deletions course/format/singleactivity/lib.php
Original file line number Diff line number Diff line change
Expand Up @@ -338,16 +338,10 @@ protected function can_add_activity() {
* @return bool|null (null if the check is not possible)
*/
public function activity_has_subtypes() {
global $CFG;
if (!($modname = $this->get_activitytype())) {
return null;
}
$libfile = "$CFG->dirroot/mod/$modname/lib.php";
if (!file_exists($libfile)) {
return null;
}
include_once($libfile);
return function_exists($modname. '_get_types');
return component_callback('mod_' . $modname, 'get_types', array(), MOD_SUBTYPE_NO_CHILDREN) !== MOD_SUBTYPE_NO_CHILDREN;
}

/**
Expand Down

0 comments on commit 3bacf55

Please sign in to comment.