You are here

function heartbeat_plugins_form_alter in Heartbeat 7

Implements hook_form_alter().

_state

Parameters

array $form:

File

modules/heartbeat_plugins/heartbeat_plugins.module, line 97

Code

function heartbeat_plugins_form_alter(&$form, &$form_state, $form_id) {

  // Hook into the ctools edit form for heartbeat message templates.
  if ($form_id == 'ctools_export_ui_edit_item_form') {

    // Hook into the message template form.
    if (isset($form['info']['message_id'])) {
      _heartbeat_plugins_template_attachments_sort_form($form, $form_state);
    }

    // Hook into the stream configuration form.
    if (isset($form['info']['class']) && isset($form['real_class'])) {
      foreach (heartbeat_plugins_get_active_plugins() as $pluginWrapper) {
        $plugin = $pluginWrapper
          ->getPlugin();
        if ($plugin && $plugin
          ->adaptsStream()) {
          $plugin
            ->pluginStreamForm($form, $form_state);
        }
      }
    }
  }
}