You are here

function fblikebutton_config_form_validate in Facebook Like Button 7.2

Same name and namespace in other branches
  1. 6.2 fblikebutton.admin.inc \fblikebutton_config_form_validate()

Validation handler for fblikebutton_dynamic_settings form.

2 string references to 'fblikebutton_config_form_validate'
fblikebutton_dynamic_settings in ./fblikebutton.admin.inc
Settings for the dynamic FB button in full node viewmode and teaser viewmode.
fblikebutton_static_settings in ./fblikebutton.admin.inc
Settings for the static FB Like button block.

File

./fblikebutton.admin.inc, line 238
Admin functions for fblikebutton.

Code

function fblikebutton_config_form_validate($form, &$form_state) {
  if (isset($form_state['values']['fblikebutton_iframe_width'])) {
    if (!is_numeric($form_state['values']['fblikebutton_iframe_width']) || $form_state['values']['fblikebutton_iframe_width'] <= 0) {
      form_set_error('fblikebutton_iframe_width', t('The width of the like button must be a positive number that is greater than 0 (examples: 201 or 450 or 1024).'));
    }
  }
  if (isset($form_state['values']['fblikebutton_iframe_height'])) {
    if (!is_numeric($form_state['values']['fblikebutton_iframe_height']) || $form_state['values']['fblikebutton_iframe_height'] <= 0) {
      form_set_error('fblikebutton_iframe_height', t('The height of the like button must be a positive number that is greater than 0 (examples: 201 or 450 or 1024).'));
    }
  }
  if (isset($form_state['values']['fblikebutton_bl_iframe_width'])) {
    if (!is_numeric($form_state['values']['fblikebutton_bl_iframe_width']) || $form_state['values']['fblikebutton_bl_iframe_width'] <= 0) {
      form_set_error('fblikebutton_bl_iframe_width', t('The width of the like button must be a positive number that is greater than 0 (examples: 201 or 450 or 1024).'));
    }
  }
  if (isset($form_state['values']['fblikebutton_bl_iframe_height'])) {
    if (!is_numeric($form_state['values']['fblikebutton_bl_iframe_height']) || $form_state['values']['fblikebutton_bl_iframe_height'] <= 0) {
      form_set_error('fblikebutton_bl_iframe_height', t('The height of the like button must be a positive number that is greater than 0 (examples: 201 or 450 or 1024).'));
    }
  }
  if (isset($form_state['values']['fblikebutton_weight'])) {
    if (!is_numeric($form_state['values']['fblikebutton_weight'])) {
      form_set_error('fblikebutton_weight', t('The weight of the like button must be a number (examples: 50 or -42 or 0).'));
    }
  }
  if (isset($form_state['values']['fblikebutton_bl_weight'])) {
    if (!is_numeric($form_state['values']['fblikebutton_bl_weight'])) {
      form_set_error('fblikebutton_bl_weight', t('The weight of the like button must be a number (examples: 50 or -42 or 0).'));
    }
  }
}