Theme.php 874 B

1234567891011121314151617181920212223242526272829303132333435363738394041
  1. <?php
  2. /**
  3. * Copyright © Magento, Inc. All rights reserved.
  4. * See COPYING.txt for license details.
  5. */
  6. namespace Magento\Cms\Model\Page\Source;
  7. use Magento\Framework\Data\OptionSourceInterface;
  8. use Magento\Framework\View\Design\Theme\Label\ListInterface;
  9. /**
  10. * Class Theme
  11. */
  12. class Theme implements OptionSourceInterface
  13. {
  14. /**
  15. * @var \Magento\Framework\View\Design\Theme\Label\ListInterface
  16. */
  17. protected $themeList;
  18. /**
  19. * Constructor
  20. *
  21. * @param ListInterface $themeList
  22. */
  23. public function __construct(ListInterface $themeList)
  24. {
  25. $this->themeList = $themeList;
  26. }
  27. /**
  28. * Get options
  29. *
  30. * @return array
  31. */
  32. public function toOptionArray()
  33. {
  34. $options[] = ['label' => 'Default', 'value' => ''];
  35. return array_merge($options, $this->themeList->getLabels());
  36. }
  37. }