Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
What's new
10
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
Open sidebar
project
drupal
Commits
9472fbae
Commit
9472fbae
authored
Apr 24, 2006
by
Dries
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
- Patch
#59222
by Zen: fixed problem with breadcrumb navigation.
parent
326f49b6
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
24 additions
and
9 deletions
+24
-9
includes/menu.inc
includes/menu.inc
+6
-0
includes/path.inc
includes/path.inc
+12
-0
sites/default/settings.php
sites/default/settings.php
+2
-2
themes/engines/phptemplate/phptemplate.engine
themes/engines/phptemplate/phptemplate.engine
+4
-7
No files found.
includes/menu.inc
View file @
9472fbae
...
...
@@ -528,6 +528,12 @@ function menu_get_active_help() {
* Returns an array of rendered menu items in the active breadcrumb trail.
*/
function
menu_get_active_breadcrumb
()
{
// No breadcrumb for the front page.
if
(
drupal_is_front_page
())
{
return
array
();
}
$links
[]
=
l
(
t
(
'Home'
),
'<front>'
);
$trail
=
_menu_get_active_trail
();
...
...
includes/path.inc
View file @
9472fbae
...
...
@@ -187,3 +187,15 @@ function drupal_set_title($title = NULL) {
}
return
$stored_title
;
}
/**
* Check if the current page is the front page.
*
* @return
* Boolean value: TRUE if the current page is the front page; FALSE if otherwise.
*/
function
drupal_is_front_page
()
{
// As drupal_init_path updates $_GET['q'] with the 'site_frontpage' path,
// rely on $_REQUEST to verify the original value of 'q'.
return
!
isset
(
$_REQUEST
[
'q'
]);
}
sites/default/settings.php
View file @
9472fbae
...
...
@@ -32,8 +32,8 @@
* 10. sites/default
*
* If you are installing on a non-standard port number, prefix the
* hostname with that number. For example,
* http://www.drupal.org:8080/mysite/test/ could be loaded from
* hostname with that number. For example,
* http://www.drupal.org:8080/mysite/test/ could be loaded from
* sites/8080.www.drupal.org.mysite.test/.
*/
...
...
themes/engines/phptemplate/phptemplate.engine
View file @
9472fbae
...
...
@@ -84,13 +84,13 @@ function _phptemplate_callback($hook, $variables = array(), $file = NULL) {
* A sequential array of variables passed to the theme function.
*/
function
_phptemplate_default_variables
(
$hook
,
$variables
)
{
global
$theme
;
global
$theme
,
$sidebar_indicator
;
static
$count
=
array
();
$count
[
$hook
]
=
isset
(
$count
[
$hook
])
&&
is_int
(
$count
[
$hook
])
?
$count
[
$hook
]
:
1
;
$variables
[
'zebra'
]
=
(
$count
[
$hook
]
%
2
)
?
'odd'
:
'even'
;
$variables
[
'id'
]
=
$count
[
$hook
]
++
;
global
$sidebar_indicator
;
if
(
$hook
==
'block'
)
{
$count
[
'block_counter'
][
$sidebar_indicator
]
=
isset
(
$count
[
'block_counter'
][
$sidebar_indicator
])
&&
is_int
(
$count
[
'block_counter'
][
$sidebar_indicator
])
?
$count
[
'block_counter'
][
$sidebar_indicator
]
:
1
;
$variables
[
'block_zebra'
]
=
(
$count
[
'block_counter'
][
$sidebar_indicator
]
%
2
)
?
'odd'
:
'even'
;
...
...
@@ -110,10 +110,7 @@ function _phptemplate_default_variables($hook, $variables) {
}
// Tell all templates where they are located.
$variables
[
'directory'
]
=
path_to_theme
();
if
(
drupal_get_path_alias
(
$_GET
[
'q'
])
==
variable_get
(
'site_frontpage'
,
'node'
))
{
$variables
[
'is_front'
]
=
true
;
}
$variables
[
'is_front'
]
=
drupal_is_front_page
();
return
$variables
;
}
...
...
@@ -142,7 +139,7 @@ function phptemplate_features() {
function
phptemplate_page
(
$content
)
{
/* Set title and breadcrumb to declared values */
if
(
drupal_
get_path_alias
(
$_GET
[
'q'
])
==
variable_get
(
'site
_frontpage
'
,
'node'
))
{
if
(
drupal_
is
_front
_
page
(
))
{
$mission
=
filter_xss_admin
(
theme_get_setting
(
'mission'
));
}
...
...
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