function headerimage_settings_block_add_validate in Header image 5
Same name and namespace in other branches
- 6 headerimage.admin.inc \headerimage_settings_block_add_validate()
- 7 headerimage.admin.inc \headerimage_settings_block_add_validate()
File
- ./
headerimage.module, line 122 - headerimage.module Conditionally display an node in a block.
Code
function headerimage_settings_block_add_validate($form_id, $form_values) {
$blocks = headerimage_get_blocks();
if (!empty($blocks)) {
// Check if name is unique
if (in_array($form_values['title'], $blocks)) {
form_set_error('', t('Header Image block %s already exists. Please use a different name.', array(
'%s' => $form_values['title'],
)));
}
}
}