|
1
|
|
|
<?php |
|
2
|
|
|
/** |
|
3
|
|
|
* Copyright © Wirecard Brasil. All rights reserved. |
|
4
|
|
|
* |
|
5
|
|
|
* @author Bruno Elisei <[email protected]> |
|
6
|
|
|
* See COPYING.txt for license details. |
|
7
|
|
|
*/ |
|
8
|
|
|
|
|
9
|
|
|
namespace Moip\Magento2\Block\Adminhtml\System\Config; |
|
10
|
|
|
|
|
11
|
|
|
/** |
|
12
|
|
|
* Class PaymentGroup - Fieldset renderer for moip. |
|
13
|
|
|
*/ |
|
14
|
|
|
class PaymentGroup extends \Magento\Config\Block\System\Config\Form\Fieldset |
|
|
|
|
|
|
15
|
|
|
{ |
|
16
|
|
|
/** |
|
17
|
|
|
* @param \Magento\Backend\Block\Context $context |
|
18
|
|
|
* @param \Magento\Backend\Model\Auth\Session $authSession |
|
19
|
|
|
* @param \Magento\Framework\View\Helper\Js $jsHelper |
|
20
|
|
|
* @param array $data |
|
21
|
|
|
*/ |
|
22
|
|
|
public function __construct( |
|
23
|
|
|
\Magento\Backend\Block\Context $context, |
|
|
|
|
|
|
24
|
|
|
\Magento\Backend\Model\Auth\Session $authSession, |
|
|
|
|
|
|
25
|
|
|
\Magento\Framework\View\Helper\Js $jsHelper, |
|
|
|
|
|
|
26
|
|
|
array $data = [] |
|
27
|
|
|
) { |
|
28
|
|
|
parent::__construct($context, $authSession, $jsHelper, $data); |
|
29
|
|
|
} |
|
30
|
|
|
|
|
31
|
|
|
/** |
|
32
|
|
|
* Return header comment part of html for fieldset |
|
33
|
|
|
* |
|
34
|
|
|
* @param \Magento\Framework\Data\Form\Element\AbstractElement $element |
|
|
|
|
|
|
35
|
|
|
* @return string |
|
36
|
|
|
*/ |
|
37
|
|
|
protected function _getHeaderCommentHtml($element) |
|
38
|
|
|
{ |
|
39
|
|
|
$groupConfig = $element->getGroup(); |
|
40
|
|
|
|
|
41
|
|
|
if (empty($groupConfig['help_url']) || !$element->getComment()) { |
|
42
|
|
|
return parent::_getHeaderCommentHtml($element); |
|
43
|
|
|
} |
|
44
|
|
|
|
|
45
|
|
|
$html = '<div class="comment">' . |
|
46
|
|
|
$element->getComment() . |
|
47
|
|
|
' <a target="_blank" href="' . |
|
48
|
|
|
$groupConfig['help_url'] . |
|
49
|
|
|
'">' . |
|
50
|
|
|
__( |
|
|
|
|
|
|
51
|
|
|
'Help' |
|
52
|
|
|
) . '</a></div>'; |
|
53
|
|
|
|
|
54
|
|
|
return $html; |
|
55
|
|
|
} |
|
56
|
|
|
|
|
57
|
|
|
/** |
|
58
|
|
|
* Return collapse state |
|
59
|
|
|
* |
|
60
|
|
|
* @param \Magento\Framework\Data\Form\Element\AbstractElement $element |
|
61
|
|
|
* @return bool |
|
62
|
|
|
*/ |
|
63
|
|
|
protected function _isCollapseState($element) |
|
64
|
|
|
{ |
|
65
|
|
|
$extra = $this->_authSession->getUser()->getExtra(); |
|
66
|
|
|
if (isset($extra['configState'][$element->getId()])) { |
|
67
|
|
|
return $extra['configState'][$element->getId()]; |
|
68
|
|
|
} |
|
69
|
|
|
|
|
70
|
|
|
$groupConfig = $element->getGroup(); |
|
71
|
|
|
if (!empty($groupConfig['expanded'])) { |
|
72
|
|
|
return true; |
|
73
|
|
|
} |
|
74
|
|
|
|
|
75
|
|
|
return false; |
|
76
|
|
|
} |
|
77
|
|
|
} |
|
78
|
|
|
|
The issue could also be caused by a filter entry in the build configuration. If the path has been excluded in your configuration, e.g.
excluded_paths: ["lib/*"], you can move it to the dependency path list as follows:For further information see https://scrutinizer-ci.com/docs/tools/php/php-scrutinizer/#list-dependency-paths