/** * Load blocks using the system context, rather than the user's context. * * This is needed because the My Moodle pages set the page context to the * user's context for access control, etc. But the blocks for the system * pages are stored in the system context. */ public function load_blocks($includeinvisible = null) { $origcontext = $this->page->context; $this->page->context = context_system::instance(); parent::load_blocks($includeinvisible); $this->page->context = $origcontext; }
/** * Load blocks using the system context, rather than the user's context. * * This is needed because the My Moodle pages set the page context to the * user's context for access control, etc. But the blocks for the system * pages are stored in the system context. */ public function load_blocks($includeinvisible = null) { $origcontext = $this->page->context; $this->page->context = get_context_instance(CONTEXT_SYSTEM); parent::load_blocks($includeinvisible); $this->page->context = $origcontext; }