mirror of
https://github.com/moodle/moodle.git
synced 2025-04-13 12:32:08 +02:00
MDL-78484 formslib: Move enable checkbox display before the date picker
This commit is contained in:
parent
64b701190d
commit
14079fa738
@ -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);
|
||||
|
@ -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);
|
||||
|
Loading…
x
Reference in New Issue
Block a user