Index: admin/settings/plugins.php =================================================================== RCS file: /cvsroot/moodle/moodle/admin/settings/plugins.php,v retrieving revision 1.4 diff -u -r1.4 plugins.php --- admin/settings/plugins.php 25 Dec 2007 10:04:00 -0000 1.4 +++ admin/settings/plugins.php 1 May 2008 12:31:17 -0000 @@ -20,16 +20,29 @@ foreach ($modulebyname as $strmodulename=>$module) { $modulename = $module->name; + $settings = false; 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) { include($CFG->dirroot.'/mod/'.$modulename.'/settings.php'); } - $ADMIN->add('modsettings', $settings); } else if (file_exists($CFG->dirroot.'/mod/'.$modulename.'/config.html')) { - $ADMIN->add('modsettings', new admin_externalpage('modsetting'.$modulename, $strmodulename, "$CFG->wwwroot/$CFG->admin/module.php?module=$modulename", 'moodle/site:config', !$module->visible)); + $settings = new admin_externalpage('modsetting'.$modulename, $strmodulename, "$CFG->wwwroot/$CFG->admin/module.php?module=$modulename", 'moodle/site:config', !$module->visible); } + if ($settings){ + //if the activity module wants to add more settings pages make a main cat for all the + //settings pages for this module. + if (file_exists($CFG->dirroot.'/mod/'.$modulename.'/settingstree.php')) { + $ADMIN->add('modsettings', new admin_category('modsettings'.$modulename.'cat', get_string('modulename', $modulename), !$module->visible)); + //give the main module settings page a new name 'General settings.'. + $settings->visiblename = get_string('generalsettings', 'admin'); + $ADMIN->add('modsettings'.$modulename.'cat', $settings); + include($CFG->dirroot.'/mod/'.$modulename.'/settingstree.php'); + } else { + $ADMIN->add('modsettings', $settings); + } + } } }