From e7b98680d75d1466854efbf8ae9f3f3cbf60c18e Mon Sep 17 00:00:00 2001 From: dongsheng Date: Wed, 1 Apr 2009 07:39:42 +0000 Subject: [PATCH] "MDL-13224, select how many courses can be shown in mymoodle page, backported from 2.0" --- admin/settings/appearance.php | 1 + my/index.php | 8 +++++--- version.php | 2 +- 3 files changed, 7 insertions(+), 4 deletions(-) diff --git a/admin/settings/appearance.php b/admin/settings/appearance.php index 948b5e0b155..1278df26de2 100644 --- a/admin/settings/appearance.php +++ b/admin/settings/appearance.php @@ -77,6 +77,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) diff --git a/my/index.php b/my/index.php index 449a9541e6a..d077a54501c 100644 --- a/my/index.php +++ b/my/index.php @@ -63,9 +63,11 @@ print_container_start(TRUE); /// 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, $courses_limit); $site = get_site(); $course = $site; //just in case we need the old global $course hack diff --git a/version.php b/version.php index 3ae9f35ed1c..ccef4ce9908 100644 --- a/version.php +++ b/version.php @@ -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 = 2007101545.01; // YYYYMMDD = date of the 1.9 branch (don't change) + $version = 2007101546; // YYYYMMDD = date of the 1.9 branch (don't change) // X = release number 1.9.[0,1,2,3,4,5...] // Y.YY = micro-increments between releases