You are here

function notifications_manage_subscriptions_form_validate in Notifications 6.3

Same name and namespace in other branches
  1. 6.4 notifications.manage.inc \notifications_manage_subscriptions_form_validate()
  2. 6 notifications.manage.inc \notifications_manage_subscriptions_form_validate()
  3. 6.2 notifications.manage.inc \notifications_manage_subscriptions_form_validate()
  4. 7 notifications.manage.inc \notifications_manage_subscriptions_form_validate()

Validate notifications_admin_subscriptions form submissions.

Check if any items have been selected to perform the chosen 'Update option' on.

1 string reference to 'notifications_manage_subscriptions_form_validate'
notifications_manage_subscriptions_form in ./notifications.manage.inc
Administer user subscriptions

File

./notifications.manage.inc, line 138
Common functions for bulk management of subscriptions

Code

function notifications_manage_subscriptions_form_validate($form, &$form_state) {
  $items = array_filter($form_state['values']['subscriptions']);
  if (count($items) == 0) {
    form_set_error('', t('No items selected.'));
  }
  else {
    if (!notifications_manage_subscriptions_access(array_keys($items))) {
      form_set_error('', t('You don\'t have permissions to manage these subscriptions'));
    }
  }
}