mirror of
https://github.com/moodle/moodle.git
synced 2025-01-18 05:58:34 +01:00
Fixes for course ordering in one category
This commit is contained in:
parent
f853105459
commit
90c2ca2e68
@ -984,6 +984,7 @@ function print_courses_sideblock($category=0, $width="100%") {
|
||||
$modicon[]=$icon;
|
||||
}
|
||||
} else { // Just print course names of single category
|
||||
$category = array_shift($categories);
|
||||
$courses = get_courses($category);
|
||||
if ($courses) {
|
||||
foreach ($courses as $course) {
|
||||
@ -1010,8 +1011,14 @@ function print_courses($category, $width="100%") {
|
||||
global $CFG, $THEME;
|
||||
|
||||
if (empty($category)) {
|
||||
$categories = NULL;
|
||||
$courses = get_courses(0);
|
||||
$categories = get_categories(0); // Parent = 0 ie top-level categories only
|
||||
if (count($categories) == 1) {
|
||||
$category = array_shift($categories);
|
||||
$courses = get_courses($category);
|
||||
} else {
|
||||
$courses = get_courses(0);
|
||||
}
|
||||
unset($categories);
|
||||
} else {
|
||||
$categories = get_categories($category->id); // sub categories
|
||||
$courses = get_courses($category);
|
||||
|
Loading…
x
Reference in New Issue
Block a user