]> git.mjollnir.org Git - moodle.git/commitdiff
* Removed one obsolete function
authordefacer <defacer>
Fri, 21 May 2004 13:51:02 +0000 (13:51 +0000)
committerdefacer <defacer>
Fri, 21 May 2004 13:51:02 +0000 (13:51 +0000)
* Changed the expired events' color to dimmed
* Added "new event" button in upcoming events screen
* Small improvement (more robust) in redirection from set.php to upcoming events

calendar/lib.php
calendar/set.php
calendar/view.php

index d6a1aadfacb50d448f4da61092f5b02d7b9e202d..0e5e32a25a6b2036252ea5657c85eaa7a606a8a9 100644 (file)
@@ -307,8 +307,8 @@ function calendar_get_upcoming($courses, $groups, $users, $daysinfuture, $maxeve
                 $time = calendar_time_representation($event->timestart + $event->timeduration);
 
                 // This var always has the printable time representation
-                $eventtime = '<span class="calendarexpired">'.get_string('expired', 'calendar').' '.
-                    calendar_get_link_tag($day, CALENDAR_URL.'view.php?view=day&amp;', $enddate['mday'], $enddate['mon'], $enddate['year']).'</span> ('.$time.')';
+                $eventtime = '<span class="dimmed_text"><a class="dimmed" href="'.calendar_get_link_href(CALENDAR_URL.'view.php?view=day&amp;', $enddate['mday'], $enddate['mon'], $enddate['year']).'">'.$day.'</a> ('.$time.')</span>';
+
             }
             else if($event->timeduration) {
                 // It has a duration
index 108386cf044f17aba229d4237dddbbfb6350751c..b4c710287cca2f2840cf4d27c06b337c71986de8 100644 (file)
@@ -89,7 +89,7 @@
         redirect($CFG->wwwroot.'/calendar/view.php?view=month&cal_d='.$_GET['cal_d'].'&cal_m='.$_GET['cal_m'].'&cal_y='.$_GET['cal_y']);
         break;
         case 'upcoming':
-        redirect($CFG->wwwroot.'/calendar/view.php?view=upcoming&cal_d='.$_GET['cal_d'].'&cal_m='.$_GET['cal_m'].'&cal_y='.$_GET['cal_y']);
+        redirect($CFG->wwwroot.'/calendar/view.php?view=upcoming');
         break;
         case 'day':
         redirect($CFG->wwwroot.'/calendar/view.php?view=day&cal_d='.$_GET['cal_d'].'&cal_m='.$_GET['cal_m'].'&cal_y='.$_GET['cal_y']);
index 8867e2d81fb2e8f0545fba4f34188d0e477f7a78..dd97d8fcd3e4c5fc06b664ca5e4a9f234d27f775 100644 (file)
 
     print_footer();
 
-function calendar_show_event($event) {
-    // In this case, we haven't been given month, day, year. So we 'll have to
-    // get them from the event date, and return them to the main function.
-
-    $startdate = usergetdate($event->timestart); // This is only to be returned
-    $coursecache = array();
-
-    print_side_block_start(get_string('eventview', 'calendar'), '', 'mycalendar');
-    calendar_print_event_table($event, $event->timestart, $event->timestart + $event->timeduration, $coursecache, true);
-    print_side_block_end();
-
-    return $startdate; // We need this to set "current" day, month, year
-}
-
 function calendar_show_day($d, $m, $y, $courses, $groups, $users) {
     global $CFG, $THEME;
 
@@ -512,12 +498,21 @@ function calendar_show_upcoming_events($courses, $groups, $users, $futuredays, $
     $events = calendar_get_upcoming($courses, $groups, $users, $futuredays, $maxevents);
     $numevents = count($events);
 
-    if(!$numevents) {
-        // There are no events in the specified time period
-        return;
+    // New event button
+    if(isguest()) {
+        $text = get_string('upcomingevents', 'calendar').': '.calendar_course_filter_selector('from=upcoming');
+    }
+    else {
+        $text = '<div style="float: left;">'.get_string('upcomingevents', 'calendar').': '.calendar_course_filter_selector('from=upcoming').'</div><div style="float: right;">';
+        $text.= '<form style="display: inline;" action="'.CALENDAR_URL.'event.php" method="get">';
+        $text.= '<input type="hidden" name="action" value="new" />';
+        $text.= '<input type="hidden" name="cal_m" value="'.$m.'" />';
+        $text.= '<input type="hidden" name="cal_y" value="'.$y.'" />';
+        $text.= '<input type="submit" value="'.get_string('newevent', 'calendar').'" />';
+        $text.= '</form></div>';
     }
 
-    print_side_block_start(get_string('upcomingevents', 'calendar').': '.calendar_course_filter_selector('from=upcoming'), '', 'mycalendar');
+    print_side_block_start($text, '', 'mycalendar');
     for($i = 0; $i < $numevents; ++$i) {
         echo '<p>';
         if(!empty($events[$i]->icon)) {