function current_search_export_ui::edit_execute_form in Facet API 7.2
Same name and namespace in other branches
- 6.3 contrib/current_search/plugins/export_ui/current_search_export_ui.class.php \current_search_export_ui::edit_execute_form()
- 7 contrib/current_search/plugins/export_ui/current_search_export_ui.class.php \current_search_export_ui::edit_execute_form()
Overrides ctools_export_ui::edit_execute_form().
This is hacky, but since CTools Export UI uses drupal_goto() we have to effectively change the plugin to modify the redirect path dynamically.
Overrides ctools_export_ui::edit_execute_form
2 calls to current_search_export_ui::edit_execute_form()
- current_search_export_ui::add_page in contrib/
current_search/ plugins/ export_ui/ current_search_export_ui.class.php - Overrides ctools_export_ui::add_page().
- current_search_export_ui::edit_page in contrib/
current_search/ plugins/ export_ui/ current_search_export_ui.class.php - Overrides ctools_export_ui::edit_page().
File
- contrib/
current_search/ plugins/ export_ui/ current_search_export_ui.class.php, line 39 - Export UI display customizations.
Class
- current_search_export_ui
- CTools export UI extending class. Slightly customized for Context.
Code
function edit_execute_form(&$form_state) {
$output = parent::edit_execute_form($form_state);
if (!empty($form_state['executed'])) {
$clicked = $form_state['clicked_button']['#value'];
if (t('Add item') == $clicked || t('Save and edit') == $clicked) {
// We always want to redirect back to this page when adding an item,
// but we want to preserve the destination so we can be redirected back
// to where we came from after clicking "Save".
$options = array();
if (!empty($_GET['destination'])) {
$options['query']['destination'] = $_GET['destination'];
unset($_GET['destination']);
}
// Sets redirect path and options.
$op = $form_state['op'];
$name = $form_state['values']['name'];
$path = 'add' != $op ? current_path() : 'admin/config/search/current_search/list/' . $name . '/edit';
$this->plugin['redirect'][$op] = array(
$path,
$options,
);
}
}
return $output;
}