You are here

function _subscriptions_content_validate_blocked_nodes in Subscriptions 6

Same name and namespace in other branches
  1. 5.2 subscriptions_content.module \_subscriptions_content_validate_blocked_nodes()
  2. 7 subscriptions_content.admin.inc \_subscriptions_content_validate_blocked_nodes()
  3. 2.0.x subscriptions_content/subscriptions_content.admin.inc \_subscriptions_content_validate_blocked_nodes()

Validate the 'subscriptions_blocked_nodes' input.

1 string reference to '_subscriptions_content_validate_blocked_nodes'
subscriptions_content_form_subscriptions_settings_form_alter in ./subscriptions_content.module
Implementation of hook_form_alter().

File

./subscriptions_content.module, line 367
Subscriptions to content events

Code

function _subscriptions_content_validate_blocked_nodes($form, $form_state) {
  $form_values = $form_state['values'];
  $values = $form_values['subscriptions_blocked_nodes'];
  if (!empty($values)) {
    $values = explode(' ', $values);
    foreach ($values as $v) {
      if (!empty($v) && !is_numeric($v)) {
        form_set_error('subscriptions_blocked_nodes', t('Enter a series of numbers, separated by spaces.'));
        break;
      }
    }
  }
}