diff options
author | cash <cash@36083f99-b078-4883-b0ff-0f9b5a30f544> | 2010-12-05 23:54:32 +0000 |
---|---|---|
committer | cash <cash@36083f99-b078-4883-b0ff-0f9b5a30f544> | 2010-12-05 23:54:32 +0000 |
commit | 2a43428c44761fae91f4acf046faccae5cb32644 (patch) | |
tree | 9087851a5c67f39df93b797e2512764bee47a220 /views/default/navigation | |
parent | d70a442f3bf0b6f5d7a6448697e3ba07c339c3ad (diff) | |
download | elgg-2a43428c44761fae91f4acf046faccae5cb32644.tar.gz elgg-2a43428c44761fae91f4acf046faccae5cb32644.tar.bz2 |
rewrote breadcrumbs
git-svn-id: http://code.elgg.org/elgg/trunk@7542 36083f99-b078-4883-b0ff-0f9b5a30f544
Diffstat (limited to 'views/default/navigation')
-rw-r--r-- | views/default/navigation/breadcrumbs.php | 47 |
1 files changed, 22 insertions, 25 deletions
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 |