You are here

function notifications_subscription_type_enabled in Notifications 7

Same name and namespace in other branches
  1. 6.4 notifications.module \notifications_subscription_type_enabled()

Check if this type is enabled or get array with all enabled types

11 calls to notifications_subscription_type_enabled()
notifications_access_subscribe in ./notifications.module
Menu access callback for subscribe links.
notifications_admin_subscriptions_settings in ./notifications.admin.inc
Subscription settings
notifications_admin_subscriptions_settings_submit in ./notifications.admin.inc
Subscription settings submit, disable all subscriptions not allowed
notifications_content_menu in notifications_content/notifications_content.module
Implementation of hook_menu_()
notifications_content_type_enabled in notifications_content/notifications_content.module
Get subscription options for this content type

... See full list

2 string references to 'notifications_subscription_type_enabled'
notifications_admin_subscriptions_settings_submit in ./notifications.admin.inc
Subscription settings submit, disable all subscriptions not allowed
Notifications_Event::subscription_types in ./notifications.event.inc
Get subscription types triggered by this event

File

./notifications.module, line 898
Notifications module

Code

function notifications_subscription_type_enabled($type = NULL) {
  if ($type) {
    $info = notifications_subscription_type($type);
    return empty($info['disabled']) && (!isset($info['enabled']) || $info['enabled']);
  }
  else {
    $types = array_keys(notifications_subscription_type());
    return array_filter($types, 'notifications_subscription_type_enabled');

    //array_combine($types, $types)
  }
}