Merge branch 'MDL-66120-36' of git://github.com/peterRd/moodle into MOODLE_36_STABLE
This commit is contained in:
@@ -20,12 +20,12 @@ Feature: Edit capabilities
|
||||
And I set the following system permissions of "Teacher" role:
|
||||
| capability | permission |
|
||||
| block/mnet_hosts:myaddinstance | Allow |
|
||||
| moodle/community:add | Inherit |
|
||||
| moodle/site:messageanyuser | Inherit |
|
||||
| moodle/grade:managesharedforms | Prevent |
|
||||
| moodle/course:request | Prohibit |
|
||||
When I follow "Edit Teacher role"
|
||||
Then "block/mnet_hosts:myaddinstance" capability has "Allow" permission
|
||||
And "moodle/community:add" capability has "Not set" permission
|
||||
And "moodle/site:messageanyuser" capability has "Not set" permission
|
||||
And "moodle/grade:managesharedforms" capability has "Prevent" permission
|
||||
And "moodle/course:request" capability has "Prohibit" permission
|
||||
|
||||
|
||||
@@ -48,54 +48,11 @@ class block_community extends block_list {
|
||||
}
|
||||
|
||||
function get_content() {
|
||||
global $CFG, $OUTPUT, $USER;
|
||||
|
||||
$coursecontext = context::instance_by_id($this->instance->parentcontextid);
|
||||
|
||||
if (!has_capability('moodle/community:add', $coursecontext)
|
||||
or $this->content !== NULL) {
|
||||
return $this->content;
|
||||
}
|
||||
|
||||
$this->content = new stdClass();
|
||||
$this->content->items = array();
|
||||
$this->content->icons = array();
|
||||
$this->content->footer = '';
|
||||
|
||||
if (!isloggedin()) {
|
||||
return $this->content;
|
||||
}
|
||||
|
||||
$icon = $OUTPUT->pix_icon('i/group', get_string('group'));
|
||||
$addcourseurl = new moodle_url('/blocks/community/communitycourse.php',
|
||||
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;
|
||||
|
||||
require_once($CFG->dirroot . '/blocks/community/locallib.php');
|
||||
$communitymanager = new block_community_manager();
|
||||
$courses = $communitymanager->block_community_get_courses($USER->id);
|
||||
if ($courses) {
|
||||
$this->content->items[] = html_writer::empty_tag('hr');
|
||||
$this->content->icons[] = '';
|
||||
$this->content->items[] = get_string('mycommunities', 'block_community');
|
||||
$this->content->icons[] = '';
|
||||
foreach ($courses as $course) {
|
||||
//delete link
|
||||
$deleteicon = $OUTPUT->pix_icon('t/delete', get_string('removecommunitycourse', 'block_community'));
|
||||
$deleteurl = new moodle_url('/blocks/community/communitycourse.php',
|
||||
array('remove' => true,
|
||||
'courseid' => $this->page->course->id,
|
||||
'communityid' => $course->id, 'sesskey' => sesskey()));
|
||||
$deleteatag = html_writer::tag('a', $deleteicon, array('href' => $deleteurl));
|
||||
|
||||
$courselink = html_writer::tag('a', $course->coursename,
|
||||
array('href' => $course->courseurl));
|
||||
$this->content->items[] = $courselink . ' ' . $deleteatag;
|
||||
$this->content->icons[] = '';
|
||||
}
|
||||
}
|
||||
$this->content->items[] = get_string('functionalityremoved', 'error');
|
||||
|
||||
return $this->content;
|
||||
}
|
||||
|
||||
@@ -262,6 +262,7 @@ $string['filternotactive'] = 'Filter {$a} is not currently active';
|
||||
$string['filternotenabled'] = 'Filter not enabled!';
|
||||
$string['filternotinstalled'] = 'Filter {$a} is not currently installed';
|
||||
$string['forumblockingtoomanyposts'] = 'You have exceeded the posting threshold set for this forum';
|
||||
$string['functionalityremoved'] = 'You are trying to access functionality that has been removed.';
|
||||
$string['generalexceptionmessage'] = 'Exception - {$a}';
|
||||
$string['gradepubdisable'] = 'Grade publishing disabled';
|
||||
$string['gradesneedregrading'] = 'The course grades need to be recalculated';
|
||||
|
||||
+1
-1
@@ -29,7 +29,7 @@
|
||||
|
||||
defined('MOODLE_INTERNAL') || die();
|
||||
|
||||
$version = 2018120305.10; // 20181203 = branching date YYYYMMDD - do not modify!
|
||||
$version = 2018120305.11; // 20181203 = branching date YYYYMMDD - do not modify!
|
||||
// RR = release increments - 00 in DEV branches.
|
||||
// .XX = incremental changes.
|
||||
|
||||
|
||||
Reference in New Issue
Block a user