Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse code

mnet: introducing print_remote_host()... and use it in print_my_cours…

…es()
  • Loading branch information...
commit 643b67b8b8b399618334d41be3aa78475f48d0a3 1 parent 86dd62a
authored January 19, 2007

Showing 1 changed file with 21 additions and 3 deletions. Show diff stats Hide diff stats

  1. 24  course/lib.php
24  course/lib.php
@@ -1840,7 +1840,7 @@ function print_my_moodle() {
1840 1840
     $rcourses = array();
1841 1841
     if ($CFG->mnet_dispatcher_mode === 'strict') {
1842 1842
         $rcourses = get_my_remotecourses($USER->id);
1843  
-        $rhosts   = get_my_remotehosts($USER->id);
  1843
+        $rhosts   = get_my_remotehosts();
1844 1844
     }
1845 1845
 
1846 1846
     if (!empty($courses) || !empty($rcourses) || !empty($rhosts)) {
@@ -1863,7 +1863,7 @@ function print_my_moodle() {
1863 1863
         } elseif (!empty($rhosts)) {
1864 1864
             // non-IDP, we know of all the remote servers, but not courses
1865 1865
             foreach ($rhosts as $host) {
1866  
-                // print_remote_host($host, "100%");
  1866
+                print_remote_host($host, "100%");
1867 1867
             }
1868 1868
         }
1869 1869
         unset($course);
@@ -1929,7 +1929,7 @@ function print_remote_course($course, $width="100%") {
1929 1929
 
1930 1930
     $url = "{$CFG->wwwroot}/auth/mnet/jump.php?hostid={$course->hostid}&wantsurl=/course/view.php?id={$course->remoteid}";
1931 1931
 
1932  
-    echo '<div class="coursebox">';
  1932
+    echo '<div class="coursebox remotecoursebox">';
1933 1933
     echo '<div class="info">';
1934 1934
     echo '<div class="name"><a title="'.get_string('entercourse').'"'.
1935 1935
          $linkcss.' href="'.$url.'">'
@@ -1947,6 +1947,24 @@ function print_remote_course($course, $width="100%") {
1947 1947
     echo '<div class="clearer"></div>';
1948 1948
 }
1949 1949
 
  1950
+function print_remote_host($host, $width="100%") {
  1951
+
  1952
+    global $CFG, $USER;
  1953
+
  1954
+    $linkcss = '';
  1955
+
  1956
+    echo '<div class="coursebox">';
  1957
+    echo '<div class="info">';
  1958
+    echo '<div class="name">';
  1959
+    echo '<img src="'.$CFG->pixpath.'/i/mnethost.gif" class="icon" alt="'.get_string('course').'" />';
  1960
+    echo '<a title="'.s($host['name']).'" href="'.s($host['url']).'">'
  1961
+        . s($host['name']).'</a> - ';
  1962
+    echo $host['count'] . get_string('courses');
  1963
+    echo '</div>';
  1964
+    echo '</div>';
  1965
+    echo '<div class="clearer"></div>';
  1966
+}
  1967
+
1950 1968
 
1951 1969
 /// MODULE FUNCTIONS /////////////////////////////////////////////////////////////////
1952 1970
 

0 notes on commit 643b67b

Please sign in to comment.
Something went wrong with that request. Please try again.