drupal_get_destination

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

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

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

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

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

См. также

drupal_goto()

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

comment_admin_overview in modules/comment/comment.admin.inc
Конструктор формы; генерирует форму с кратким содержанием комментариев для администратора.
hook_translated_menu_link_alter in developer/hooks/core.php
Позволяет изменять уже переведенную ссылку меню перед отображением.
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 sumit function: handle the 'Delete' button on the node form.
openid_authentication in modules/openid/openid.module
Authenticate a user or attempt registration.
openid_form_alter in modules/openid/openid.module
Implementation of hook_form_alter : adds OpenID login to the login forms.
path_admin_overview in modules/path/path.admin.inc
Return a listing of all defined URL aliases. When filter key passed, perform a standard search on the given key, and return the list of matching URL aliases.
statistics_top_visitors in modules/statistics/statistics.admin.inc
Menu callback; presents the 'top visitors' page.
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. See alsotaxonomy_form_term()
template_preprocess_forums in modules/forum/forum.module
Process variables for forums.tpl.php
theme_book_admin_table in modules/book/book.admin.inc
Theme function for the book administration page form. See alsobook_admin_table()
user_admin_account in modules/user/user.admin.inc
Form builder; User administration page. See alsouser_admin_account_validate()
user_edit_delete_submit in modules/user/user.pages.inc
Submit function for the 'Delete' button on the user edit form.
user_login_block in modules/user/user.module
_update_no_data in modules/update/update.module
Prints a warning message when there is no data about available updates.

Код

<?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);
  }
}
?>
Войдите или зарегистрируйтесь, чтобы получить возможность отправлять комментарии

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