You are here

function _eminline_url_settings_form_validate in Embedded Media Field 5

Same name and namespace in other branches
  1. 6.3 contrib/eminline/eminline.module \_eminline_url_settings_form_validate()
  2. 6 contrib/eminline/eminline.module \_eminline_url_settings_form_validate()
  3. 6.2 contrib/eminline/eminline.module \_eminline_url_settings_form_validate()

File

contrib/eminline/eminline.module, line 204

Code

function _eminline_url_settings_form_validate($form_id, $form_values, $form, $format) {
  if (!is_numeric($form_values['eminline_' . $format]['video']['video_width']) || intval($form_values['eminline_' . $format]['video']['video_width']) != $form_values['eminline_' . $format]['video']['video_width'] || $form_values['eminline_' . $format]['video']['video_width'] < 1) {
    form_set_error('eminline_' . $format . '][video][video_width', t('"Video width" must be a positive integer.'));
  }
  if (!is_numeric($form_values['eminline_' . $format]['video']['video_height']) || intval($form_values['eminline_' . $format]['video']['video_height']) != $form_values['eminline_' . $format]['video']['video_height'] || $form_values['eminline_' . $format]['video']['video_height'] < 1) {
    form_set_error('eminline_' . $format . '][video][video_height', t('"Video height" must be a positive integer.'));
  }
  if (!is_numeric($form_values['eminline_' . $format]['preview']['preview_width']) || intval($form_values['eminline_' . $format]['preview']['preview_width']) != $form_values['eminline_' . $format]['preview']['preview_width'] || $form_values['eminline_' . $format]['preview']['preview_width'] < 1) {
    form_set_error('eminline_' . $format . '][preview][preview_width', t('"Preview width" must be a positive integer.'));
  }
  if (!is_numeric($form_values['eminline_' . $format]['preview']['preview_height']) || intval($form_values['eminline_' . $format]['preview']['preview_height']) != $form_values['eminline_' . $format]['preview']['preview_height'] || $form_values['eminline_' . $format]['preview']['preview_height'] < 1) {
    form_set_error('eminline_' . $format . '][preview][preview_height', t('"Preview height" must be a positive integer.'));
  }
  if (!is_numeric($form_values['eminline_' . $format]['tn']['thumbnail_height']) || intval($form_values['eminline_' . $format]['tn']['thumbnail_height']) != $form_values['eminline_' . $format]['tn']['thumbnail_height'] || $form_values['eminline_' . $format]['tn']['thumbnail_height'] < 1) {
    form_set_error('eminline_' . $format . '][tn][thumbnail_height', t('"Thumbnail height" must be a positive integer.'));
  }
  if (!is_numeric($form_values['eminline_' . $format]['tn']['thumbnail_width']) || intval($form_values['eminline_' . $format]['tn']['thumbnail_width']) != $form_values['eminline_' . $format]['tn']['thumbnail_width'] || $form_values['eminline_' . $format]['tn']['thumbnail_width'] < 1) {
    form_set_error('eminline_' . $format . '][tn][thumbnail_width', t('"Thumbnail width" must be a positive integer.'));
  }
}