$icon = html_writer::empty_tag('img', array('src' => $OUTPUT->pix_url('i/group'),
'class' => 'icon', 'alt' => get_string('addcourse', 'block_community')));
$addcourseurl = new moodle_url('/blocks/community/communitycourse.php',
- array('add' => true, 'courseid' => $coursecontext->instanceid));
+ array('add' => true, 'courseid' => $this->page->course->id));
$searchlink = html_writer::tag('a', $icon . ' ' . get_string('addcourse', 'block_community'),
array('href' => $addcourseurl->out(false)));
$this->content->items[] = $searchlink;
'alt' => get_string('removecommunitycourse', 'block_community')));
$deleteurl = new moodle_url('/blocks/community/communitycourse.php',
array('remove' => true,
- 'courseid' => $coursecontext->instanceid,
+ 'courseid' => $this->page->course->id,
'communityid' => $course->id, 'sesskey' => sesskey()));
$deleteatag = html_writer::tag('a', $deleteicon, array('href' => $deleteurl));