/** * Export this data so it can be used as the context for a mustache template. * * @param renderer_base $output * @return stdClass */ public function export_for_template(renderer_base $output) { global $USER; $data = new stdClass(); $user = new stdClass(); $user->name = fullname($USER); $user->picture = $output->user_picture($USER, array('link' => false)); $data->user = $user; $data->cmid = $this->cmid; $data->treasurehunt = $this->treasurehunt; if (empty($this->treasurehunt->description)) { $hasdescription = false; } else { $hasdescription = true; } $data->hasdescription = $hasdescription; return $data; }