You are here

function heartbeat_plugins_preprocess_heartbeat_attachments in Heartbeat 7

Preprocess function for the heartbeat activity attachments.

File

modules/heartbeat_plugins/heartbeat_plugins.module, line 426

Code

function heartbeat_plugins_preprocess_heartbeat_attachments(&$variables) {
  $pluginAttachments = isset($variables['heartbeat_activity']->additions->plugins) ? $variables['heartbeat_activity']->additions->plugins : array();
  foreach ($pluginAttachments as $pluginId => $plugin) {
    if ($plugin
      ->hasAttachmentsContent()) {
      $plugin
        ->renderAttachmentsContent($variables['heartbeat_activity']);
    }
  }
  $variables['attachments'] = $variables['heartbeat_activity']->attachments;
}