MDL-14637 "allow activity modules to add sub menus of settings pages to admin menu...
authorjamiesensei <jamiesensei>
Fri, 9 May 2008 06:12:57 +0000 (06:12 +0000)
committerjamiesensei <jamiesensei>
Fri, 9 May 2008 06:12:57 +0000 (06:12 +0000)
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

index f3ff0f7b7a33423c3c90232546126cdbf570b8ae..f1fd753fede3aac7e810e04a7ba8088e9d926195 100644 (file)
@@ -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));
             }
         }