You are here

function notifications_event_enabled in Notifications 6.4

Same name and namespace in other branches
  1. 6.2 notifications.module \notifications_event_enabled()
  2. 6.3 notifications.module \notifications_event_enabled()
  3. 7 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

8 calls to notifications_event_enabled()
notifications_admin_events_tree_form in ./notifications.admin.inc
Build tree of event types
notifications_content_comment in notifications_content/notifications_content.module
Implementation of hook_comment().
notifications_content_content_extra_fields in notifications_content/notifications_content.module
Implementation of hook hook_content_extra_fields().
notifications_content_form_alter in notifications_content/notifications_content.module
Implementation of hook_form_alter().
Notifications_Event::create in includes/notifications_event.class.inc
Build new event object from array of data

... See full list

3 string references to 'notifications_event_enabled'
NotificationsContentTests::testNotificationsContent in tests/notifications_content.test
Play with creating, retrieving, deleting a pair subscriptions
notifications_admin_events_form in ./notifications.admin.inc
Event configuration administration
notifications_content_update_6002 in notifications_content/notifications_content.install
Update enabled options (again)

File

./notifications.module, line 601
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_types($key, 'parent'))) {
    return notifications_event_enabled($parent, FALSE);
  }
  else {
    return $status;
  }
}