diff options
author | cash <cash@36083f99-b078-4883-b0ff-0f9b5a30f544> | 2011-01-22 20:33:28 +0000 |
---|---|---|
committer | cash <cash@36083f99-b078-4883-b0ff-0f9b5a30f544> | 2011-01-22 20:33:28 +0000 |
commit | 8423cda014c6aee9fb3a3f7ebe78bc0465e7355f (patch) | |
tree | e1baa523308221d33908e4ea4014191ade8d5d66 /mod/pages/lib | |
parent | cec8a4f34681d4c2a43e0c07de0a68bc22f1b558 (diff) | |
download | elgg-8423cda014c6aee9fb3a3f7ebe78bc0465e7355f.tar.gz elgg-8423cda014c6aee9fb3a3f7ebe78bc0465e7355f.tar.bz2 |
finished the first pass on the pages plugin for using the new HTML/CSS
git-svn-id: http://code.elgg.org/elgg/trunk@7904 36083f99-b078-4883-b0ff-0f9b5a30f544
Diffstat (limited to 'mod/pages/lib')
-rw-r--r-- | mod/pages/lib/pages.php | 39 |
1 files changed, 21 insertions, 18 deletions
diff --git a/mod/pages/lib/pages.php b/mod/pages/lib/pages.php index e3ed3c822..72aad2aed 100644 --- a/mod/pages/lib/pages.php +++ b/mod/pages/lib/pages.php @@ -42,6 +42,26 @@ function pages_prepare_form_vars($page = null, $parent_guid = 0) { } /** + * Recurses the page tree and adds the breadcrumbs for all ancestors + * + * @param ElggObject $page Page entity + */ +function pages_prepare_parent_breadcrumbs($page) { + if ($page && $page->parent_guid) { + $parents = array(); + $parent = get_entity($page->parent_guid); + while ($parent) { + array_push($parents, $parent); + $parent = get_entity($parent->parent_guid); + } + while ($parents) { + $parent = array_pop($parents); + elgg_push_breadcrumb($parent->title, $parent->getURL()); + } + } +} + +/** * Register the navigation menu * * @param ElggEntity $container Container entity for the pages @@ -54,7 +74,7 @@ function pages_register_navigation_tree($container) { $top_pages = elgg_get_entities(array( 'type' => 'object', 'subtype' => 'page_top', - 'container_guid' => $container->getGUID, + 'container_guid' => $container->getGUID(), )); foreach ($top_pages as $page) { @@ -87,20 +107,3 @@ function pages_register_navigation_tree($container) { } } } - -/** - * Return the correct sidebar for a given entity - * - * @param ElggObject $entity - */ -function pages_get_entity_sidebar(ElggObject $entity, $fulltree = 0) { - $body = ""; - - $children = elgg_get_entities_from_metadata(array('metadata_names' => 'parent_guid', 'metadata_values' => $entity->guid, 'limit' => 9999)); - $body .= elgg_view('pages/sidebar/sidebarthis', array('entity' => $entity, - 'children' => $children, - 'fulltree' => $fulltree)); - //$body = elgg_view('pages/sidebar/wrapper', array('body' => $body)); - - return $body; -} |