2 // enrol_config.php - allows admin to edit all enrollment variables
3 // Yes, enrol is correct English spelling.
5 require_once(dirname(__FILE__
) . "/../../config.php");
6 require_once($CFG->libdir
.'/adminlib.php');
8 $adminroot = admin_get_root();
9 admin_externalpage_setup('mnetenrol', $adminroot);
10 $CFG->pagepath
= 'admin/mnet';
13 require_once("$CFG->dirroot/enrol/enrol.class.php"); /// Open the factory class
15 $enrolment = enrolment_factory
::factory('mnet');
17 /// Otherwise fill and print the form.
19 /// get language strings
21 admin_externalpage_print_header($adminroot);
23 print_box(get_string("remoteenrolhosts_desc", "mnet"));
27 if (empty($CFG->mnet_dispatcher_mode
) ||
$CFG->mnet_dispatcher_mode
!== 'strict') {
28 print_box(get_string('mnetdisabled','mnet'));
31 print ('<table align="center" cellspacing="0" cellpadding="5" width="500" id="hosts" class="generaltable generalbox" >'
33 . '<th class="header c0"> '.get_string('host', 'mnet').' </th>'
34 . '<th class="header c1"> '.get_string('enrolments', 'mnet').' </th>'
35 . '<th class="header c2"> '.get_string('courses', 'mnet').' </th>'
36 // . '<th class="header c3"> </th>'
38 $hosts = $enrolment->list_remote_servers();
39 foreach ($hosts as $host) {
40 $coursesurl = "{$CFG->wwwroot}/admin/mnet/enr_courses.php?host={$host->id}&sesskey={$USER->sesskey}";
41 $coursecount = get_field_sql("SELECT count(id) FROM {$CFG->prefix}mnet_enrol_course WHERE hostid={$host->id}");
42 if (empty($coursecount)) {
45 $enrolcount = get_field_sql("SELECT count(id) FROM {$CFG->prefix}mnet_enrol_assignments WHERE hostid={$host->id}");
48 . "<td><a href=\"{$coursesurl}\">{$host->name}</a></td>"
49 . "<td align=\"center\" >$enrolcount</td>"
50 . "<td align=\"center\" >$coursecount - <a href=\"{$coursesurl}\">".get_string('editenrolments', 'mnet')."</a></td>"
51 // TODO: teach report/log/index.php to show per-host-logs
52 // . '<td align="center" ><a href="{$CFG->wwwroot}/admin/report/log/index.php?course_host={$host->id}">'
53 // . get_string('logs', 'mnet').'</a> </td>'
58 admin_externalpage_print_footer($adminroot);