blob: 7bb709be9ca81e39a7c3c6a024d5d93d12dc3a59 (
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
31
32
33
34
35
36
37
38
39
40
41
42
43
|
<?php
/**
* Displays registered breadcrumbs.
*
* @package Elgg
* @subpackage Core
*
* @uses optional $vars['breadcrumbs'] = array('title' => 'The title', 'link' => 'url')
* @see elgg_push_breadcrumb
*/
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 class="breadcrumbs">
$breadcrumbs_html
</div>
___END;
?>
|