MDL-16348 Reorganise admin tree:
[moodle.git] / admin / settings / top.php
CommitLineData
50999a0b 1<?php // $Id$
2
c0a1aae3 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
6// are added to them.
50999a0b 7
8e5da17a 8$systemcontext = get_context_instance(CONTEXT_SYSTEM);
afdde5a1 9if (get_site()) {
10 $hassiteconfig = has_capability('moodle/site:config', $systemcontext);
11} else {
12 // installation starts - no permission checks
13 $hassiteconfig = true;
14}
8e5da17a 15
bee4702d 16$ADMIN->add('root', new admin_externalpage('adminnotifications', get_string('notifications'), "$CFG->wwwroot/$CFG->admin/index.php"));
c0a1aae3 17
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));
20
90658eef 21if ($hassiteconfig) {
22 $optionalsubsystems = new admin_settingpage('optionalsubsystems', get_string('optionalsubsystems', 'admin'));
23 $ADMIN->add('root', $optionalsubsystems);
24}
25
bee4702d 26$ADMIN->add('root', new admin_category('users', get_string('users','admin')));
27$ADMIN->add('root', new admin_category('courses', get_string('courses','admin')));
28e2c556 28$ADMIN->add('root', new admin_category('grades', get_string('grades')));
bee4702d 29$ADMIN->add('root', new admin_category('location', get_string('location','admin')));
30$ADMIN->add('root', new admin_category('language', get_string('language')));
bee4702d 31$ADMIN->add('root', new admin_category('modules', get_string('plugins', 'admin')));
bee4702d 32$ADMIN->add('root', new admin_category('security', get_string('security','admin')));
33$ADMIN->add('root', new admin_category('appearance', get_string('appearance','admin')));
84c8ede0 34$ADMIN->add('root', new admin_category('frontpage', get_string('frontpage','admin')));
bee4702d 35$ADMIN->add('root', new admin_category('server', get_string('server','admin')));
90658eef 36$ADMIN->add('root', new admin_category('mnet', get_string('net','mnet'), (isset($CFG->mnet_dispatcher_mode) and $CFG->mnet_dispatcher_mode === 'off')));
bee4702d 37$ADMIN->add('root', new admin_category('reports', get_string('reports')));
b032b490 38$ADMIN->add('root', new admin_category('development', get_string('development', 'admin')));
c9a49cea 39// hidden unsupported category
40$ADMIN->add('root', new admin_category('unsupported', get_string('unsupported', 'admin'), true));
220a90c5 41// hidden search script
42$ADMIN->add('root', new admin_externalpage('search', get_string('searchresults'), "$CFG->wwwroot/$CFG->admin/search.php", 'moodle/site:config', true));
43
bee4702d 44?>