Merge branch 'MDL-51177-master' of git://github.com/andrewnicols/moodle
[moodle.git] / admin / settings / mnet.php
blob9bb5b15dd4a58f2c93dbd5f935d8c73a724a115a
1 <?php
3 // This file defines settingpages and externalpages under the "mnet" category
5 if ($hassiteconfig) { // speedup for non-admins, add all caps used on this page
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'));
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'));
18 $ADMIN->add('mnet', new admin_category('mnetpeercat', new lang_string('mnetpeers', 'mnet')));
20 if (isset($CFG->mnet_dispatcher_mode) and $CFG->mnet_dispatcher_mode !== 'off') {
21 require_once($CFG->dirroot.'/mnet/lib.php');
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');
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'
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'));
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);
54 $fields = mnet_profile_field_options();
55 $forced = implode(', ', $fields['forced']);
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']));
62 } // end of speedup