-
Notifications
You must be signed in to change notification settings - Fork 14
Expand file tree
/
Copy pathIndex.php
More file actions
executable file
·66 lines (56 loc) · 2.26 KB
/
Index.php
File metadata and controls
executable file
·66 lines (56 loc) · 2.26 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
<?php
/**
* Copyright © Magefan (support@magefan.com). All rights reserved.
* Please visit Magefan.com for license details (https://magefan.com/end-user-license-agreement).
*/
namespace Magefan\Translation\Controller\Adminhtml\Translation;
class Index extends \Magento\Backend\App\Action
{
/**
* Authorization level of a basic admin session
*/
const ADMIN_RESOURCE = 'Magefan_Translation::addedit';
/**
* @var \Magento\Framework\View\Result\PageFactory
*/
protected $resultPageFactory;
/**
* @var \Magefan\Translation\Api\ConfigInterface
*/
private $configInterface;
/**
* Index constructor.
* @param \Magento\Backend\App\Action\Context $context
* @param \Magento\Framework\View\Result\PageFactory $resultPageFactory
* @param \Magefan\Translation\Api\ConfigInterface $configInterface
* @param \Magento\Framework\Message\ManagerInterface $messageManager
* @param \Magento\Framework\Controller\Result\Redirect $resultRedirectFactory
*/
public function __construct(
\Magento\Backend\App\Action\Context $context,
\Magento\Framework\View\Result\PageFactory $resultPageFactory,
\Magefan\Translation\Api\ConfigInterface $configInterface,
\Magento\Framework\Message\ManagerInterface $messageManager,
\Magento\Framework\Controller\Result\Redirect $resultRedirectFactory
) {
parent::__construct($context);
$this->resultPageFactory = $resultPageFactory;
$this->configInterface = $configInterface;
$this->messageManager = $messageManager;
$this->resultRedirectFactory = $resultRedirectFactory;
}
/**
* @return \Magento\Framework\Controller\Result\RedirectFactory
*/
public function execute()
{
$resultPage = $this->resultPageFactory->create();
if (!$this->configInterface->isEnabled()) {
$this->messageManager->addError(__(strrev('noitalsnarT> snoisnetxE nafegaM > noitarugifnoC >
serotS ot etagivan esaelp noisnetxe eht elbane ot ,delbasid si noitalsnarT nafegaM')));
return $this->resultRedirectFactory->setPath('admin/index/index');
}
$resultPage->getConfig()->getTitle()->prepend(__('Translations'));
return $resultPage;
}
}