From c37415a08df2540ab5bdb36c5cce88dd96f5edc3 Mon Sep 17 00:00:00 2001 From: jamiesensei Date: Fri, 9 May 2008 06:12:57 +0000 Subject: [PATCH] MDL-14637 "allow activity modules to add sub menus of settings pages to admin menu" and MDL-14565 "allow quiz reports to add configuration settings to the admin tree" added a mechanism to admin/settings/plugins.php to allow modules to include a file settingstree.php instead of settings.php which will allow for more flexibility of what a module can add to the admin settings menu. Merged from 1.9 Added a comment to the if branch that includes config.html that this branch needs to be deleted as soon as quiz/config.html has been migrated to settingstree.php which is MDL-7010 --- admin/settings/plugins.php | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/admin/settings/plugins.php b/admin/settings/plugins.php index f3ff0f7b7a..f1fd753fed 100644 --- a/admin/settings/plugins.php +++ b/admin/settings/plugins.php @@ -20,7 +20,9 @@ if ($hassiteconfig) { foreach ($modulebyname as $strmodulename=>$module) { $modulename = $module->name; - if (file_exists($CFG->dirroot.'/mod/'.$modulename.'/settings.php')) { + if (file_exists($CFG->dirroot.'/mod/'.$modulename.'/settingstree.php')) { + include($CFG->dirroot.'/mod/'.$modulename.'/settingstree.php'); + } else if (file_exists($CFG->dirroot.'/mod/'.$modulename.'/settings.php')) { // do not show disabled modules in tree, keep only settings link on manage page $settings = new admin_settingpage('modsetting'.$modulename, $strmodulename, 'moodle/site:config', !$module->visible); if ($ADMIN->fulltree) { @@ -28,6 +30,8 @@ if ($hassiteconfig) { } $ADMIN->add('modsettings', $settings); } else if (file_exists($CFG->dirroot.'/mod/'.$modulename.'/config.html')) { + //TODO this branch should be deleted as soon as quiz/config.html has been + //migrated to settings.php $ADMIN->add('modsettings', new admin_externalpage('modsetting'.$modulename, $strmodulename, "$CFG->wwwroot/$CFG->admin/module.php?module=$modulename", 'moodle/site:config', !$module->visible)); } } -- 2.39.5