1 | <?php |
||
39 | class PageModuleSummary |
||
40 | { |
||
41 | /** |
||
42 | * @var array |
||
43 | */ |
||
44 | protected $pluginContentElement = []; |
||
45 | |||
46 | /** |
||
47 | * @var array |
||
48 | */ |
||
49 | protected $flexformData = []; |
||
50 | |||
51 | /** |
||
52 | * @var array |
||
53 | */ |
||
54 | protected $settings = []; |
||
55 | |||
56 | /** |
||
57 | * Returns information about a plugin's flexform configuration |
||
58 | * |
||
59 | * @param array $parameters Parameters to the hook |
||
60 | * @return string Plugin configuration information |
||
61 | */ |
||
62 | 1 | public function getSummary(array $parameters) |
|
63 | { |
||
64 | 1 | $this->initialize($parameters['row']); |
|
65 | |||
66 | 1 | $this->addTargetPage(); |
|
67 | 1 | $this->addSettingFromFlexForm('Filter', 'search.query.filter'); |
|
68 | 1 | $this->addSettingFromFlexForm('Sorting', 'search.query.sortBy'); |
|
69 | 1 | $this->addSettingFromFlexForm('Results per Page', 'search.results.resultsPerPage'); |
|
70 | 1 | $this->addSettingFromFlexForm('Boost Function', 'search.query.boostFunction'); |
|
71 | 1 | $this->addSettingFromFlexForm('Boost Query', 'search.query.boostQuery'); |
|
72 | 1 | $this->addSettingFromFlexForm('Template', 'templateFile.results'); |
|
73 | 1 | return $this->render(); |
|
74 | } |
||
75 | |||
76 | /** |
||
77 | * @param array $contentElement |
||
78 | */ |
||
79 | 1 | protected function initialize(array $contentElement) |
|
86 | |||
87 | /** |
||
88 | * Adds the target page to the settings. |
||
89 | */ |
||
90 | 1 | protected function addTargetPage() |
|
98 | |||
99 | /** |
||
100 | * @param string $settingName |
||
101 | * @param string $flexFormField |
||
102 | */ |
||
103 | 1 | protected function addSettingFromFlexForm($settingName, $flexFormField) |
|
112 | |||
113 | /** |
||
114 | * @param string $settingName |
||
115 | * @param array $values |
||
116 | * @return bool |
||
117 | */ |
||
118 | 1 | protected function addSettingFromFlexFormArray($settingName, $values) |
|
132 | |||
133 | /** |
||
134 | * @param string $settingName |
||
135 | * @param string $value |
||
136 | */ |
||
137 | 1 | protected function addSettingIfNotEmpty($settingName, $value) |
|
143 | |||
144 | /** |
||
145 | * Gets a field's value from flexform configuration, will check if |
||
146 | * flexform configuration is available. |
||
147 | * |
||
148 | * @param string $path name of the field |
||
149 | * @return string if nothing found, value if found |
||
150 | */ |
||
151 | 1 | protected function getFieldFromFlexform($path) |
|
155 | |||
156 | /** |
||
157 | * @return string |
||
158 | */ |
||
159 | 1 | protected function render() |
|
173 | } |
||
174 |