Updated the code for backup to include element max width and page margin
Also, improved image elements add form.
This commit is contained in:
parent
444bc35d22
commit
7634568df1
2 changed files with 12 additions and 4 deletions
|
@ -49,12 +49,12 @@ class backup_customcert_activity_structure_step extends backup_activity_structur
|
||||||
// The pages.
|
// The pages.
|
||||||
$pages = new backup_nested_element('pages');
|
$pages = new backup_nested_element('pages');
|
||||||
$page = new backup_nested_element('page', array('id'), array(
|
$page = new backup_nested_element('page', array('id'), array(
|
||||||
'customcertid', 'width', 'height', 'pagenumber',
|
'customcertid', 'width', 'height', 'margin',
|
||||||
'timecreated', 'timemodified'));
|
'pagenumber', 'timecreated', 'timemodified'));
|
||||||
|
|
||||||
// The elements.
|
// The elements.
|
||||||
$element = new backup_nested_element('element', array('id'), array(
|
$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'));
|
'posx', 'posy', 'sequence', 'timecreated', 'timemodified'));
|
||||||
|
|
||||||
// Build the tree.
|
// Build the tree.
|
||||||
|
|
|
@ -47,7 +47,15 @@ class customcert_element_image extends customcert_element_base {
|
||||||
$mform->setDefault('height', 0);
|
$mform->setDefault('height', 0);
|
||||||
$mform->addHelpButton('height', 'height', 'customcertelement_image');
|
$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,
|
$filemanageroptions = array('maxbytes' => $COURSE->maxbytes,
|
||||||
'subdirs' => 1,
|
'subdirs' => 1,
|
||||||
|
|
Loading…
Reference in a new issue