| Línea 144... |
Línea 144... |
| 144 |
$hours, $this->getAttributesForFormElement(), true);
|
144 |
$hours, $this->getAttributesForFormElement(), true);
|
| 145 |
// Reverse date element (Should be: Day, Month, Year), in RTL mode.
|
145 |
// Reverse date element (Should be: Day, Month, Year), in RTL mode.
|
| 146 |
$dateformat = array_reverse($dateformat);
|
146 |
$dateformat = array_reverse($dateformat);
|
| 147 |
}
|
147 |
}
|
| 148 |
foreach ($dateformat as $key => $date) {
|
148 |
foreach ($dateformat as $key => $date) {
|
| 149 |
// E_STRICT creating elements without forms is nasty because it internally uses $this
|
- |
|
| 150 |
$this->_elements[] = $this->createFormElement('select', $key, get_string($key, 'form'), $date,
|
149 |
$this->_elements[] = $this->createFormElement('select', $key, get_string($key, 'form'), $date,
|
| 151 |
$this->getAttributesForFormElement(), true);
|
150 |
$this->getAttributesForFormElement(), true);
|
| 152 |
}
|
151 |
}
|
| 153 |
if (!right_to_left()) { // Display time to the left of date, in LTR mode.
|
152 |
if (!right_to_left()) { // Display time to the left of date, in LTR mode.
|
| 154 |
$this->_elements[] = $this->createFormElement('select', 'hour', get_string('hour', 'form'), $hours,
|
153 |
$this->_elements[] = $this->createFormElement('select', 'hour', get_string('hour', 'form'), $hours,
|
| Línea 156... |
Línea 155... |
| 156 |
$this->_elements[] = $this->createFormElement('select', 'minute', get_string('minute', 'form'), $minutes,
|
155 |
$this->_elements[] = $this->createFormElement('select', 'minute', get_string('minute', 'form'), $minutes,
|
| 157 |
$this->getAttributesForFormElement(), true);
|
156 |
$this->getAttributesForFormElement(), true);
|
| 158 |
}
|
157 |
}
|
| 159 |
// The YUI2 calendar only supports the gregorian calendar type so only display the calendar image if this is being used.
|
158 |
// The YUI2 calendar only supports the gregorian calendar type so only display the calendar image if this is being used.
|
| 160 |
if ($calendartype->get_name() === 'gregorian') {
|
159 |
if ($calendartype->get_name() === 'gregorian') {
|
| 161 |
$image = $OUTPUT->pix_icon('i/calendar', get_string('calendar', 'calendar'), 'moodle');
|
160 |
$image = $OUTPUT->pix_icon('i/calendar', '');
|
| 162 |
$this->_elements[] = $this->createFormElement('link', 'calendar',
|
161 |
$this->_elements[] = $this->createFormElement(
|
| - |
|
162 |
'button',
|
| - |
|
163 |
'calendar',
|
| - |
|
164 |
$image,
|
| - |
|
165 |
[
|
| 163 |
null, '#', $image);
|
166 |
'type' => 'button',
|
| - |
|
167 |
'title' => get_string('datepicker', 'calendar'),
|
| - |
|
168 |
'aria-label' => get_string('datepicker', 'calendar'),
|
| - |
|
169 |
],
|
| - |
|
170 |
[
|
| - |
|
171 |
'customclassoverride' => 'btn-link btn-sm icon-no-margin',
|
| - |
|
172 |
],
|
| - |
|
173 |
);
|
| 164 |
}
|
174 |
}
|
| 165 |
foreach ($this->_elements as $element){
|
175 |
foreach ($this->_elements as $element){
|
| 166 |
if (method_exists($element, 'setHiddenLabel')){
|
176 |
if (method_exists($element, 'setHiddenLabel')){
|
| 167 |
$element->setHiddenLabel(true);
|
177 |
$element->setHiddenLabel(true);
|
| 168 |
}
|
178 |
}
|