drupal_get_destination

Хочешь помочь с переводом? Это очень просто и быстро. Лишь зарегистрируйся, и можешь тут же начать переводить.

includes/common.inc, строка 247

Версии
5 – 6
drupal_get_destination()

Подготавливает строку запроса перенаправления для использования совместно с функцией drupal_goto().

Используется для перенаправления пользователя назад к ссылающейся страницы после заполнения формы. По умолчанию возвращается текущий URL. Если путь назначения задан в предыдущем запросе, возвращается этот путь. Таким образом, путь назначения может сохраняться при последовательности переходов между несколькими страницами.

См. также

drupal_goto()

▾ 10 функции вызывают drupal_get_destination()

comment_admin_overview in modules/comment/comment.module
Конструктор формы; генерирует форму с кратким содержанием комментариев для администратора.
node_admin_nodes in modules/node/node.module
node_page_edit in modules/node/node.module
Menu callback; presents the node editing form, or redirects to delete confirmation.
path_overview in modules/path/path.module
Return a listing of all defined URL aliases.
statistics_top_visitors in modules/statistics/statistics.module
Menu callback; presents the 'top visitors' page.
taxonomy_overview_terms in modules/taxonomy/taxonomy.module
Display a tree of all the terms in a vocabulary, with options to edit each one.
theme_forum_display in modules/forum/forum.module
Format the forum body.
user_admin_account in modules/user/user.module
user_edit in modules/user/user.module
user_login_block in modules/user/user.module

Код

<?php
function drupal_get_destination() {
  if (isset($_REQUEST['destination'])) {
    return 'destination='. urlencode($_REQUEST['destination']);
  }
  else {
    // Use $_GET here to retrieve the original path in source form.
    $path = isset($_GET['q']) ? $_GET['q'] : '';
    $query = drupal_query_string_encode($_GET, array('q'));
    if ($query != '') {
      $path .= '?'. $query;
    }
    return 'destination='. urlencode($path);
  }
}
?>
Войдите или зарегистрируйтесь, чтобы получить возможность отправлять комментарии

Вход в систему