summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJohnAlbin2008-09-11 10:15:10 (GMT)
committer JohnAlbin2008-09-11 10:15:10 (GMT)
commit597944647733812b8fe3e2524902cc32823593cb (patch)
tree50255bcd67931b5942e7100de1e8a23eef44cd9b
parent4f5c1d0c13064577be565d584cbe46ce59e6cd69 (diff)
Optimized zen_breadcrumb().
-rw-r--r--zen/template.php15
1 files changed, 8 insertions, 7 deletions
diff --git a/zen/template.php b/zen/template.php
index 4bd40ec..c2feca5 100644
--- a/zen/template.php
+++ b/zen/template.php
@@ -39,19 +39,20 @@ function zen_theme(&$existing, $type, $theme, $path) {
* A string containing the breadcrumb output.
*/
function zen_breadcrumb($breadcrumb) {
- $show_breadcrumb = theme_get_setting('zen_breadcrumb');
- $show_breadcrumb_home = theme_get_setting('zen_breadcrumb_home');
- $breadcrumb_separator = theme_get_setting('zen_breadcrumb_separator');
- $trailing_separator = (theme_get_setting('zen_breadcrumb_trailing') || theme_get_setting('zen_breadcrumb_title')) ? $breadcrumb_separator : '';
-
// Determine if we are to display the breadcrumb
+ $show_breadcrumb = theme_get_setting('zen_breadcrumb');
if ($show_breadcrumb == 'yes' || $show_breadcrumb == 'admin' && arg(0) == 'admin') {
+
+ // Optionally get rid of the homepage link
+ $show_breadcrumb_home = theme_get_setting('zen_breadcrumb_home');
if (!$show_breadcrumb_home) {
- // Optionally get rid of the homepage link
array_shift($breadcrumb);
}
+
+ // Return the breadcrumb with separators
if (!empty($breadcrumb)) {
- // Return the breadcrumb with separators
+ $breadcrumb_separator = theme_get_setting('zen_breadcrumb_separator');
+ $trailing_separator = (theme_get_setting('zen_breadcrumb_trailing') || theme_get_setting('zen_breadcrumb_title')) ? $breadcrumb_separator : '';
return '<div class="breadcrumb">' . implode($breadcrumb_separator, $breadcrumb) . "$trailing_separator</div>";
}
}