Skip to content

Commit

Permalink
Merge branch 'MDL-68263-master' of git://github.com/mihailges/moodle
Browse files Browse the repository at this point in the history
  • Loading branch information
sarjona committed Apr 1, 2020
2 parents c986e55 + 9ba1716 commit 4aa71de
Showing 1 changed file with 10 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -185,7 +185,7 @@ private function legacy_item_inherit_missing(\stdClass $legacyitem, content_item
* @return array the array of content items.
*/
public function find_all(): array {
global $OUTPUT, $DB;
global $OUTPUT, $DB, $CFG;

// Get all modules so we know which plugins are enabled and able to add content.
// Only module plugins may add content items.
Expand All @@ -194,6 +194,10 @@ public function find_all(): array {

// Now, generate the content_items.
foreach ($modules as $modid => $mod) {
// Exclude modules if the code doesn't exist.
if (!file_exists("$CFG->dirroot/mod/$mod->name/lib.php")) {
continue;
}
// Create the content item for the module itself.
// If the module chooses to implement the hook, this may be thrown away.
$help = $this->get_core_module_help_string($mod->name);
Expand Down Expand Up @@ -241,7 +245,7 @@ public function find_all(): array {
* @return array the array of content_item objects
*/
public function find_all_for_course(\stdClass $course, \stdClass $user): array {
global $OUTPUT, $DB;
global $OUTPUT, $DB, $CFG;

// Get all modules so we know which plugins are enabled and able to add content.
// Only module plugins may add content items.
Expand All @@ -253,7 +257,10 @@ public function find_all_for_course(\stdClass $course, \stdClass $user): array {

// Now, generate the content_items.
foreach ($modules as $modid => $mod) {

// Exclude modules if the code doesn't exist.
if (!file_exists("$CFG->dirroot/mod/$mod->name/lib.php")) {
continue;
}
// Create the content item for the module itself.
// If the module chooses to implement the hook, this may be thrown away.
$help = $this->get_core_module_help_string($mod->name);
Expand Down

0 comments on commit 4aa71de

Please sign in to comment.