You are here

function notifications_ui_display_options in Notifications 7

Same name and namespace in other branches
  1. 6.4 notifications_ui/notifications_ui.module \notifications_ui_display_options()

Check enabled option for object type / display type

@pram $check_option Option to check for object type: 'links', 'form', 'page', 'create'

Parameters

$type: Object type: node, user (subscribe to another user), account (own user account tab)

3 calls to notifications_ui_display_options()
NotificationsContentTests::testNotificationsUserPages in tests/notifications_content.test
Check all user pages before and after enabling permissions
notifications_ui_user in notifications_ui/notifications_ui.module
Implementation of hook_user().
notifications_ui_user_options in notifications_ui/notifications_ui.module
Check enabled option / Get options for user account pages

File

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

Code

function notifications_ui_display_options($type, $check_option = NULL, $object = NULL, $defaults = array(
  'links',
  'block',
)) {
  if ($type == 'node' && $object) {
    $options = notifications_ui_node_options($object->type);
  }
  else {
    $options = variable_get('notifications_ui_' . $type . '_options', $defaults);
  }
  if ($check_option) {
    return in_array($check_option, $options, TRUE);
  }
  else {
    return $options;
  }
}