function notifications_subscription_types in Notifications 6.4
Same name and namespace in other branches
- 5 notifications.module \notifications_subscription_types()
- 6 notifications.module \notifications_subscription_types()
- 6.2 notifications.module \notifications_subscription_types()
- 6.3 notifications.module \notifications_subscription_types()
Get info about subscription types
Parameters
$type: String, the subscriptions type OPTIONAL
$field: String, a specific field to retrieve info from OPTIONAL
$check_access: Whether to check user access and filter out disabled types
Information for a given field and type or information for a given field for all types
25 calls to notifications_subscription_types()
- NotificationsContentTests::testNotificationsContent in tests/
notifications_content.test - Play with creating, retrieving, deleting a pair subscriptions
- NotificationsTestCase::enableSubscriptionTypes in tests/
notifications_test_case.inc - NotificationsTestCase::enableUIPages in tests/
notifications_test_case.inc - notifications_access_user_add in ./
notifications.module - Menu access callback, add a given subscription type
- notifications_admin_status_page in ./
notifications.admin.inc - Current subscriptions page
1 string reference to 'notifications_subscription_types'
- notifications_subscription_type_enabled in ./
notifications.module - Check if this type is enabled
File
- ./
notifications.module, line 1055 - Notifications module
Code
function notifications_subscription_types($type = NULL, $field = NULL, $check_access = FALSE) {
$types = notifications_info('subscription types');
$result = $types;
if ($check_access) {
foreach ($types as $key => $info) {
if (!empty($info['disabled']) || !notifications_subscription_type_enabled($key) || !empty($info['access']) && !user_access($info['access'])) {
unset($result[$key]);
}
}
}
return notifications_array_info($result, $type, $field);
}