Permalink
Browse files

MDL-27295 Course Category View - Only display count when more than 0 …

…courses
  • Loading branch information...
1 parent 228d24f commit eea78ebc0322d897517c409aab3fb581fb5bc2d0 @danpoltawski danpoltawski committed Aug 6, 2011
Showing with 3 additions and 1 deletion.
  1. +3 −1 course/lib.php
View
4 course/lib.php
@@ -2265,7 +2265,9 @@ function print_category_info($category, $depth=0, $showcourses = false) {
echo '<div class="categorylist">';
$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++) {

0 comments on commit eea78eb

Please sign in to comment.