You are here

function theme_heartbeat_list in Heartbeat 6.4

Same name and namespace in other branches
  1. 6.3 heartbeat.module \theme_heartbeat_list()
  2. 7 heartbeat.module \theme_heartbeat_list()

Theme function for a list of heartbeat activity messages.

2 theme calls to theme_heartbeat_list()
heartbeat_message_activity in ./heartbeat.pages.inc
Page callback for one activity message.
theme_heartbeat_block in ./heartbeat.module
Theme function for a block of heartbeat activity messages.

File

./heartbeat.module, line 851

Code

function theme_heartbeat_list($messages, HeartbeatAccess $heartbeatAccess, $link = '') {
  global $user, $language;
  $content = '';
  drupal_add_css(drupal_get_path('module', 'heartbeat') . '/heartbeat.css');
  $access_type = drupal_strtolower($heartbeatAccess
    ->getAccess());
  $stream = $heartbeatAccess->stream;
  if ($stream->display_filters) {
    $content .= theme('heartbeat_filters', $stream);
  }
  $class = $heartbeatAccess
    ->isPage() ? 'page' : 'block';
  $content .= '<div id="heartbeat-stream-' . $access_type . '" class="heartbeat-' . $class . ' heartbeat-stream heartbeat-stream-' . $access_type . '">';
  $content .= '<div class="heartbeat-messages-wrapper">';
  if (empty($messages)) {
    if ($heartbeatAccess
      ->hasErrors()) {
      $content .= '<p>' . implode('<br />', $heartbeatAccess
        ->getErrors()) . '</p>';
    }
    else {
      $content .= '<p>' . t('No activity yet.') . '</p>';
    }
  }
  else {
    $content .= theme('heartbeat_messages', $messages, $heartbeatAccess, $link);
  }
  $content .= '</div>';
  $content .= '</div>';
  return $content;
}