Merge branch 'MDL-86501-500' of https://github.com/junpataleta/moodle into MOODLE_500_STABLE

This commit is contained in:
Paul Holden
2025-09-09 14:01:01 +01:00
7 changed files with 40 additions and 17 deletions
+1
View File
@@ -53,6 +53,7 @@ $string['categoryevents'] = 'Category events';
$string['courses'] = 'Courses';
$string['customexport'] = 'Custom range ({$a->timestart} - {$a->timeend})';
$string['daily'] = 'Daily';
$string['datepicker'] = 'Date picker';
$string['day'] = 'Day';
$string['dayeventsmany'] = '{$a->num} events, {$a->day}';
$string['dayeventsnone'] = 'No events, {$a}';
+14 -3
View File
@@ -138,9 +138,20 @@ class MoodleQuickForm_date_selector extends MoodleQuickForm_group {
}
// The YUI2 calendar only supports the gregorian calendar type so only display the calendar image if this is being used.
if ($calendartype->get_name() === 'gregorian') {
$image = $OUTPUT->pix_icon('i/calendar', get_string('calendar', 'calendar'), 'moodle');
$this->_elements[] = $this->createFormElement('link', 'calendar',
null, '#', $image);
$image = $OUTPUT->pix_icon('i/calendar', '');
$this->_elements[] = $this->createFormElement(
'button',
'calendar',
$image,
[
'type' => 'button',
'title' => get_string('datepicker', 'calendar'),
'aria-label' => get_string('datepicker', 'calendar'),
],
[
'customclassoverride' => 'btn-link btn-sm icon-no-margin',
],
);
}
foreach ($this->_elements as $element){
if (method_exists($element, 'setHiddenLabel')){
+14 -3
View File
@@ -157,9 +157,20 @@ class MoodleQuickForm_date_time_selector extends MoodleQuickForm_group {
}
// The YUI2 calendar only supports the gregorian calendar type so only display the calendar image if this is being used.
if ($calendartype->get_name() === 'gregorian') {
$image = $OUTPUT->pix_icon('i/calendar', get_string('calendar', 'calendar'), 'moodle');
$this->_elements[] = $this->createFormElement('link', 'calendar',
null, '#', $image);
$image = $OUTPUT->pix_icon('i/calendar', '');
$this->_elements[] = $this->createFormElement(
'button',
'calendar',
$image,
[
'type' => 'button',
'title' => get_string('datepicker', 'calendar'),
'aria-label' => get_string('datepicker', 'calendar'),
],
[
'customclassoverride' => 'btn-link btn-sm icon-no-margin',
],
);
}
foreach ($this->_elements as $element){
if (method_exists($element, 'setHiddenLabel')){
@@ -240,7 +240,7 @@ CALENDAR.prototype = {
}, this);
// Loop through the input fields.
var inputs = this.get('node').all('input, a');
var inputs = this.get('node').all('input, button');
inputs.each(function(node) {
// Check if the current node is a calendar image field.
if (node.get('name').match(/\[calendar\]/)) {
@@ -381,10 +381,10 @@ CALENDAR.prototype = {
toggle_calendar_image: function() {
// If the enable checkbox is not checked, disable the calendar image and prevent focus.
if (!this.enablecheckbox.get('checked')) {
this.calendarimage.addClass('disabled');
this.calendarimage.setAttribute('disabled');
this.release_calendar();
} else {
this.calendarimage.removeClass('disabled');
this.calendarimage.removeAttribute('disabled');
}
}
};
File diff suppressed because one or more lines are too long
@@ -240,7 +240,7 @@ CALENDAR.prototype = {
}, this);
// Loop through the input fields.
var inputs = this.get('node').all('input, a');
var inputs = this.get('node').all('input, button');
inputs.each(function(node) {
// Check if the current node is a calendar image field.
if (node.get('name').match(/\[calendar\]/)) {
@@ -381,10 +381,10 @@ CALENDAR.prototype = {
toggle_calendar_image: function() {
// If the enable checkbox is not checked, disable the calendar image and prevent focus.
if (!this.enablecheckbox.get('checked')) {
this.calendarimage.addClass('disabled');
this.calendarimage.setAttribute('disabled');
this.release_calendar();
} else {
this.calendarimage.removeClass('disabled');
this.calendarimage.removeAttribute('disabled');
}
}
};
+3 -3
View File
@@ -32,7 +32,7 @@ CALENDAR.prototype = {
}, this);
// Loop through the input fields.
var inputs = this.get('node').all('input, a');
var inputs = this.get('node').all('input, button');
inputs.each(function(node) {
// Check if the current node is a calendar image field.
if (node.get('name').match(/\[calendar\]/)) {
@@ -173,10 +173,10 @@ CALENDAR.prototype = {
toggle_calendar_image: function() {
// If the enable checkbox is not checked, disable the calendar image and prevent focus.
if (!this.enablecheckbox.get('checked')) {
this.calendarimage.addClass('disabled');
this.calendarimage.setAttribute('disabled');
this.release_calendar();
} else {
this.calendarimage.removeClass('disabled');
this.calendarimage.removeAttribute('disabled');
}
}
};