Ejemplo 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()
 {
     global $DB;
     $teacher = $DB->get_record('user', array('id' => $this->element->data));
     $teachername = fullname($teacher);
     return parent::render_html_content($teachername);
 }
Ejemplo n.º 2
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, $USER;
     // The user field to display.
     $field = $this->element->data;
     // The value to display on the PDF.
     $value = '';
     if (is_number($field)) {
         // Must be a custom user profile field.
         if ($field = $DB->get_record('user_info_field', array('id' => $field))) {
             $value = $USER->profile[$field->shortname];
         }
     } else {
         if (!empty($USER->{$field})) {
             // Field in the user table.
             $value = $USER->{$field};
         }
     }
     return parent::render_html_content($value);
 }
Ejemplo 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()
 {
     $code = customcert_generate_code();
     return parent::render_html_content($code);
 }
Ejemplo n.º 4
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);
 }
Ejemplo n.º 5
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()
 {
     return parent::render_html_content($this->element->data);
 }
Ejemplo n.º 6
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()
 {
     // If there is no element data, we have nothing to display.
     if (empty($this->element->data)) {
         return;
     }
     // Decode the information stored in the database.
     $dateinfo = json_decode($this->element->data);
     $dateformat = $dateinfo->dateformat;
     $date = time();
     switch ($dateformat) {
         case 1:
             $certificatedate = userdate($date, '%B %d, %Y');
             break;
         case 2:
             $suffix = $this->get_ordinal_number_suffix(userdate($date, '%d'));
             $certificatedate = userdate($date, '%B %d' . $suffix . ', %Y');
             break;
         case 3:
             $certificatedate = userdate($date, '%d %B %Y');
             break;
         case 4:
             $certificatedate = userdate($date, '%B %Y');
             break;
         default:
             $certificatedate = userdate($date, get_string('strftimedate', 'langconfig'));
     }
     return parent::render_html_content($certificatedate);
 }
Ejemplo n.º 7
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;
     // If there is no element data, we have nothing to display.
     if (empty($this->element->data)) {
         return;
     }
     // Decode the information stored in the database.
     $gradeinfo = json_decode($this->element->data);
     $courseitem = grade_item::fetch_course_item($COURSE->id);
     $grade = grade_format_gradevalue('100', $courseitem, true, $gradeinfo->gradeformat, 2);
     return parent::render_html_content($grade);
 }
Ejemplo 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 $DB;
     // Check that the grade item is not empty.
     if (!empty($this->element->data)) {
         // Get the course module information.
         $cm = $DB->get_record('course_modules', array('id' => $this->element->data), '*', MUST_EXIST);
         $module = $DB->get_record('modules', array('id' => $cm->module), '*', MUST_EXIST);
         // Get the name of the item.
         $itemname = $DB->get_field($module->name, 'name', array('id' => $cm->instance), MUST_EXIST);
         return parent::render_html_content($itemname);
     }
 }
Ejemplo 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 $COURSE;
     return parent::render_html_content($COURSE->fullname);
 }
Ejemplo n.º 10
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));
 }