Skip to content

Commit

Permalink
Few small fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
vyshane committed Sep 19, 2006
1 parent f2269f3 commit 285f94f
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions lib/datalib.php
Expand Up @@ -506,9 +506,10 @@ function get_courses($categoryid="all", $sort="c.sortorder ASC", $fields="c.*")
// loop throught them
foreach ($courses as $course) {

if ($course->visible <= 0) {
if (isset($course->visible) && $course->visible <= 0) {
// for hidden courses, require visibility check
if (has_capability('moodle/course:viewhiddencourses', get_context_instance(CONTEXT_COURSE, $course->id))) {
if (has_capability('moodle/course:viewhiddencourses',
get_context_instance(CONTEXT_COURSE, $course->id))) {
$visiblecourses [] = $course;
}
} else {
Expand Down Expand Up @@ -586,7 +587,7 @@ function get_courses_page($categoryid="all", $sort="c.sortorder ASC", $fields="c
$limitnum = count($courses);
}

if (!limitfrom) {
if (!$limitfrom) {
$limitfrom = 0;
}

Expand Down

0 comments on commit 285f94f

Please sign in to comment.