You are here

function finder_admin_element_edit_submit in Finder 6

Same name and namespace in other branches
  1. 7 includes/finder.admin.inc \finder_admin_element_edit_submit()

Submit function for admin finder add/edit page.

File

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

Code

function finder_admin_element_edit_submit($form, &$form_state) {
  $values =& $form_state['values'];
  if ($form_state['clicked_button']['#id'] == 'edit-delete') {
    drupal_goto('admin/build/finder/' . $values['finder_id'] . '/edit/' . $values['finder_element_id'] . '/delete');
  }
  else {
    $finder_element = (object) array(
      'finder_element_id' => $values['finder_element_id'],
      'finder_id' => $values['finder_id'],
      'element' => $values['element'],
      'title' => $values['title'],
      'weight' => $values['weight'],
      'settings' => $values['settings'],
    );
    finder_element_save($finder_element);
    drupal_set_message(t('The finder element was saved.'));
    drupal_goto('admin/build/finder/' . $values['finder_id'] . '/edit');
  }
}