/admin/settings/top.php

https://github.com/gerrywastaken/moodle · PHP · 48 lines · 33 code · 8 blank · 7 comment · 1 complexity · b2964c598c6db8723160366061813470 MD5 · raw file

  1. <?php
  2. // This is the first file read by the lib/adminlib.php script
  3. // We use it to create the categories in correct order,
  4. // since they need to exist *before* settingpages and externalpages
  5. // are added to them.
  6. $systemcontext = get_context_instance(CONTEXT_SYSTEM);
  7. $hassiteconfig = has_capability('moodle/site:config', $systemcontext);
  8. $ADMIN->add('root', new admin_externalpage('adminnotifications', new lang_string('notifications'), "$CFG->wwwroot/$CFG->admin/index.php"));
  9. $ADMIN->add('root', new admin_externalpage('registrationindex', new lang_string('registration','admin'),
  10. "$CFG->wwwroot/$CFG->admin/registration/index.php"));
  11. $ADMIN->add('root', new admin_externalpage('registration', new lang_string('registeron','hub'),
  12. "$CFG->wwwroot/$CFG->admin/registration/register.php", 'moodle/site:config', true));
  13. $ADMIN->add('root', new admin_externalpage('registrationselector', new lang_string('registeron','hub'),
  14. "$CFG->wwwroot/$CFG->admin/registration/hubselector.php", 'moodle/site:config', true));
  15. $ADMIN->add('root', new admin_externalpage('siteregistrationconfirmed',
  16. new lang_string('registrationconfirmed', 'hub'),
  17. $CFG->wwwroot."/".$CFG->admin."/registration/confirmregistration.php", 'moodle/site:config', true));
  18. // hidden upgrade script
  19. $ADMIN->add('root', new admin_externalpage('upgradesettings', new lang_string('upgradesettings', 'admin'), "$CFG->wwwroot/$CFG->admin/upgradesettings.php", 'moodle/site:config', true));
  20. if ($hassiteconfig) {
  21. $optionalsubsystems = new admin_settingpage('optionalsubsystems', new lang_string('advancedfeatures', 'admin'));
  22. $ADMIN->add('root', $optionalsubsystems);
  23. }
  24. $ADMIN->add('root', new admin_category('users', new lang_string('users','admin')));
  25. $ADMIN->add('root', new admin_category('courses', new lang_string('courses','admin')));
  26. $ADMIN->add('root', new admin_category('grades', new lang_string('grades')));
  27. $ADMIN->add('root', new admin_category('location', new lang_string('location','admin')));
  28. $ADMIN->add('root', new admin_category('language', new lang_string('language')));
  29. $ADMIN->add('root', new admin_category('modules', new lang_string('plugins', 'admin')));
  30. $ADMIN->add('root', new admin_category('security', new lang_string('security','admin')));
  31. $ADMIN->add('root', new admin_category('appearance', new lang_string('appearance','admin')));
  32. $ADMIN->add('root', new admin_category('frontpage', new lang_string('frontpage','admin')));
  33. $ADMIN->add('root', new admin_category('server', new lang_string('server','admin')));
  34. $ADMIN->add('root', new admin_category('mnet', new lang_string('net','mnet'), (isset($CFG->mnet_dispatcher_mode) and $CFG->mnet_dispatcher_mode === 'off')));
  35. $ADMIN->add('root', new admin_category('reports', new lang_string('reports')));
  36. $ADMIN->add('root', new admin_category('development', new lang_string('development', 'admin')));
  37. // hidden unsupported category
  38. $ADMIN->add('root', new admin_category('unsupported', new lang_string('unsupported', 'admin'), true));
  39. // hidden search script
  40. $ADMIN->add('root', new admin_externalpage('search', new lang_string('searchresults'), "$CFG->wwwroot/$CFG->admin/search.php", 'moodle/site:config', true));