Automatic installer.php lang files by installer_builder (20070726)
[moodle-linuxchix.git] / admin / mnet / enr_hosts.php
blobec82c2cc43a7e1dd6f1a3d0a52fe4df15405cbff
1 <?PHP // $Id$
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 admin_externalpage_setup('mnetenrol');
9 $CFG->pagepath = 'admin/mnet';
12 require_once("$CFG->dirroot/enrol/enrol.class.php"); /// Open the factory class
14 $enrolment = enrolment_factory::factory('mnet');
16 /// Otherwise fill and print the form.
18 /// get language strings
20 admin_externalpage_print_header();
22 print_box(get_string("remoteenrolhosts_desc", "mnet"));
24 echo '<hr />';
26 if (empty($CFG->mnet_dispatcher_mode) || $CFG->mnet_dispatcher_mode !== 'strict') {
27 print_box(get_string('mnetdisabled','mnet'));
30 echo '<div id="trustedhosts"><!-- See theme/standard/styles_layout.css #trustedhosts .generaltable for rules -->'
31 . '<table cellspacing="0" cellpadding="5" id="hosts" class="generaltable generalbox" >'
32 . '<tr>'
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"> &nbsp; </th>'
37 . '</tr>';
38 $hosts = $enrolment->list_remote_servers();
39 foreach ($hosts as $host) {
40 $coursesurl = "{$CFG->wwwroot}/admin/mnet/enr_courses.php?host={$host->id}&amp;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)) {
43 $coursecount = '?';
45 $enrolcount = get_field_sql("SELECT count(id) FROM {$CFG->prefix}mnet_enrol_assignments WHERE hostid={$host->id}");
47 echo '<tr>'
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>'
54 . '</tr>';
56 echo '</table>'
57 . '</div>';
59 admin_externalpage_print_footer();