/**
  * Export the data.
  *
  * @param renderer_base $output
  * @return stdClass
  */
 public function export_for_template(\renderer_base $output)
 {
     $data = new stdClass();
     $userevidencesummaryexporter = new user_evidence_summary_exporter($this->userevidence, array('context' => $this->context));
     $data->userevidence = $userevidencesummaryexporter->export($output);
     $data->pluginbaseurl = (new moodle_url('/admin/tool/lp'))->out(true);
     return $data;
 }
 /**
  * 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)
 {
     $data = new stdClass();
     $data->userid = $this->userid;
     $data->pluginbaseurl = (new moodle_url('/admin/tool/lp'))->out(true);
     $data->canmanage = $this->canmanage;
     $data->evidence = array();
     if ($this->evidence) {
         foreach ($this->evidence as $evidence) {
             $userevidencesummaryexporter = new user_evidence_summary_exporter($evidence, array('context' => $this->context));
             $data->evidence[] = $userevidencesummaryexporter->export($output);
         }
     }
     $data->navigation = array();
     foreach ($this->navigation as $button) {
         $data->navigation[] = $output->render($button);
     }
     return $data;
 }
Example #3
0
 /**
  * Returns description of external function result value.
  *
  * @return \external_description
  */
 public static function data_for_user_evidence_page_returns()
 {
     return new external_single_structure(array('userevidence' => user_evidence_summary_exporter::get_read_structure(), 'pluginbaseurl' => new external_value(PARAM_LOCALURL, 'Url to the tool_lp plugin folder on this Moodle site')));
 }