]> git.mjollnir.org Git - moodle.git/commitdiff
"MDL-13224, select how many courses can be shown in mymoodle page"
authordongsheng <dongsheng>
Wed, 1 Apr 2009 07:32:57 +0000 (07:32 +0000)
committerdongsheng <dongsheng>
Wed, 1 Apr 2009 07:32:57 +0000 (07:32 +0000)
admin/settings/appearance.php
my/index.php
version.php

index c7f52cd4b476950d37297021865af0b2939f54b8..615d2fafad406a9e32fa47e708f62f0a8af16829 100644 (file)
@@ -88,6 +88,7 @@ if ($hassiteconfig) { // speedup for non-admins, add all caps used on this page
 
     $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_configtext('mycoursesperpage', get_string('mycoursesperpage', 'admin'), get_string('configmycoursesperpage', 'admin'), 21, PARAM_INT));
     $ADMIN->add('appearance', $temp);
 
     // new CFG variable for coursemanager (what roles to display)
index 1c052e6291996d34fe9c2b7df48bd19db540c9e9..651865f66983735c60700642ab8ed08fa24d4a7a 100644 (file)
 /// The main overview in the middle of the page
     
     // limits the number of courses showing up
-    $courses = get_my_courses($USER->id, 'visible DESC,sortorder ASC', '*', false, 21);
+    $courses_limit = 21;
+    if (!empty($CFG->mycoursesperpage) && is_int($CFG->mycoursesperpage)) {
+        $courses_limit = $CFG->mycoursesperpage;
+    }
+    $courses = get_my_courses($USER->id, 'visible DESC,sortorder ASC', '*', false, $CFG->mycoursesperpage);
     $site = get_site();
     $course = $site; //just in case we need the old global $course hack
 
index 4c1b7b54660b06ab2134e3b72f346d6d75e1ba63..d5584f05984b9b04d2526cf3a64191be0ef3ebb5 100644 (file)
@@ -6,7 +6,7 @@
 // This is compared against the values stored in the database to determine
 // whether upgrades should be performed (see lib/db/*.php)
 
-    $version = 2009033100;  // YYYYMMDD   = date of the last version bump
+    $version = 2009040100;  // YYYYMMDD   = date of the last version bump
                             //         XX = daily increments
 
     $release = '2.0 dev (Build: 20090401)';  // Human-friendly version name