You are here

function _search_api_saved_searches_admin_redirect_url in Search API Saved Searches 7

Returns the correct redirect URL after changing a saved search.

This will be the user's "Saved searches" overview tab, if it is accessible; otherwise, if the search has a page associated with it, that page; and if none of the two are the case, the front page.

Parameters

SearchApiSavedSearch $search: The saved search that was edited, deleted or otherwise changed.

Return value

string The URL to redirect to.

5 calls to _search_api_saved_searches_admin_redirect_url()
search_api_saved_searches_search_delete_form in ./search_api_saved_searches.pages.inc
Form builder for confirming the deletion of a saved search.
search_api_saved_searches_search_delete_form_submit in ./search_api_saved_searches.pages.inc
Submission handler for search_api_saved_searches_search_delete_form().
search_api_saved_searches_search_disable_form in ./search_api_saved_searches.pages.inc
Page callback: Constructs a form for disabling a saved search.
search_api_saved_searches_search_disable_form_submit in ./search_api_saved_searches.pages.inc
Form submission handler for search_api_saved_searches_search_disable_form().
search_api_saved_searches_search_enable in ./search_api_saved_searches.pages.inc
Page callback: Enables a saved search.

File

./search_api_saved_searches.pages.inc, line 389
User UI functions and form callbacks for saved searches.

Code

function _search_api_saved_searches_admin_redirect_url(SearchApiSavedSearch $search) {
  if ($search->uid && search_api_saved_search_edit_access(user_load($search->uid))) {
    return 'user/' . $search->uid . '/saved-searches';
  }
  elseif (!empty($search->options['page'])) {
    return $search->options['page'];
  }
  return '<front>';
}