You are here

function customfilter_rule_edit_submit in Custom filter 7

Same name and namespace in other branches
  1. 6 customfilter.admin.inc \customfilter_rule_edit_submit()
  2. 7.2 customfilter.module \customfilter_rule_edit_submit()

Submission callback for the replacement rule edit form.

File

./customfilter.module, line 1315
Allows the users with the right permission to define custom filters.

Code

function customfilter_rule_edit_submit($form, &$form_state) {
  switch ($form_state['values']['operation']) {
    case 'edit':
      drupal_write_record('customfilter_rule', $form_state['values'], array(
        'rid',
      ));
      break;
    case 'add':
      drupal_write_record('customfilter_rule', $form_state['values']);
      break;
  }
  customfilter_cache_clear($form_state['values']['fid']);
  $form_state['redirect'] = "admin/config/content/customfilter/{$form_state['values']['fid']}";
}