Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
Menu
Open sidebar
project
drupal
Commits
93073218
Commit
93073218
authored
Sep 06, 2007
by
Gábor Hojtsy
Browse files
#148677
by pwolanin: set active menu item on 403/404 pages (and on the user page)
parent
c3685d60
Changes
3
Hide whitespace changes
Inline
Side-by-side
includes/common.inc
View file @
93073218
...
...
@@ -340,6 +340,9 @@ function drupal_not_found() {
$path
=
drupal_get_normal_path
(
variable_get
(
'site_404'
,
''
));
if
(
$path
&&
$path
!=
$_GET
[
'q'
])
{
// Set the active item in case there are tabs to display, or other
// dependencies on the path.
menu_set_active_item
(
$path
);
$return
=
menu_execute_active_handler
(
$path
);
}
...
...
@@ -365,6 +368,9 @@ function drupal_access_denied() {
$path
=
drupal_get_normal_path
(
variable_get
(
'site_403'
,
''
));
if
(
$path
&&
$path
!=
$_GET
[
'q'
])
{
// Set the active item in case there are tabs to display, or other
// dependencies on the path.
menu_set_active_item
(
$path
);
$return
=
menu_execute_active_handler
(
$path
);
}
...
...
includes/menu.inc
View file @
93073218
...
...
@@ -1240,7 +1240,18 @@ function menu_get_active_menu_name() {
return
menu_set_active_menu_name
();
}
function
menu_set_active_item
()
{
/**
* Set the active path, which determines which page is loaded.
*
* @param $path
* A Drupal path - not a path alias.
*
* Note that this may not have the desired effect unless invoked very early
* in the page load, such as during hook_boot, or unless you call
* menu_execute_active_handler() to generate your page output.
*/
function
menu_set_active_item
(
$path
)
{
$_GET
[
'q'
]
=
$path
;
}
/**
...
...
modules/user/user.module
View file @
93073218
...
...
@@ -1138,7 +1138,7 @@ function user_set_authmaps($account, $authmaps) {
function
user_page
()
{
global
$user
;
if
(
$user
->
uid
)
{
$_GET
[
'q'
]
=
'user/'
.
$user
->
uid
;
menu_set_active_item
(
'user/'
.
$user
->
uid
)
;
return
menu_execute_active_handler
();
}
else
{
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment