You are here

function headerimage_settings_block_add_validate in Header image 7

Same name and namespace in other branches
  1. 5 headerimage.module \headerimage_settings_block_add_validate()
  2. 6 headerimage.admin.inc \headerimage_settings_block_add_validate()

File

./headerimage.admin.inc, line 59
headerimage.admin.inc

Code

function headerimage_settings_block_add_validate($form, &$form_state) {
  $blocks = headerimage_get_blocks();
  if (!empty($blocks)) {

    // Check if name is unique
    if (in_array($form_state['values']['title'], $blocks)) {
      form_set_error('', t('Header Image block %s already exists. Please use a different name.', array(
        '%s' => $form_state['values']['title'],
      )));
    }
  }
}