mirror of
https://github.com/moodle/moodle.git
synced 2025-03-13 04:01:40 +01:00
Merge branch 'MDL-30889-master' of git://github.com/ankitagarwal/moodle
This commit is contained in:
commit
daa9be54c0
@ -317,9 +317,9 @@ function calendar_get_mini($courses, $groups, $users, $cal_month = false, $cal_y
|
||||
|
||||
//Accessibility: functionality moved to calendar_get_popup.
|
||||
if($display->thismonth && $day == $d) {
|
||||
$popup = calendar_get_popup(true, $events[$eventid]->timestart, $popupcontent);
|
||||
$popupid = calendar_get_popup(true, $events[$eventid]->timestart, $popupcontent);
|
||||
} else {
|
||||
$popup = calendar_get_popup(false, $events[$eventid]->timestart, $popupcontent);
|
||||
$popupid = calendar_get_popup(false, $events[$eventid]->timestart, $popupcontent);
|
||||
}
|
||||
|
||||
// Class and cell content
|
||||
@ -332,7 +332,7 @@ function calendar_get_mini($courses, $groups, $users, $cal_month = false, $cal_y
|
||||
} else if(isset($typesbyday[$day]['startuser'])) {
|
||||
$class .= ' calendar_event_user';
|
||||
}
|
||||
$cell = '<a href="'.(string)$dayhref.'" '.$popup.'>'.$day.'</a>';
|
||||
$cell = html_writer::link((string)$dayhref, $day, array('aria-controls' => $popupid.'_panel', 'id' => $popupid));
|
||||
} else {
|
||||
$cell = $day;
|
||||
}
|
||||
@ -374,8 +374,8 @@ function calendar_get_mini($courses, $groups, $users, $cal_month = false, $cal_y
|
||||
|
||||
if(! isset($eventsbyday[$day])) {
|
||||
$class .= ' eventnone';
|
||||
$popup = calendar_get_popup(true, false);
|
||||
$cell = '<a href="#" '.$popup.'>'.$day.'</a>';
|
||||
$popupid = calendar_get_popup(true, false);
|
||||
$cell = html_writer::link('#', $day, array('aria-controls' => $popupid.'_panel', 'id' => $popupid));;
|
||||
}
|
||||
$cell = get_accesshide($today.' ').$cell;
|
||||
}
|
||||
@ -406,8 +406,8 @@ function calendar_get_mini($courses, $groups, $users, $cal_month = false, $cal_y
|
||||
*
|
||||
* @param bool $is_today false except when called on the current day.
|
||||
* @param mixed $event_timestart $events[$eventid]->timestart, OR false if there are no events.
|
||||
* @param string $popupcontent content for the popup window/layout
|
||||
* @return string of eventid for the calendar_tooltip popup window/layout
|
||||
* @param string $popupcontent content for the popup window/layout.
|
||||
* @return string eventid for the calendar_tooltip popup window/layout.
|
||||
*/
|
||||
function calendar_get_popup($is_today, $event_timestart, $popupcontent='') {
|
||||
global $PAGE;
|
||||
@ -430,7 +430,7 @@ function calendar_get_popup($is_today, $event_timestart, $popupcontent='') {
|
||||
$PAGE->requires->yui_module('moodle-calendar-eventmanager', 'M.core_calendar.add_event', array(array('eventId'=>$id,'title'=>$popupcaption, 'content'=>$popupcontent)));
|
||||
|
||||
$popupcount++;
|
||||
return 'id="'.$id.'"';
|
||||
return $id;
|
||||
}
|
||||
|
||||
/**
|
||||
|
9
calendar/upgrade.txt
Normal file
9
calendar/upgrade.txt
Normal file
@ -0,0 +1,9 @@
|
||||
This files describes API changes in /calendar/* ,
|
||||
information provided here is intended especially for developers.
|
||||
|
||||
|
||||
=== 2.4 ===
|
||||
|
||||
required changes in code:
|
||||
|
||||
* calendar_get_popup() function now just returns id, instead of the string "id=$id"
|
11
calendar/yui/eventmanager/eventmanager.js
vendored
11
calendar/yui/eventmanager/eventmanager.js
vendored
@ -24,6 +24,8 @@ YUI.add('moodle-calendar-eventmanager', function(Y) {
|
||||
this.publish('hideevent');
|
||||
td.on('mouseenter', this.startShow, this);
|
||||
td.on('mouseleave', this.startHide, this);
|
||||
td.on('focus', this.startShow, this);
|
||||
td.on('blur', this.startHide, this);
|
||||
return true;
|
||||
},
|
||||
initPanel : function() {
|
||||
@ -47,7 +49,10 @@ YUI.add('moodle-calendar-eventmanager', function(Y) {
|
||||
});
|
||||
panel.render(td);
|
||||
panel.get('boundingBox').addClass('calendar-event-panel');
|
||||
panel.get('boundingBox').setAttribute('aria-live', 'off');
|
||||
this.on('showevent', panel.show, panel);
|
||||
this.on('showevent', this.setAriashow, panel);
|
||||
this.on('hideevent', this.setAriahide, panel);
|
||||
this.on('hideevent', panel.hide, panel);
|
||||
}
|
||||
},
|
||||
@ -61,6 +66,12 @@ YUI.add('moodle-calendar-eventmanager', function(Y) {
|
||||
cancelShow : function() {
|
||||
clearTimeout(this.get(SHOWTIMEOUT));
|
||||
},
|
||||
setAriashow : function() {
|
||||
this.get('boundingBox').setAttribute('aria-live', 'assertive');
|
||||
},
|
||||
setAriahide : function() {
|
||||
this.get('boundingBox').setAttribute('aria-live', 'off');
|
||||
},
|
||||
show : function() {
|
||||
this.initPanel();
|
||||
this.fire('showevent');
|
||||
|
Loading…
x
Reference in New Issue
Block a user