You are here

function views_natural_sort_settings_form in Views Natural Sort 7

Same name and namespace in other branches
  1. 6 views_natural_sort.admin.inc \views_natural_sort_settings_form()
  2. 7.2 views_natural_sort.admin.inc \views_natural_sort_settings_form()

Form callback for the Views Natural Sort settings page

Allows the removal of specific words and symbols from all your titles.

1 string reference to 'views_natural_sort_settings_form'
views_natural_sort_menu in ./views_natural_sort.module
Implementation of hook_menu().

File

./views_natural_sort.admin.inc, line 30
Callbacks for managing Views Natural Sort.

Code

function views_natural_sort_settings_form() {
  $form = array();
  $form['beginning_words'] = array(
    '#type' => 'textfield',
    '#title' => 'Words to filter from the beginning of a phrase',
    '#default_value' => implode(',', variable_get('views_natural_sort_beginning_words_remove', array())),
    '#description' => t('Commonly, the words "A", "The", and "An" are removed when sorting book titles if they appear at the beginning of the title. Those would be great candidates for this field. Separate words with a comma.'),
  );
  $form['words'] = array(
    '#type' => 'textfield',
    '#title' => 'Words to filter from anywhere in a phrase',
    '#default_value' => implode(',', variable_get('views_natural_sort_words_remove', array())),
    '#description' => t('Commonly used words like "of", "and", and "or" are removed when sorting book titles. Words you would like filtered go here. Separate words with a comma.'),
  );
  $form['symbols'] = array(
    '#type' => 'textfield',
    '#title' => 'Symbols to filter from anywhere in a phrase',
    '#default_value' => variable_get('views_natural_sort_symbols_remove', ''),
    '#description' => t('Most symbols are ignored when performing a sort naturally. Those symbols you want ignored go here. Do not use a separator. EX: &$".'),
  );
  $form['save'] = array(
    '#type' => 'submit',
    '#value' => t('Save Settings'),
  );
  return $form;
}