You are here

function _easy_breadcrumb_admin_submit in Easy Breadcrumb 6

Same name and namespace in other branches
  1. 7.2 includes/easy_breadcrumb.admin.inc \_easy_breadcrumb_admin_submit()
  2. 7 includes/easy_breadcrumb.admin.inc \_easy_breadcrumb_admin_submit()

Process the submitting of the administration form of this module.

Parameters

Assoc $form: renderable form.

Assoc $form_state: form state.

1 string reference to '_easy_breadcrumb_admin_submit'
_easy_breadcrumb_general_settings_form in includes/easy_breadcrumb.admin.inc
General configuration form.

File

includes/easy_breadcrumb.admin.inc, line 130
Module's admin forms.

Code

function _easy_breadcrumb_admin_submit($form, &$form_state) {

  // Pre-processes the list of ignored words for storing them as an array.
  // Replaces line-endings by spaces and splits words by spaces.
  // E.g.: array('of','and').
  $ignored_words_arr = array();
  $ignored_words = $form_state['values'][EasyBreadcrumbConstants::DB_VAR_CAPITALIZATOR_IGNORED_WORDS];
  $ignored_words = preg_replace('/\\r*\\n+/', ' ', $ignored_words);
  $ignored_words = trim($ignored_words);
  $ignored_words_arr_aux = $ignored_words === '' ? array() : preg_split('/\\s+/', $ignored_words);
  foreach ($ignored_words_arr_aux as $word) {
    $ignored_words_arr[$word] = $word;
  }

  // Updates the $form_state before passing it to the Drupal system.
  $form_state['values'][EasyBreadcrumbConstants::DB_VAR_CAPITALIZATOR_IGNORED_WORDS] = $ignored_words_arr;

  // Delegates persistence to the existing Drupal system.
  system_settings_form_submit($form, $form_state);
}