|
6 | 6 | */
|
7 | 7 | namespace Magento\Theme\Controller\Adminhtml\System\Design\Theme;
|
8 | 8 |
|
9 |
| -use Magento\Backend\App\Action\Context; |
10 | 9 | use Magento\Framework\App\Action\HttpGetActionInterface;
|
11 |
| -use Magento\Framework\App\Response\Http\FileFactory; |
12 | 10 | use Magento\Framework\App\ResponseInterface;
|
13 | 11 | use Magento\Framework\App\Filesystem\DirectoryList;
|
14 |
| -use Magento\Framework\Escaper; |
15 |
| -use Magento\Framework\Filesystem; |
16 |
| -use Magento\Framework\Registry; |
| 12 | +use Magento\Theme\Controller\Adminhtml\System\Design\Theme; |
17 | 13 | use Magento\Framework\Url\DecoderInterface;
|
18 |
| -use Magento\Framework\View\Asset\Repository; |
19 | 14 | use Magento\Framework\View\Design\ThemeInterface;
|
20 |
| -use Magento\Theme\Controller\Adminhtml\System\Design\Theme; |
21 | 15 | use Psr\Log\LoggerInterface;
|
22 | 16 |
|
23 | 17 | /**
|
|
28 | 22 | */
|
29 | 23 | class DownloadCss extends Theme implements HttpGetActionInterface
|
30 | 24 | {
|
31 |
| - /** |
32 |
| - * @var Escaper |
33 |
| - */ |
34 |
| - private $escaper; |
35 |
| - |
36 |
| - /** |
37 |
| - * DownloadCss constructor. |
38 |
| - * @param Context $context |
39 |
| - * @param Registry $coreRegistry |
40 |
| - * @param FileFactory $fileFactory |
41 |
| - * @param Repository $assetRepo |
42 |
| - * @param Filesystem $appFileSystem |
43 |
| - * @param Escaper|null $escaper |
44 |
| - */ |
45 |
| - public function __construct( |
46 |
| - Context $context, |
47 |
| - Registry $coreRegistry, |
48 |
| - FileFactory $fileFactory, |
49 |
| - Repository $assetRepo, |
50 |
| - Filesystem $appFileSystem, |
51 |
| - Escaper $escaper = null |
52 |
| - ) { |
53 |
| - $this->escaper = $escaper ?? $context->getObjectManager()->get(Escaper::class); |
54 |
| - parent::__construct($context, $coreRegistry, $fileFactory, $assetRepo, $appFileSystem); |
55 |
| - } |
56 |
| - |
57 | 25 | /**
|
58 | 26 | * Download css file
|
59 | 27 | *
|
@@ -86,11 +54,11 @@ public function execute()
|
86 | 54 | DirectoryList::ROOT
|
87 | 55 | );
|
88 | 56 | } catch (\InvalidArgumentException $e) {
|
89 |
| - $this->messageManager->addException($e, __('Theme not found: "%1".', $this->escaper->escapeHtml($themeId))); |
| 57 | + $this->messageManager->addException($e, sprintf('Theme not found: "%d".', $themeId)); |
90 | 58 | $this->getResponse()->setRedirect($this->_redirect->getRefererUrl());
|
91 | 59 | $this->_objectManager->get(LoggerInterface::class)->critical($e);
|
92 | 60 | } catch (\Exception $e) {
|
93 |
| - $this->messageManager->addException($e, __('File not found: "%1".', $this->escaper->escapeHtml($fileId))); |
| 61 | + $this->messageManager->addException($e, sprintf('File not found: "%d".', $fileId)); |
94 | 62 | $this->getResponse()->setRedirect($this->_redirect->getRefererUrl());
|
95 | 63 | $this->_objectManager->get(LoggerInterface::class)->critical($e);
|
96 | 64 | }
|
|
0 commit comments