Updated the 19 build version to 20101023
[moodle.git] / admin / mnet / enr_courses.php
blob79aad8fa06faa9bed6df47bec50f855458d14d97
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 if (!confirm_sesskey()) {
9 print_error('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);
24 /// Print the page
26 admin_externalpage_print_header();
28 print_box('<strong>' . s($host->name) . ' </strong><br />'
29 . get_string("enrolcourses_desc", "mnet"));
31 echo '<hr />';
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/$CFG->admin/mnet/enr_course_enrol.php?"
41 . "host={$mnethost}&amp;courseid={$course->id}&amp;sesskey={$USER->sesskey}";
42 echo '<tr>'
43 . "<td>$icon</td>"
44 . "<td><a href=\"$link\">".format_string($course->fullname). "</a></td>"
45 . '</tr><tr>'
46 . '<td></td>'
47 . '<td>'.format_string($course->shortname). ' - ' .format_string($course->cat_name).'</td>'
48 . '</tr><tr>'
49 . '<td></td>'
50 . "<td align=\"left\" >{$course->summary}</td>"
51 . '</tr>';
53 echo '</table></div>';
55 admin_externalpage_print_footer();