Skip to content

Commit

Permalink
Merge branch 'MDL-31466-m22' of git://github.com/ankitagarwal/moodle …
Browse files Browse the repository at this point in the history
…into MOODLE_22_STABLE
  • Loading branch information
Sam Hemelryk committed Mar 4, 2012
2 parents d736ed9 + 72ffaf4 commit 5c3c0a8
Showing 1 changed file with 4 additions and 8 deletions.
12 changes: 4 additions & 8 deletions tag/coursetagslib.php
Expand Up @@ -395,15 +395,11 @@ function coursetag_get_tagged_courses($tagid) {
$courses = array(); $courses = array();
if ($crs = $DB->get_records_select('tag_instance', "tagid=:tagid AND itemtype='course'", array('tagid'=>$tagid))) { if ($crs = $DB->get_records_select('tag_instance', "tagid=:tagid AND itemtype='course'", array('tagid'=>$tagid))) {
foreach ($crs as $c) { foreach ($crs as $c) {
//this capability check was introduced to stop display of courses that a student could not $course = $DB->get_record('course', array('id'=>$c->itemid));
//view, but arguably it is best that when clicking on a tag, the tagged course summary should // check if the course is hidden
//be seen and then if the student clicks on that they will be given the opportunity to join if ($course->visible == 1 || has_capability('moodle/course:viewhiddencourses', context_course::instance($course->id))) {
//note courses not visible should not have their tagid sent to this function
// $context = get_context_instance(CONTEXT_COURSE, $c->itemid);
//if (is_enrolled($context) oe is_viewing($context)) {
$course = $DB->get_record('course', array('id'=>$c->itemid));
$courses[$c->itemid] = $course; $courses[$c->itemid] = $course;
//} }
} }
} }
return $courses; return $courses;
Expand Down

0 comments on commit 5c3c0a8

Please sign in to comment.