links.vars.php 843 B

12345678910111213141516171819202122232425262728293031
  1. <?php
  2. /**
  3. * @file
  4. * Stub file for "links" theme hook [pre]process functions.
  5. */
  6. /**
  7. * Pre-processes variables for the "links" theme hook.
  8. *
  9. * See theme function for list of available variables.
  10. *
  11. * @see theme_links()
  12. *
  13. * @ingroup theme_preprocess
  14. */
  15. function bootstrap_preprocess_links(&$variables) {
  16. if (isset($variables['attributes']) && isset($variables['attributes']['class'])) {
  17. $string = is_string($variables['attributes']['class']);
  18. if ($string) {
  19. $variables['attributes']['class'] = explode(' ', $variables['attributes']['class']);
  20. }
  21. if ($key = array_search('inline', $variables['attributes']['class'])) {
  22. $variables['attributes']['class'][$key] = 'list-inline';
  23. }
  24. if ($string) {
  25. $variables['attributes']['class'] = implode(' ', $variables['attributes']['class']);
  26. }
  27. }
  28. }