Config.php 1.1 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546
  1. <?php
  2. /**
  3. * Copyright © Magento, Inc. All rights reserved.
  4. * See COPYING.txt for license details.
  5. */
  6. /**
  7. * {@inheritdoc}
  8. */
  9. namespace Magento\Theme\Model\Theme\Customization;
  10. class Config implements \Magento\Framework\View\Design\Theme\Customization\ConfigInterface
  11. {
  12. /**
  13. * XML path to definitions of customization services
  14. */
  15. const XML_PATH_CUSTOM_FILES = 'theme/customization';
  16. /**
  17. * @var \Magento\Framework\App\Config\ScopeConfigInterface
  18. */
  19. protected $config;
  20. /**
  21. * @param \Magento\Framework\App\Config\ScopeConfigInterface $config
  22. */
  23. public function __construct(\Magento\Framework\App\Config\ScopeConfigInterface $config)
  24. {
  25. $this->config = $config;
  26. }
  27. /**
  28. * {@inheritdoc}
  29. */
  30. public function getFileTypes()
  31. {
  32. $types = [];
  33. $convertNode = $this->config->getValue(self::XML_PATH_CUSTOM_FILES, 'default');
  34. if ($convertNode) {
  35. foreach ($convertNode as $name => $value) {
  36. $types[$name] = $value;
  37. }
  38. }
  39. return $types;
  40. }
  41. }