icon.vars.php 594 B

12345678910111213141516171819202122232425
  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. * @see icon_preprocess_icon_image()
  14. * @see template_preprocess_icon()
  15. * @see theme_icon()
  16. *
  17. * @ingroup theme_preprocess
  18. */
  19. function bootstrap_preprocess_icon(&$variables) {
  20. $bundle = &$variables['bundle'];
  21. if ($bundle['provider'] === 'bootstrap') {
  22. $variables['attributes']['class'][] = 'glyphicon';
  23. }
  24. }