$rcourses = array();
if ($CFG->mnet_dispatcher_mode === 'strict') {
$rcourses = get_my_remotecourses($USER->id);
- $rhosts = get_my_remotehosts($USER->id);
+ $rhosts = get_my_remotehosts();
}
if (!empty($courses) || !empty($rcourses) || !empty($rhosts)) {
} elseif (!empty($rhosts)) {
// non-IDP, we know of all the remote servers, but not courses
foreach ($rhosts as $host) {
- // print_remote_host($host, "100%");
+ print_remote_host($host, "100%");
}
}
unset($course);
$url = "{$CFG->wwwroot}/auth/mnet/jump.php?hostid={$course->hostid}&wantsurl=/course/view.php?id={$course->remoteid}";
- echo '<div class="coursebox">';
+ echo '<div class="coursebox remotecoursebox">';
echo '<div class="info">';
echo '<div class="name"><a title="'.get_string('entercourse').'"'.
$linkcss.' href="'.$url.'">'
echo '<div class="clearer"></div>';
}
+function print_remote_host($host, $width="100%") {
+
+ global $CFG, $USER;
+
+ $linkcss = '';
+
+ echo '<div class="coursebox">';
+ echo '<div class="info">';
+ echo '<div class="name">';
+ echo '<img src="'.$CFG->pixpath.'/i/mnethost.gif" class="icon" alt="'.get_string('course').'" />';
+ echo '<a title="'.s($host['name']).'" href="'.s($host['url']).'">'
+ . s($host['name']).'</a> - ';
+ echo $host['count'] . get_string('courses');
+ echo '</div>';
+ echo '</div>';
+ echo '<div class="clearer"></div>';
+}
+
/// MODULE FUNCTIONS /////////////////////////////////////////////////////////////////