Magento 2 Documentation  2.3
Documentation for Magento 2 CMS v2.3 (December 2018)
Edit.php
Go to the documentation of this file.
1 <?php
8 
9 use Magento\Framework\App\Action\HttpGetActionInterface as HttpGetActionInterface;
10 
12 {
16  protected $resultPageFactory;
17 
25  public function __construct(
26  \Magento\Backend\App\Action\Context $context,
27  \Magento\Config\Model\Config\Structure $configStructure,
28  \Magento\Config\Controller\Adminhtml\System\ConfigSectionChecker $sectionChecker,
29  \Magento\Config\Model\Config $backendConfig,
30  \Magento\Framework\View\Result\PageFactory $resultPageFactory
31  ) {
32  parent::__construct($context, $configStructure, $sectionChecker, $backendConfig);
33  $this->resultPageFactory = $resultPageFactory;
34  }
35 
41  public function execute()
42  {
43  $current = $this->getRequest()->getParam('section');
44  $website = $this->getRequest()->getParam('website');
45  $store = $this->getRequest()->getParam('store');
46 
48  $section = $this->_configStructure->getElement($current);
49  if ($current && !$section->isVisible($website, $store)) {
51  $redirectResult = $this->resultRedirectFactory->create();
52  return $redirectResult->setPath('adminhtml/*/', ['website' => $website, 'store' => $store]);
53  }
54 
56  $resultPage = $this->resultPageFactory->create();
57  $resultPage->setActiveMenu('Magento_Config::system_config');
58  $resultPage->getLayout()->getBlock('menu')->setAdditionalCacheKeyInfo([$current]);
59  $resultPage->addBreadcrumb(__('System'), __('System'), $this->getUrl('*\/system'));
60  $resultPage->getConfig()->getTitle()->prepend(__('Configuration'));
61  return $resultPage;
62  }
63 }
__()
Definition: __.php:13
__construct(\Magento\Backend\App\Action\Context $context, \Magento\Config\Model\Config\Structure $configStructure, \Magento\Config\Controller\Adminhtml\System\ConfigSectionChecker $sectionChecker, \Magento\Config\Model\Config $backendConfig, \Magento\Framework\View\Result\PageFactory $resultPageFactory)
Definition: Edit.php:25