Altered the render function in the studentname element to use the common rendering function
This commit is contained in:
parent
7ce63bbca0
commit
7c4e8def0c
1 changed files with 8 additions and 6 deletions
|
@ -41,13 +41,15 @@ class customcert_element_studentname extends customcert_element_base {
|
||||||
/**
|
/**
|
||||||
* Handles rendering the element on the pdf.
|
* Handles rendering the element on the pdf.
|
||||||
*
|
*
|
||||||
* @param $pdf the pdf object, see lib/pdflib.php
|
* @param stdClass $pdf the pdf object
|
||||||
|
* @param int $userid
|
||||||
*/
|
*/
|
||||||
public function render($pdf) {
|
public function render($pdf, $userid) {
|
||||||
global $USER;
|
global $DB;
|
||||||
|
|
||||||
$pdf->setFont($this->element->font, '', $this->element->size);
|
$user = $DB->get_record('user', array('id' => $userid), 'id, firstname, lastname', MUST_EXIST);
|
||||||
$pdf->SetXY($this->element->posx, $this->element->posy);
|
$fullname = fullname($user);
|
||||||
$pdf->writeHTMLCell(0, 0, '', '', fullname($USER), 0, 0, 0, true, $align);
|
|
||||||
|
parent::render_content($pdf, $fullname);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue