aboutsummaryrefslogtreecommitdiff
path: root/engine/lib/elgglib.php
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 /engine/lib/elgglib.php
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 'engine/lib/elgglib.php')
-rw-r--r--engine/lib/elgglib.php48
1 files changed, 48 insertions, 0 deletions
diff --git a/engine/lib/elgglib.php b/engine/lib/elgglib.php
index 42d6ffc6f..fd270bc1d 100644
--- a/engine/lib/elgglib.php
+++ b/engine/lib/elgglib.php
@@ -2661,6 +2661,54 @@ function elgg_http_add_url_query_elements($url, array $elements) {
return $string;
}
+
+/**
+ * Breadcrumb support.
+ */
+
+/**
+ * Adds a breadcrumb to the stack
+ *
+ * @param string $title The title to display
+ * @param string $link Optional. The link for the title.
+ */
+function elgg_push_breadcrumb($title, $link = NULL) {
+ global $CONFIG;
+ if (!is_array($CONFIG->breadcrumbs)) {
+ $CONFIG->breadcrumbs = array();
+ }
+
+ // avoid key collisions.
+ $CONFIG->breadcrumbs[] = array('title' => $title, 'link' => $link);
+}
+
+/**
+ * Removes last breadcrumb entry.
+ *
+ * @return array popped item.
+ */
+function elgg_pop_breadcrumb() {
+ global $CONFIG;
+
+ if (is_array($CONFIG->breadcrumbs)) {
+ array_pop($CONFIG->breadcrumbs);
+ }
+
+ return FALSE;
+}
+
+/**
+ * Returns all breadcrumbs
+ *
+ * @return array Breadcrumbs
+ */
+function elgg_get_breadcrumbs() {
+ global $CONFIG;
+
+ return (is_array($CONFIG->breadcrumbs)) ? $CONFIG->breadcrumbs : array();
+}
+
+
/**
* Returns the PHP INI setting in bytes
*