Hide completion date option if not applicable (#160)
This commit is contained in:
parent
97e44d3d1d
commit
cf93b540d6
1 changed files with 5 additions and 2 deletions
|
@ -68,12 +68,15 @@ class element extends \mod_customcert\element {
|
|||
* @param \mod_customcert\edit_element_form $mform the edit_form instance
|
||||
*/
|
||||
public function render_form_elements($mform) {
|
||||
global $COURSE;
|
||||
global $CFG, $COURSE;
|
||||
|
||||
// Get the possible date options.
|
||||
$dateoptions = array();
|
||||
$dateoptions[CUSTOMCERT_DATE_ISSUE] = get_string('issueddate', 'customcertelement_date');
|
||||
$dateoptions[CUSTOMCERT_DATE_COMPLETION] = get_string('completiondate', 'customcertelement_date');
|
||||
$completionenabled = $CFG->enablecompletion && $COURSE->enablecompletion;
|
||||
if ($completionenabled) {
|
||||
$dateoptions[CUSTOMCERT_DATE_COMPLETION] = get_string('completiondate', 'customcertelement_date');
|
||||
}
|
||||
$dateoptions[CUSTOMCERT_DATE_COURSE_START] = get_string('coursestartdate', 'customcertelement_date');
|
||||
$dateoptions[CUSTOMCERT_DATE_COURSE_END] = get_string('courseenddate', 'customcertelement_date');
|
||||
$dateoptions[CUSTOMCERT_DATE_COURSE_GRADE] = get_string('coursegradedate', 'customcertelement_date');
|
||||
|
|
Loading…
Reference in a new issue