Ejemplo n.º 1
0
 /**
  * Export this data so it can be used as the context for a mustache template.
  *
  * @param renderer_base $output Renderer base.
  * @return stdClass
  */
 public function export_for_template(renderer_base $output)
 {
     $data = new stdClass();
     $data->pagecontextid = $this->pagecontext->id;
     $data->templates = array();
     foreach ($this->templates as $template) {
         $exporter = new template_exporter($template);
         $data->templates[] = $exporter->export($output);
     }
     $data->pluginbaseurl = (new moodle_url('/admin/tool/lp'))->out(true);
     $data->navigation = array();
     foreach ($this->navigation as $button) {
         $data->navigation[] = $output->render($button);
     }
     $data->canmanage = template::can_manage_context($this->pagecontext);
     return $data;
 }
Ejemplo n.º 2
0
 public static function define_other_properties()
 {
     return array('statusname' => array('type' => PARAM_RAW), 'isbasedontemplate' => array('type' => PARAM_BOOL), 'canmanage' => array('type' => PARAM_BOOL), 'canrequestreview' => array('type' => PARAM_BOOL), 'canreview' => array('type' => PARAM_BOOL), 'canbeedited' => array('type' => PARAM_BOOL), 'isactive' => array('type' => PARAM_BOOL), 'isdraft' => array('type' => PARAM_BOOL), 'iscompleted' => array('type' => PARAM_BOOL), 'isinreview' => array('type' => PARAM_BOOL), 'iswaitingforreview' => array('type' => PARAM_BOOL), 'isreopenallowed' => array('type' => PARAM_BOOL), 'iscompleteallowed' => array('type' => PARAM_BOOL), 'isunlinkallowed' => array('type' => PARAM_BOOL), 'isrequestreviewallowed' => array('type' => PARAM_BOOL), 'iscancelreviewrequestallowed' => array('type' => PARAM_BOOL), 'isstartreviewallowed' => array('type' => PARAM_BOOL), 'isstopreviewallowed' => array('type' => PARAM_BOOL), 'isapproveallowed' => array('type' => PARAM_BOOL), 'isunapproveallowed' => array('type' => PARAM_BOOL), 'duedateformatted' => array('type' => PARAM_TEXT), 'commentarea' => array('type' => comment_area_exporter::read_properties_definition()), 'reviewer' => array('type' => user_summary_exporter::read_properties_definition(), 'optional' => true), 'template' => array('type' => template_exporter::read_properties_definition(), 'optional' => true), 'url' => array('type' => PARAM_URL));
 }
Ejemplo n.º 3
0
 /**
  * Returns description of list_templates_using_competency() result value.
  *
  * @return \external_description
  */
 public static function list_templates_using_competency_returns()
 {
     return new external_multiple_structure(template_exporter::get_read_structure());
 }
Ejemplo n.º 4
0
 /**
  * Returns description of data_for_template_competencies_page() result value.
  *
  * @return \external_description
  */
 public static function data_for_template_competencies_page_returns()
 {
     return new external_single_structure(array('template' => template_exporter::get_read_structure(), 'pagecontextid' => new external_value(PARAM_INT, 'Context ID'), 'canmanagecompetencyframeworks' => new external_value(PARAM_BOOL, 'User can manage competency frameworks'), 'canmanagetemplatecompetencies' => new external_value(PARAM_BOOL, 'User can manage learning plan templates'), 'competencies' => new external_multiple_structure(competency_summary_exporter::get_read_structure()), 'manageurl' => new external_value(PARAM_LOCALURL, 'Url to the manage competencies page.'), 'pluginbaseurl' => new external_value(PARAM_LOCALURL, 'Base URL of the plugin.'), 'statistics' => template_statistics_exporter::get_read_structure()));
 }