Skip to content

Commit 685b697

Browse files
author
Bohdan Korablov
committed
MAGETWO-61786: Implementation
1 parent 2a6d6a4 commit 685b697

File tree

4 files changed

+24
-7
lines changed

4 files changed

+24
-7
lines changed

app/code/Magento/Config/Model/Config/Structure/AbstractElement.php

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -218,7 +218,9 @@ public function getPath($fieldPrefix = '')
218218
* Get instance of ElementVisibilityInterface.
219219
*
220220
* @return ElementVisibilityInterface
221-
* @deprecated
221+
* @deprecated Added to not break backward compatibility of the constructor signature
222+
* by injecting the new dependency directly.
223+
* The method can be removed in a future major release, when constructor signature can be changed.
222224
*/
223225
public function getElementVisibility()
224226
{

app/code/Magento/Config/Model/Config/Structure/ConcealInProductionConfigList.php

Lines changed: 18 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -8,12 +8,26 @@
88
use Magento\Framework\App\State;
99

1010
/**
11-
* Contains list of elements paths which should be hidden or disabled on Configuration page in Production mode.
11+
* Defines status of visibility of form elements on Store > Settings > Configuration page
12+
* in Admin Panel in Production mode.
1213
*/
1314
class ConcealInProductionConfigList implements ElementVisibilityInterface
1415
{
1516
/**
16-
* The list of paths of form elements in the structure.
17+
* The list of form element paths with concrete visibility status.
18+
*
19+
* E.g.
20+
*
21+
* ```php
22+
* [
23+
* 'general/locale/code' => ElementVisibilityInterface::DISABLED,
24+
* 'general/country' => ElementVisibilityInterface::HIDDEN,
25+
* ];
26+
* ```
27+
*
28+
* It means that:
29+
* - field Locale (in group Locale Options in section General) will be disabled
30+
* - group Country Options (in section General) will be hidden
1731
*
1832
* @var array
1933
*/
@@ -28,7 +42,7 @@ class ConcealInProductionConfigList implements ElementVisibilityInterface
2842

2943
/**
3044
* @param State $state The object that has information about the state of the system
31-
* @param array $configs The list of paths of form elements in the structure
45+
* @param array $configs The list of form element paths with concrete visibility status.
3246
*/
3347
public function __construct(State $state, array $configs = [])
3448
{
@@ -73,7 +87,7 @@ public function isDisabled($path)
7387
/**
7488
* Returns normalized path.
7589
*
76-
* @param string $path The path will be normalized
90+
* @param string $path The path to be normalized
7791
* @return string The normalized path
7892
*/
7993
private function normalizePath($path)

app/code/Magento/Config/Model/Config/Structure/ElementVisibilityComposite.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99

1010
/**
1111
* Contains list of classes which implement ElementVisibilityInterface for
12-
* checking of visibility of form elements on Configuration page.
12+
* checking of visibility of form elements on Store > Settings > Configuration page in Admin Panel.
1313
*/
1414
class ElementVisibilityComposite implements ElementVisibilityInterface
1515
{

app/code/Magento/Config/Model/Config/Structure/ElementVisibilityInterface.php

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,8 @@
66
namespace Magento\Config\Model\Config\Structure;
77

88
/**
9-
* Checks visibility of form elements on Configuration page by their paths in the structure.
9+
* Checks visibility status of form elements on Store > Settings > Configuration page in Admin Panel
10+
* by their paths in the structure.
1011
*/
1112
interface ElementVisibilityInterface
1213
{

0 commit comments

Comments
 (0)