]> git.mjollnir.org Git - moodle.git/commitdiff
Merging from MOODLE_16_STABLE:
authordefacer <defacer>
Tue, 27 Feb 2007 14:36:58 +0000 (14:36 +0000)
committerdefacer <defacer>
Tue, 27 Feb 2007 14:36:58 +0000 (14:36 +0000)
Fix for MDL-4701: Event URLs now include anchor so that the event is immediately visible.

calendar/lib.php
calendar/view.php

index b0ed6973ac14b324ca77a16276ce676f0db6b8a8..b3abd872ce54cea1d507047b8c045c542be67045 100644 (file)
@@ -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 class="icon" src="'.$popupicon.'" alt="'.$popupalt.'" /><a href="'.$dayhref.'">'.format_string($event->name,true).'</a></div>';
+                $popupcontent .= '<div><img class="icon" src="'.$popupicon.'" 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;
@@ -883,7 +883,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;
index 2f83fe30c3026ed32946ff3eb270ed7afd7964ea..42a4e7983a64fca7fbdb045b9462cd4b9e6a8a31 100644 (file)
@@ -470,7 +470,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>';
         }