diff --git a/blocks/community/forms.php b/blocks/community/forms.php index 2e9e7c8daf8..47037865abd 100644 --- a/blocks/community/forms.php +++ b/blocks/community/forms.php @@ -130,8 +130,9 @@ class community_hub_search_form extends moodleform { } } - //display enrol/download select box if the USER has the download capability - if (has_capability('moodle/community:download', get_context_instance(CONTEXT_USER, $USER->id))) { + //display enrol/download select box if the USER has the download capability on the course + if (has_capability('moodle/community:download', + get_context_instance(CONTEXT_COURSE, $this->_customdata['courseid']))) { $options = array(0 => get_string('enrollable', 'block_community'), 1 => get_string('downloadable', 'block_community')); $mform->addElement('select', 'downloadable', get_string('enroldownload', 'block_community'), diff --git a/blocks/community/renderer.php b/blocks/community/renderer.php index f1593715507..eeb91890d98 100644 --- a/blocks/community/renderer.php +++ b/blocks/community/renderer.php @@ -115,17 +115,11 @@ class block_community_renderer extends plugin_renderer_base { array('class' => 'hubcoursedescription')); //create users related information html - $courseuserinfo = ''; - if (!empty($course->contributornames)) { - $course->contributorname = get_string('contributors', 'block_community', - $course->contributorname); - } - if ($course->contributornames) { - $courseuserinfo .= get_string('contributors', 'block_community', - $course->contributornames); - $courseuserinfo .= ' - '; - } $courseuserinfo = get_string('userinfo', 'block_community', $course); + if ($course->contributornames) { + $courseuserinfo .= ' - ' . get_string('contributors', 'block_community', + $course->contributornames); + } $courseuserinfohtml = html_writer::tag('div', $courseuserinfo, array('class' => 'hubcourseuserinfo'));