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 if (!confirm_sesskey()) {
9 error(get_string('confirmsesskeybad', 'error'));
13 admin_externalpage_setup('mnetenrol');
14 $CFG->pagepath
= 'admin/mnet';
16 require_once("$CFG->dirroot/enrol/enrol.class.php"); /// Open the factory class
17 $enrolment = enrolment_factory
::factory('mnet');
19 $mnethost = required_param('host', PARAM_INT
);
20 $host = get_record('mnet_host', 'id', $mnethost);
22 $courses = $enrolment->fetch_remote_courses($mnethost);
26 admin_externalpage_print_header();
28 print_box('<strong>' . s($host->name
) . ' </strong><br />'
29 . get_string("enrolcourses_desc", "mnet"));
33 echo '<div id="trustedhosts"><!-- See theme/standard/styles_layout.css #trustedhosts .generaltable for rules -->'
34 . '<table class="generaltable">';
36 $icon = "<img src=\"$CFG->pixpath/i/course.gif\"".
37 " class=\"icon\" alt=\"".get_string("course")."\" />";
39 foreach ($courses as $course) {
40 $link = $CFG->wwwroot
. '/admin/mnet/enr_course_enrol.php?'
41 . "host={$mnethost}&courseid={$course->id}&sesskey={$USER->sesskey}";
44 . "<td><a href=\"$link\">".format_string($course->fullname
). "</a></td>"
47 . '<td>'.format_string($course->shortname
). ' - ' .format_string($course->cat_name
).'</td>'
50 . "<td align=\"left\" >{$course->summary}</td>"
53 echo '</table></div>';
55 admin_externalpage_print_footer();