function notifications_update_user_subscriptions in Notifications 6.4
Same name and namespace in other branches
- 6.2 notifications.pages.inc \notifications_update_user_subscriptions()
- 6.3 notifications.pages.inc \notifications_update_user_subscriptions()
Bulk update all user subscriptions, confirmation form
Parameters
$account: User account
$operation: Operation to perform: enable, disable
1 string reference to 'notifications_update_user_subscriptions'
- notifications_menu in ./
notifications.module - Implementation of hook_menu().
File
- ./
notifications.pages.inc, line 540 - User pages for Notifications
Code
function notifications_update_user_subscriptions($form_state, $account, $operation) {
$form['account'] = array(
'#type' => 'value',
'#value' => $account,
);
$form['operation'] = array(
'#type' => 'value',
'#value' => $operation,
);
$destination = 'user/' . $account->uid . '/notifications';
$form['#redirect'] = $destination;
if ($operation == 'enable') {
return confirm_form($form, t('Are you sure you want to enable all your subscriptions?'), $destination, t('You will get notifications again for all of them.'), t('Enable'), t('Cancel'));
}
elseif ($operation == 'disable') {
return confirm_form($form, t('Are you sure you want to disable all your subscriptions?'), $destination, t('You will stop getting notifications until you enable them again.'), t('Disable'), t('Cancel'));
}
else {
drupal_access_denied();
}
}