You are here

function flashnode_admin_settings_validate in Flash Node 5.6

Same name and namespace in other branches
  1. 5.2 flashnode.module \flashnode_admin_settings_validate()
  2. 5.3 flashnode.module \flashnode_admin_settings_validate()
  3. 6.3 flashnode.admin.inc \flashnode_admin_settings_validate()
  4. 6.2 flashnode.admin.inc \flashnode_admin_settings_validate()

Validate flashnode_admin_settings to ensure that flashnode_max_width and flashnode_max_height are valid

File

./flashnode.module, line 847

Code

function flashnode_admin_settings_validate($form_id, $form_values) {

  // Check max width - must be numeric and not negative
  if (!is_numeric($form_values['flashnode_max_width']) || $form_values['flashnode_max_width'] < 0) {
    form_set_error('flashnode_max_width', t('The maximum displayed width must be zero or a positive number.'));
  }

  // Check max height - must be numeric and not negative
  if (!is_numeric($form_values['flashnode_max_height']) || $form_values['flashnode_max_height'] < 0) {
    form_set_error('flashnode_max_height', t('The maximum displayed height must be zero or a positive number.'));
  }
}