[ Index ]

PHP Cross Reference of Moodle 1.9.3 [Build 15-Oct-2008]

title

Body

[close]

/admin/settings/ -> top.php (source)

   1  <?php // $Id: top.php,v 1.15.2.6 2008/07/05 13:05:24 skodak Exp $
   2  
   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.
   7  
   8  $systemcontext = get_context_instance(CONTEXT_SYSTEM);
   9  if (get_site()) {
  10      $hassiteconfig = has_capability('moodle/site:config', $systemcontext);
  11  } else {
  12      // installation starts - no permission checks
  13      $hassiteconfig = true;
  14  }
  15  
  16  $ADMIN->add('root', new admin_externalpage('adminnotifications', get_string('notifications'), "$CFG->wwwroot/$CFG->admin/index.php"));
  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  
  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')));
  26  
  27  $ADMIN->add('root', new admin_category('modules', get_string('plugins', 'admin')));
  28  
  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')));
  34  
  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') {
  39          continue;
  40      }
  41  /// End of removable snippet
  42      $reportname = get_string($plugin, 'report_' . $plugin);
  43      if ($reportname[1] == '[') {
  44          $reportname = get_string($plugin, 'admin');
  45      }
  46      // ugly hack for special access control in reports
  47      switch($plugin) {
  48          case 'backups': $cap = 'moodle/site:backup'; break;
  49          case 'simpletest': $cap = 'moodle/site:config'; break;
  50          default: $cap = 'moodle/site:viewreports';
  51      }
  52      $ADMIN->add('reports', new admin_externalpage('report'.$plugin, $reportname, "$CFG->wwwroot/$CFG->admin/report/$plugin/index.php",$cap));
  53  }
  54  
  55  $ADMIN->add('root', new admin_category('misc', get_string('miscellaneous')));
  56  
  57  // hidden unsupported category
  58  $ADMIN->add('root', new admin_category('unsupported', get_string('unsupported', 'admin'), true));
  59  
  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));
  62  
  63  ?>


Generated: Wed Jan 14 11:33:29 2009 Cross-referenced by PHPXref 0.7