Magento Extensions Rating 2024
EXTENSIONS BY CATEGORY
B2B (Business-To-Business)
Blog
Customer
ERP (Enterprise Resource Planning)
Mega Menu
One Step Checkout
Order
POS (Point Of Sale)
Search
Shopping Cart
Sitemap
SEO
Social
Stock & Inventory Management
EXTENSIONS BY DEVELOPER
aheadWorks
Amasty
Boost My Shop
BSS Commerce
Magestore
MageWorx
Mirasvit
Templates Master
Wyomind
XTENTO
Magento 2 Documentation
Magento 2 Documentation
2.3
Documentation for Magento 2 CMS v2.3 (December 2018)
vendor
magento
module-config
Controller
Adminhtml
System
AbstractConfig.php
Go to the documentation of this file.
1
<?php
7
namespace
Magento\Config\Controller\Adminhtml\System
;
8
9
use
Magento\Framework\Exception\LocalizedException
;
10
16
abstract
class
AbstractConfig
extends
\Magento\Backend\App\AbstractAction
17
{
23
const
ADMIN_RESOURCE
=
'Magento_Config::config'
;
24
28
protected
$_configStructure
;
29
33
protected
$_sectionChecker
;
34
40
public
function
__construct
(
41
\
Magento
\Backend\
App
\Action\
Context
$context,
42
\
Magento
\Config\Model\Config\Structure $configStructure,
43
$sectionChecker
44
) {
45
parent::__construct($context);
46
$this->_configStructure = $configStructure;
47
$this->_sectionChecker = $sectionChecker;
48
}
49
56
public
function
dispatch
(\
Magento
\Framework\
App
\RequestInterface
$request
)
57
{
58
if
(!
$request
->getParam(
'section'
)) {
59
try
{
60
$request
->setParam(
'section'
, $this->_configStructure->getFirstSection()->getId());
61
}
catch
(
LocalizedException
$e) {
63
$this->messageManager->addWarningMessage($e->getMessage());
64
}
65
}
66
return
parent::dispatch(
$request
);
67
}
68
74
protected
function
_isAllowed
()
75
{
76
$sectionId = $this->_request->getParam(
'section'
);
77
return
parent::_isAllowed()
78
|| $this->_configStructure->getElement($sectionId)->isAllowed();
79
}
80
87
protected
function
_saveState
($configState = [])
88
{
89
if
(is_array($configState)) {
90
$configState = $this->
sanitizeConfigState
($configState);
91
$adminUser = $this->_auth->getUser();
92
$extra
= $adminUser->getExtra();
93
if
(!is_array(
$extra
)) {
94
$extra
= [];
95
}
96
if
(!isset(
$extra
[
'configState'
])) {
97
$extra
[
'configState'
] = [];
98
}
99
foreach
($configState as $fieldset => $state) {
100
$extra
[
'configState'
][$fieldset] = $state;
101
}
102
$adminUser->saveExtra(
$extra
);
103
}
104
return
true
;
105
}
106
115
protected
function
sanitizeConfigState
($configState)
116
{
117
$sectionList = $this->_configStructure->getSectionList();
118
$sanitizedConfigState = $configState;
119
foreach
($configState as $sectionId =>
$value
) {
120
if
(array_key_exists($sectionId, $sectionList)) {
121
$sanitizedConfigState[$sectionId] = (bool)$sanitizedConfigState[$sectionId] ?
'1'
:
'0'
;
122
}
else
{
123
unset($sanitizedConfigState[$sectionId]);
124
}
125
}
126
return
$sanitizedConfigState;
127
}
128
}
Magento\Config\Controller\Adminhtml\System\AbstractConfig\__construct
__construct(\Magento\Backend\App\Action\Context $context, \Magento\Config\Model\Config\Structure $configStructure, $sectionChecker)
Definition:
AbstractConfig.php:40
Magento\Backend\App\AbstractAction
Definition:
AbstractAction.php:16
Magento\Framework\Exception\LocalizedException
Definition:
LocalizedException.php:17
Magento\Config\Controller\Adminhtml\System\AbstractConfig\_saveState
_saveState($configState=[])
Definition:
AbstractConfig.php:87
Magento\Framework\App
Magento\Config\Controller\Adminhtml\System\AbstractConfig
Definition:
AbstractConfig.php:16
Magento\Config\Controller\Adminhtml\System\AbstractConfig\ADMIN_RESOURCE
const ADMIN_RESOURCE
Definition:
AbstractConfig.php:23
Magento\Config\Controller\Adminhtml\System\AbstractConfig\$_sectionChecker
$_sectionChecker
Definition:
AbstractConfig.php:33
$value
$value
Definition:
gender.phtml:16
Magento\Config\Controller\Adminhtml\System\AbstractConfig\_isAllowed
_isAllowed()
Definition:
AbstractConfig.php:74
Magento
$request
$request
Definition:
quote_with_configurable_product_last_variation.php:22
Magento\Config\Controller\Adminhtml\System\AbstractConfig\dispatch
dispatch(\Magento\Framework\App\RequestInterface $request)
Definition:
AbstractConfig.php:56
Context
Definition:
ClassesForConstructorIntegrity.php:33
Magento\Config\Controller\Adminhtml\System\AbstractConfig\$_configStructure
$_configStructure
Definition:
AbstractConfig.php:28
Magento\Config\Controller\Adminhtml\System
Definition:
ConfigTest.php:7
Magento\Config\Controller\Adminhtml\System\AbstractConfig\sanitizeConfigState
sanitizeConfigState($configState)
Definition:
AbstractConfig.php:115
$extra
if( $_orders &&count( $_orders))( 'Orders') ?></caption >< thead >< tr >< th scopeforeach( $_orders as $_order)(__( 'Order #')) ?>" class $extra
Definition:
history.phtml:32