You are here

function notifications_object_subscribe_options in Notifications 6.4

Get subscription options for object, account. Only enabled subscription types

2 calls to notifications_object_subscribe_options()
notifications_object_user_subscriptions in includes/object.inc
Get list of possible and existing subscriptions for user/object
notifications_user_get_subscriptions in ./notifications.module
Get active subscriptions for a given user to some object

File

includes/object.inc, line 76
Notifications object and fields

Code

function notifications_object_subscribe_options($type, $object, $account = NULL) {
  $account = $account ? $account : $GLOBALS['user'];
  $object = notifications_object_load($type, $object);
  $subscriptions = module_invoke_all('notifications_object_' . $type, 'subscriptions', $object, $account);

  // Filter out subscription types that are disabled
  foreach ($subscriptions as $key => $subs) {
    $type = is_object($subs) ? $subs->type : $subs['type'];
    if (!notifications_subscription_type_enabled($type)) {
      unset($subscriptions[$key]);
    }
  }
  return $subscriptions;
}