You are here

function resp_img_add_style_form_validate in Responsive images and styles 7

File

./resp_img.admin.inc, line 113
Admin settings

Code

function resp_img_add_style_form_validate($form, &$form_state) {
  foreach (array_filter($form_state['values']['suffixes']) as $suffix) {
    if (image_style_load($form_state['values']['base_name'] . $suffix)) {
      form_set_error('suffixes', t('An image style with the name !name already exists', array(
        '!name' => $form_state['values']['base_name'] . $suffix,
      )));
    }
  }
}