blob: 0ab175339183de1de6aad2db959c71b9c77d9433 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
|
<?php
/**
* Breadcrumbs for pages.
*
* @package ElggPages
*/
$page_owner = elgg_get_page_owner_guid();
$parent = $vars['parent'];
$breadcrumbs = '';
$owner_url = $CONFIG->wwwroot . "pg/pages/owned/" . get_entity($page_owner)->username;
echo "<div id='breadcrumbs'><b><a href=\"{$owner_url}\">" . elgg_echo('pages:user') . "</a></b>";
//see if the new page's parent has a parent
$getparent = get_entity($parent->parent_guid);
while ($getparent instanceof ElggObject){
$breadcrumbs = " > <a href=\"{$getparent->getURL()}\">$getparent->title</a>" . $breadcrumbs;
$getparent = get_entity($getparent->parent_guid);
}
echo $breadcrumbs;
//if it is adding a page, make the last page a link, otherwise, don't
if ($vars['add']){
echo " > <a href=\"{$parent->getURL()}\">$parent->title</a></div>";
} else {
echo " > $parent->title</div>";
}
|