You are here

function event_calendar_table in Event 5

Same name and namespace in other branches
  1. 5.2 event.module \event_calendar_table()

Creates a themed table of events.

Parameters

$op :

$stamp The timestamp:

$endstamp end of the menu:

$types limit to given event node types:

$terms limit to nodes with these :

Return value

A fully themed table.

Related topics

1 call to event_calendar_table()
event_page in ./event.module
Displays a page containing event information. The page layout defaults to a graphical calendar.

File

./event.module, line 638

Code

function event_calendar_table($op, $stamp, $endstamp, $types = NULL, $terms = NULL) {
  $today = _event_user_date();
  $thead[] = array(
    'data' => ' ',
  );
  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();
    $tbody[][] = array(
      'colspan' => 3,
      'class' => strtolower("{$month_name} " . $weekdays[$dow]['day'] . ($stamp == $today ? ' today' : '') . ($cur_day == $day ? ' selected' : '')),
      'id' => strtolower($month_name . $cur_day),
      'data' => event_render_day($year, $month, $cur_day, 'table', $types, $terms),
    );
    $stamp += 86400;
  }
  return array(
    $thead,
    $tbody,
  );
}