You are here

function _cmf_contains_validate in Content Management Filter 7

Same name and namespace in other branches
  1. 6.2 cmf.module \_cmf_contains_validate()

Validation handler for filter doing "contains".

1 string reference to '_cmf_contains_validate'
cmf_filters in ./cmf.module
List node administration filters that can be applied.

File

./cmf.module, line 592
@brief Content management filter module file

Code

function _cmf_contains_validate($form) {

  // Make sure this was triggered by the selected filter.
  if ($form['#name'] == $form['#post']['filter']) {

    // Strip blanks to see if the field is empty.
    $value = trim($form['#value']);
    if (empty($value)) {
      form_error($form, t('%name text value may not be empty.', array(
        '%name' => $form['#name'],
      )));
    }
  }
}