function notifications_user_setting in Notifications 5
Same name and namespace in other branches
- 6.4 notifications.module \notifications_user_setting()
- 6 notifications.module \notifications_user_setting()
- 6.2 notifications.module \notifications_user_setting()
- 6.3 notifications.module \notifications_user_setting()
- 7 notifications.module \notifications_user_setting()
Gets a user setting, defaults to default system setting for each
Parameters
$name: Setting name
$account: Optional user account, will default to current user
$default: Optional default to return if this is not set
10 calls to notifications_user_setting()
- notifications_autosubscribe in notifications_autosubscribe/
notifications_autosubscribe.module - Subscribes users to content they post, if not already subscribed
- notifications_autosubscribe_form_alter in notifications_autosubscribe/
notifications_autosubscribe.module - Implementation of hook_form_alter()
- notifications_autosubscribe_notifications_node_form_alter in notifications_autosubscribe/
notifications_autosubscribe.module - Implementation of hook_notifications_node_form_alter
- notifications_content_form in notifications_content/
notifications_content.module - Generic subscriptions content form
- Notifications_Content_Tests::testNotificationsContent in tests/
notifications_content.test - Play with creating, retrieving, deleting a pair subscriptions
File
- ./
notifications.module, line 210 - Notifications module
Code
function notifications_user_setting($name, $account = NULL, $default = NULL) {
global $user;
$account = $account ? $account : $user;
// Default send method is taken from messaging module
if ($name == 'send_method') {
return messaging_method_default($account);
}
$field = 'notifications_' . $name;
if (isset($account->{$field})) {
return $account->{$field};
}
else {
return variable_get('notifications_default_' . $name, $default);
}
}