You are here

function feeds_tamper_keyword_filter_form in Feeds Tamper 6

Same name and namespace in other branches
  1. 7 plugins/keyword_filter.inc \feeds_tamper_keyword_filter_form()
1 string reference to 'feeds_tamper_keyword_filter_form'
keyword_filter.inc in plugins/keyword_filter.inc

File

plugins/keyword_filter.inc, line 17

Code

function feeds_tamper_keyword_filter_form($importer, $element_key, $settings) {
  $form = array();
  $form['words'] = array(
    '#type' => 'textarea',
    '#title' => t('Words or phrases to filter on'),
    '#default_value' => isset($settings['words']) ? $settings['words'] : '',
    '#description' => t('A list of words/phrases that need to appear in the text.'),
  );
  $form['word_boundaries'] = array(
    '#type' => 'checkbox',
    '#title' => t('Respect word boundaries'),
    '#default_value' => isset($settings['word_boundaries']) ? $settings['word_boundaries'] : FALSE,
    '#description' => t('If checked, then "book" will match "book" but not "bookcase".'),
  );
  $form['exact'] = array(
    '#type' => 'checkbox',
    '#title' => t('Exact'),
    '#default_value' => isset($settings['exact']) ? $settings['exact'] : FALSE,
    '#description' => t('If checked, then "book" will only match "book". This will override the "Respect word boundaries" setting above.'),
  );
  $form['case_sensitive'] = array(
    '#type' => 'checkbox',
    '#title' => t('Case sensitive'),
    '#default_value' => isset($settings['case_sensitive']) ? $settings['case_sensitive'] : FALSE,
    '#description' => t('If checked, then "book" will match "book" but not "Book" or "BOOK".'),
  );
  $form['invert'] = array(
    '#type' => 'checkbox',
    '#title' => t('Invert filter'),
    '#default_value' => isset($settings['invert']) ? $settings['invert'] : FALSE,
    '#description' => t('Inverting the filter will %remove items with the specified text.', array(
      '%remove' => 'remove',
    )),
  );
  return $form;
}