You are here

function template_preprocess_heartbeat_activity in Heartbeat 7

Process variables for heartbeat-activity.tpl.php.

File

./heartbeat.module, line 709
Module file for heartbeat activity. Basic hook implementations and helper functions will be found here.

Code

function template_preprocess_heartbeat_activity(&$variables) {
  $variables['view_mode'] = $variables['elements']['#view_mode'];
  $variables['heartbeat_activity'] = $variables['elements']['#heartbeat_activity'];
  $message = $variables['heartbeat_activity'];
  $variables['content'] = array();

  // Prepare $content variable for template file.
  foreach (element_children($variables['elements']) as $key) {
    $variables['content'][$key] = $variables['elements'][$key];
  }
  $variables['classes_array'][] = $variables['zebra'];
  $variables['classes_array'][] = 'heartbeat-activity-' . $message->uaid;
  $variables['classes_array'][] = $message->message_id;
  $variables['attributes_array']['id'] = 'heartbeat-activity-' . $message->uaid;

  // Preprocess fields.
  field_attach_preprocess('heartbeat_activity', $message, $variables['elements'], $variables);
}