You are here

function template_preprocess_calendar_node in Calendar 7.2

Same name in this branch
  1. 7.2 theme/theme.inc \template_preprocess_calendar_node()
  2. 7.2 calendar_multiday/theme/theme.inc \template_preprocess_calendar_node()
Same name and namespace in other branches
  1. 6.2 theme/theme.inc \template_preprocess_calendar_node()
  2. 6.2 calendar_multiday/theme/theme.inc \template_preprocess_calendar_node()
  3. 7 theme/theme.inc \template_preprocess_calendar_node()
  4. 7 calendar_multiday/theme/theme.inc \template_preprocess_calendar_node()

Format an calendar node for display.

6 calls to template_preprocess_calendar_node()
template_preprocess_calendar_day_node in theme/theme.inc
Format an calendar day node for display.
template_preprocess_calendar_day_node in calendar_multiday/theme/theme.inc
Format an calendar day node for display.
template_preprocess_calendar_month_node in theme/theme.inc
Format an calendar month node for display.
template_preprocess_calendar_month_node in calendar_multiday/theme/theme.inc
Format an calendar month node for display.
template_preprocess_calendar_week_node in theme/theme.inc
Format an calendar week node for display.

... See full list

File

theme/theme.inc, line 563
Theme functions for the Calendar module.

Code

function template_preprocess_calendar_node(&$vars) {
  $node = $vars['node'];
  $view = $vars['view'];
  $fields = array();
  foreach ($view->field as $name => $field) {
    $data = $node->rendered[$name];
    $label = $field->options['label'];

    // CCK has some special label options.
    if (!empty($field->content_field)) {
      switch ($field->options['label_type']) {
        case 'none':
          $label = '';
          break;
        case 'widget':
          $label = $field->content_field['widget']['label'];
          break;
      }
    }
    $fields[$name] = array(
      'id' => drupal_clean_css_identifier($node->id),
      'label' => $label,
      'data' => $data,
    );
  }
  $vars['fields'] = $fields;
  $vars['calendar_start'] = $node->calendar_start;
  $vars['calendar_end'] = $node->calendar_end;
  $vars['calendar_start_date'] = $node->calendar_start_date;
  $vars['calendar_end_date'] = $node->calendar_end_date;
}