-
Notifications
You must be signed in to change notification settings - Fork 12
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #5 from ericthehacker/feature/m2.1-support
Magento 2.1.x support
- Loading branch information
Showing
9 changed files
with
127 additions
and
149 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,63 @@ | ||
<?php | ||
|
||
namespace EW\ConfigScopeHints\Plugin\Framework\Data\Form\Element; | ||
|
||
use \Magento\Framework\Data\Form\Element\Fieldset as OriginalFieldset; | ||
|
||
class Fieldset | ||
{ | ||
/** | ||
* @var \EW\ConfigScopeHints\Helper\Data | ||
*/ | ||
protected $helper; | ||
/** | ||
* @var \Magento\Framework\App\RequestInterface | ||
*/ | ||
protected $request; | ||
|
||
/** | ||
* Fieldset constructor. | ||
* @param \EW\ConfigScopeHints\Helper\Data $helper | ||
* @param \Magento\Framework\App\RequestInterface $request | ||
*/ | ||
public function __construct( | ||
\EW\ConfigScopeHints\Helper\Data $helper, | ||
\Magento\Framework\App\RequestInterface $request | ||
) | ||
{ | ||
$this->helper = $helper; | ||
$this->request = $request; | ||
} | ||
|
||
/** | ||
* If field is overwritten at more specific scope(s), | ||
* set field hint with this info. | ||
* | ||
* @param OriginalFieldset $subject | ||
* @param callable $proceed | ||
* @param string $elementId | ||
* @param string $type | ||
* @param array $config | ||
* @param bool $after | ||
* @param bool $isAdvanced | ||
* @return \Magento\Framework\Data\Form\Element\AbstractElement | ||
*/ | ||
public function aroundAddField(OriginalFieldset $subject, callable $proceed, $elementId, $type, $config, $after = false, $isAdvanced = false) { | ||
$path = $config['field_config']['path'] . '/' . $config['field_config']['id']; | ||
$scope = $config['scope']; | ||
$scopeId = $config['scope_id']; | ||
$section = $this->request->getParam('section'); //@todo: don't talk to request directly | ||
|
||
$overriddenLevels = $this->helper->getOverriddenLevels( | ||
$path, | ||
$scope, | ||
$scopeId | ||
); | ||
|
||
if(!empty($overriddenLevels)) { | ||
$config['comment'] .= $this->helper->formatOverriddenScopes($section, $overriddenLevels); | ||
} | ||
|
||
return $proceed($elementId, $type, $config, $after, $isAdvanced); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,6 @@ | ||
<?xml version="1.0"?> | ||
<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../../lib/internal/Magento/Framework/ObjectManager/etc/config.xsd"> | ||
<type name="Magento\Config\Block\System\Config\Form"> | ||
<plugin name="configScopeHints" type="EW\ConfigScopeHints\Model\Plugin" sortOrder="100" /> | ||
<type name="Magento\Framework\Data\Form\Element\Fieldset"> | ||
<plugin name="ew_configscopehints" type="EW\ConfigScopeHints\Plugin\Framework\Data\Form\Element\Fieldset" sortOrder="100" /> | ||
</type> | ||
</config> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,36 +1,17 @@ | ||
a.overridden-hint-list-toggle { | ||
display: inline-block; | ||
width: 16px; | ||
height: 16px; | ||
line-height: 16px; | ||
margin-left: 5px; | ||
text-decoration: none; | ||
.overridden-hint-wrapper { | ||
font-style: italic; | ||
|
||
&:hover, &:active, &:visited, &:focus { | ||
text-decoration: inherit; | ||
.lead-text { | ||
&:before { | ||
color: #eb5202; | ||
content: '\e623'; | ||
font-family: "Admin Icons"; | ||
display: inline-block; | ||
margin-right: 0.5em; | ||
} | ||
} | ||
|
||
> span { | ||
text-indent: -9999px; | ||
white-space: nowrap; | ||
display: inline-block; | ||
.overridden-hint-list { | ||
list-style-position: inside; | ||
} | ||
|
||
&::before { | ||
color: #eb5202; | ||
content: '\e623'; | ||
font-family: "Admin Icons"; | ||
} | ||
} | ||
|
||
.overridden-hint-list { | ||
display: none; | ||
|
||
li { | ||
display: inherit; | ||
} | ||
|
||
&.visible { | ||
display: block; | ||
} | ||
} | ||
} |
This file was deleted.
Oops, something went wrong.