mirror of
https://github.com/moodle/moodle.git
synced 2025-04-15 13:33:52 +02:00
community hub MDL-19314 fix context issue + contributor name not well displayed
This commit is contained in:
parent
12fcd26de2
commit
8a3b20ce38
@ -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'),
|
||||
|
@ -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'));
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user