Skip to content

Commit

Permalink
fix #206 - error on activity creation
Browse files Browse the repository at this point in the history
  • Loading branch information
bozoh committed Aug 20, 2018
1 parent 9cfdcb0 commit b036f49
Showing 1 changed file with 18 additions and 15 deletions.
33 changes: 18 additions & 15 deletions mod_form.php
Original file line number Diff line number Diff line change
Expand Up @@ -48,13 +48,6 @@ public function definition() {
// Design Options.
$mform->addElement('header', 'designoptions', get_string('designoptions', 'simplecertificate'));

// Certificate image file.
$mform->addElement('filemanager', 'certificateimage',
get_string('certificateimage', 'simplecertificate'), null,
$this->get_filemanager_options_array()
);
$mform->addHelpButton('certificateimage', 'certificateimage', 'simplecertificate');

// Certificate Text HTML editor.
$mform->addElement('editor', 'certificatetext',
get_string('certificatetext', 'simplecertificate'), null,
Expand All @@ -63,6 +56,13 @@ public function definition() {
$mform->addRule('certificatetext', get_string('error'), 'required', null, 'client');
$mform->addHelpButton('certificatetext', 'certificatetext', 'simplecertificate');

// Certificate image file.
$mform->addElement('filemanager', 'certificateimage',
get_string('certificateimage', 'simplecertificate'), null,
$this->get_filemanager_options_array()
);
$mform->addHelpButton('certificateimage', 'certificateimage', 'simplecertificate');

// Certificate Width.
$mform->addElement('text', 'width', get_string('width', 'simplecertificate'), array('size' => '5'));
$mform->setType('width', PARAM_INT);
Expand Down Expand Up @@ -92,27 +92,30 @@ public function definition() {
$mform->addHelpButton('certificatetexty', 'textposition', 'simplecertificate');

// Second page.
$mform->addElement('header', 'secondpageoptions', get_string('secondpageoptions', 'simplecertificate'));
$mform->addElement('header', 'secondpageoptions', get_string(
'secondpageoptions', 'simplecertificate')
);
// Enable back page text.

$mform->addElement('selectyesno', 'enablesecondpage', get_string('enablesecondpage', 'simplecertificate'));
$mform->setDefault('enablesecondpage', get_config('simplecertificate', 'enablesecondpage'));
$mform->addHelpButton('enablesecondpage', 'enablesecondpage', 'simplecertificate');

// Certificate secondimage file.
$mform->addElement('filemanager', 'secondimage',
get_string('secondimage', 'simplecertificate'), null,
$this->get_filemanager_options_array());
$mform->addHelpButton('secondimage', 'secondimage', 'simplecertificate');
$mform->disabledIf('secondimage', 'enablesecondpage', 'eq', 0);

// Certificate secondText HTML editor.
$mform->addElement('editor', 'secondpagetext',
get_string('secondpagetext', 'simplecertificate'), null,
simplecertificate_get_editor_options($this->context));
$mform->addHelpButton('secondpagetext', 'certificatetext', 'simplecertificate');
$mform->disabledIf('secondpagetext', 'enablesecondpage', 'eq', 0);

// Certificate secondimage file.
$mform->addElement('filemanager', 'secondimage',
get_string('secondimage', 'simplecertificate'), null,
$this->get_filemanager_options_array()
);
$mform->addHelpButton('secondimage', 'secondimage', 'simplecertificate');
// ...$mform->disabledIf('secondimage', 'enablesecondpage', 'eq', 0);.

// Certificate Position X.
$mform->addElement('text', 'secondpagex', get_string('secondpagex', 'simplecertificate'), array('size' => '5'));
$mform->setType('secondpagex', PARAM_INT);
Expand Down

0 comments on commit b036f49

Please # to comment.