Updated the code for backup to include element max width and page margin

Also, improved image elements add form.
This commit is contained in:
Shamim Rezaie 2015-07-30 14:44:42 +10:00 committed by Mark Nelson
parent 444bc35d22
commit 7634568df1
2 changed files with 12 additions and 4 deletions

View file

@ -49,12 +49,12 @@ class backup_customcert_activity_structure_step extends backup_activity_structur
// The pages.
$pages = new backup_nested_element('pages');
$page = new backup_nested_element('page', array('id'), array(
'customcertid', 'width', 'height', 'pagenumber',
'timecreated', 'timemodified'));
'customcertid', 'width', 'height', 'margin',
'pagenumber', 'timecreated', 'timemodified'));
// The elements.
$element = new backup_nested_element('element', array('id'), array(
'pageid', 'name', 'element', 'data', 'font', 'size', 'colour',
'pageid', 'name', 'element', 'data', 'font', 'size', 'colour', 'width',
'posx', 'posy', 'sequence', 'timecreated', 'timemodified'));
// Build the tree.

View file

@ -47,7 +47,15 @@ class customcert_element_image extends customcert_element_base {
$mform->setDefault('height', 0);
$mform->addHelpButton('height', 'height', 'customcertelement_image');
parent::render_form_element_position($mform);
$mform->addElement('text', 'posx', get_string('posx', 'customcert'), array('size' => 10));
$mform->setType('posx', PARAM_INT);
$mform->setDefault('posx', '0');
$mform->addHelpButton('posx', 'posx', 'customcert');
$mform->addElement('text', 'posy', get_string('posy', 'customcert'), array('size' => 10));
$mform->setType('posy', PARAM_INT);
$mform->setDefault('posy', '0');
$mform->addHelpButton('posy', 'posy', 'customcert');
$filemanageroptions = array('maxbytes' => $COURSE->maxbytes,
'subdirs' => 1,