Search moodle.org's
Developer Documentation

See Release Notes

  • Bug fixes for general core bugs in 3.11.x will end 14 Nov 2022 (12 months plus 6 months extension).
  • Bug fixes for security issues in 3.11.x will end 13 Nov 2023 (18 months plus 12 months extension).
  • PHP version: minimum PHP 7.3.0 Note: minimum PHP version has increased since Moodle 3.10. PHP 7.4.x is supported too.

Differences Between: [Versions 311 and 400]

   1  <?php
   2  
   3  // This file defines settingpages and externalpages under the "mnet" category
   4  
   5  if ($hassiteconfig) { // speedup for non-admins, add all caps used on this page
   6  
   7  $ADMIN->add('mnet', new admin_externalpage('net', new lang_string('settings', 'mnet'),
   8                                             "$CFG->wwwroot/$CFG->admin/mnet/index.php",
   9                                             'moodle/site:config'));
  10  
  11  
  12  
  13  $ADMIN->add('mnet', new admin_externalpage('mnetpeers', new lang_string('managemnetpeers', 'mnet'),
  14                                             "$CFG->wwwroot/$CFG->admin/mnet/peers.php",
  15                                             'moodle/site:config'));
  16  
  17  
  18  $ADMIN->add('mnet', new admin_category('mnetpeercat', new lang_string('mnetpeers', 'mnet')));
  19  
  20  if (isset($CFG->mnet_dispatcher_mode) and $CFG->mnet_dispatcher_mode !== 'off') {
  21      require_once($CFG->dirroot.'/mnet/lib.php');
  22  
  23      $hosts = mnet_get_hosts();
  24      foreach ($hosts as $host) {
  25          if ($host->id == $CFG->mnet_all_hosts_id) {
  26              $host->name = new lang_string('allhosts', 'core_mnet');
  27          }
  28          $ADMIN->add('mnetpeercat',
  29              new admin_externalpage(
  30                  'mnetpeer' . $host->id,
  31                  $host->name,
  32                  $CFG->wwwroot . '/'.$CFG->admin.'/mnet/peers.php?step=update&hostid=' . $host->id,
  33                  'moodle/site:config'
  34              )
  35          );
  36      }
  37  }
  38  
  39  $ADMIN->add('mnet', new admin_externalpage('ssoaccesscontrol', new lang_string('ssoaccesscontrol', 'mnet'),
  40                                             "$CFG->wwwroot/$CFG->admin/mnet/access_control.php",
  41                                             'moodle/site:config'));
  42  $ADMIN->add('mnet', new admin_externalpage('mnetenrol', new lang_string('clientname', 'mnetservice_enrol'),
  43                                             "$CFG->wwwroot/mnet/service/enrol/index.php",
  44                                             'moodle/site:config'));
  45  $ADMIN->add('mnet', new admin_externalpage('trustedhosts', new lang_string('trustedhosts', 'mnet'),
  46                                             "$CFG->wwwroot/$CFG->admin/mnet/trustedhosts.php",
  47                                             'moodle/site:config'));
  48  
  49  if (isset($CFG->mnet_dispatcher_mode) and $CFG->mnet_dispatcher_mode !== 'off') {
  50      $profilefields = new admin_settingpage('mnetprofilefields', new lang_string('profilefields', 'mnet'),
  51                                                 'moodle/site:config');
  52      $ADMIN->add('mnet', $profilefields);
  53  
  54      $fields = mnet_profile_field_options();
  55      $forced = implode(', ', $fields['forced']);
  56  
  57      $profilefields->add(new admin_setting_configmultiselect('mnetprofileexportfields', new lang_string('profileexportfields', 'mnet'), new lang_string('profilefielddesc', 'mnet', $forced), $fields['legacy'], $fields['optional']));
  58      $profilefields->add(new admin_setting_configmultiselect('mnetprofileimportfields', new lang_string('profileimportfields', 'mnet'), new lang_string('profilefielddesc', 'mnet', $forced), $fields['legacy'], $fields['optional']));
  59  }
  60  
  61  
  62  } // end of speedup