drupal_get_destination

Versions
mediamosa-21
drupal_get_destination()

Prepare a 'destination' URL query parameter for use in combination with drupal_goto().

Used to direct the user back to the referring page after completing a form. By default the current URL is returned. If a destination exists in the previous request, that destination is returned. As such, a destination can persist across multiple pages.

See also

drupal_goto()

▾ 39 functions call drupal_get_destination()

comment_admin_overview in modules/comment/comment.admin.inc
Form builder; Builds the comment overview form for the admin.
contextual_links_view in modules/contextual/contextual.module
Build a renderable array for contextual links.
devel_switch_user_list in sites/all/modules/devel/devel.module
devel_translated_menu_link_alter in sites/all/modules/devel/devel.module
An Implements hook_translated_menu_item_alter(). Append dynamic querystring 'destination' to several of our own menu items.
field_ui_field_overview_form_submit in modules/field_ui/field_ui.admin.inc
Submit handler for the field overview form.
forum_menu_local_tasks_alter in modules/forum/forum.module
Implements hook_menu_local_tasks_alter().
hook_translated_menu_link_alter in modules/menu/menu.api.php
Alter a menu link after it's translated, but before it's rendered.
hook_user_login in modules/user/user.api.php
The user just logged in.
mediamosa_browse_asset_list_form in sites/all/modules/mediamosa/maintenance/browse/mediamosa_maintenance_browse_asset.inc
Form builder; asset listing page.
mediamosa_browse_collection_list_form in sites/all/modules/mediamosa/maintenance/browse/mediamosa_maintenance_browse_collection.inc
Form builder; collection listing page.
mediamosa_maintenance_browse_errorcode_form in sites/all/modules/mediamosa/maintenance/browse/mediamosa_maintenance_browse_errorcode.inc
The main browse form.
node_admin_nodes in modules/node/node.admin.inc
Form builder: Builds the node administration overview.
node_form_delete_submit in modules/node/node.pages.inc
Button submit function: handle the 'Delete' button on the node form.
openid_authentication in modules/openid/openid.module
Authenticate a user or attempt registration.
path_admin_form_delete_submit in modules/path/path.admin.inc
Submit function for the 'Delete' button on the URL alias editing form.
path_admin_overview in modules/path/path.admin.inc
Return a listing of all defined URL aliases.
shortcut_preprocess_page in modules/shortcut/shortcut.module
Implements hook_preprocess_page().
statistics_top_visitors in modules/statistics/statistics.admin.inc
Menu callback; presents the "top visitors" page.
system_test_destination in modules/simpletest/tests/system_test.module
system_user_login in modules/system/system.module
Implements hook_user_login().
taxonomy_overview_terms in modules/taxonomy/taxonomy.admin.inc
Form builder for the taxonomy terms overview.
taxonomy_term_confirm_parents in modules/taxonomy/taxonomy.admin.inc
Form builder for the confirmation of multiple term parents.
theme_book_admin_table in modules/book/book.admin.inc
Theme function for the book administration page form.
theme_mediamosa_maintenance_browse_properties in sites/all/modules/mediamosa/maintenance/browse/mediamosa_maintenance_browse.inc
Our asset/collection detail view.
theme_node_recent_block in modules/node/node.module
Returns a formatted list of recent nodes.
theme_system_compact_link in modules/system/system.module
Display the link to show or hide inline help descriptions.
theme_toolbar_toggle in modules/toolbar/toolbar.module
Formats an element used to toggle the toolbar drawer's visibility.
theme_update_last_check in modules/update/update.module
Render the HTML to display the last time we checked for update data.
user_admin_account in modules/user/user.admin.inc
Form builder; User administration page.
user_edit_cancel_submit in modules/user/user.pages.inc
Submit function for the 'Cancel account' button on the user edit form.
user_login_block in modules/user/user.module
user_login_destination in modules/user/user.module
Helper function to rewrite the destination to avoid redirecting to login page after login.
_locale_translate_seek in includes/locale.inc
Perform a string search and display results in a table
_mediamosa_app_list in sites/all/modules/mediamosa/modules/app/mediamosa_app.module
Show a listing of apps.
_mediamosa_browse_asset_page_view_collections_list in sites/all/modules/mediamosa/maintenance/browse/mediamosa_maintenance_browse_asset.inc
Build the mediafile listing.
_mediamosa_server_list in sites/all/modules/mediamosa/modules/server/mediamosa_server.module
Show the mediamosa servers.
_mediamosa_transcode_profile_list in sites/all/modules/mediamosa/modules/transcode/profile/mediamosa_transcode_profile.inc
Show the listing of the current transcode profiles.
_mediamosa_webservice_list in sites/all/modules/mediamosa/modules/webservice/mediamosa_webservice.module
List of all webservices.
_update_no_data in modules/update/update.module
Prints a warning message when there is no data about available updates.

Code

includes/common.inc, line 498

<?php
function drupal_get_destination() {
  $destination = &drupal_static(__FUNCTION__);

  if (isset($destination)) {
    return $destination;
  }

  if (isset($_GET['destination'])) {
    $destination = array('destination' => $_GET['destination']);
  }
  else {
    $path = $_GET['q'];
    $query = drupal_http_build_query(drupal_get_query_parameters());
    if ($query != '') {
      $path .= '?' . $query;
    }
    $destination = array('destination' => $path);
  }
  return $destination;
}
?>