You are here

function finder_admin_custom_matching_submit in Finder 7

Submit function for finder admin custom matching configuration page.

File

includes/finder.admin.inc, line 1126
The finder admin screens.

Code

function finder_admin_custom_matching_submit($form, &$form_state) {
  $values = $form_state['values'];
  unset($values['actions']);
  $defaults = array_keys(finder_condition_args_default());
  foreach ($defaults as $key) {
    if (isset($values[$key])) {
      unset($values[$key]);
    }
  }
  $custom_matching = array();
  foreach ($values as $key => $value) {
    if (is_array($value) && isset($value['name']) && !empty($value['name'])) {
      $custom_matching[$key] = $value;
    }
  }
  variable_set('finder_custom_matching', $custom_matching);
}