Elgg  Version 1.9
breadcrumbs.php
Go to the documentation of this file.
1 <?php
14 if (isset($vars['breadcrumbs'])) {
15  $breadcrumbs = $vars['breadcrumbs'];
16 } else {
17  $breadcrumbs = elgg_get_breadcrumbs();
18 }
19 
20 $class = 'elgg-menu elgg-breadcrumbs';
22 if ($additional_class) {
23  $class = "$class $additional_class";
24 }
25 
26 if (is_array($breadcrumbs) && count($breadcrumbs) > 0) {
27  echo "<ul class=\"$class\">";
28  foreach ($breadcrumbs as $breadcrumb) {
29  if (!empty($breadcrumb['link'])) {
30  $crumb = elgg_view('output/url', array(
31  'href' => $breadcrumb['link'],
32  'text' => $breadcrumb['title'],
33  'is_trusted' => true,
34  ));
35  } else {
36  $crumb = $breadcrumb['title'];
37  }
38  echo "<li>$crumb</li>";
39  }
40  echo '</ul>';
41 }
elgg_extract($key, array $array, $default=null, $strict=true)
Checks for $array[$key] and returns its value if it exists, else returns $default.
Definition: elgglib.php:1464
elgg echo
Translates a string.
Definition: languages.js:43
elgg_get_breadcrumbs()
Returns all breadcrumbs as an array of array(&#39;title&#39; => &#39;Readable Title&#39;, &#39;link&#39; => &#39;URL&#39;) ...
Definition: navigation.php:253
elgg_view($view, $vars=array(), $bypass=false, $ignored=false, $viewtype= '')
Return a parsed view.
Definition: views.php:354
if(file_exists($welcome)) $vars
Definition: upgrade.php:93