drupal_get_destination

Versions
4.6 – 7
drupal_get_destination()

Prepare a destination query string for use in combination with drupal_goto(). Used to direct the user back to the referring page after completing a form.

See also

drupal_goto()

▾ 6 functions call drupal_get_destination()

comment_admin_overview in modules/comment.module
Menu callback; present an administrative comment listing.
node_admin_nodes in modules/node.module
Generate the content administration overview.
path_overview in modules/path.module
Return a listing of all defined URL aliases.
user_admin_account in modules/user.module
user_block in modules/user.module
Implementation of hook_block().
user_login in modules/user.module

Code

includes/common.inc, line 124

<?php
function drupal_get_destination() {
  $destination[] = $_GET['q'];
  $params = array('from', 'sort', 'order');
  foreach ($params as $param) {
    if (isset($_GET[$param])) {
      $destination[] = "$param=". $_GET[$param];
    }
  }
  return 'destination='. urlencode(implode('&', $destination));
}
?>
Login or register to post comments
 
 

All source code and documentation on this site is released under the terms of the GNU General Public License, version 2 and later. Drupal is a registered trademark of Dries Buytaert.