function headerimage_settings_block_add_validate in Header image 6
Same name and namespace in other branches
- 5 headerimage.module \headerimage_settings_block_add_validate()
- 7 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'],
)));
}
}
}