Render the purposes management page.

@param purposes $page
@return string html for the page
@throws moodle_exception
428489
public function render_purposes(purposes $page) {
        $data = $page->export_for_template($this);
        return parent::render_from_template('tool_dataprivacy/purposes', $data);
    }
382679
public function render_print_book_page(print_book_page $page) {
        $data = $page->export_for_template($this);
        return parent::render_from_template('booktool_print/print_book', $data);
    }
1369546
public function render_html_page(exported_html_page $page) {
        $data = $page->export_for_template($this);
        return parent::render_from_template('core_privacy/htmlpage', $data);
    }
844693
private function processContext(&$page, $theme, Context $context, $contextType)
    {
        $layout     = $context->getCurrentLayout();
        $isEditMode = $context->isTemporary();

        if (!$layout) {
            return;
        }

        if ($isEditMode) {
            // @todo drupal_add_js() to be removed
            drupal_add_js(['ucmsLayout' => ['editToken' => $context->getToken(), 'layoutId'  => $layout->getId()]], 'setting');
        }

        foreach ($this->contextManager->getThemeRegionConfig($theme) as $name => $regionStatus) {

            if ($contextType !== (int)$regionStatus) {
                continue; // This region does not belong to us
            }

            // Preload all nodes for performance.
            $items      = [];
            $region     = $layout->getRegion($name);

            /* @var $item Item */
            foreach ($region as $item) {

                // Nodes are preloaded before
                $nodeId = $item->getNodeId();
                $node   = $this->getNode($nodeId);
                $mode   = $item->getViewMode();

                if ($node && $node->access('view')) {
                    $items[] = [
                        '#theme'     => 'ucms_layout_item',
                        '#nid'       => $nodeId,
                        '#node'      => $node,
                        '#view_mode' => $mode,
                        '#region'    => $region,
                    ];
                }
            }

            if ($isEditMode && empty($items) && empty($page[$name])) {
                // Trick block.module so that it's not "empty"
                $items = ['#markup' => ''];
            }

            if ($items) {
                $page[$name] = $items;
            }
        }
    }
550820
public function render_user_competency_summary(user_competency_summary $page) {
        $data = $page->export_for_template($this);
        return parent::render_from_template('tool_lp/user_competency_summary', $data);
    }
165627
public function getTemplate(Page $page)
    {
        $this->authorize('editTemplate', $page);

        return view("$this->viewPrefix.template", [
            'current'   => $page->getTemplate(),
            'templates' => TemplateFacade::findValid(),
        ]);
    }
234129
public function renderBoxesSettings()
    {
        $this->reloadContent();

        // fetch all boxes
        $parameters = $this->getContext()->container->getParameters();

        // fetch all pages
        $pages = $this->em->getRepository('WebCMS\Entity\Page')->findBy(array(
            'language' => $this->state->language,
        ));

        $boxesAssoc = array();
        foreach ($pages as $page) {
            if ($page->getParent() != NULL) {
                $module = $this->createObject($page->getModuleName());

                foreach ($module->getBoxes() as $box) {
                    $boxesAssoc[$page->getId().'-'.$box['module'].'-'.$box['presenter'].'-'.$box['function']] = $page->getTitle().' - '.$this->translation[$box['name']];
                }
            }
        }

        $boxesAssoc = array(
            0 => $this->translation['Box is not linked.'],
            ) + $boxesAssoc;

        $boxesAssocError = array();
        foreach ($parameters['boxes'] as $name => $status) {
            
            $criteria = new \Doctrine\Common\Collections\Criteria();
            $criteria->where($criteria->expr()->eq('box', $name));
            $criteria->andWhere($criteria->expr()->isNull('pageTo'));

            $enabled = $this->em->getRepository('WebCMS\Entity\Box')->matching($criteria);

            if ($enabled->isEmpty()) {
                $boxesAssocError[$name] = false;
            } else {
                $boxesAssocError[$name] = true;
            }
        }

        $this->template->boxes = $parameters['boxes'];
        $this->template->pages = $pages;
        $this->template->boxesAssoc = $boxesAssoc;
        $this->template->boxesAssocError = $boxesAssocError;
    }
1304617
protected function renderPage($page, $options = array()) {
        $this->render(__DIR__ . DIRECTORY_SEPARATOR . 'views' . DIRECTORY_SEPARATOR . $page . '.php', $options);
    }
101049
private function renderPage(Page $page, Request $request)
    {
        return $this->get('synapse')
            ->createDecorator($page)
            ->decorate(array(
                'page' => $page,
                'request' => $request,
            ))
        ;
    }
1322617
public function render_user_evidence_list_page(user_evidence_list_page $page) {
        $data = $page->export_for_template($this);
        return parent::render_from_template('tool_lp/user_evidence_list_page', $data);
    }
1352759
public function initialise_rating_javascript(moodle_page $page) {
        global $CFG;

        // Only needs to be initialized once.
        static $done = false;
        if ($done) {
            return true;
        }

        $page->requires->js_init_call('M.core_rating.init');
        $done = true;

        return true;
    }
650978
public function render_template_competencies_page(template_competencies_page $page) {
        $data = $page->export_for_template($this);
        return parent::render_from_template('tool_lp/template_competencies_page', $data);
    }
830271
public function render_head_html($page = null) {
        if (is_null($page)) {
            global $PAGE;
            $page = $PAGE;
        }
        // TODO go via behaviour.
        return $this->question->get_renderer($page)->head_code($this) .
                $this->behaviour->get_renderer($page)->head_code($this);
    }
664422
public function viewAction(Request $request, ContentTypeGroup $group, int $page = 1): Response
    {
        return $this->render('@ezdesign/admin/content_type_group/view.html.twig', [
            'content_type_group' => $group,
            'page' => $page,
            'route_name' => $request->get('_route'),
        ]);
    }
621559
public function render_plan_page(plan_page $page) {
        $data = $page->export_for_template($this);
        return parent::render_from_template('tool_lp/plan_page', $data);
    }
500208
public function requestApproval(Page $page)
    {
        $this->authorize('edit', $page);

        $page->markUpdatesAsPendingApproval();

        Event::fire(new Events\PageApprovalRequested($page, auth()->user()));

        return $page->getCurrentVersion()->getStatus();
    }
205366
public function render_data_registry_page(data_registry_page $page) {
        $data = $page->export_for_template($this);
        return parent::render_from_template('tool_dataprivacy/data_registry', $data);
    }