Custom.php 837 B

12345678910111213141516171819202122232425262728293031323334353637
  1. <?php
  2. namespace Drupal\bootstrap\Backport\Plugin\Provider;
  3. /**
  4. * The "custom" CDN provider plugin.
  5. *
  6. * Note: this class is a backport from the 8.x-3.x code base.
  7. *
  8. * @see https://drupal-bootstrap.org/api/bootstrap/namespace/Drupal%21bootstrap%21Plugin%21Provider/8
  9. *
  10. * @ingroup plugins_provider
  11. */
  12. class Custom extends ProviderBase {
  13. /**
  14. * {@inheritdoc}
  15. */
  16. protected $pluginId = 'custom';
  17. /**
  18. * {@inheritdoc}
  19. */
  20. protected function discoverCdnAssets($version, $theme) {
  21. $assets = array();
  22. foreach (array('css', 'js') as $type) {
  23. if ($setting = bootstrap_setting('cdn_custom_' . $type)) {
  24. $assets[$type][] = $setting;
  25. }
  26. if ($setting = bootstrap_setting('cdn_custom_' . $type . '_min')) {
  27. $assets['min'][$type][] = $setting;
  28. }
  29. }
  30. return $assets;
  31. }
  32. }