diff options
Diffstat (limited to 'views')
-rw-r--r-- | views/default/css/screen.php | 30 | ||||
-rw-r--r-- | views/default/navigation/breadcrumbs.php | 47 |
2 files changed, 43 insertions, 34 deletions
diff --git a/views/default/css/screen.php b/views/default/css/screen.php index 895e263bf..5835033ff 100644 --- a/views/default/css/screen.php +++ b/views/default/css/screen.php @@ -710,22 +710,34 @@ li.navigation-more ul li { *************************************** */ .elgg-breadcrumbs { font-size: 80%; - line-height:1.2em; - color:#bababa; - position: relative; - top:-6px; - left:0; + font-weight: bold; + line-height: 1.2em; + color: #bababa; +} +.elgg-breadcrumbs li { + display: inline; +} +.elgg-breadcrumbs li:after{ + content: "\003E"; + display: inline-block; + padding: 0 4px 0 4px; + font-weight: normal; +} +.elgg-breadcrumbs li:last-child:after { + content: ""; } .elgg-breadcrumbs a { - color:#999999; - font-weight:bold; - text-decoration: none; + color: #999999; } .elgg-breadcrumbs a:hover { color: #0054a7; text-decoration: underline; } - +.elgg-main .elgg-breadcrumbs { + position: relative; + top:-6px; + left:0; +} /* *************************************** SUBMENU diff --git a/views/default/navigation/breadcrumbs.php b/views/default/navigation/breadcrumbs.php index 8f5b52f14..67e985bed 100644 --- a/views/default/navigation/breadcrumbs.php +++ b/views/default/navigation/breadcrumbs.php @@ -1,11 +1,13 @@ <?php /** - * Displays registered breadcrumbs. + * Displays breadcrumbs. * * @package Elgg * @subpackage Core * - * @uses optional $vars['breadcrumbs'] = array('title' => 'The title', 'link' => 'url') + * @uses $vars['breadcrumbs'] (Optional) Array of arrays with keys 'title' and 'link' + * @uses $vars['class'] + * * @see elgg_push_breadcrumb */ @@ -15,29 +17,24 @@ if (isset($vars['breadcrumbs'])) { $breadcrumbs = elgg_get_breadcrumbs(); } -$formatted_breadcrumbs = array(); - -foreach ($breadcrumbs as $breadcrumb) { - $link = $breadcrumb['link']; - $title = $breadcrumb['title']; +$class = 'elgg-breadcrumbs'; +$additional_class = elgg_get_array_value('class', $vars, ''); +if ($additional_class) { + $class = "$class $additional_class"; +} - if (!empty($link)) { - $formatted_breadcrumbs[] = elgg_view('output/url', array( - 'href' => $link, - 'text' => $title - )); - } else { - $formatted_breadcrumbs[] = $title; +if (is_array($breadcrumbs) && count($breadcrumbs) > 0) { + echo "<ul class=\"$class\">"; + foreach ($breadcrumbs as $breadcrumb) { + if (!empty($breadcrumb['link'])) { + $crumb = elgg_view('output/url', array( + 'href' => $breadcrumb['link'], + 'text' => $breadcrumb['title'], + )); + } else { + $crumb = $breadcrumb['title']; + } + echo "<li>$crumb</li>"; } + echo '</ul>'; } - -$breadcrumbs_html = implode(' > ', $formatted_breadcrumbs); - -echo <<<___END - -<div class="elgg-breadcrumbs"> - $breadcrumbs_html -</div> - -___END; -?>
\ No newline at end of file |