Automatic installer.php lang files by installer_builder (20070726)
[moodle-linuxchix.git] / admin / mnet / enr_courses.php
blob7e09e5fba2e318fed75057aa57d90e318f283729
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 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);
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 . '/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();