You are here

function notifications_ui_allowed_types in Notifications 5

Same name and namespace in other branches
  1. 6.4 notifications_ui/notifications_ui.module \notifications_ui_allowed_types()
  2. 6 notifications_ui/notifications_ui.module \notifications_ui_allowed_types()
  3. 6.2 notifications_ui/notifications_ui.module \notifications_ui_allowed_types()
  4. 6.3 notifications_ui/notifications_ui.module \notifications_ui_allowed_types()

Get list of allowed subscriptions types

Checks permissions and settings

Return value

Subscription types allowed for this user

1 call to notifications_ui_allowed_types()
notifications_ui_user_node in notifications_ui/notifications_ui.module
Get list of possible and existing subscriptions for user/node

File

notifications_ui/notifications_ui.module, line 241
User Interface for subscriptions modules

Code

function notifications_ui_allowed_types() {
  $enabled = variable_get('notifications_ui_types', array());
  $allowed = array();
  foreach (notifications_subscription_types() as $type => $info) {
    if (isset($enabled[$type]) && $enabled[$type] && !empty($info['access']) && user_access($info['access'])) {
      $allowed[$type] = $info;
    }
  }
  return $allowed;
}