breadcrumbs.php 1005 B

1234567891011121314151617181920212223242526272829303132333435363738394041
  1. <?php
  2. /**
  3. * Modbash Clean Elgg Theme
  4. *
  5. * Copyright (c) 2015 ModBash
  6. *
  7. * @author Shane Barron <admin@modbash.com>
  8. * @copyright 2015 SocialApparatus
  9. * @license GNU General Public License (GPL) version 2
  10. * @version 1
  11. * @link http://modbash.com
  12. */
  13. if (isset($vars['breadcrumbs'])) {
  14. $breadcrumbs = $vars['breadcrumbs'];
  15. } else {
  16. $breadcrumbs = elgg_get_breadcrumbs();
  17. }
  18. $class = 'elgg-menu elgg-breadcrumbs';
  19. $additional_class = elgg_extract('class', $vars, '');
  20. if ($additional_class) {
  21. $class = "$class $additional_class";
  22. }
  23. if (is_array($breadcrumbs) && count($breadcrumbs) > 0) {
  24. echo "<ol class='breadcrumb'>";
  25. foreach ($breadcrumbs as $breadcrumb) {
  26. if (!empty($breadcrumb['link'])) {
  27. $crumb = elgg_view('output/url', array(
  28. 'href' => $breadcrumb['link'],
  29. 'text' => $breadcrumb['title'],
  30. 'is_trusted' => true,
  31. ));
  32. } else {
  33. $crumb = $breadcrumb['title'];
  34. }
  35. echo "<li>$crumb</li>";
  36. }
  37. echo '</ol>';
  38. }