You are here

function featured_content_num_words_in_title_validate in Featured Content 7

Same name and namespace in other branches
  1. 6.2 featured_content.admin.inc \featured_content_num_words_in_title_validate()
  2. 6 featured_content.admin.inc \featured_content_num_words_in_title_validate()
  3. 7.2 featured_content.module \featured_content_num_words_in_title_validate()

Validate that we have a valid minimum number of words to search against in the title.

1 string reference to 'featured_content_num_words_in_title_validate'
featured_content_block_configure in ./featured_content.module
Implements hook_block_configure().

File

./featured_content.module, line 2190
Featured Content module for created related & featured content blocks.

Code

function featured_content_num_words_in_title_validate($element, &$form_state) {

  // If we're not filtering by keyword, we can safely ignore the set minimum number
  // of words to search against
  if ($form_state['values']['filter_by_keyword'] === '1') {

    // Make sure that we're checking against at least one word in the title
    if (!is_numeric($element['#value']) || $element['#value'] < 0) {
      form_error($element, t('The number of words to search against must be numeric and at least 1.'));
    }
  }
}