46 \
Magento\Config\Model\Config\Structure $configStructure,
52 parent::__construct($context, $configStructure, $sectionChecker);
65 $groups = $this->
getRequest()->getPost(
'groups');
76 if (!empty($groups[$groupName])) {
77 $groups[$groupName] = array_merge_recursive((array)$groups[$groupName],
$data);
79 $groups[$groupName] =
$data;
97 if (isset(
$group[
'fields']) && is_array(
$group[
'fields'])) {
98 foreach (
$group[
'fields'] as $fieldName => $field) {
99 if (!empty($field[
'value'])) {
100 $data[
'fields'][$fieldName] = [
'value' => $field[
'value']];
105 if (isset(
$group[
'groups']) && is_array(
$group[
'groups'])) {
106 foreach (
$group[
'groups'] as $groupName => $groupData) {
108 if (!empty($nestedGroup)) {
109 $data[
'groups'][$groupName] = $nestedGroup;
124 $method =
'_save' . $this->
string->upperCaseWords($this->
getRequest()->getParam(
'section'),
'_',
'');
125 if (method_exists($this,
$method)) {
137 $this->_cache->clean();
150 $section = $this->
getRequest()->getParam(
'section');
155 'section' => $section,
161 $configModel = $this->_configFactory->create([
'data' =>
$configData]);
162 $configModel->save();
163 $this->_eventManager->dispatch(
'admin_system_config_save', [
167 $this->messageManager->addSuccess(
__(
'You saved the configuration.'));
169 $messages = explode(
"\n", $e->getMessage());
171 $this->messageManager->addError(
$message);
173 }
catch (\Exception $e) {
174 $this->messageManager->addException(
176 __(
'Something went wrong while saving this configuration:') .
' ' . $e->getMessage()
182 $resultRedirect = $this->resultRedirectFactory->create();
183 return $resultRedirect->setPath(
184 'adminhtml/system_config/edit',
186 '_current' => [
'section',
'website',
'store'],
_saveState($configState=[])
_processNestedGroups($group)
__construct(\Magento\Backend\App\Action\Context $context, \Magento\Config\Model\Config\Structure $configStructure, \Magento\Config\Controller\Adminhtml\System\ConfigSectionChecker $sectionChecker, \Magento\Config\Model\Config\Factory $configFactory, \Magento\Framework\Cache\FrontendInterface $cache, \Magento\Framework\Stdlib\StringUtils $string)
foreach($appDirs as $dir) $files