General developer forum

init_requirements_data

 
Picture of Tony Finlay
init_requirements_data
 
I was wondering if it was possible to unset some of the regions $params in red below either by extending the page_requirements_manager or by any other method?


protected function init_requirements_data(moodle_page $page, core_renderer $renderer) {
        global $CFG;

        // Init the js config.
        $this->get_config_for_javascript($page, $renderer);

        // Accessibility stuff.
        $this->skip_link_to('maincontent', get_string('tocontent', 'access'));

        // Add strings used on many pages.
        $this->string_for_js('confirmation', 'admin');
        $this->string_for_js('cancel', 'moodle');
        $this->string_for_js('yes', 'moodle');

        // Alter links in top frame to break out of frames.
        if ($page->pagelayout === 'frametop') {
            $this->js_init_call('M.util.init_frametop');
        }

        // Include block drag/drop if editing is on
        if ($page->user_is_editing()) {
            $params = array(
                'courseid' => $page->course->id,
                'pagetype' => $page->pagetype,
                'pagelayout' => $page->pagelayout,
                'subpage' => $page->subpage,
                'regions' => $page->blocks->get_regions(),
                'contextid' => $page->context->id,
            );
            if (!empty($page->cm->id)) {
                $params['cmid'] = $page->cm->id;
            }

            // Strings for drag and drop.
            $this->strings_for_js(array('movecontent',
                                        'tocontent',
                                        'emptydragdropregion'),
                                  'moodle');
            $page->requires->yui_module('moodle-core-blocks', 'M.core_blocks.init_dragdrop', array($params), null, true);
        }

        // Include the YUI CSS Modules.
        $page->requires->set_yuicssmodules($page->theme->yuicssmodules);
    }
 
Average of ratings: -