Issue #16 - Check if plugin is enabled before adding menu items.

This commit is contained in:
Daniel Thee Roperto
2016-09-06 22:39:47 +10:00
parent abe029afce
commit 0251377852

View File

@@ -24,8 +24,11 @@
*/
defined('MOODLE_INTERNAL') || die;
// FIXME If plugin not installed, it is still generating the category Outage under Auth Plugins.
if ($hassiteconfig) {
// Check if plugin is enabled, if not do not create menu entries.
$enabled = core_plugin_manager::instance()->get_enabled_plugins('auth');
$enabled = array_key_exists('outage', $enabled);
if ($hassiteconfig && $enabled) {
// Configure default settings page.
$settings->visiblename = get_string('menudefaults', 'auth_outage');
$settings->add(
@@ -54,4 +57,4 @@ if ($hassiteconfig) {
new moodle_url($CFG->wwwroot . '/auth/outage/list.php')
)
);
}
}