function notifications_event_enabled in Notifications 7
Same name and namespace in other branches
- 6.4 notifications.module \notifications_event_enabled()
- 6.2 notifications.module \notifications_event_enabled()
- 6.3 notifications.module \notifications_event_enabled()
Check whether we have enabled events of this type
Parameters
$key: Event type key
$default: Default value to return if not set
4 calls to notifications_event_enabled()
- notifications_admin_events_tree_form in ./
notifications.admin.inc - Build tree of event types
- notifications_content_content_extra_fields in notifications_content/
notifications_content.module - Implementation of hook hook_content_extra_fields().
- notifications_content_node_event_enabled in notifications_content/
notifications_content.module - Check whether a specific event type is enabled for this node type
- notifications_event_enabled_types in ./
notifications.module - Get event types. Invoking this function will also load the event API
2 string references to 'notifications_event_enabled'
- NotificationsContentTests::testNotificationsContent in tests/
notifications_content.test - Play with creating, retrieving, deleting a pair subscriptions
- notifications_content_update_6002 in notifications_content/
notifications_content.install - Update enabled options (again)
File
- ./
notifications.module, line 741 - Notifications module
Code
function notifications_event_enabled($key, $default = TRUE) {
$info = variable_get('notifications_event_enabled', array());
$status = isset($info[$key]) ? $info[$key] : $default;
// If this has a parent type, will be enabled just if parent is
if ($status && ($parent = notifications_event_type($key, 'parent'))) {
return notifications_event_enabled($parent, FALSE);
}
else {
return $status;
}
}