summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDries Buytaert <dries@buytaert.net>2006-04-24 19:25:37 +0000
committerDries Buytaert <dries@buytaert.net>2006-04-24 19:25:37 +0000
commit9472fbae388b5d44ed07519b18097cfd3c7eb449 (patch)
tree817e569a10da92c4d70dea3557e2a374e4c1732a
parent326f49b64678cccf5c57fe45820acd3595296a52 (diff)
downloadbrdo-9472fbae388b5d44ed07519b18097cfd3c7eb449.tar.gz
brdo-9472fbae388b5d44ed07519b18097cfd3c7eb449.tar.bz2
- Patch #59222 by Zen: fixed problem with breadcrumb navigation.
-rw-r--r--includes/menu.inc6
-rw-r--r--includes/path.inc12
-rw-r--r--sites/default/settings.php4
-rw-r--r--themes/engines/phptemplate/phptemplate.engine11
4 files changed, 24 insertions, 9 deletions
diff --git a/includes/menu.inc b/includes/menu.inc
index b160dc094..b1d1bdb51 100644
--- a/includes/menu.inc
+++ b/includes/menu.inc
@@ -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();
diff --git a/includes/path.inc b/includes/path.inc
index 0202c4820..665f05a3a 100644
--- a/includes/path.inc
+++ b/includes/path.inc
@@ -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']);
+}
diff --git a/sites/default/settings.php b/sites/default/settings.php
index dbd81225f..888018b75 100644
--- a/sites/default/settings.php
+++ b/sites/default/settings.php
@@ -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/.
*/
diff --git a/themes/engines/phptemplate/phptemplate.engine b/themes/engines/phptemplate/phptemplate.engine
index 0a136a3ac..569e86ecd 100644
--- a/themes/engines/phptemplate/phptemplate.engine
+++ b/themes/engines/phptemplate/phptemplate.engine
@@ -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'));
}