Reordered code in the date element
This commit is contained in:
parent
9d9ce7ad27
commit
be2c3ab56a
1 changed files with 6 additions and 7 deletions
|
@ -50,17 +50,16 @@ class customcert_element_date extends customcert_element_base {
|
||||||
$dateoptions['1'] = get_string('issueddate', 'certificate');
|
$dateoptions['1'] = get_string('issueddate', 'certificate');
|
||||||
$dateoptions['2'] = get_string('completiondate', 'certificate');
|
$dateoptions['2'] = get_string('completiondate', 'certificate');
|
||||||
$dateoptions = $dateoptions + customcert_element_grade::get_grade_items();
|
$dateoptions = $dateoptions + customcert_element_grade::get_grade_items();
|
||||||
|
|
||||||
$mform->addElement('select', 'dateitem_' . $this->element->id, get_string('dateitem', 'customcertelement_date'), $dateoptions);
|
$mform->addElement('select', 'dateitem_' . $this->element->id, get_string('dateitem', 'customcertelement_date'), $dateoptions);
|
||||||
|
$mform->setDefault('dateitem_' . $this->element->id, $dateitem);
|
||||||
|
$mform->addHelpButton('dateitem_' . $this->element->id, 'dateitem', 'customcertelement_date');
|
||||||
|
|
||||||
$mform->addElement('select', 'dateformat_' . $this->element->id, get_string('dateformat', 'customcertelement_date'), customcert_element_date::get_date_formats());
|
$mform->addElement('select', 'dateformat_' . $this->element->id, get_string('dateformat', 'customcertelement_date'), customcert_element_date::get_date_formats());
|
||||||
|
$mform->setDefault('dateformat_' . $this->element->id, $dateformat);
|
||||||
|
$mform->addHelpButton('dateformat_' . $this->element->id, 'dateformat', 'customcertelement_date');
|
||||||
|
|
||||||
parent::render_form_elements($mform);
|
parent::render_form_elements($mform);
|
||||||
|
|
||||||
$mform->setDefault('dateitem_' . $this->element->id, $dateitem);
|
|
||||||
$mform->setDefault('dateformat_' . $this->element->id, $dateformat);
|
|
||||||
|
|
||||||
// Add help buttons.
|
|
||||||
$mform->addHelpButton('dateitem_' . $this->element->id, 'dateitem', 'customcertelement_date');
|
|
||||||
$mform->addHelpButton('dateformat_' . $this->element->id, 'dateformat', 'customcertelement_date');
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
Loading…
Reference in a new issue