file icons.inc

  1. 8 icons.inc
  2. 7 includes/icons.inc

Icon API support to provide Bootstrap Framework glyphicons.

Source
  1. <?php
  2. /**
  3. * @file
  4. * Icon API support to provide Bootstrap Framework glyphicons.
  5. */
  6. use Drupal\bootstrap\Bootstrap;
  7. /**
  8. * Implements hook_icon_providers().
  9. */
  10. function bootstrap_icon_providers() {
  11. $providers['bootstrap'] = [
  12. 'title' => t('Bootstrap'),
  13. 'url' => 'http://getbootstrap.com/components/#glyphicons',
  14. ];
  15. return $providers;
  16. }
  17. /**
  18. * Implements hook_icon_bundles().
  19. */
  20. function bootstrap_icon_bundles() {
  21. $bundles = [];
  22. if (Bootstrap::getTheme()->hasGlyphicons()) {
  23. $bundles['bootstrap'] = [
  24. 'render' => 'sprite',
  25. 'provider' => 'bootstrap',
  26. 'title' => t('Bootstrap'),
  27. 'version' => t('Icons by Glyphicons'),
  28. 'variations' => [
  29. 'icon-white' => t('White'),
  30. ],
  31. 'settings' => [
  32. 'tag' => 'span',
  33. ],
  34. 'icons' => Bootstrap::glyphicons(),
  35. ];
  36. }
  37. return $bundles;
  38. }

Functions

Namesort descending Description
bootstrap_icon_bundles Implements hook_icon_bundles().
bootstrap_icon_providers Implements hook_icon_providers().