Exemplo n.º 1
0
 /**
  * Render the element in html.
  *
  * This function is used to render the element when we are using the
  * drag and drop interface to position it.
  */
 public function render_html()
 {
     $code = customcert_generate_code();
     return parent::render_html_content($code);
 }
Exemplo n.º 2
0
 /**
  * Sets the data on the form when editing an element.
  *
  * @param mod_customcert_edit_element_form $mform the edit_form instance
  */
 public function definition_after_data($mform)
 {
     $this->element->userfield = $this->element->data;
     parent::definition_after_data($mform);
 }
Exemplo n.º 3
0
 /**
  * Render the element in html.
  *
  * This function is used to render the element when we are using the
  * drag and drop interface to position it.
  */
 public function render_html()
 {
     global $DB, $COURSE;
     $categoryname = $DB->get_field('course_categories', 'name', array('id' => $COURSE->category), MUST_EXIST);
     return parent::render_html_content($categoryname);
 }
Exemplo n.º 4
0
 /**
  * Sets the data on the form when editing an element.
  *
  * @param mod_customcert_edit_element_form $mform the edit_form instance
  */
 public function definition_after_data($mform)
 {
     $this->element->teacher = $this->element->data;
     parent::definition_after_data($mform);
 }
Exemplo n.º 5
0
 /**
  * Sets the data on the form when editing an element.
  *
  * @param mod_customcert_edit_element_form $mform the edit_form instance
  */
 public function definition_after_data($mform)
 {
     // Set the item and format for this element.
     $dateinfo = json_decode($this->element->data);
     $this->element->dateitem = $dateinfo->dateitem;
     $this->element->dateformat = $dateinfo->dateformat;
     parent::definition_after_data($mform);
 }
Exemplo n.º 6
0
 /**
  * Sets the data on the form when editing an element.
  *
  * @param mod_customcert_edit_element_form $mform the edit_form instance
  */
 public function definition_after_data($mform)
 {
     global $COURSE;
     // Set the image, width and height for this element.
     $imageinfo = json_decode($this->element->data);
     $this->element->image = $imageinfo->pathnamehash;
     $this->element->width = $imageinfo->width;
     $this->element->height = $imageinfo->height;
     // Editing existing instance - copy existing files into draft area.
     $draftitemid = file_get_submitted_draft_itemid('customcertimage');
     $filemanageroptions = array('maxbytes' => $COURSE->maxbytes, 'subdirs' => 1, 'accepted_types' => 'image');
     file_prepare_draft_area($draftitemid, context_course::instance($COURSE->id)->id, 'mod_customcert', 'image', 0, $filemanageroptions);
     $element = $mform->getElement('customcertimage');
     $element->setValue($draftitemid);
     parent::definition_after_data($mform);
 }
Exemplo n.º 7
0
 /**
  * Sets the data on the form when editing an element.
  *
  * @param mod_customcert_edit_element_form $mform the edit_form instance
  */
 public function definition_after_data($mform)
 {
     $this->element->gradeitem = $this->element->data;
     parent::definition_after_data($mform);
 }
Exemplo n.º 8
0
 /**
  * Render the element in html.
  *
  * This function is used to render the element when we are using the
  * drag and drop interface to position it.
  */
 public function render_html()
 {
     global $COURSE;
     return parent::render_html_content($COURSE->fullname);
 }
Exemplo n.º 9
0
 /**
  * Render the element in html.
  *
  * This function is used to render the element when we are using the
  * drag and drop interface to position it.
  */
 public function render_html()
 {
     global $USER;
     return parent::render_html_content(fullname($USER));
 }