You are here

function heartbeat_stream_save in Heartbeat 6.4

Helper function to save a heartbeat stream / access type

1 call to heartbeat_stream_save()
heartbeat_activity_stream_configure_submit in ./heartbeat.admin.inc
Callback function to configure a heartbeat stream

File

./heartbeat.module, line 1778

Code

function heartbeat_stream_save($access_type, $properties = array()) {
  $access_types = variable_get('heartbeat_access_types', array());
  foreach ($access_types as $key => $type) {

    // Fix the old naming convention for backward compatibility upgrades
    // If the class name (with capitals) is a hash key, dump it
    if (drupal_strtolower($key) != $key) {
      unset($access_types[$key]);
    }

    // Merge the new values for this stream configuration
    $realname = drupal_strtolower(isset($type['realname']) ? $type['realname'] : $type['class']);
    if ($realname == drupal_strtolower($access_type)) {
      $access_types[$key] = array_merge($access_types[$key], $properties);
    }
  }
  variable_set('heartbeat_access_types', $access_types);
  drupal_set_message('Activity stream settings saved.');
}