You are here

function image_settings_sizes_validate in Image 5

Same name and namespace in other branches
  1. 5.2 image.module \image_settings_sizes_validate()

Check that the sizes provided have the required amount of information.

File

./image.module, line 170

Code

function image_settings_sizes_validate(&$form) {
  foreach (element_children($form) as $key) {

    // If there's a label they must provide at either a height or width.
    if ($key != IMAGE_ORIGINAL && !empty($form[$key]['label']['#value'])) {
      if (empty($form[$key]['width']['#value']) && empty($form[$key]['height']['#value'])) {
        form_set_error("image_sizes][{$key}][width", t('Must specify a width or height.'));
      }
    }
  }
}