diff --git a/edit_form.php b/edit_form.php index c0721f4..7a59c15 100644 --- a/edit_form.php +++ b/edit_form.php @@ -212,11 +212,13 @@ class mod_customcert_edit_form extends moodleform { $mform->addElement('text', 'width_' . $pageid, get_string('width', 'customcert')); $mform->setType('width_' . $pageid, PARAM_INT); + $mform->setDefault('width_' . $pageid, '210'); $mform->addRule('width_' . $pageid, null, 'required', null, 'client'); $mform->addHelpButton('width_' . $pageid, 'width', 'customcert'); $mform->addElement('text', 'height_' . $pageid, get_string('height', 'customcert')); $mform->setType('height_' . $pageid, PARAM_INT); + $mform->setDefault('height_' . $pageid, '297'); $mform->addRule('height_' . $pageid, null, 'required', null, 'client'); $mform->addHelpButton('height_' . $pageid, 'height', 'customcert'); diff --git a/lib.php b/lib.php index 7a242e1..edf2ccb 100644 --- a/lib.php +++ b/lib.php @@ -558,6 +558,8 @@ function customcert_add_page($data) { $page = new stdClass(); $page->customcertid = $data->id; $page->orientation = 'P'; + $page->width = '210'; + $page->height = '297'; $page->pagenumber = $pagenum; $page->timecreated = $time; $page->timemodified = $time;