Files.php 1.3 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455
  1. <?php
  2. /**
  3. * Copyright © Magento, Inc. All rights reserved.
  4. * See COPYING.txt for license details.
  5. */
  6. /**
  7. * Files controller
  8. */
  9. namespace Magento\Theme\Controller\Adminhtml\System\Design\Wysiwyg;
  10. abstract class Files extends \Magento\Backend\App\Action
  11. {
  12. /**
  13. * Authorization level of a basic admin session
  14. *
  15. * @see _isAllowed()
  16. */
  17. const ADMIN_RESOURCE = 'Magento_Theme::theme';
  18. /**
  19. * @var \Magento\Framework\App\Response\Http\FileFactory
  20. */
  21. protected $_fileFactory;
  22. /**
  23. * @var \Magento\Theme\Helper\Storage
  24. */
  25. protected $storage;
  26. /**
  27. * @param \Magento\Backend\App\Action\Context $context
  28. * @param \Magento\Framework\App\Response\Http\FileFactory $fileFactory
  29. * @param \Magento\Theme\Helper\Storage $storage
  30. */
  31. public function __construct(
  32. \Magento\Backend\App\Action\Context $context,
  33. \Magento\Framework\App\Response\Http\FileFactory $fileFactory,
  34. \Magento\Theme\Helper\Storage $storage
  35. ) {
  36. $this->_fileFactory = $fileFactory;
  37. $this->storage = $storage;
  38. parent::__construct($context);
  39. }
  40. /**
  41. * Get storage
  42. *
  43. * @return \Magento\Theme\Model\Wysiwyg\Storage
  44. */
  45. protected function _getStorage()
  46. {
  47. return $this->_objectManager->get(\Magento\Theme\Model\Wysiwyg\Storage::class);
  48. }
  49. }