3 // This is the first file read by the lib/adminlib.php script
4 // We use it to create the categories in correct order,
5 // since they need to exist *before* settingpages and externalpages
8 $systemcontext = get_context_instance(CONTEXT_SYSTEM
);
10 $hassiteconfig = has_capability('moodle/site:config', $systemcontext);
12 // installation starts - no permission checks
13 $hassiteconfig = true;
16 $ADMIN->add('root', new admin_externalpage('adminnotifications', get_string('notifications'), "$CFG->wwwroot/$CFG->admin/index.php"));
18 // hidden upgrade script
19 $ADMIN->add('root', new admin_externalpage('upgradesettings', get_string('upgradesettings', 'admin'), "$CFG->wwwroot/$CFG->admin/upgradesettings.php", 'moodle/site:config', true));
21 $ADMIN->add('root', new admin_category('users', get_string('users','admin')));
22 $ADMIN->add('root', new admin_category('courses', get_string('courses','admin')));
23 $ADMIN->add('root', new admin_category('grades', get_string('grades')));
24 $ADMIN->add('root', new admin_category('location', get_string('location','admin')));
25 $ADMIN->add('root', new admin_category('language', get_string('language')));
27 $ADMIN->add('root', new admin_category('modules', get_string('plugins', 'admin')));
29 $ADMIN->add('root', new admin_category('security', get_string('security','admin')));
30 $ADMIN->add('root', new admin_category('appearance', get_string('appearance','admin')));
31 $ADMIN->add('root', new admin_category('frontpage', get_string('frontpage','admin')));
32 $ADMIN->add('root', new admin_category('server', get_string('server','admin')));
33 $ADMIN->add('root', new admin_category('mnet', get_string('net','mnet')));
35 $ADMIN->add('root', new admin_category('reports', get_string('reports')));
36 foreach (get_list_of_plugins($CFG->admin
.'/report') as $plugin) {
37 /// This snippet is temporary until simpletest can be fixed to use xmldb. See MDL-7377 XXX TODO
38 if ($plugin == 'simpletest' && $CFG->dbfamily
!= 'mysql' && $CFG->dbfamily
!= 'postgres') {
41 /// End of removable snippet
42 $reportname = get_string($plugin, 'report_' . $plugin);
43 if ($reportname[1] == '[') {
44 $reportname = get_string($plugin, 'admin');
46 // ugly hack for special access control in reports
48 case 'backups': $cap = 'moodle/site:backup'; break;
49 case 'simpletest': $cap = 'moodle/site:config'; break;
50 default: $cap = 'moodle/site:viewreports';
52 $ADMIN->add('reports', new admin_externalpage('report'.$plugin, $reportname, "$CFG->wwwroot/$CFG->admin/report/$plugin/index.php",$cap));
55 $ADMIN->add('root', new admin_category('misc', get_string('miscellaneous')));
57 // hidden unsupported category
58 $ADMIN->add('root', new admin_category('unsupported', get_string('unsupported', 'admin'), true));
60 // hidden search script
61 $ADMIN->add('root', new admin_externalpage('search', get_string('searchresults'), "$CFG->wwwroot/$CFG->admin/search.php", 'moodle/site:config', true));