You are here

function notifications_manage_subscriptions_form_validate in Notifications 6.4

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

2 string references to 'notifications_manage_subscriptions_form_validate'
notifications_destination_manage_subscriptions_form_options in includes/destination.inc
Form options
notifications_manage_subscriptions_form_options in ./notifications.manage.inc
Form options

File

./notifications.manage.inc, line 148
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'));
    }
  }
}