Merge branch 'MDL-78484-402' of https://github.com/NashTechOpenUniversity/moodle into MOODLE_402_STABLE

This commit is contained in:
Jun Pataleta
2023-07-06 09:41:33 +08:00
2 changed files with 10 additions and 8 deletions
+5 -4
View File
@@ -127,6 +127,11 @@ class MoodleQuickForm_date_selector extends MoodleQuickForm_group {
if (right_to_left()) {
$dateformat = array_reverse($dateformat);
}
// If optional we add a checkbox which the user can use to turn if on.
if ($this->_options['optional']) {
$this->_elements[] = $this->createFormElement('checkbox', 'enabled', null,
get_string('enable'), $this->getAttributes(), true);
}
foreach ($dateformat as $key => $value) {
// E_STRICT creating elements without forms is nasty because it internally uses $this
$this->_elements[] = $this->createFormElement('select', $key, get_string($key, 'form'), $value, $this->getAttributes(), true);
@@ -137,10 +142,6 @@ class MoodleQuickForm_date_selector extends MoodleQuickForm_group {
$this->_elements[] = $this->createFormElement('link', 'calendar',
null, '#', $image);
}
// If optional we add a checkbox which the user can use to turn if on
if ($this->_options['optional']) {
$this->_elements[] = $this->createFormElement('checkbox', 'enabled', null, get_string('enable'), $this->getAttributes(), true);
}
foreach ($this->_elements as $element){
if (method_exists($element, 'setHiddenLabel')){
$element->setHiddenLabel(true);
+5 -4
View File
@@ -131,6 +131,11 @@ class MoodleQuickForm_date_time_selector extends MoodleQuickForm_group {
}
$this->_elements = array();
// If optional we add a checkbox which the user can use to turn if on.
if ($this->_options['optional']) {
$this->_elements[] = $this->createFormElement('checkbox', 'enabled', null,
get_string('enable'), $this->getAttributes(), true);
}
$dateformat = $calendartype->get_date_order($this->_options['startyear'], $this->_options['stopyear']);
if (right_to_left()) { // Display time to the right of date, in RTL mode.
$this->_elements[] = $this->createFormElement('select', 'minute', get_string('minute', 'form'),
@@ -156,10 +161,6 @@ class MoodleQuickForm_date_time_selector extends MoodleQuickForm_group {
$this->_elements[] = $this->createFormElement('link', 'calendar',
null, '#', $image);
}
// If optional we add a checkbox which the user can use to turn if on
if ($this->_options['optional']) {
$this->_elements[] = $this->createFormElement('checkbox', 'enabled', null, get_string('enable'), $this->getAttributes(), true);
}
foreach ($this->_elements as $element){
if (method_exists($element, 'setHiddenLabel')){
$element->setHiddenLabel(true);