You are here

function flickr_sets_admin_settings_validate in Flickr 7

Validate user input.

1 string reference to 'flickr_sets_admin_settings_validate'
flickr_sets_form_flickr_admin_settings_alter in sets/flickr_sets.admin.inc
Implements hook_form_FORM_ID_alter().

File

sets/flickr_sets.admin.inc, line 60
The admin settings for the Flickr Sets module.

Code

function flickr_sets_admin_settings_validate($form, &$form_state) {

  // Validate sets per page.
  $limit = trim($form_state['values']['flickr_sets_per_page']);
  if (!ctype_digit($limit) || $limit < 1) {
    form_set_error('flickr_sets_per_page', t('Set an integer from 1 to 99.'));
  }

  // Validate photos per set.
  $limit = trim($form_state['values']['flickr_sets_photos_per_set']);
  if (!ctype_digit($limit) || $limit < 1) {
    form_set_error('flickr_sets_photos_per_set', t('Set an integer from 1 to 99.'));
  }
}