You are here

function heartbeat_message_activity in Heartbeat 7

Same name and namespace in other branches
  1. 6.4 heartbeat.pages.inc \heartbeat_message_activity()

Page callback for one activity message.

1 string reference to 'heartbeat_message_activity'
heartbeat_menu in ./heartbeat.module
Implements hook_menu().

File

./heartbeat.pages.inc, line 137
Separate codefile for page displays

Code

function heartbeat_message_activity($heartbeatActivity) {

  // Set the page title.
  $title = '';
  if ($heartbeatActivity->actor->uid) {
    $title = t('Activity of @username', array(
      '@username' => entity_label('user', $heartbeatActivity->actor),
    ));
  }
  drupal_set_title($title);
  $heartbeatStream = heartbeat_stream('singleactivity', 1);
  $content = array();

  // Configuration at runtime.
  if ($heartbeatStream) {
    $heartbeatStream
      ->setLatestActivityId($heartbeatActivity->uaid);
    heartbeat_stream_build($heartbeatStream);
    $content['#theme'] = 'heartbeat_list';
    $content['#stream'] = $heartbeatStream;
    $content['#content'] = heartbeat_stream_view($heartbeatStream);
  }
  else {
    $content['error'] = array(
      '#markup' => t('You are not allowed to see this message.'),
    );
  }
  return $content;
}