mirror of
https://github.com/moodle/moodle.git
synced 2025-08-05 08:56:36 +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)
|
* @param string|null $view preference view options (eg: day, month, upcoming)
|
||||||
*/
|
*/
|
||||||
public function add_sidecalendar_blocks(core_calendar_renderer $renderer, $showfilters=false, $view=null) {
|
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;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
if ($showfilters) {
|
if ($showfilters) {
|
||||||
$filters = new block_contents();
|
$filters = new block_contents();
|
||||||
$filters->content = $renderer->event_filter();
|
$filters->content = $renderer->event_filter();
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue