Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
MDL-6216 print_category_info no longer counts invisible courses if th…
…e user does't have permission to see them.
  • Loading branch information
jmg324 committed Jan 10, 2008
1 parent 18159e2 commit 7ffcbfe
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions course/lib.php
Expand Up @@ -1734,8 +1734,8 @@ function print_category_info($category, $depth, $files = false) {

echo "\n\n".'<table class="categorylist">';

$courses = get_courses($category->id, 'c.sortorder ASC', 'c.id,c.sortorder,c.visible,c.fullname,c.shortname,c.password,c.summary,c.guest,c.cost,c.currency');
if ($files and $coursecount) {
$courses = get_courses($category->id, 'c.sortorder ASC', 'c.id,c.sortorder,c.visible,c.fullname,c.shortname,c.password,c.summary,c.guest,c.cost,c.currency');

echo '<tr>';

Expand Down Expand Up @@ -1798,8 +1798,8 @@ function print_category_info($category, $depth, $files = false) {
echo '<a '.$catlinkcss.' href="'.$CFG->wwwroot.'/course/category.php?id='.$category->id.'">'. format_string($category->name).'</a>';
echo '</td>';
echo '<td valign="top" class="category number">';
if ($category->coursecount) {
echo $category->coursecount;
if (count($courses)) {
echo count($courses);
}
echo '</td></tr>';
}
Expand Down

0 comments on commit 7ffcbfe

Please sign in to comment.