diff options
author | brettp <brettp@36083f99-b078-4883-b0ff-0f9b5a30f544> | 2010-03-11 18:07:26 +0000 |
---|---|---|
committer | brettp <brettp@36083f99-b078-4883-b0ff-0f9b5a30f544> | 2010-03-11 18:07:26 +0000 |
commit | bdacb612f3fffa967ef6fda89c081fb7a59894d2 (patch) | |
tree | ce26e1209d280025645dfca08d36abcacaadaee3 /views/default/navigation | |
parent | a454889d81ed753de06ac6b014ff92ca3c57e039 (diff) | |
download | elgg-bdacb612f3fffa967ef6fda89c081fb7a59894d2.tar.gz elgg-bdacb612f3fffa967ef6fda89c081fb7a59894d2.tar.bz2 |
Added breadcrumb support and updated the mods with old-style breadcrumbs.
git-svn-id: http://code.elgg.org/elgg/trunk@5366 36083f99-b078-4883-b0ff-0f9b5a30f544
Diffstat (limited to 'views/default/navigation')
-rw-r--r-- | views/default/navigation/breadcrumbs.php | 45 |
1 files changed, 45 insertions, 0 deletions
diff --git a/views/default/navigation/breadcrumbs.php b/views/default/navigation/breadcrumbs.php new file mode 100644 index 000000000..1dc97f29c --- /dev/null +++ b/views/default/navigation/breadcrumbs.php @@ -0,0 +1,45 @@ +<?php +/** + * Displays registered breadcrumbs. + * + * @package Elgg + * @subpackage Core + * @author Curverider Ltd + * @link http://elgg.org/ + * + * @uses optional $vars['breadcrumbs'] = array('title' => 'The title', 'link' => 'url') + * + */ + +if (isset($vars['breadcrumbs'])) { + $breadcrumbs = $vars['breadcrumbs']; +} else { + $breadcrumbs = elgg_get_breadcrumbs(); +} + +$formatted_breadcrumbs = array(); + +foreach ($breadcrumbs as $breadcrumb) { + $link = $breadcrumb['link']; + $title = $breadcrumb['title']; + + if (!empty($link)) { + $formatted_breadcrumbs[] = elgg_view('output/url', array( + 'href' => $link, + 'text' => $title + )); + } else { + $formatted_breadcrumbs[] = $title; + } +} + +$breadcrumbs_html = implode(' > ', $formatted_breadcrumbs); + +echo <<<___END + +<div id="breadcrumbs"> + $breadcrumbs_html +</div> + +___END; +?>
\ No newline at end of file |