Commit 45ad1693 authored by Sam Hemelryk's avatar Sam Hemelryk
Browse files

MDL-47183 post-integration fixes

* Fixed typo with context_module::instance
* Fixed use of $mod->get_context()
parent 5baf74a3
......@@ -128,7 +128,7 @@ class block_site_main_menu extends block_list {
} else {
$editbuttons = '';
}
if ($mod->visible || has_capability('moodle/course:viewhiddenactivities', $mod->get_context())) {
if ($mod->visible || has_capability('moodle/course:viewhiddenactivities', $mod->context)) {
if ($ismoving) {
if ($mod->id == $USER->activitycopy) {
continue;
......
......@@ -130,7 +130,7 @@ class block_social_activities extends block_list {
} else {
$editbuttons = '';
}
if ($mod->visible || has_capability('moodle/course:viewhiddenactivities', $mod->get_context())) {
if ($mod->visible || has_capability('moodle/course:viewhiddenactivities', $mod->context)) {
if ($ismoving) {
if ($mod->id == $USER->activitycopy) {
continue;
......
......@@ -79,7 +79,7 @@ class format_singleactivity extends format_base {
$orphanednode->nodetype = navigation_node::NODETYPE_BRANCH;
$orphanednode->add_class('orphaned');
foreach ($modinfo->sections[1] as $cmid) {
if (has_capability('moodle/course:viewhiddenactivities', context_module($cmid))) {
if (has_capability('moodle/course:viewhiddenactivities', context_module::instance($cmid))) {
$this->navigation_add_activity($orphanednode, $modinfo->cms[$cmid]);
}
}
......
......@@ -770,7 +770,7 @@ class core_course_renderer extends plugin_renderer_base {
if ($mod->uservisible) {
$conditionalhidden = $this->is_cm_conditionally_hidden($mod);
$accessiblebutdim = (!$mod->visible || $conditionalhidden) &&
has_capability('moodle/course:viewhiddenactivities', $mod->get_context());
has_capability('moodle/course:viewhiddenactivities', $mod->context);
if ($accessiblebutdim) {
$linkclasses .= ' dimmed';
$textclasses .= ' dimmed_text';
......@@ -827,7 +827,7 @@ class core_course_renderer extends plugin_renderer_base {
if ($mod->uservisible) {
$conditionalhidden = $this->is_cm_conditionally_hidden($mod);
$accessiblebutdim = (!$mod->visible || $conditionalhidden) &&
has_capability('moodle/course:viewhiddenactivities', $mod->get_context());
has_capability('moodle/course:viewhiddenactivities', $mod->context);
if ($accessiblebutdim) {
$textclasses .= ' dimmed_text';
if ($conditionalhidden) {
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment