Index: event.module
===================================================================
RCS file: /cvs/drupal-contrib/contributions/modules/event/event.module,v
retrieving revision 1.148
diff -u -F^f -r1.148 event.module
--- event.module	2 Jul 2005 00:26:51 -0000	1.148
+++ event.module	13 Jul 2005 20:48:31 -0000
@@ -45,6 +45,7 @@ function event_link($type, $node = NULL,
         $links[] = l(t('week'), "event/$node->year/$node->month/$node->day/week/". $node->filter, array('title' => t('Week view')));
         $links[] = l(t('day'), "event/$node->year/$node->month/$node->day/day/". $node->filter, array('title' => t('Day view')));
         $links[] = l(t('table'), "event/$node->year/$node->month/$node->day/table/". $node->filter, array('title' => t('Table view')));
+        $links[] = l(t('list'), "event/$node->year/$node->month/$node->day/list/". $node->filter, array('title' => t('List view')));
       }
       break;
     case 'event_week':
@@ -52,6 +53,7 @@ function event_link($type, $node = NULL,
         $links[] = l(t('month'), "event/$node->year/$node->month/$node->day/month/". $node->filter, array('title' => t('Month view')));
         $links[] = l(t('day'), "event/$node->year/$node->month/$node->day/day/". $node->filter, array('title' => t('Day view')));
         $links[] = l(t('table'), "event/$node->year/$node->month/$node->day/table/". $node->filter, array('title' => t('Table view')));
+        $links[] = l(t('list'), "event/$node->year/$node->month/$node->day/list/". $node->filter, array('title' => t('List view')));
       }
       break;
     case 'event_day':
@@ -59,6 +61,7 @@ function event_link($type, $node = NULL,
         $links[] = l(t('month'), "event/$node->year/$node->month/$node->day/month/". $node->filter, array('title' => t('Month view')));
         $links[] = l(t('week'), "event/$node->year/$node->month/$node->day/week/". $node->filter, array('title' => t('Week view')));
         $links[] = l(t('table'), "event/$node->year/$node->month/$node->day/table/". $node->filter, array('title' => t('Table view')));
+        $links[] = l(t('list'), "event/$node->year/$node->month/$node->day/list/". $node->filter, array('title' => t('List view')));
       }
       break;
     case 'event_table':
@@ -66,6 +69,15 @@ function event_link($type, $node = NULL,
         $links[] = l(t('month'), "event/$node->year/$node->month/$node->day/month/". $node->filter, array('title' => t('Month view')));
         $links[] = l(t('week'), "event/$node->year/$node->month/$node->day/week/". $node->filter, array('title' => t('Week view')));
         $links[] = l(t('day'), "event/$node->year/$node->month/$node->day/day/". $node->filter, array('title' => t('Day view')));
+        $links[] = l(t('list'), "event/$node->year/$node->month/$node->day/list/". $node->filter, array('title' => t('List view')));
+      }
+      break;
+    case 'event_list':
+      if (user_access('access content')) {
+        $links[] = l(t('month'), "event/$node->year/$node->month/$node->day/month/". $node->filter, array('title' => t('Month view')));
+        $links[] = l(t('week'), "event/$node->year/$node->month/$node->day/week/". $node->filter, array('title' => t('Week view')));
+        $links[] = l(t('day'), "event/$node->year/$node->month/$node->day/day/". $node->filter, array('title' => t('Day view')));
+        $links[] = l(t('table'), "event/$node->year/$node->month/$node->day/table/". $node->filter, array('title' => t('Table view')));
       }
       break;
   }
@@ -151,7 +163,7 @@ function event_settings() {
   $group .= form_textfield(t('Upcoming event block limit'), 'event_upcoming_limit', variable_get('event_upcoming_limit', '6'), 5, 2, t('Limit the amount of events displayed in the upcoming events block by this amount.'));
   $output = form_group(t('General Event options'), $group);
 
-  $group = form_radios(t('Default overview'), 'event_overview', variable_get('event_overview', 'month'), array('day' => t('Day'), 'week' => t('Week'), 'month' => t('Month'), 'table' => t('Table')), t('The default event view to display when no format is specifically requested. This is also the view that will be displayed from the block calendar links.'));
+  $group = form_radios(t('Default overview'), 'event_overview', variable_get('event_overview', 'month'), array('day' => t('Day'), 'week' => t('Week'), 'month' => t('Month'), 'table' => t('Table'), 'list' => t('List')), t('The default event view to display when no format is specifically requested. This is also the view that will be displayed from the block calendar links.'));
   $group .= form_textfield(t('Table view default period'), 'event_table_duration', variable_get('event_table_duration', '30'), 5, 3, t('The default number of days to display in the table view. You can specify a different number of days in the url. More info on the event url format %link', array('%link' => l(t('here'), 'admin/help/event#url-format'))));
 
   if (module_exist('taxonomy')) {
@@ -292,6 +304,15 @@ function event_page($year = NULL, $month
         $headertitle = t('%startmonth %startdate, %startyear - %endmonth %enddate, %endyear', array('%startmonth' => t(gmdate('F', $stamp)), '%startdate' => gmdate('d', $stamp), '%startyear' => gmdate('Y', $stamp), '%endmonth' => t(gmdate('F', $endstamp)), '%enddate' => gmdate('d', $endstamp), '%endyear' => gmdate('Y', $endstamp)));
         $rows = event_calendar_table('page', $stamp, $endstamp, $types, $terms);
       break;
+    case 'list':
+        // list view
+        // next 30 day view, $duration can be set for different ranges
+        // but set a maximum $duration of 1 year.
+        $duration = $duration && $duration <= 366 ? $duration : variable_get('event_table_duration', '30');
+        $endstamp = $stamp + ($duration * 86400);
+        $headertitle = t('%startmonth %startdate, %startyear - %endmonth %enddate, %endyear', array('%startmonth' => t(gmdate('F', $stamp)), '%startdate' => gmdate('d', $stamp), '%startyear' => gmdate('Y', $stamp), '%endmonth' => t(gmdate('F', $endstamp)), '%enddate' => gmdate('d', $endstamp), '%endyear' => gmdate('Y', $endstamp)));
+        $rows = event_calendar_list('page', $stamp, $endstamp, $types, $terms);
+      break;
     case 'feed':
         // rss feed
         drupal_set_header('Content-Type: text/xml; charset=utf-8');
@@ -556,6 +577,34 @@ function event_calendar_table($op, $stam
 }
 
 /**
+ * Creates a themed list of events.
+ *
+ * @ingroup event_view
+ * @param $start The GMT starting date for the table. 
+ * @param $end The GMT ending date for the table.
+ * @return A themed list of events.
+ */
+function event_calendar_list($op, $stamp, $endstamp, $types = NULL, $terms = NULL) {
+
+  $today = _event_user_date();
+  $rows = '';
+
+  while ($stamp <= $endstamp) {
+    $year = gmdate('Y', $stamp);
+    $month = gmdate('m', $stamp);
+    $cur_day = gmdate('j', $stamp);
+    $month_name = gmdate('M', $stamp);
+    $dow = _event_day_of_week($stamp);
+    $weekdays = event_week_days();
+
+    $rows .= event_render_day($year, $month, $cur_day, 'list', $types, $terms);
+    $stamp += 86400;
+  }
+
+  return $rows;
+}
+
+/**
  * Creates an rss feed of events.
  *
  * @ingroup event_view
@@ -1109,17 +1158,16 @@ function event_render_day_single($year, 
  */
 function event_render_day($year, $month, $day, $view, $types, $terms) {
 
-  $output = theme('event_calendar_date_box', $year, $month, $day, $view);
-
   $nodes = event_calendar_data($year, $month, $day, $view, $types, $terms);
-
+ 
   if (count($nodes)) {
+    $output = theme('event_calendar_date_box', $year, $month, $day, $view);
     foreach ($nodes as $node) {
       $output .= theme('event_node_'. $view, $node);
     }
   }
   else {
-    $output .= theme('event_empty_day', $view);
+    $output .= theme('event_empty_day', $year, $month, $day, $view);
   }
 
   return $output;
Index: event.theme
===================================================================
RCS file: /cvs/drupal-contrib/contributions/modules/event/event.theme,v
retrieving revision 1.15
diff -u -F^f -r1.15 event.theme
--- event.theme	30 Jun 2005 15:08:15 -0000	1.15
+++ event.theme	13 Jul 2005 20:48:32 -0000
@@ -51,6 +51,16 @@ function theme_event_calendar_table($op,
 }
 
 /**
+ * Format a calendar view
+ *
+ * @param day
+ *   The day to display.
+ */
+function theme_event_calendar_list($op, $header, $rows) {
+  return '<div class="event-calendar"><div class="list-view">'. $rows ."</div></div>\n";
+}
+
+/**
  * Format an event node for display in an expanded calendar, like a calendar page
  *
  * @param node
@@ -238,6 +248,61 @@ function theme_event_node_table($node, $
   return $output;
 }
 
+function theme_event_node_list($node, $module = NULL) {
+  static $stripe, $stripe_map, $link_count;
+  $link_count++;
+
+  if (!$stripe_map[$node->nid]) {
+    if ($stripe >= 10) {
+      $stripe = 1;
+    }
+    else {
+      $stripe++;
+    }
+    $stripe_map[$node->nid] = $stripe;
+  }
+
+  $output .= '<div class="event tableview">'."\n";
+  $output .= '<div class="stripe-'. $stripe_map[$node->nid] .'"></div>'."\n";
+  if (!$module) {
+    $output .= '<div class="type">'. l('('. $node->event_node_title .')', 'event/'.gmdate('Y/m/d', $node->event_start).'/table/'.$node->type, array('title' => t('limit view to events of this type'))).'</div>'."\n";
+  }
+  $output .= '<div class="title">'. l($node->title, "node/$node->nid", array('title' => t('view this event'))) .'</div>'."\n";
+
+  switch ($node->event_state) {
+    case 'singleday';
+        $output .= '<div class="start">'. t('Start') .': '. $node->start_time_format ."</div>\n";
+        if ($node->event_start != $node->event_end) {
+          $output .= '<div class="end">'. t('End') .': '. $node->end_time_format ."</div>\n";
+        }
+      break;
+    case 'start':
+        $output .= '<div class="start">'. t('Start') .': '. $node->start_time_format ."</div>\n";
+      break;
+    case 'end':
+        $output .= '<div class="end">'. t('End') .': '. $node->end_time_format ."</div>\n";
+      break;
+    case 'ongoing':
+        $output .= '<div class="ongoing">('. t('all day') .')</div>'."\n";
+      break;
+  }
+
+  $output .= '<div id="info_'. $link_count .'" class="info">'."\n";
+  if ($node->event_state != 'singleday') {
+    $output .= '<div class="start">'. t('Start') .': '. $node->start_format .'</div>'."\n";
+    if ($node->event_start != $node->event_end) {
+      $output .= '<div class="end">'. t('End') .': '. $node->end_format .'</div>'."\n";
+    }
+  }
+  $output .= '<div class="content">'. $node->teaser .'</div></div>'."\n";
+
+  $links = $node->event_links;
+  $links[] = l(t('more info'), 'node/'.$node->nid, array('onclick' => "popupnotes('info_". $link_count ."'); return false;", 'title' => t('Show detailed information for this event.')));
+  $output .= '<div class="links">'. theme('links', $links) ."\n</div>";
+  $output .= '</div>'."\n";
+  return $output;
+}
+
 /**
  * Format an date's day box in a calendar
  *
@@ -249,6 +314,9 @@ function theme_event_calendar_date_box($
     case 'table':
         $output = '<div class="day">'. t('%month / %day', array('%month' => $month, '%day' => $day)) .'</div>'."\n";
       break;
+    case 'list':
+        $output = '<div class="day">'. format_date(_event_mktime(0, 0, 0, $month, $day, $year), 'custom', 'l, F j, Y') .'</div>'."\n";
+      break;
     case 'day':
      break;
     default:
@@ -264,8 +332,22 @@ function theme_event_calendar_date_box($
  * @param day
  *   The day to display.
  */
-function theme_event_empty_day() {
-  return '<div class="event-empty"></div>'."\n";
+function theme_event_empty_day($year, $month, $day, $view) {
+  switch ($view) {
+    case 'table':
+        $output = '<div class="day">'. t('%month / %day', array('%month'
+=> $month, '%day' => $day)) .'</div>'."\n";
+        $output .= '<div class="event-empty"></div>'."\n";
+      break;
+    case 'day':
+    case 'list':
+     break;
+    default:
+        $output = '<div class="day">'. $day .'</div>'."\n";
+        $output .= '<div class="event-empty"></div>'."\n";
+      break;
+  }
+  return $output;
 }
 
 /**
