You are here

function hds_heartbeat_view in Heartbeat 6.4

Implementation of hook_heartbeat_view().

File

modules/hds/hds.module, line 53
Heartbeat displays module.

Code

function hds_heartbeat_view(&$messages, HeartbeatAccess $stream) {
  foreach ($messages as $key => $message) {

    // Override the build mode if a different is specified
    if (isset($message->template->variables['build_mode'])) {
      $messages[$key]->build_mode = $message->template->variables['build_mode'];
    }

    // Override the build mode with the one set on stream level.
    // But only if the stream build mode is prior to message type level settings.
    if (isset($stream->stream->variables['build_mode']) && $stream->stream->variables['build_mode'] != 'none') {
      $messages[$key]->build_mode = $stream->stream->variables['build_mode'];
    }
    ds_build_fields_and_regions($messages[$key], 'hds');
  }
}