aboutsummaryrefslogtreecommitdiff
path: root/views/default/navigation
diff options
context:
space:
mode:
authorbrettp <brettp@36083f99-b078-4883-b0ff-0f9b5a30f544>2010-03-11 18:07:26 +0000
committerbrettp <brettp@36083f99-b078-4883-b0ff-0f9b5a30f544>2010-03-11 18:07:26 +0000
commitbdacb612f3fffa967ef6fda89c081fb7a59894d2 (patch)
treece26e1209d280025645dfca08d36abcacaadaee3 /views/default/navigation
parenta454889d81ed753de06ac6b014ff92ca3c57e039 (diff)
downloadelgg-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.php45
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(' &gt; ', $formatted_breadcrumbs);
+
+echo <<<___END
+
+<div id="breadcrumbs">
+ $breadcrumbs_html
+</div>
+
+___END;
+?> \ No newline at end of file