Index: course/lib.php
===================================================================
RCS file: /cvsroot/moodle/moodle/course/lib.php,v
retrieving revision 1.576
diff -u -r1.576 lib.php
--- course/lib.php	15 Apr 2008 07:23:39 -0000	1.576
+++ course/lib.php	15 Apr 2008 13:13:14 -0000
@@ -783,19 +783,54 @@
             }
         }
     }
-    foreach ($courses as $course) {
-        print_simple_box_start('center', '100%', '', 5, "coursebox");
-        $linkcss = '';
+    
+    // get block content
+    if ($blocks = get_records('block')) {
+        foreach ($blocks as $block) {
+            if (file_exists(dirname(dirname(__FILE__)).'/blocks/'.$block->name.'/block_'.$block->name.'.php')) {
+                require_once(dirname(dirname(__FILE__)).'/blocks/'.$block->name.'/block_'.$block->name.'.php');
+                call_user_func_array(array('block_'.$block->name,'print_overview'),array($courses,&$htmlarray)); 
+            }
+        } 
+    } 
+    
+    foreach ($courses as $course) {     	
+        print_box_start("coursebox");
+        //  Now put a padding div inside the box
+        print_box_start("padded");
+        if (!empty($CFG->allowusermycoursehiding)){
+            $strshow = addslashes_js(get_string('showblocka', 'access',$course->fullname));
+            $strhide = addslashes_js(get_string('hideblocka', 'access',$course->fullname));
+ 
+            echo '<div style="float:left;" ><input type="image" src="'.$CFG->pixpath.'/t/switch_minus.gif" '. 
+                'id="'.$course->id.'" onclick="elementToggleHide(this, true, function(el) {'.
+                'return findParentNode(el, \'DIV\', \'padded\'); },'.
+                ' \''.$strshow.'\', \''.$strhide.'\'); return false;" '.
+                'alt="'.$strhide.'" title="'.$strhide.'" class="hide-show-image" /></div>';
+         }
+        
+    	$linkcss = '';
         if (empty($course->visible)) {
             $linkcss = 'class="dimmed"';
         }
         print_heading('<a title="'. format_string($course->fullname).'" '.$linkcss.' href="'.$CFG->wwwroot.'/course/view.php?id='.$course->id.'">'. format_string($course->fullname).'</a>');
+
+        print_box_start("hidediv");
+        // and the roles
+        $coursecontext = get_context_instance(CONTEXT_COURSE, $course->id);
+        if ($rolestring = get_user_roles_in_context($USER->id, $coursecontext)) {
+            echo ' '. get_string('roles').':'. format_string($rolestring, false).'<br/><br/>';
+        }
+
         if (array_key_exists($course->id,$htmlarray)) {
             foreach ($htmlarray[$course->id] as $modname => $html) {
                 echo $html;
             }
         }
-        print_simple_box_end();
+        //  Close all divs
+        print_box_end();
+        print_box_end();
+        print_box_end();
     }
 }
 
Index: lang/en_utf8/admin.php
===================================================================
RCS file: /cvsroot/moodle/moodle/lang/en_utf8/admin.php,v
retrieving revision 1.192
diff -u -r1.192 admin.php
--- lang/en_utf8/admin.php	15 Mar 2008 16:10:32 -0000	1.192
+++ lang/en_utf8/admin.php	15 Apr 2008 13:13:14 -0000
@@ -12,6 +12,7 @@
 $string['allowrenames'] = 'Allow renames';
 $string['allowuserblockhiding'] = 'Allow users to hide blocks';
 $string['allowusermailcharset'] = 'Allow user to select character set';
+$string['allowusermycoursehiding'] = 'Allow users to hide course information';
 $string['allowuserthemes'] = 'Allow user themes';
 $string['allowvisiblecoursesinhiddencategories'] = 'Allow visible courses in hidden categories';
 $string['antivirus'] = 'Anti-Virus';
@@ -61,6 +62,7 @@
 $string['configallowunenroll'] = 'If this is set \'Yes\', then students are allowed to unenrol themselves from courses whenever they like. Otherwise they are not allowed, and this process will be solely controlled by the teachers and administrators.';
 $string['configallowuserblockhiding'] = 'Do you want to allow users to hide/show side blocks throughout this site?  This feature uses Javascript and cookies to remember the state of each collapsible block, and only affects the user\'s own view.';
 $string['configallowusermailcharset'] = 'Enabling this, every user in the site will be able to specify his own charset for email.';
+$string['configallowusermycoursehiding'] = 'Do you want to allow users to hide/show the information about individual courses on their myMoodle page?  This feature uses Javascript and cookies to remember the state of each collapsible block, and only affects the user\'s own view.';
 $string['configallowuserthemes'] = 'If you enable this, then users will be allowed to set their own themes.  User themes override site themes (but not course themes)';
 $string['configallusersaresitestudents'] = 'For activities on the front page of the site, should ALL users be considered as students?  If you answer \"Yes\", then any confirmed user account will be allowed to participate as a student in those activities.  If you answer \"No\", then only users who are already a participant in at least one course will be able to take part in those front page activities. Only admins and specially assigned teachers can act as teachers for these front page activities.';
 $string['configvisiblecourses'] = 'Display courses in hidden categories normally';
Index: admin/settings/appearance.php
===================================================================
RCS file: /cvsroot/moodle/moodle/admin/settings/appearance.php,v
retrieving revision 1.31
diff -u -r1.31 appearance.php
--- admin/settings/appearance.php	26 Dec 2007 21:33:34 -0000	1.31
+++ admin/settings/appearance.php	15 Apr 2008 13:13:13 -0000
@@ -70,6 +70,7 @@
 
     $temp = new admin_settingpage('mymoodle', get_string('mymoodle', 'admin'));
     $temp->add(new admin_setting_configcheckbox('mymoodleredirect', get_string('mymoodleredirect', 'admin'), get_string('configmymoodleredirect', 'admin'), 0));
+    $temp->add(new admin_setting_configcheckbox('allowusermycoursehiding', get_string('allowusermycoursehiding', 'admin'), get_string('configallowusermycoursehiding', 'admin'), 1));
     $ADMIN->add('appearance', $temp);
 
     // new CFG variable for coursemanager (what roles to display)
