mirror of
https://github.com/moodle/moodle.git
synced 2025-04-21 16:32:18 +02:00
Show category list rather than the whole list of courses if there is only one category and with more than 200 courses in it
Otherwise we will have a HUGE list of courses flooding our browser. Backported from MOODLE_15_STABLE
This commit is contained in:
parent
48643b4918
commit
765d3c7dde
@ -55,7 +55,7 @@ class block_course_list extends block_list {
|
||||
|
||||
$categories = get_categories("0"); // Parent = 0 ie top-level categories only
|
||||
if ($categories) { //Check we have categories
|
||||
if (count($categories) > 1) { // Just print top level category links
|
||||
if (count($categories) > 1 || (count($categories) == 1 && count_records('course') > 200)) { // Just print top level category links
|
||||
foreach ($categories as $category) {
|
||||
$linkcss = $category->visible ? "" : " class=\"dimmed\" ";
|
||||
$this->content->items[]="<a $linkcss href=\"$CFG->wwwroot/course/category.php?id=$category->id\">$category->name</a>";
|
||||
|
@ -41,7 +41,7 @@
|
||||
if (!$adminediting) {
|
||||
$countcategories = count_records("course_categories");
|
||||
|
||||
if ($countcategories > 1) {
|
||||
if ($countcategories > 1 || ($countcategories == 1 && count_records('course') > 200)) {
|
||||
$strcourses = get_string("courses");
|
||||
$strcategories = get_string("categories");
|
||||
print_header("$site->shortname: $strcategories", $strcourses,
|
||||
|
Loading…
x
Reference in New Issue
Block a user