Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Merging from MOODLE_16_STABLE:

Fix for MDL-4701: Event URLs now include anchor so that the event is immediately visible.
  • Loading branch information...
commit 2eb862ba188e84954a21e191e193b393aec1a945 1 parent e5c482b
defacer authored
Showing with 4 additions and 4 deletions.
  1. +3 −3 calendar/lib.php
  2. +1 −1  calendar/view.php
View
6 calendar/lib.php
@@ -242,7 +242,7 @@ function calendar_get_mini($courses, $groups, $users, $cal_month = false, $cal_y
$popupicon = $CFG->pixpath.'/c/user.gif';
$popupalt = '';
}
- $popupcontent .= '<div><img height="16" width="16" src="'.$popupicon.'" style="vertical-align: middle; margin-right: 4px;" alt="'.$popupalt.'" /><a href="'.$dayhref.'">'.format_string($event->name,true).'</a></div>';
+ $popupcontent .= '<div><img height="16" width="16" src="'.$popupicon.'" style="vertical-align: middle; margin-right: 4px;" alt="'.$popupalt.'" /><a href="'.$dayhref.'#event_'.$event->id.'">'.format_string($event->name,true).'</a></div>';
}
//Accessibility: functionality moved to calendar_get_popup.
@@ -456,7 +456,7 @@ function calendar_print_event($event) {
static $strftimetime;
$event = calendar_add_event_metadata($event);
- echo '<table class="event" cellspacing="0">';
+ echo '<a name="event_'.$event->id.'"></a><table class="event" cellspacing="0">';
echo '<tr><td class="picture">';
if (!empty($event->icon)) {
echo $event->icon;
@@ -870,7 +870,7 @@ function calendar_get_sideblock_upcoming($events, $linkhref = NULL) {
if(!empty($linkhref)) {
$ed = usergetdate($events[$i]->timestart);
$href = calendar_get_link_href(CALENDAR_URL.$linkhref, $ed['mday'], $ed['mon'], $ed['year']);
- $content .= '<a href="'.$href.'">'.$events[$i]->name.'</a>';
+ $content .= '<a href="'.$href.'#event_'.$events[$i]->id.'">'.$events[$i]->name.'</a>';
}
else {
$content .= $events[$i]->name;
View
2  calendar/view.php
@@ -450,7 +450,7 @@ function calendar_show_month_detailed($m, $y, $courses, $groups, $users) {
if(isset($eventsbyday[$day])) {
echo '<ul class="events-new">';
foreach($eventsbyday[$day] as $eventindex) {
- echo '<li><a href="'.$dayhref.'">'.format_string($events[$eventindex]->name,true).'</a></li>';
+ echo '<li><a href="'.$dayhref.'#event_'.$events[$eventindex]->id.'">'.format_string($events[$eventindex]->name, true).'</a></li>';
}
echo '</ul>';
}
Please sign in to comment.
Something went wrong with that request. Please try again.