View source
<?php
function theme_event_calendar_month($op, $header, $rows, $attributes = array(), $caption = NULL) {
$output = theme("table", $header, $rows, $attributes, $caption);
return '<div class="event-calendar"><div class="month-view">' . $output . "</div></div>\n";
}
function theme_event_calendar_week($op, $header, $rows, $attributes = array(), $caption = NULL) {
$output = theme("table", $header, $rows, $attributes, $caption);
return '<div class="event-calendar"><div class="week-view">' . $output . "</div></div>\n";
}
function theme_event_calendar_day($op, $header, $rows, $attributes = array(), $caption = NULL) {
$output = theme("table", $header, $rows, $attributes, $caption);
return '<div class="event-calendar"><div class="day-view">' . $output . "</div></div>\n";
}
function theme_event_calendar_table($op, $header, $rows, $attributes = array(), $caption = NULL) {
$output = theme("table", $header, $rows, $attributes, $caption);
return '<div class="event-calendar"><div class="table-view">' . $output . "</div></div>\n";
}
function theme_event_calendar_list($op, $header, $rows) {
return '<div class="event-calendar"><div class="list-view">' . $rows . "</div></div>\n";
}
function theme_event_node_day($node) {
static $zebra;
$output .= '<div class="event dayview' . ($zebra++ % 2 ? ' odd' : '') . '">' . "\n";
if (variable_get('event_type_control', 'all') != 'never') {
if (count(event_get_types('all')) + count(event_get_types('solo')) > 1) {
$output .= '<div class="type">' . l('(' . $node->event_node_title . ')', 'event/' . gmdate('Y/m/d', $node->event_start) . '/day/' . $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";
$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";
}
$output .= '<div class="content">' . check_markup($node->teaser) . "</div>\n";
$output .= '<div class="links">' . theme('links', $node->event_links) . "\n</div>";
$output .= "</div>\n";
return $output;
}
function theme_event_node_week($node) {
static $stripe, $stripe_map;
if (!$stripe_map[$node->nid]) {
if ($stripe >= 10) {
$stripe = 1;
}
else {
$stripe++;
}
$stripe_map[$node->nid] = $stripe;
}
$output .= '<div class="event weekview">' . "\n";
$output .= '<div class="stripe-' . $stripe_map[$node->nid] . '"></div>' . "\n";
switch ($node->event_state) {
case 'singleday':
$times = '<div class="start">' . t('Start: ') . $node->start_time_format . '</div>' . "\n";
if ($node->event_start != $node->event_end) {
$times .= '<div class="end">' . t('End: ') . $node->end_time_format . '</div>' . "\n";
}
break;
case 'start':
$times = '<div class="start">' . t('Start: ') . $node->start_time_format . '</div>' . "\n";
break;
case 'end':
$times = '<div class="end">' . t('End: ') . $node->end_time_format . '</div>' . "\n";
break;
case 'ongoing':
$times = '<div class="ongoing">' . t('all day') . '</div>' . "\n";
break;
}
if (variable_get('event_type_control', 'all') != 'never') {
if (count(event_get_types('all')) + count(event_get_types('solo')) > 1) {
$output .= '<div class="type">' . l('(' . $node->event_node_title . ')', 'event/' . gmdate('Y/m/d', $node->event_current_date) . '/month/' . $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";
$output .= $times;
$output .= '<div class="links">' . theme('links', $node->event_links) . "\n</div>";
$output .= '</div>' . "\n";
return $output;
}
function theme_event_node_month($node) {
static $stripe, $stripe_map;
if (!$stripe_map[$node->nid]) {
if ($stripe >= 10) {
$stripe = 1;
}
else {
$stripe++;
}
$stripe_map[$node->nid] = $stripe;
}
$output .= '<div class="event monthview">' . "\n";
$output .= '<div class="stripe-' . $stripe_map[$node->nid] . '"></div>' . "\n";
switch ($node->event_state) {
case 'singleday':
$times = '<div class="start">' . t('Start: ') . $node->start_time_format . '</div>' . "\n";
if ($node->event_start != $node->event_end) {
$times .= '<div class="end">' . t('End: ') . $node->end_time_format . '</div>' . "\n";
}
break;
case 'start':
$times = '<div class="start">' . t('Start: ') . $node->start_time_format . '</div>' . "\n";
break;
case 'end':
$times = '<div class="end">' . t('End: ') . $node->end_time_format . '</div>' . "\n";
break;
case 'ongoing':
$times = '<div class="ongoing">' . t('all day') . '</div>' . "\n";
break;
}
if (variable_get('event_type_control', 'all') != 'never') {
if (count(event_get_types('all')) + count(event_get_types('solo')) > 1) {
$output .= '<div class="type">' . l('(' . $node->event_node_title . ')', 'event/' . gmdate('Y/m/d', $node->event_current_date) . '/month/' . $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";
$output .= $times;
$output .= '<div class="links">' . theme('links', $node->event_links) . "\n</div>";
$output .= '</div>' . "\n";
return $output;
}
function theme_event_node_table($node) {
static $stripe, $stripe_map, $link_count;
drupal_add_js(drupal_get_path('module', 'event') . '/event.js');
$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 (variable_get('event_type_control', 'all') != 'never') {
if (!$module && count(event_get_types('all')) + count(event_get_types('solo')) > 1) {
$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">' . check_markup($node->teaser) . '</div></div>' . "\n";
$links = $node->event_links;
$links['more_info'] = array(
'title' => t('more info'),
'href' => 'node/' . $node->nid,
'attributes' => 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;
}
function theme_event_node_list($node, $module = NULL) {
static $stripe, $stripe_map, $link_count;
drupal_add_js(drupal_get_path('module', 'event') . '/event.js');
$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 (variable_get('event_type_control', 'all') != 'never') {
if (!$module && count(event_get_types('all')) + count(event_get_types('solo')) > 1) {
$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">' . check_markup($node->teaser) . '</div></div>' . "\n";
$links = $node->event_links;
$links['more_info'] = array(
'title' => t('more info'),
'href' => 'node/' . $node->nid,
'attributes' => 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;
}
function theme_event_calendar_date_box($year, $month, $day, $view) {
switch ($view) {
case 'table':
$output = '<div class="day">' . t('%month / %day', array(
'%month' => $month,
'%day' => $day,
)) . '</div>' . "\n";
break;
case 'list':
$stamp = _event_mktime(0, 0, 0, $month, $day, $year);
$output = '<div class="day">' . t('%weekday %month %day, %year', array(
'%weekday' => t(format_date($stamp, 'custom', 'l')),
'%month' => t(format_date($stamp, 'custom', 'F')),
'%day' => $day,
'%year' => $year,
)) . '</div>' . "\n";
break;
case 'day':
break;
default:
$output = '<div class="day">' . $day . '</div>' . "\n";
break;
}
return $output;
}
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;
}
function theme_event_nodeapi($node) {
$output = '<div class="event-nodeapi"><div class="' . $node->type . '-start"><label>' . t('Start: ') . '</label>' . $node->start_format . '</div></div>' . "\n";
if ($node->event_start != $node->event_end) {
$output .= '<div class="event-nodeapi"><div class="' . $node->type . '-end"><label>' . t('End: ') . '</label>' . $node->end_format . '</div></div>' . "\n";
}
if (variable_get('configurable_timezones', 1)) {
include_once EVENT_PATH . '/event_timezones.inc';
$zones = event_zonelist();
$output .= '<div class="event-nodeapi"><div class="' . $node->type . '-tz"><label>' . t('Timezone: ') . '</label>' . $zones[$node->timezone] . '</div></div>' . "\n";
}
return $output;
}
function theme_event_filter_control($form) {
return '<div class="event-filter-control">' . $form . '</div>';
}
function theme_event_nav_next($url, $attributes = array()) {
return '<span class="next">' . l('»', $url, $attributes) . '</span>';
}
function theme_event_nav_prev($url, $attributes = array()) {
return '<span class="prev">' . l('«', $url, $attributes) . '</span>';
}
function theme_event_links($links, $view) {
return theme('links', $links);
}
function theme_event_ical_link($path) {
return '<div class="ical-link">' . l('<img src="' . base_path() . drupal_get_path('module', 'event') . '/images/ical16x16.gif" alt="' . t('Add to iCalendar') . '" />', $path, array(
'title' => t('Add this calendar to your iCalendar'),
), NULL, NULL, TRUE, TRUE) . '</div>';
}
function theme_event_more_link($path) {
return '<div class="more-link">' . l(t('more'), $path, array(
'title' => t('More events.'),
)) . '</div>';
}
function theme_event_upcoming_item($node) {
$output = l($node->title, "node/{$node->nid}", array(
'title' => $node->title,
));
if (count(event_get_types('all')) + count(event_get_types('solo')) > 1) {
$output .= '<span class="event-nodetype">' . t("({$node->typename})") . '</span>';
}
$output .= '<span class="event-timeleft">(' . $node->timeleft . ')</span>';
return $output;
}
function theme_event_upcoming_block($items) {
$output = theme("item_list", $items);
return $output;
}