/** * Defer to template. * * @param plan_page $page * @return bool|string */ public function render_plan_page(plan_page $page) { $data = $page->export_for_template($this); return parent::render_from_template('tool_lp/plan_page', $data); }
/** * Loads the data required to render the plan_page template. * * @param int $planid Learning Plan id. * @return boolean */ public static function data_for_plan_page($planid) { global $PAGE; $params = self::validate_parameters(self::data_for_plan_page_parameters(), array('planid' => $planid)); $plan = api::read_plan($params['planid']); self::validate_context($plan->get_context()); $renderable = new output\plan_page($plan); $renderer = $PAGE->get_renderer('tool_lp'); $data = $renderable->export_for_template($renderer); return $data; }