breadcrumb.vars.php 1.1 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243
  1. <?php
  2. /**
  3. * @file
  4. * Stub file for "breadcrumb" theme hook [pre]process functions.
  5. */
  6. /**
  7. * Pre-processes variables for the "breadcrumb" theme hook.
  8. *
  9. * See theme function for list of available variables.
  10. *
  11. * @see bootstrap_breadcrumb()
  12. * @see theme_breadcrumb()
  13. *
  14. * @ingroup theme_preprocess
  15. */
  16. function bootstrap_preprocess_breadcrumb(&$variables) {
  17. // Do not modify breadcrumbs if the Path Breadcrumbs module should be used.
  18. if (_bootstrap_use_path_breadcrumbs()) {
  19. return;
  20. }
  21. $breadcrumb = &$variables['breadcrumb'];
  22. // Optionally get rid of the homepage link.
  23. $show_breadcrumb_home = bootstrap_setting('breadcrumb_home');
  24. if (!$show_breadcrumb_home) {
  25. array_shift($breadcrumb);
  26. }
  27. if (bootstrap_setting('breadcrumb_title') && !empty($breadcrumb)) {
  28. $item = menu_get_item();
  29. $page_title = !empty($item['tab_parent']) ? check_plain($item['title']) : drupal_get_title();
  30. if (!empty($page_title)) {
  31. $breadcrumb[] = array(
  32. // If we are on a non-default tab, use the tab's title.
  33. 'data' => $page_title,
  34. 'class' => array('active'),
  35. );
  36. }
  37. }
  38. }