Index: lang/en_utf8/my.php
===================================================================
RCS file: /cvsroot/moodle/moodle/lang/en_utf8/my.php,v
retrieving revision 1.3
diff -u -r1.3 my.php
--- lang/en_utf8/my.php	1 Nov 2006 09:44:07 -0000	1.3
+++ lang/en_utf8/my.php	15 Apr 2008 13:43:14 -0000
@@ -3,9 +3,10 @@
 
 
 $string['mymoodle'] = 'Overview of my courses';
+$string['mycourses'] = 'My courses';
 $string['nocourses'] = 'No course information to show.';
 $string['noguest'] = 'The \'Course Overview\' page is not available to guest users';
 $string['pinblocks'] = 'Configure pinned blocks for my moodle';
 $string['pinblocksexplan'] = 'Any block settings you configure here will be visible (and non-editable) for any user of moodle on their \'my moodle\' overview page.';
-
+$string['sitelevelactivity'] = ' site-level activity';
 ?>
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:43: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';
@@ -213,6 +215,7 @@
 $string['configsessioncookiepath'] = 'If you need to change where browsers send the Moodle cookies, you can change this setting to specify a subdirectory of your web site.  Otherwise the default \'/\' should be fine.';
 $string['configsessiontimeout'] = 'If people logged in to this site are idle for a long time (without loading pages) then they are automatically logged out (their session is ended).  This variable specifies how long this time should be.';
 $string['configshowblocksonmodpages'] = 'Some activity modules support blocks on their pages.  If you turn this on, then teachers will be able to add side blocks on those pages, otherwise the interface does not show this feature.';
+$string['configshowsiteactivity'] = 'Do you want to display the activity in modules at the top level of the site on the myMoodle page?';
 $string['configshowsiteparticipantslist'] = 'All of these site students and site teachers will be listed on the site participants list. Who shall be allowed to see this site participants list?';
 $string['configsitemailcharset'] = 'All the emails generated by your site will be sent in the charset specified here. Anyway, every individual user will be able to adjust it if the next setting is enabled.';
 $string['configsitepolicy'] = 'If you have a site policy that all users must see and agree to before using this site, then specify the URL to it here, otherwise leave this field blank.  The URL can point to anywhere - one convenient place would be a file in the site files.  eg http://yoursite/file.php/1/policy.html';
@@ -625,6 +628,7 @@
 $string['sessionhandling'] = 'Session Handling';
 $string['sessiontimeout'] = 'Timeout';
 $string['showblocksonmodpages'] = 'Show blocks on module pages';
+$string['showsiteactivity'] = 'Show site level activity';
 $string['simpletest'] = 'Unit tests';
 $string['sitelangchanged'] = 'Site language setting changed successfully';
 $string['sitemailcharset'] = 'Character set';
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:43:14 -0000
@@ -70,6 +70,8 @@
 
     $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'), 0));
+    $temp->add(new admin_setting_configcheckbox('showsiteactivity', get_string('showsiteactivity', 'admin'), get_string('configshowsiteactivity', 'admin'), 0));
     $ADMIN->add('appearance', $temp);
 
     // new CFG variable for coursemanager (what roles to display)
Index: my/index.php
===================================================================
RCS file: /cvsroot/moodle/moodle/my/index.php,v
retrieving revision 1.18
diff -u -r1.18 index.php
--- my/index.php	9 Apr 2008 02:46:55 -0000	1.18
+++ my/index.php	15 Apr 2008 13:43:14 -0000
@@ -69,6 +69,13 @@
     $site = get_site();
     $course = $site; //just in case we need the old global $course hack
 
+   if (!empty($CFG->showsiteactivity)) {
+
+        //Now get the site course record and print the module entries for that.
+        print_site_overview( $site );
+        print_heading( get_string( 'mycourses', 'my' ) ); 
+    }
+
     if (array_key_exists($site->id,$courses)) {
         unset($courses[$site->id]);
     }
@@ -116,4 +123,68 @@
 
     print_footer();
 
+    // function to output site level activity
+    function print_site_overview( $site ) {
+
+        global $CFG, $USER;
+
+        //The lastaccess time for the site course is not held - so use lastlogin.
+        $site->lastaccess = $USER->lastlogin;
+        $sitearr = array( $site->id => $site );
+
+        $htmlarray = array();
+        if ($modules = get_records('modules')) {
+            foreach ($modules as $mod) {
+                if (file_exists(dirname(dirname(__FILE__)).'/mod/'.$mod->name.'/lib.php')) {
+                    require_once(dirname(dirname(__FILE__)).'/mod/'.$mod->name.'/lib.php');
+                    $fname = $mod->name.'_print_overview';
+                    if (function_exists($fname)) {
+                        $fname($sitearr,$htmlarray);
+                    }
+                }
+            }
+        }
+
+       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($sitearr,&$htmlarray)); 
+                }
+            }
+        }
+
+        if( !(array_key_exists($site->id,$htmlarray) ) ){
+             print_simple_box(get_string('noactivity','my'),'center');
+        }else{
+
+            print_box_start('coursebox', 'mymoodlebox');
+            //  Now put a padding div inside the box
+            print_box_start('padded', 'mymoodlecontent');
+
+             if (!empty($CFG->allowusermycoursehiding)){
+                $strshow = addslashes_js(get_string('showblocka', 'access',$site->fullname));
+                $strhide = addslashes_js(get_string('hideblocka', 'access',$site->fullname));
+                echo '<div style="float:left;" ><input type="image" src="'.$CFG->pixpath.'/t/switch_minus.gif" '. 
+                'id="'.$site->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>';
+            }
+            print_heading($site->fullname.get_string( 'sitelevelactivity', 'my' ));
+
+            print_box_start('hidediv');
+
+            if (array_key_exists($site->id,$htmlarray)) {
+                foreach ($htmlarray[$site->id] as $modname => $html) {
+                    echo $html;
+                }
+            }
+
+            //  Close both divs
+            print_box_end();
+            print_box_end();
+            print_box_end();
+        }
+    }
 ?>
