|
1
|
|
|
<?php |
|
2
|
|
|
/** |
|
3
|
|
|
* MagePrince |
|
4
|
|
|
* |
|
5
|
|
|
* NOTICE OF LICENSE |
|
6
|
|
|
* |
|
7
|
|
|
* This source file is subject to the mageprince.com license that is |
|
8
|
|
|
* available through the world-wide-web at this URL: |
|
9
|
|
|
* https://mageprince.com/end-user-license-agreement |
|
10
|
|
|
* |
|
11
|
|
|
* DISCLAIMER |
|
12
|
|
|
* |
|
13
|
|
|
* Do not edit or add to this file if you wish to upgrade this extension to newer |
|
14
|
|
|
* version in the future. |
|
15
|
|
|
* |
|
16
|
|
|
* @category MagePrince |
|
17
|
|
|
* @package Mageprince_Faq |
|
18
|
|
|
* @copyright Copyright (c) MagePrince (https://mageprince.com/) |
|
19
|
|
|
* @license https://mageprince.com/end-user-license-agreement |
|
20
|
|
|
*/ |
|
21
|
|
|
|
|
22
|
|
|
namespace Mageprince\Faq\Ui\Component\Listing\Column; |
|
23
|
|
|
|
|
24
|
|
|
use Magento\Framework\UrlInterface; |
|
|
|
|
|
|
25
|
|
|
use Magento\Framework\View\Element\UiComponent\ContextInterface; |
|
|
|
|
|
|
26
|
|
|
use Magento\Framework\View\Element\UiComponentFactory; |
|
|
|
|
|
|
27
|
|
|
use Magento\Ui\Component\Listing\Columns\Column; |
|
|
|
|
|
|
28
|
|
|
|
|
29
|
|
|
class FaqActions extends Column |
|
30
|
|
|
{ |
|
31
|
|
|
/** |
|
32
|
|
|
* @var UrlInterface |
|
33
|
|
|
*/ |
|
34
|
|
|
protected $urlBuilder; |
|
35
|
|
|
|
|
36
|
|
|
/** |
|
37
|
|
|
* Faq delete url path |
|
38
|
|
|
*/ |
|
39
|
|
|
private const URL_PATH_EDIT = 'mageprince_faq/faq/edit'; |
|
40
|
|
|
|
|
41
|
|
|
/** |
|
42
|
|
|
* FaqActions constructor. |
|
43
|
|
|
* @param ContextInterface $context |
|
44
|
|
|
* @param UiComponentFactory $uiComponentFactory |
|
45
|
|
|
* @param UrlInterface $urlBuilder |
|
46
|
|
|
* @param array $components |
|
47
|
|
|
* @param array $data |
|
48
|
|
|
*/ |
|
49
|
|
|
public function __construct( |
|
50
|
|
|
ContextInterface $context, |
|
51
|
|
|
UiComponentFactory $uiComponentFactory, |
|
52
|
|
|
UrlInterface $urlBuilder, |
|
53
|
|
|
array $components = [], |
|
54
|
|
|
array $data = [] |
|
55
|
|
|
) { |
|
56
|
|
|
$this->urlBuilder = $urlBuilder; |
|
57
|
|
|
parent::__construct($context, $uiComponentFactory, $components, $data); |
|
58
|
|
|
} |
|
59
|
|
|
|
|
60
|
|
|
/** |
|
61
|
|
|
* Prepare Data Source |
|
62
|
|
|
* |
|
63
|
|
|
* @param array $dataSource |
|
64
|
|
|
* @return array |
|
65
|
|
|
*/ |
|
66
|
|
|
public function prepareDataSource(array $dataSource) |
|
67
|
|
|
{ |
|
68
|
|
|
if (isset($dataSource['data']['items'])) { |
|
69
|
|
|
foreach ($dataSource['data']['items'] as & $item) { |
|
70
|
|
|
if (isset($item['faq_id'])) { |
|
71
|
|
|
$item[$this->getData('name')] = [ |
|
72
|
|
|
'edit' => [ |
|
73
|
|
|
'href' => $this->urlBuilder->getUrl( |
|
74
|
|
|
static::URL_PATH_EDIT, |
|
75
|
|
|
[ |
|
76
|
|
|
'faq_id' => $item['faq_id'] |
|
77
|
|
|
] |
|
78
|
|
|
), |
|
79
|
|
|
'label' => __('Edit') |
|
|
|
|
|
|
80
|
|
|
] |
|
81
|
|
|
]; |
|
82
|
|
|
} |
|
83
|
|
|
} |
|
84
|
|
|
} |
|
85
|
|
|
|
|
86
|
|
|
return $dataSource; |
|
87
|
|
|
} |
|
88
|
|
|
} |
|
89
|
|
|
|
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