community hub MDL-19314 fix context issue + contributor name not well displayed

This commit is contained in:
jerome mouneyrac 2010-09-13 07:21:49 +00:00
parent 12fcd26de2
commit 8a3b20ce38
2 changed files with 7 additions and 12 deletions

View File

@ -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'),

View File

@ -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'));