You are here

function _subscriptions_content_validate_blocked_nodes in Subscriptions 2.0.x

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

Validates the 'subscriptions_blocked_nodes' input.

_state

Parameters

array $form:

1 string reference to '_subscriptions_content_validate_blocked_nodes'
_subscriptions_content_form_subscriptions_settings_form_alter in subscriptions_content/subscriptions_content.admin.inc
Implements hook_form_alter().

File

subscriptions_content/subscriptions_content.admin.inc, line 96
Subscriptions Content module (admin functions).

Code

function _subscriptions_content_validate_blocked_nodes(array $form, array $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;
      }
    }
  }
}