MDL-85652 block_site_main_menu: correct page course comparison.

We can only use the "Add activity" control when on site page.
This commit is contained in:
Paul Holden
2025-07-07 17:04:21 +01:00
parent 0365910448
commit 7074b2d85f
@@ -56,12 +56,14 @@ class block_site_main_menu extends block_base {
$this->content->text = $courserenderer->render($output);
$this->content->footer = $courserenderer->course_section_add_cm_control(
course: $course,
section: 0,
sectionreturn: null,
displayoptions: ['inblock' => true],
);
if ($this->page->course->id === SITEID) {
$this->content->footer = $courserenderer->course_section_add_cm_control(
course: $course,
section: 0,
sectionreturn: null,
displayoptions: ['inblock' => true],
);
}
return $this->content;
}
}