icon.vars.php 692 B

1234567891011121314151617181920212223242526272829
  1. <?php
  2. /**
  3. * @file
  4. * Stub file for "icon" theme hook [pre]process functions.
  5. */
  6. /**
  7. * Pre-processes variables for the "icon" theme hook.
  8. *
  9. * Bootstrap requires an additional "glyphicon" class for all icons.
  10. *
  11. * See theme function for list of available variables.
  12. *
  13. * @param array $variables
  14. * An associative array of variables, passed by reference.
  15. *
  16. * @see icon_preprocess_icon_image()
  17. * @see template_preprocess_icon()
  18. * @see theme_icon()
  19. *
  20. * @ingroup theme_preprocess
  21. */
  22. function bootstrap_preprocess_icon(array &$variables) {
  23. $bundle = &$variables['bundle'];
  24. if ($bundle['provider'] === 'bootstrap') {
  25. $variables['attributes']['class'][] = 'glyphicon';
  26. }
  27. }