mirror of
https://github.com/moodle/moodle.git
synced 2025-08-05 00:46:50 +02:00
MDL-68974 calendar: Use page context for block check
This commit is contained in:
parent
5c91f31d2e
commit
a35b0464b1
1 changed files with 4 additions and 1 deletions
|
@ -1281,9 +1281,12 @@ class calendar_information {
|
|||
* @param string|null $view preference view options (eg: day, month, upcoming)
|
||||
*/
|
||||
public function add_sidecalendar_blocks(core_calendar_renderer $renderer, $showfilters=false, $view=null) {
|
||||
if (!has_capability('moodle/block:view', $this->context) ) {
|
||||
global $PAGE;
|
||||
|
||||
if (!has_capability('moodle/block:view', $PAGE->context) ) {
|
||||
return;
|
||||
}
|
||||
|
||||
if ($showfilters) {
|
||||
$filters = new block_contents();
|
||||
$filters->content = $renderer->event_filter();
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue