From 3ebc548f9bc14e645c2823879d7754a585a444f4 Mon Sep 17 00:00:00 2001 From: Sam Hemelryk Date: Thu, 3 Jun 2010 06:11:39 +0000 Subject: [PATCH] course MDL-8369 Fixed bug in front page combo list and tweaked CSS --- course/lib.php | 4 +++- theme/base/style/course.css | 4 +++- theme/standard/style/course.css | 5 ++--- 3 files changed, 8 insertions(+), 5 deletions(-) diff --git a/course/lib.php b/course/lib.php index f2f1eeea8db..52fb7d4701b 100644 --- a/course/lib.php +++ b/course/lib.php @@ -1884,7 +1884,9 @@ function get_course_category_tree($id = 0, $depth = 0) { $categoryids[$category->id] = $category; if (empty($CFG->maxcategorydepth) || $depth <= $CFG->maxcategorydepth) { list($category->categories, $subcategories) = get_course_category_tree($category->id, $depth+1); - $categoryids = array_merge($categoryids, $subcategories); + foreach ($subcategories as $subid=>$subcat) { + $categoryids[$subid] = $subcat; + } $category->courses = array(); } } diff --git a/theme/base/style/course.css b/theme/base/style/course.css index fe36edc5796..d7bb6b22be9 100644 --- a/theme/base/style/course.css +++ b/theme/base/style/course.css @@ -90,8 +90,10 @@ /* Course and category combo list on front page */ .course_category_tree .controls {visibility: hidden;} .course_category_tree .controls div {display:inline;cursor:pointer;} -.course_category_tree .category.with_children .category_label {background-image:url([[pix:moodle|t/expanded]]);background-repeat: no-repeat;} +.course_category_tree .category.with_children>.category_label {background-image:url([[pix:moodle|t/expanded]]);background-repeat: no-repeat;} .course_category_tree .category_label {padding-left:13px;} +.course_category_tree .category .category {margin:5px;} +.course_category_tree .category .courses {padding-left:16px;} .course_category_tree .category .courses .course_link {display:block;background-image:url([[pix:moodle|i/course]]);background-repeat: no-repeat;padding-left:18px;} .course_category_tree .category .course {position:relative;} .course_category_tree .category .course_info {position:absolute;right:0;top:0;} diff --git a/theme/standard/style/course.css b/theme/standard/style/course.css index bc9281b505f..f34946ec8e5 100644 --- a/theme/standard/style/course.css +++ b/theme/standard/style/course.css @@ -90,16 +90,15 @@ .course_category_tree .controls {margin-bottom:5px;text-align:right;float:right;} .course_category_tree .controls div {padding-right:2em;font-size:75%;} .course_category_tree .category {background-color:#FFF;background-image:url([[pix:theme|hgradient]]);background-repeat: repeat-x;border:1px solid #ddd;margin-bottom:10px;} -.course_category_tree .category .category {margin:5px;} .course_category_tree .category .subcategories {background-color:inherit;padding-left:16px;border:1px solid #FFF;} .course_category_tree .category.with_children .category_label {background-position:3px 3px;} .course_category_tree .category_link .category_link {font-size:95%;} .course_category_tree .category_label {padding-left:13px;} .course_category_tree .category_link {display:block;margin:5px;font-size:120%;font-weight:bold;} -.course_category_tree .category .courses {background-color:inherit;padding-left:16px;} +.course_category_tree .category .courses {background-color:inherit;} .course_category_tree .category .courses .course_link {margin:5px;} .course_category_tree .category .course {border:1px solid #f9f9f9;border-bottom-color: #eee;border-right-width:0;} .course_category_tree .category .course:last-child {border-bottom-color:#f6f6f6;} .course_category_tree .category .course.even {background-color:#f6f6f6;border-color:#eee;border-top-color: #f9f9f9;} .course_category_tree .category .course_info {right:3px;top:3px;} -.course_category_tree .category .course:hover {background-color:#eee;} \ No newline at end of file +.course_category_tree .category .course:hover {background-color:#eee;}