Index: event.module
===================================================================
RCS file: /cvs/drupal-contrib/contributions/modules/event/event.module,v
retrieving revision 1.232
diff -u -p -r1.232 event.module
--- event.module	25 Mar 2007 19:51:46 -0000	1.232
+++ event.module	26 Mar 2007 08:24:21 -0000
@@ -395,9 +395,24 @@ function event_page($year = NULL, $month
         $duration = $duration ? $duration : variable_get('event_table_duration', '30');
         print event_calendar_ical($stamp, $duration, $types, $terms, $title);
       break;
+    case 'block':
+        // block update
+        $time = _event_user_date();
+        if (arg(0) == 'event' && is_numeric(arg(1))) {
+          // follow event calendar
+          $year = (arg(1) ? arg(1) : gmdate('Y', $time));
+          $month = (arg(2) ? arg(2) : gmdate('m', $time));
+          $day = (arg(3) ? arg(3) : gmdate('d', $time));
+          $stamp = gmmktime(0, 0, 0, $month, $day, $year);
+        }
+        else {
+          $stamp = _event_user_date();
+        }
+        print event_calendar_month('block', $stamp);
+      break;
   }
 
-  if($view != 'feed' && $view != 'ical') {
+  if($view != 'feed' && $view != 'ical' && $view != 'block') {
     // build header navigation
     $prev = _event_nav($stamp, 'prev', $view, $types, $terms, $duration);
     $next = _event_nav($stamp, 'next', $view, $types, $terms, $duration);
@@ -497,7 +512,7 @@ function event_calendar_month($op, $stam
 
     case 'block':
       // create caption and navigation links
-      $caption = _event_nav($stamp, 'prev', 'month', $types, $terms) .' '. l(t(gmdate('F', $stamp)) .' '. $year, 'event/'. $year .'/'. $month .'/'. $day .'/month') .' '. _event_nav($stamp, 'next', 'month', $types, $terms);
+      $caption = _event_nav($stamp, 'prev', 'block', $types, $terms) .' '. l(t(gmdate('F', $stamp)) .' '. $year, 'event/'. $year .'/'. $month .'/'. $day .'/month') .' '. _event_nav($stamp, 'next', 'block', $types, $terms);
 
       $callback = 'event_render_day_single';
       $view = 'block';
@@ -1584,6 +1599,13 @@ function _event_nav($date, $dir, $view, 
     $inc = ($dir == 'prev' ? -1 : 1);
     $duration = ($duration ? $duration : 1);
 
+    // we have to separeate block navigation from normal month view
+    // what happens with $attributes if its not declared? its still passed to theme below
+    if($view == 'block') {
+      $view = 'month';
+      $attributes = array('class' => 'updateblock');
+    }
+
     switch ($view) {
       case 'day':
       case 'table':
@@ -1608,7 +1630,8 @@ function _event_nav($date, $dir, $view, 
     $url[] = ($types ? implode('+', $types) : 'all');
     $url[] = ($terms ? implode('+', $terms) : 'all');
     $url[] = $duration;
-    return theme('event_nav_'. $dir, implode('/', $url));
+    /*return theme('event_nav_'. $dir, implode('/', $url));*/
+    return theme('event_nav_'. $dir, implode('/', $url), $attributes);
   }
 }
 
@@ -1748,6 +1771,8 @@ function event_block($op = 'list', $delt
       if (user_access('access content')) {
         switch ($delta) {
           case 0:
+            drupal_add_js(drupal_get_path('module', 'event') .'/eventblock.js');
+            drupal_add_js('misc/progress.js');
             $time = _event_user_date();
             if (arg(0) == 'event' && is_numeric(arg(1))) {
               // follow event calendar
