You are here

function current_search_delete_item_form_submit in Facet API 7.2

Same name and namespace in other branches
  1. 6.3 contrib/current_search/plugins/export_ui/current_search_export_ui.class.php \current_search_delete_item_form_submit()
  2. 7 contrib/current_search/plugins/export_ui/current_search_export_ui.class.php \current_search_delete_item_form_submit()

Form submission handler for facetapi_revert_form_submit().

1 string reference to 'current_search_delete_item_form_submit'
current_search_delete_item_form in contrib/current_search/plugins/export_ui/current_search_export_ui.class.php
Form constructor for the revert form.

File

contrib/current_search/plugins/export_ui/current_search_export_ui.class.php, line 574
Export UI display customizations.

Code

function current_search_delete_item_form_submit($form, &$form_state) {
  $name = $form['#current_search']['name'];
  $item = $form['#current_search']['item'];

  // Removes item from the current search block configuration.
  if (isset($item->settings['items'][$name])) {
    $label = $item->settings['items'][$name]['label'];
    drupal_set_message(t('@label has been removed.', array(
      '@label' => $label,
    )));
    unset($item->settings['items'][$name]);
    ctools_export_crud_save('current_search', $item);
  }

  // Resirects back to current search block configuration page.
  $form_state['redirect'] = 'admin/config/search/current_search/list/' . $item->name . '/edit';
}