| @@ 37-96 (lines=60) @@ | ||
| 34 | /** |
|
| 35 | * Controller class for API-log details-page |
|
| 36 | */ |
|
| 37 | class View extends \Magento\Backend\App\Action |
|
| 38 | { |
|
| 39 | /** |
|
| 40 | * Result page |
|
| 41 | * |
|
| 42 | * @var \Magento\Framework\View\Result\PageFactory |
|
| 43 | */ |
|
| 44 | protected $resultPageFactory; |
|
| 45 | ||
| 46 | /** |
|
| 47 | * Result forward |
|
| 48 | * |
|
| 49 | * @var \Magento\Backend\Model\View\Result\ForwardFactory |
|
| 50 | */ |
|
| 51 | protected $resultForwardFactory; |
|
| 52 | ||
| 53 | /** |
|
| 54 | * Constructor |
|
| 55 | * |
|
| 56 | * @param \Magento\Backend\App\Action\Context $context |
|
| 57 | * @param \Magento\Backend\Model\View\Result\ForwardFactory $resultForwardFactory |
|
| 58 | * @param \Magento\Framework\View\Result\PageFactory $resultPageFactory |
|
| 59 | */ |
|
| 60 | public function __construct( |
|
| 61 | Context $context, |
|
| 62 | ForwardFactory $resultForwardFactory, |
|
| 63 | PageFactory $resultPageFactory |
|
| 64 | ) { |
|
| 65 | parent::__construct($context); |
|
| 66 | $this->resultPageFactory = $resultPageFactory; |
|
| 67 | $this->resultForwardFactory = $resultForwardFactory; |
|
| 68 | } |
|
| 69 | ||
| 70 | /** |
|
| 71 | * Return if the user has the needed rights to view this page |
|
| 72 | * |
|
| 73 | * @return bool |
|
| 74 | */ |
|
| 75 | protected function _isAllowed() |
|
| 76 | { |
|
| 77 | return $this->_authorization->isAllowed('Payone_Core::payone_protocol_api'); |
|
| 78 | } |
|
| 79 | ||
| 80 | /** |
|
| 81 | * Returns result page |
|
| 82 | * |
|
| 83 | * @return Page |
|
| 84 | */ |
|
| 85 | public function execute() |
|
| 86 | { |
|
| 87 | /** @var Page $resultPage */ |
|
| 88 | $resultPage = $this->resultPageFactory->create(); |
|
| 89 | if ($this->_isAllowed()) { |
|
| 90 | $resultPage->setActiveMenu('Payone_Core::payone_protocol_api'); |
|
| 91 | $resultPage->getConfig()->getTitle()->prepend(__('Protocol - API')); |
|
| 92 | $resultPage->getConfig()->getTitle()->prepend(sprintf("#%s", $this->getRequest()->getParam('id'))); |
|
| 93 | } |
|
| 94 | return $resultPage; |
|
| 95 | } |
|
| 96 | } |
|
| 97 | ||
| @@ 37-96 (lines=60) @@ | ||
| 34 | /** |
|
| 35 | * Controller class for TransactionStatus details-page |
|
| 36 | */ |
|
| 37 | class View extends \Magento\Backend\App\Action |
|
| 38 | { |
|
| 39 | /** |
|
| 40 | * Result page factory |
|
| 41 | * |
|
| 42 | * @var \Magento\Framework\View\Result\PageFactory |
|
| 43 | */ |
|
| 44 | protected $resultPageFactory; |
|
| 45 | ||
| 46 | /** |
|
| 47 | * Result forward factory |
|
| 48 | * |
|
| 49 | * @var \Magento\Backend\Model\View\Result\ForwardFactory |
|
| 50 | */ |
|
| 51 | protected $resultForwardFactory; |
|
| 52 | ||
| 53 | /** |
|
| 54 | * Constructor |
|
| 55 | * |
|
| 56 | * @param Context $context |
|
| 57 | * @param ForwardFactory $resultForwardFactory |
|
| 58 | * @param PageFactory $resultPageFactory |
|
| 59 | */ |
|
| 60 | public function __construct( |
|
| 61 | Context $context, |
|
| 62 | ForwardFactory $resultForwardFactory, |
|
| 63 | PageFactory $resultPageFactory |
|
| 64 | ) { |
|
| 65 | parent::__construct($context); |
|
| 66 | $this->resultForwardFactory = $resultForwardFactory; |
|
| 67 | $this->resultPageFactory = $resultPageFactory; |
|
| 68 | } |
|
| 69 | ||
| 70 | /** |
|
| 71 | * Return if the user has the needed rights to view this page |
|
| 72 | * |
|
| 73 | * @return bool |
|
| 74 | */ |
|
| 75 | protected function _isAllowed() |
|
| 76 | { |
|
| 77 | return $this->_authorization->isAllowed('Payone_Core::payone_protocol_transactionstatus'); |
|
| 78 | } |
|
| 79 | ||
| 80 | /** |
|
| 81 | * Returns result page |
|
| 82 | * |
|
| 83 | * @return Page |
|
| 84 | */ |
|
| 85 | public function execute() |
|
| 86 | { |
|
| 87 | /** @var Page $resultPage */ |
|
| 88 | $resultPage = $this->resultPageFactory->create(); |
|
| 89 | if ($this->_isAllowed()) { |
|
| 90 | $resultPage->setActiveMenu('Payone_Core::payone_protocol_transactionstatus'); |
|
| 91 | $resultPage->getConfig()->getTitle()->prepend(__('Protocol - TransactionStatus')); |
|
| 92 | $resultPage->getConfig()->getTitle()->prepend(sprintf("#%s", $this->getRequest()->getParam('id'))); |
|
| 93 | } |
|
| 94 | return $resultPage; |
|
| 95 | } |
|
| 96 | } |
|
| 97 | ||