139
// advcheckbox is not compatible with disabledIf!
140
$mform->addElement('checkbox', 'hidden', get_string('hidden', 'grades'));
139
if ($item->cancontrolvisibility) {
140
// advcheckbox is not compatible with disabledIf!
141
$mform->addElement('checkbox', 'hidden', get_string('hidden', 'grades'));
142
$mform->addElement('date_time_selector', 'hiddenuntil', get_string('hiddenuntil', 'grades'), array('optional'=>true));
143
$mform->disabledIf('hidden', 'hiddenuntil[off]', 'notchecked');
145
$mform->addElement('static', 'hidden', get_string('hidden', 'grades'),
146
get_string('componentcontrolsvisibility', 'grades'));
147
// Unset hidden to avoid data override.
148
unset($item->hidden);
141
150
$mform->addHelpButton('hidden', 'hidden', 'grades');
142
$mform->addElement('date_time_selector', 'hiddenuntil', get_string('hiddenuntil', 'grades'), array('optional'=>true));
143
$mform->disabledIf('hidden', 'hiddenuntil[off]', 'notchecked');
146
153
$mform->addElement('advcheckbox', 'locked', get_string('locked', 'grades'));