From eea78ebc0322d897517c409aab3fb581fb5bc2d0 Mon Sep 17 00:00:00 2001 From: Dan Poltawski Date: Sat, 6 Aug 2011 22:12:07 +0100 Subject: [PATCH] MDL-27295 Course Category View - Only display count when more than 0 courses --- course/lib.php | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/course/lib.php b/course/lib.php index f3c81f7b6ce..a00348f3269 100644 --- a/course/lib.php +++ b/course/lib.php @@ -2265,7 +2265,9 @@ function print_category_info($category, $depth=0, $showcourses = false) { echo '
'; $html = ''; $cat = html_writer::link(new moodle_url('/course/category.php', array('id'=>$category->id)), $fullname, $catlinkcss); - $cat .= html_writer::tag('span', ' ('.count($courses).')', array('title'=>get_string('numberofcourses'), 'class'=>'numberofcourse')); + if (count($courses) > 0) { + $cat .= html_writer::tag('span', ' ('.count($courses).')', array('title'=>get_string('numberofcourses'), 'class'=>'numberofcourse')); + } if ($depth > 0) { for ($i=0; $i< $depth; $i++) {