MDL-16348 Reorganise admin tree:
* New Capability report put under Users -> Permissions * Miscellaneous category renamed to Development * Unit tests and Functional DB test moved to be under Development. * The hard-coded hack that was used to change the permission that controls the Backups and stats reports replaced with settings.php files. * There were two hidden Miscellaneous things in the old category, so I moved them. Multilan upgrade now under Lanuages, and Online assignment cleanup now under Plugins -> Activity modules. Both still hidden. There was already a way for admin report plugins to control where they appeared in the tree, but it was not documented, so see http://docs.moodle.org/en/Development:Admin_reports
This commit is contained in:
@@ -4950,6 +4950,22 @@ function &admin_get_root($reload=false, $requirefulltree=true) {
|
||||
include($file);
|
||||
}
|
||||
}
|
||||
|
||||
// Add all the report plugings. Do this last so they can choose where in the tree
|
||||
// they want to be added.
|
||||
foreach (get_list_of_plugins($CFG->admin.'/report') as $plugin) {
|
||||
$settingsfile = "$CFG->dirroot/$CFG->admin/report/$plugin/settings.php";
|
||||
if (file_exists($settingsfile)) {
|
||||
include($settingsfile);
|
||||
} else {
|
||||
$reportname = get_string($plugin, 'report_' . $plugin);
|
||||
if ($reportname[1] == '[') {
|
||||
$reportname = get_string($plugin, 'admin');
|
||||
}
|
||||
$ADMIN->add('reports', new admin_externalpage('report'.$plugin, $reportname, "$CFG->wwwroot/$CFG->admin/report/$plugin/index.php",'moodle/site:viewreports'));
|
||||
}
|
||||
}
|
||||
|
||||
if (file_exists($CFG->dirroot.'/local/settings.php')) {
|
||||
include_once($CFG->dirroot.'/local/settings.php');
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user