Skip to content

Commit

Permalink
MDL-47183 post-integration fixes
Browse files Browse the repository at this point in the history
* Fixed typo with context_module::instance
* Fixed use of $mod->get_context()
  • Loading branch information
Sam Hemelryk committed Oct 28, 2014
1 parent 5baf74a commit 45ad169
Show file tree
Hide file tree
Showing 4 changed files with 5 additions and 5 deletions.
2 changes: 1 addition & 1 deletion blocks/site_main_menu/block_site_main_menu.php
Original file line number Diff line number Diff line change
Expand Up @@ -128,7 +128,7 @@ function get_content() {
} 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;
Expand Down
2 changes: 1 addition & 1 deletion blocks/social_activities/block_social_activities.php
Original file line number Diff line number Diff line change
Expand Up @@ -130,7 +130,7 @@ function get_content() {
} 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;
Expand Down
2 changes: 1 addition & 1 deletion course/format/singleactivity/lib.php
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,7 @@ public function extend_course_navigation($navigation, navigation_node $node) {
$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]);
}
}
Expand Down
4 changes: 2 additions & 2 deletions course/renderer.php
Original file line number Diff line number Diff line change
Expand Up @@ -770,7 +770,7 @@ public function course_section_cm_name(cm_info $mod, $displayoptions = array())
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';
Expand Down Expand Up @@ -827,7 +827,7 @@ public function course_section_cm_text(cm_info $mod, $displayoptions = array())
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) {
Expand Down

0 comments on commit 45ad169

Please sign in to comment.