@@ -112,7 +112,7 @@ discard block |
||
112 | 112 | array_unshift($metadata, $data); |
113 | 113 | } |
114 | 114 | if (empty($metadata)) { |
115 | - $this->logger->warning('No metadata found for document with UID ' . $this->document->getUid()); |
|
115 | + $this->logger->warning('No metadata found for document with UID '.$this->document->getUid()); |
|
116 | 116 | return ''; |
117 | 117 | } |
118 | 118 | ksort($metadata); |
@@ -215,7 +215,7 @@ discard block |
||
215 | 215 | if (empty(implode('', $metadataValue)) && $this->settings['getTitle'] && $this->document->getPartof()) { |
216 | 216 | $superiorTitle = Doc::getTitle($this->document->getPartof(), true); |
217 | 217 | if (!empty($superiorTitle)) { |
218 | - $metadataArray[$i][$metadataName] = ['[' . $superiorTitle . ']']; |
|
218 | + $metadataArray[$i][$metadataName] = ['['.$superiorTitle.']']; |
|
219 | 219 | } |
220 | 220 | } |
221 | 221 | if (!empty($metadataValue)) { |
@@ -52,12 +52,12 @@ |
||
52 | 52 | $(document).ready(function() { |
53 | 53 | AudioPlayer = new dlfAudioPlayer({ |
54 | 54 | audio: { |
55 | - mimeType: "' . $this->audio['mimetype'] . '", |
|
56 | - title: "' . $this->audio['label'] . '", |
|
57 | - url: "' . $this->audio['url'] . '" |
|
55 | + mimeType: "' . $this->audio['mimetype'].'", |
|
56 | + title: "' . $this->audio['label'].'", |
|
57 | + url: "' . $this->audio['url'].'" |
|
58 | 58 | }, |
59 | 59 | parentElId: "tx-dlf-audio", |
60 | - swfPath: "' . PathUtility::stripPathSitePrefix(ExtensionManagementUtility::extPath('dlf')) . 'Resources/Public/JavaScript/jPlayer/jquery.jplayer.swf" |
|
60 | + swfPath: "' . PathUtility::stripPathSitePrefix(ExtensionManagementUtility::extPath('dlf')).'Resources/Public/JavaScript/jPlayer/jquery.jplayer.swf" |
|
61 | 61 | }); |
62 | 62 | }); |
63 | 63 | '; |
@@ -16,67 +16,67 @@ |
||
16 | 16 | // Plugin "audioplayer". |
17 | 17 | $GLOBALS['TCA']['tt_content']['types']['list']['subtypes_excludelist']['dlf_audioplayer'] = 'layout,select_key,pages,recursive'; |
18 | 18 | $GLOBALS['TCA']['tt_content']['types']['list']['subtypes_addlist']['dlf_audioplayer'] = 'pi_flexform'; |
19 | -\TYPO3\CMS\Core\Utility\ExtensionManagementUtility::addPiFlexFormValue('dlf_audioplayer', 'FILE:EXT:' . 'dlf/Configuration/FlexForms/AudioPlayer.xml'); |
|
19 | +\TYPO3\CMS\Core\Utility\ExtensionManagementUtility::addPiFlexFormValue('dlf_audioplayer', 'FILE:EXT:'.'dlf/Configuration/FlexForms/AudioPlayer.xml'); |
|
20 | 20 | // Plugin "basket". |
21 | 21 | $GLOBALS['TCA']['tt_content']['types']['list']['subtypes_excludelist']['dlf_basket'] = 'layout,select_key,pages,recursive'; |
22 | 22 | $GLOBALS['TCA']['tt_content']['types']['list']['subtypes_addlist']['dlf_basket'] = 'pi_flexform'; |
23 | -\TYPO3\CMS\Core\Utility\ExtensionManagementUtility::addPiFlexFormValue('dlf_basket', 'FILE:EXT:' . 'dlf/Configuration/FlexForms/Basket.xml'); |
|
23 | +\TYPO3\CMS\Core\Utility\ExtensionManagementUtility::addPiFlexFormValue('dlf_basket', 'FILE:EXT:'.'dlf/Configuration/FlexForms/Basket.xml'); |
|
24 | 24 | // Plugin "calendar". |
25 | 25 | $GLOBALS['TCA']['tt_content']['types']['list']['subtypes_excludelist']['dlf_calendar'] = 'layout,select_key,pages,recursive'; |
26 | 26 | $GLOBALS['TCA']['tt_content']['types']['list']['subtypes_addlist']['dlf_calendar'] = 'pi_flexform'; |
27 | -\TYPO3\CMS\Core\Utility\ExtensionManagementUtility::addPiFlexFormValue('dlf_calendar', 'FILE:EXT:' . 'dlf/Configuration/FlexForms/Calendar.xml'); |
|
27 | +\TYPO3\CMS\Core\Utility\ExtensionManagementUtility::addPiFlexFormValue('dlf_calendar', 'FILE:EXT:'.'dlf/Configuration/FlexForms/Calendar.xml'); |
|
28 | 28 | // Plugin "collection". |
29 | 29 | $GLOBALS['TCA']['tt_content']['types']['list']['subtypes_excludelist']['dlf_collection'] = 'layout,select_key,pages,recursive'; |
30 | 30 | $GLOBALS['TCA']['tt_content']['types']['list']['subtypes_addlist']['dlf_collection'] = 'pi_flexform'; |
31 | -\TYPO3\CMS\Core\Utility\ExtensionManagementUtility::addPiFlexFormValue('dlf_collection', 'FILE:EXT:' . 'dlf/Configuration/FlexForms/Collection.xml'); |
|
31 | +\TYPO3\CMS\Core\Utility\ExtensionManagementUtility::addPiFlexFormValue('dlf_collection', 'FILE:EXT:'.'dlf/Configuration/FlexForms/Collection.xml'); |
|
32 | 32 | // Plugin "feeds". |
33 | 33 | $GLOBALS['TCA']['tt_content']['types']['list']['subtypes_excludelist']['dlf_feeds'] = 'layout,select_key,pages,recursive'; |
34 | 34 | $GLOBALS['TCA']['tt_content']['types']['list']['subtypes_addlist']['dlf_feeds'] = 'pi_flexform'; |
35 | -\TYPO3\CMS\Core\Utility\ExtensionManagementUtility::addPiFlexFormValue('dlf_feeds', 'FILE:EXT:' . 'dlf/Configuration/FlexForms/Feeds.xml'); |
|
35 | +\TYPO3\CMS\Core\Utility\ExtensionManagementUtility::addPiFlexFormValue('dlf_feeds', 'FILE:EXT:'.'dlf/Configuration/FlexForms/Feeds.xml'); |
|
36 | 36 | // Plugin "listview". |
37 | 37 | $GLOBALS['TCA']['tt_content']['types']['list']['subtypes_excludelist']['dlf_listview'] = 'layout,select_key,pages,recursive'; |
38 | 38 | $GLOBALS['TCA']['tt_content']['types']['list']['subtypes_addlist']['dlf_listview'] = 'pi_flexform'; |
39 | -\TYPO3\CMS\Core\Utility\ExtensionManagementUtility::addPiFlexFormValue('dlf_listview', 'FILE:EXT:' . 'dlf/Configuration/FlexForms/ListView.xml'); |
|
39 | +\TYPO3\CMS\Core\Utility\ExtensionManagementUtility::addPiFlexFormValue('dlf_listview', 'FILE:EXT:'.'dlf/Configuration/FlexForms/ListView.xml'); |
|
40 | 40 | // Plugin "metadata". |
41 | 41 | $GLOBALS['TCA']['tt_content']['types']['list']['subtypes_excludelist']['dlf_metadata'] = 'layout,select_key,pages,recursive'; |
42 | 42 | $GLOBALS['TCA']['tt_content']['types']['list']['subtypes_addlist']['dlf_metadata'] = 'pi_flexform'; |
43 | -\TYPO3\CMS\Core\Utility\ExtensionManagementUtility::addPiFlexFormValue('dlf_metadata', 'FILE:EXT:' . 'dlf/Configuration/FlexForms/Metadata.xml'); |
|
43 | +\TYPO3\CMS\Core\Utility\ExtensionManagementUtility::addPiFlexFormValue('dlf_metadata', 'FILE:EXT:'.'dlf/Configuration/FlexForms/Metadata.xml'); |
|
44 | 44 | // Plugin "navigation". |
45 | 45 | $GLOBALS['TCA']['tt_content']['types']['list']['subtypes_excludelist']['dlf_navigation'] = 'layout,select_key,pages,recursive'; |
46 | 46 | $GLOBALS['TCA']['tt_content']['types']['list']['subtypes_addlist']['dlf_navigation'] = 'pi_flexform'; |
47 | -\TYPO3\CMS\Core\Utility\ExtensionManagementUtility::addPiFlexFormValue('dlf_navigation', 'FILE:EXT:' . 'dlf/Configuration/FlexForms/Navigation.xml'); |
|
47 | +\TYPO3\CMS\Core\Utility\ExtensionManagementUtility::addPiFlexFormValue('dlf_navigation', 'FILE:EXT:'.'dlf/Configuration/FlexForms/Navigation.xml'); |
|
48 | 48 | // Plugin "oaipmh". |
49 | 49 | $GLOBALS['TCA']['tt_content']['types']['list']['subtypes_excludelist']['dlf_oaipmh'] = 'layout,select_key,pages,recursive'; |
50 | 50 | $GLOBALS['TCA']['tt_content']['types']['list']['subtypes_addlist']['dlf_oaipmh'] = 'pi_flexform'; |
51 | -\TYPO3\CMS\Core\Utility\ExtensionManagementUtility::addPiFlexFormValue('dlf_oaipmh', 'FILE:EXT:' . 'dlf/Configuration/FlexForms/OaiPmh.xml'); |
|
51 | +\TYPO3\CMS\Core\Utility\ExtensionManagementUtility::addPiFlexFormValue('dlf_oaipmh', 'FILE:EXT:'.'dlf/Configuration/FlexForms/OaiPmh.xml'); |
|
52 | 52 | // Plugin "pagegrid". |
53 | 53 | $GLOBALS['TCA']['tt_content']['types']['list']['subtypes_excludelist']['dlf_pagegrid'] = 'layout,select_key,pages,recursive'; |
54 | 54 | $GLOBALS['TCA']['tt_content']['types']['list']['subtypes_addlist']['dlf_pagegrid'] = 'pi_flexform'; |
55 | -\TYPO3\CMS\Core\Utility\ExtensionManagementUtility::addPiFlexFormValue('dlf_pagegrid', 'FILE:EXT:' . 'dlf/Configuration/FlexForms/PageGrid.xml'); |
|
55 | +\TYPO3\CMS\Core\Utility\ExtensionManagementUtility::addPiFlexFormValue('dlf_pagegrid', 'FILE:EXT:'.'dlf/Configuration/FlexForms/PageGrid.xml'); |
|
56 | 56 | // Plugin "pageview". |
57 | 57 | $GLOBALS['TCA']['tt_content']['types']['list']['subtypes_excludelist']['dlf_pageview'] = 'layout,select_key,pages,recursive'; |
58 | 58 | $GLOBALS['TCA']['tt_content']['types']['list']['subtypes_addlist']['dlf_pageview'] = 'pi_flexform'; |
59 | -\TYPO3\CMS\Core\Utility\ExtensionManagementUtility::addPiFlexFormValue('dlf_pageview', 'FILE:EXT:' . 'dlf/Configuration/FlexForms/PageView.xml'); |
|
59 | +\TYPO3\CMS\Core\Utility\ExtensionManagementUtility::addPiFlexFormValue('dlf_pageview', 'FILE:EXT:'.'dlf/Configuration/FlexForms/PageView.xml'); |
|
60 | 60 | // Plugin "search". |
61 | 61 | $GLOBALS['TCA']['tt_content']['types']['list']['subtypes_excludelist']['dlf_search'] = 'layout,select_key,pages,recursive'; |
62 | 62 | $GLOBALS['TCA']['tt_content']['types']['list']['subtypes_addlist']['dlf_search'] = 'pi_flexform'; |
63 | -\TYPO3\CMS\Core\Utility\ExtensionManagementUtility::addPiFlexFormValue('dlf_search', 'FILE:EXT:' . 'dlf/Configuration/FlexForms/Search.xml'); |
|
63 | +\TYPO3\CMS\Core\Utility\ExtensionManagementUtility::addPiFlexFormValue('dlf_search', 'FILE:EXT:'.'dlf/Configuration/FlexForms/Search.xml'); |
|
64 | 64 | // Plugin "statistics". |
65 | 65 | $GLOBALS['TCA']['tt_content']['types']['list']['subtypes_excludelist']['dlf_statistics'] = 'layout,select_key,pages,recursive'; |
66 | 66 | $GLOBALS['TCA']['tt_content']['types']['list']['subtypes_addlist']['dlf_statistics'] = 'pi_flexform'; |
67 | -\TYPO3\CMS\Core\Utility\ExtensionManagementUtility::addPiFlexFormValue('dlf_statistics', 'FILE:EXT:' . 'dlf/Configuration/FlexForms/Statistics.xml'); |
|
67 | +\TYPO3\CMS\Core\Utility\ExtensionManagementUtility::addPiFlexFormValue('dlf_statistics', 'FILE:EXT:'.'dlf/Configuration/FlexForms/Statistics.xml'); |
|
68 | 68 | // Plugin "tableofcontents". |
69 | 69 | $GLOBALS['TCA']['tt_content']['types']['list']['subtypes_excludelist']['dlf_tableofcontents'] = 'layout,select_key,pages,recursive'; |
70 | 70 | $GLOBALS['TCA']['tt_content']['types']['list']['subtypes_addlist']['dlf_tableofcontents'] = 'pi_flexform'; |
71 | -\TYPO3\CMS\Core\Utility\ExtensionManagementUtility::addPiFlexFormValue('dlf_tableofcontents', 'FILE:EXT:' . 'dlf/Configuration/FlexForms/TableOfContents.xml'); |
|
71 | +\TYPO3\CMS\Core\Utility\ExtensionManagementUtility::addPiFlexFormValue('dlf_tableofcontents', 'FILE:EXT:'.'dlf/Configuration/FlexForms/TableOfContents.xml'); |
|
72 | 72 | // Plugin "toolbox". |
73 | 73 | $GLOBALS['TCA']['tt_content']['types']['list']['subtypes_excludelist']['dlf_toolbox'] = 'layout,select_key,pages,recursive'; |
74 | 74 | $GLOBALS['TCA']['tt_content']['types']['list']['subtypes_addlist']['dlf_toolbox'] = 'pi_flexform'; |
75 | -\TYPO3\CMS\Core\Utility\ExtensionManagementUtility::addPiFlexFormValue('dlf_toolbox', 'FILE:EXT:' . 'dlf/Configuration/FlexForms/Toolbox.xml'); |
|
75 | +\TYPO3\CMS\Core\Utility\ExtensionManagementUtility::addPiFlexFormValue('dlf_toolbox', 'FILE:EXT:'.'dlf/Configuration/FlexForms/Toolbox.xml'); |
|
76 | 76 | // Plugin "view3d". |
77 | 77 | $GLOBALS['TCA']['tt_content']['types']['list']['subtypes_excludelist']['dlf_view3d'] = 'layout,select_key,pages,recursive'; |
78 | 78 | $GLOBALS['TCA']['tt_content']['types']['list']['subtypes_addlist']['dlf_view3d'] = 'pi_flexform'; |
79 | -\TYPO3\CMS\Core\Utility\ExtensionManagementUtility::addPiFlexFormValue('dlf_view3d', 'FILE:EXT:' . 'dlf/Configuration/FlexForms/View3D.xml'); |
|
79 | +\TYPO3\CMS\Core\Utility\ExtensionManagementUtility::addPiFlexFormValue('dlf_view3d', 'FILE:EXT:'.'dlf/Configuration/FlexForms/View3D.xml'); |
|
80 | 80 | |
81 | 81 | \TYPO3\CMS\Extbase\Utility\ExtensionUtility::registerPlugin( |
82 | 82 | 'Kitodo.Dlf', |
@@ -124,7 +124,7 @@ |
||
124 | 124 | } |
125 | 125 | // Append "valueURI" to name using Unicode unit separator. |
126 | 126 | if (isset($authors[$i]['valueURI'])) { |
127 | - $this->metadata['author'][$i] .= chr(31) . (string) $authors[$i]['valueURI']; |
|
127 | + $this->metadata['author'][$i] .= chr(31).(string) $authors[$i]['valueURI']; |
|
128 | 128 | } |
129 | 129 | } |
130 | 130 | } |
@@ -129,7 +129,7 @@ |
||
129 | 129 | $this->raw->registerXPathNamespace('personal-details', 'http://www.orcid.org/ns/personal-details'); |
130 | 130 | $givenNames = $this->raw->xpath('./personal-details:name/personal-details:given-names'); |
131 | 131 | $familyName = $this->raw->xpath('./personal-details:name/personal-details:family-name'); |
132 | - return (string) $givenNames[0] . ' ' . (string) $familyName[0]; |
|
132 | + return (string) $givenNames[0].' '.(string) $familyName[0]; |
|
133 | 133 | } else { |
134 | 134 | $this->logger->warning('No name found for given ORCID'); |
135 | 135 | return false; |
@@ -101,7 +101,7 @@ discard block |
||
101 | 101 | try { |
102 | 102 | $response = $this->requestFactory->request($url); |
103 | 103 | } catch (\Exception $e) { |
104 | - $this->logger->warning('Could not fetch data from URL "' . $url . '". Error: ' . $e->getMessage() . '.'); |
|
104 | + $this->logger->warning('Could not fetch data from URL "'.$url.'". Error: '.$e->getMessage().'.'); |
|
105 | 105 | return false; |
106 | 106 | } |
107 | 107 | return $response->getBody()->getContents(); |
@@ -114,11 +114,11 @@ discard block |
||
114 | 114 | **/ |
115 | 115 | private function getApiEndpoint() |
116 | 116 | { |
117 | - $url = 'https://' . $this->level . '.' . self::HOSTNAME; |
|
118 | - $url .= '/v' . self::VERSION . '/'; |
|
117 | + $url = 'https://'.$this->level.'.'.self::HOSTNAME; |
|
118 | + $url .= '/v'.self::VERSION.'/'; |
|
119 | 119 | $url .= '0000-0001-9483-5161'; |
120 | 120 | //$url .= $this->orcid; |
121 | - $url .= '/' . $this->endpoint; |
|
121 | + $url .= '/'.$this->endpoint; |
|
122 | 122 | return $url; |
123 | 123 | } |
124 | 124 | } |
@@ -107,13 +107,13 @@ discard block |
||
107 | 107 | } |
108 | 108 | |
109 | 109 | // sanitize date search input |
110 | - if(empty($this->searchParams['dateFrom']) && !empty($this->searchParams['dateTo'])) { |
|
110 | + if (empty($this->searchParams['dateFrom']) && !empty($this->searchParams['dateTo'])) { |
|
111 | 111 | $this->searchParams['dateFrom'] = '*'; |
112 | 112 | } |
113 | - if(empty($this->searchParams['dateTo']) && !empty($this->searchParams['dateFrom'])) { |
|
113 | + if (empty($this->searchParams['dateTo']) && !empty($this->searchParams['dateFrom'])) { |
|
114 | 114 | $this->searchParams['dateTo'] = 'NOW'; |
115 | 115 | } |
116 | - if($this->searchParams['dateFrom'] > $this->searchParams['dateTo']) { |
|
116 | + if ($this->searchParams['dateFrom'] > $this->searchParams['dateTo']) { |
|
117 | 117 | $tmpDate = $this->searchParams['dateFrom']; |
118 | 118 | $this->searchParams['dateFrom'] = $this->searchParams['dateTo']; |
119 | 119 | $this->searchParams['dateTo'] = $tmpDate; |
@@ -174,7 +174,7 @@ discard block |
||
174 | 174 | |
175 | 175 | // Add uHash parameter to suggest parameter to make a basic protection of this form. |
176 | 176 | if ($this->settings['suggest']) { |
177 | - $this->view->assign('uHash', GeneralUtility::hmac((string) (new Typo3Version()) . Environment::getExtensionsPath(), 'SearchSuggest')); |
|
177 | + $this->view->assign('uHash', GeneralUtility::hmac((string) (new Typo3Version()).Environment::getExtensionsPath(), 'SearchSuggest')); |
|
178 | 178 | } |
179 | 179 | |
180 | 180 | $this->view->assign('viewData', $this->viewData); |
@@ -197,7 +197,7 @@ discard block |
||
197 | 197 | // Get facets from plugin configuration. |
198 | 198 | $facets = []; |
199 | 199 | foreach (GeneralUtility::trimExplode(',', $this->settings['facets'], true) as $facet) { |
200 | - $facets[$facet . '_faceting'] = Helper::translate($facet, 'tx_dlf_metadata', $this->settings['storagePid']); |
|
200 | + $facets[$facet.'_faceting'] = Helper::translate($facet, 'tx_dlf_metadata', $this->settings['storagePid']); |
|
201 | 201 | } |
202 | 202 | |
203 | 203 | $this->view->assign('facetsMenu', $this->makeFacetsMenuArray($facets)); |
@@ -239,13 +239,13 @@ discard block |
||
239 | 239 | $searchParams = $this->searchParams; |
240 | 240 | if ( |
241 | 241 | (!empty($searchParams['fulltext'])) |
242 | - || preg_match('/' . $fields['fulltext'] . ':\((.*)\)/', trim($searchParams['query']), $matches) |
|
242 | + || preg_match('/'.$fields['fulltext'].':\((.*)\)/', trim($searchParams['query']), $matches) |
|
243 | 243 | ) { |
244 | 244 | // If the query already is a fulltext query e.g using the facets |
245 | 245 | $searchParams['query'] = empty($matches[1]) ? $searchParams['query'] : $matches[1]; |
246 | 246 | // Search in fulltext field if applicable. Query must not be empty! |
247 | 247 | if (!empty($this->searchParams['query'])) { |
248 | - $search['query'] = $fields['fulltext'] . ':(' . Solr::escapeQuery(trim($searchParams['query'])) . ')'; |
|
248 | + $search['query'] = $fields['fulltext'].':('.Solr::escapeQuery(trim($searchParams['query'])).')'; |
|
249 | 249 | } |
250 | 250 | } else { |
251 | 251 | // Retain given search field if valid. |
@@ -257,7 +257,7 @@ discard block |
||
257 | 257 | // add filter query for date search |
258 | 258 | if (!empty($this->searchParams['dateFrom']) && !empty($this->searchParams['dateTo'])) { |
259 | 259 | // combine dateFrom and dateTo into filterquery as range search |
260 | - $search['params']['filterquery'][]['query'] = '{!join from=' . $fields['uid'] . ' to=' . $fields['uid'] . '}' . $fields['date'] . ':[' . $this->searchParams['dateFrom'] . ' TO ' . $this->searchParams['dateTo'] . ']'; |
|
260 | + $search['params']['filterquery'][]['query'] = '{!join from='.$fields['uid'].' to='.$fields['uid'].'}'.$fields['date'].':['.$this->searchParams['dateFrom'].' TO '.$this->searchParams['dateTo'].']'; |
|
261 | 261 | } |
262 | 262 | |
263 | 263 | // Add extended search query. |
@@ -275,9 +275,9 @@ discard block |
||
275 | 275 | in_array($searchParams['extOperator'][$i], $allowedOperators) |
276 | 276 | ) { |
277 | 277 | if (!empty($search['query'])) { |
278 | - $search['query'] .= ' ' . $searchParams['extOperator'][$i] . ' '; |
|
278 | + $search['query'] .= ' '.$searchParams['extOperator'][$i].' '; |
|
279 | 279 | } |
280 | - $search['query'] .= Indexer::getIndexFieldName($searchParams['extField'][$i], $this->settings['storagePid']) . ':(' . Solr::escapeQuery($searchParams['extQuery'][$i]) . ')'; |
|
280 | + $search['query'] .= Indexer::getIndexFieldName($searchParams['extField'][$i], $this->settings['storagePid']).':('.Solr::escapeQuery($searchParams['extQuery'][$i]).')'; |
|
281 | 281 | } |
282 | 282 | } |
283 | 283 | } |
@@ -403,7 +403,7 @@ discard block |
||
403 | 403 | $entryArray['doNotLinkIt'] = 0; |
404 | 404 | // Check if facet is already selected. |
405 | 405 | $queryColumn = array_column($search['params']['filterquery'], 'query'); |
406 | - $index = array_search($field . ':("' . Solr::escapeQuery($value) . '")', $queryColumn); |
|
406 | + $index = array_search($field.':("'.Solr::escapeQuery($value).'")', $queryColumn); |
|
407 | 407 | if ($index !== false) { |
408 | 408 | // Facet is selected, thus remove it from filter. |
409 | 409 | unset($queryColumn[$index]); |
@@ -417,7 +417,7 @@ discard block |
||
417 | 417 | } |
418 | 418 | } else { |
419 | 419 | // Facet is not selected, thus add it to filter. |
420 | - $queryColumn[] = $field . ':("' . Solr::escapeQuery($value) . '")'; |
|
420 | + $queryColumn[] = $field.':("'.Solr::escapeQuery($value).'")'; |
|
421 | 421 | $entryArray['ITEM_STATE'] = 'NO'; |
422 | 422 | } |
423 | 423 | $entryArray['queryColumn'] = $queryColumn; |
@@ -97,7 +97,7 @@ discard block |
||
97 | 97 | // in which case metadata of toplevel entry isn't yet filled. |
98 | 98 | if (empty($document['metadata'])) { |
99 | 99 | $document['metadata'] = $this->fetchToplevelMetadataFromSolr([ |
100 | - 'query' => 'uid:' . $document['uid'], |
|
100 | + 'query' => 'uid:'.$document['uid'], |
|
101 | 101 | 'start' => 0, |
102 | 102 | 'rows' => 1, |
103 | 103 | 'sort' => ['score' => 'desc'], |
@@ -108,7 +108,7 @@ discard block |
||
108 | 108 | if (empty($document['title']) && $document['partOf'] > 0) { |
109 | 109 | $superiorTitle = Doc::getTitle($document['partOf'], true); |
110 | 110 | if (!empty($superiorTitle)) { |
111 | - $document['title'] = '[' . $superiorTitle . ']'; |
|
111 | + $document['title'] = '['.$superiorTitle.']'; |
|
112 | 112 | } |
113 | 113 | } |
114 | 114 | } |
@@ -171,13 +171,13 @@ discard block |
||
171 | 171 | // Set search query. |
172 | 172 | if ( |
173 | 173 | (!empty($this->searchParams['fulltext'])) |
174 | - || preg_match('/' . $fields['fulltext'] . ':\((.*)\)/', trim($this->searchParams['query']), $matches) |
|
174 | + || preg_match('/'.$fields['fulltext'].':\((.*)\)/', trim($this->searchParams['query']), $matches) |
|
175 | 175 | ) { |
176 | 176 | // If the query already is a fulltext query e.g using the facets |
177 | 177 | $this->searchParams['query'] = empty($matches[1]) ? $this->searchParams['query'] : $matches[1]; |
178 | 178 | // Search in fulltext field if applicable. Query must not be empty! |
179 | 179 | if (!empty($this->searchParams['query'])) { |
180 | - $query = $fields['fulltext'] . ':(' . Solr::escapeQuery(trim($this->searchParams['query'])) . ')'; |
|
180 | + $query = $fields['fulltext'].':('.Solr::escapeQuery(trim($this->searchParams['query'])).')'; |
|
181 | 181 | } |
182 | 182 | $params['fulltext'] = true; |
183 | 183 | } else { |
@@ -200,9 +200,9 @@ discard block |
||
200 | 200 | in_array($this->searchParams['extOperator'][$i], $allowedOperators) |
201 | 201 | ) { |
202 | 202 | if (!empty($query)) { |
203 | - $query .= ' ' . $this->searchParams['extOperator'][$i] . ' '; |
|
203 | + $query .= ' '.$this->searchParams['extOperator'][$i].' '; |
|
204 | 204 | } |
205 | - $query .= Indexer::getIndexFieldName($this->searchParams['extField'][$i], $this->settings['storagePid']) . ':(' . Solr::escapeQuery($this->searchParams['extQuery'][$i]) . ')'; |
|
205 | + $query .= Indexer::getIndexFieldName($this->searchParams['extField'][$i], $this->settings['storagePid']).':('.Solr::escapeQuery($this->searchParams['extQuery'][$i]).')'; |
|
206 | 206 | } |
207 | 207 | } |
208 | 208 | } |
@@ -211,7 +211,7 @@ discard block |
||
211 | 211 | // Add filter query for date search |
212 | 212 | if (!empty($this->searchParams['dateFrom']) && !empty($this->searchParams['dateTo'])) { |
213 | 213 | // combine dateFrom and dateTo into range search |
214 | - $params['filterquery'][]['query'] = '{!join from=' . $fields['uid'] . ' to=' . $fields['uid'] . '}'. $fields['date'] . ':[' . $this->searchParams['dateFrom'] . ' TO ' . $this->searchParams['dateTo'] . ']'; |
|
214 | + $params['filterquery'][]['query'] = '{!join from='.$fields['uid'].' to='.$fields['uid'].'}'.$fields['date'].':['.$this->searchParams['dateFrom'].' TO '.$this->searchParams['dateTo'].']'; |
|
215 | 215 | } |
216 | 216 | |
217 | 217 | // Add filter query for faceting. |
@@ -228,22 +228,22 @@ discard block |
||
228 | 228 | ) { |
229 | 229 | // Search in document and all subordinates (valid for up to three levels of hierarchy). |
230 | 230 | $params['filterquery'][]['query'] = '_query_:"{!join from=' |
231 | - . $fields['uid'] . ' to=' . $fields['partof'] . '}' |
|
232 | - . $fields['uid'] . ':{!join from=' . $fields['uid'] . ' to=' . $fields['partof'] . '}' |
|
233 | - . $fields['uid'] . ':' . $this->searchParams['documentId'] . '"' . ' OR {!join from=' |
|
234 | - . $fields['uid'] . ' to=' . $fields['partof'] . '}' |
|
235 | - . $fields['uid'] . ':' . $this->searchParams['documentId'] . ' OR ' |
|
236 | - . $fields['uid'] . ':' . $this->searchParams['documentId']; |
|
231 | + . $fields['uid'].' to='.$fields['partof'].'}' |
|
232 | + . $fields['uid'].':{!join from='.$fields['uid'].' to='.$fields['partof'].'}' |
|
233 | + . $fields['uid'].':'.$this->searchParams['documentId'].'"'.' OR {!join from=' |
|
234 | + . $fields['uid'].' to='.$fields['partof'].'}' |
|
235 | + . $fields['uid'].':'.$this->searchParams['documentId'].' OR ' |
|
236 | + . $fields['uid'].':'.$this->searchParams['documentId']; |
|
237 | 237 | } |
238 | 238 | |
239 | 239 | // if a collection is given, we prepare the collection query string |
240 | 240 | if ($this->collection) { |
241 | 241 | if ($this->collection instanceof Collection) { |
242 | - $collectionsQueryString = '"' . $this->collection->getIndexName() . '"'; |
|
242 | + $collectionsQueryString = '"'.$this->collection->getIndexName().'"'; |
|
243 | 243 | } else { |
244 | 244 | $collectionsQueryString = ''; |
245 | 245 | foreach ($this->collection as $index => $collectionEntry) { |
246 | - $collectionsQueryString .= ($index > 0 ? ' OR ' : '') . '"' . $collectionEntry->getIndexName() . '"'; |
|
246 | + $collectionsQueryString .= ($index > 0 ? ' OR ' : '').'"'.$collectionEntry->getIndexName().'"'; |
|
247 | 247 | } |
248 | 248 | } |
249 | 249 | |
@@ -251,7 +251,7 @@ discard block |
||
251 | 251 | $params['filterquery'][]['query'] = 'toplevel:true'; |
252 | 252 | $params['filterquery'][]['query'] = 'partof:0'; |
253 | 253 | } |
254 | - $params['filterquery'][]['query'] = 'collection_faceting:(' . $collectionsQueryString . ')'; |
|
254 | + $params['filterquery'][]['query'] = 'collection_faceting:('.$collectionsQueryString.')'; |
|
255 | 255 | } |
256 | 256 | |
257 | 257 | // Set some query parameters. |
@@ -278,8 +278,8 @@ discard block |
||
278 | 278 | if ($this->listedMetadata) { |
279 | 279 | foreach ($this->listedMetadata as $metadata) { |
280 | 280 | if ($metadata->getIndexStored() || $metadata->getIndexIndexed()) { |
281 | - $listMetadataRecord = $metadata->getIndexName() . '_' . ($metadata->getIndexTokenized() ? 't' : 'u') . ($metadata->getIndexStored() ? 's' : 'u') . ($metadata->getIndexIndexed() ? 'i' : 'u'); |
|
282 | - $params['fields'] .= ',' . $listMetadataRecord; |
|
281 | + $listMetadataRecord = $metadata->getIndexName().'_'.($metadata->getIndexTokenized() ? 't' : 'u').($metadata->getIndexStored() ? 's' : 'u').($metadata->getIndexIndexed() ? 'i' : 'u'); |
|
282 | + $params['fields'] .= ','.$listMetadataRecord; |
|
283 | 283 | $params['listMetadataRecords'][$metadata->getIndexName()] = $listMetadataRecord; |
284 | 284 | } |
285 | 285 | } |
@@ -357,7 +357,7 @@ discard block |
||
357 | 357 | $children = $childrenOf[$doc['uid']] ?? []; |
358 | 358 | if (!empty($children)) { |
359 | 359 | $metadataOf = $this->fetchToplevelMetadataFromSolr([ |
360 | - 'query' => 'partof:' . $doc['uid'], |
|
360 | + 'query' => 'partof:'.$doc['uid'], |
|
361 | 361 | 'start' => 0, |
362 | 362 | 'rows' => 100, |
363 | 363 | ]); |
@@ -404,8 +404,8 @@ discard block |
||
404 | 404 | if ($this->listedMetadata) { |
405 | 405 | foreach ($this->listedMetadata as $metadata) { |
406 | 406 | if ($metadata->getIndexStored() || $metadata->getIndexIndexed()) { |
407 | - $listMetadataRecord = $metadata->getIndexName() . '_' . ($metadata->getIndexTokenized() ? 't' : 'u') . ($metadata->getIndexStored() ? 's' : 'u') . ($metadata->getIndexIndexed() ? 'i' : 'u'); |
|
408 | - $params['fields'] .= ',' . $listMetadataRecord; |
|
407 | + $listMetadataRecord = $metadata->getIndexName().'_'.($metadata->getIndexTokenized() ? 't' : 'u').($metadata->getIndexStored() ? 's' : 'u').($metadata->getIndexIndexed() ? 'i' : 'u'); |
|
408 | + $params['fields'] .= ','.$listMetadataRecord; |
|
409 | 409 | $params['listMetadataRecords'][$metadata->getIndexName()] = $listMetadataRecord; |
410 | 410 | } |
411 | 411 | } |
@@ -455,7 +455,7 @@ discard block |
||
455 | 455 | $cache = null; |
456 | 456 | // Calculate cache identifier. |
457 | 457 | if ($enableCache === true) { |
458 | - $cacheIdentifier = Helper::digest($solr->core . print_r($parameters, true)); |
|
458 | + $cacheIdentifier = Helper::digest($solr->core.print_r($parameters, true)); |
|
459 | 459 | $cache = GeneralUtility::makeInstance(CacheManager::class)->getCache('tx_dlf_solr'); |
460 | 460 | } |
461 | 461 | $resultSet = [ |
@@ -115,7 +115,7 @@ discard block |
||
115 | 115 | $parent->setDoc($doc); |
116 | 116 | $success = self::add($parent); |
117 | 117 | } else { |
118 | - Helper::log('Could not load parent document with UID ' . $document->getDoc()->parentId, LOG_SEVERITY_ERROR); |
|
118 | + Helper::log('Could not load parent document with UID '.$document->getDoc()->parentId, LOG_SEVERITY_ERROR); |
|
119 | 119 | return false; |
120 | 120 | } |
121 | 121 | } |
@@ -125,7 +125,7 @@ discard block |
||
125 | 125 | self::$processedDocs[] = $document->getUid(); |
126 | 126 | // Delete old Solr documents. |
127 | 127 | $updateQuery = self::$solr->service->createUpdate(); |
128 | - $updateQuery->addDeleteQuery('uid:' . $document->getUid()); |
|
128 | + $updateQuery->addDeleteQuery('uid:'.$document->getUid()); |
|
129 | 129 | self::$solr->service->update($updateQuery); |
130 | 130 | |
131 | 131 | // Index every logical unit as separate Solr document. |
@@ -174,14 +174,14 @@ discard block |
||
174 | 174 | } catch (\Exception $e) { |
175 | 175 | if (!(\TYPO3_REQUESTTYPE & \TYPO3_REQUESTTYPE_CLI)) { |
176 | 176 | Helper::addMessage( |
177 | - Helper::getLanguageService()->getLL('flash.solrException') . ' ' . htmlspecialchars($e->getMessage()), |
|
177 | + Helper::getLanguageService()->getLL('flash.solrException').' '.htmlspecialchars($e->getMessage()), |
|
178 | 178 | Helper::getLanguageService()->getLL('flash.error'), |
179 | 179 | FlashMessage::ERROR, |
180 | 180 | true, |
181 | 181 | 'core.template.flashMessages' |
182 | 182 | ); |
183 | 183 | } |
184 | - Helper::log('Apache Solr threw exception: "' . $e->getMessage() . '"', LOG_SEVERITY_ERROR); |
|
184 | + Helper::log('Apache Solr threw exception: "'.$e->getMessage().'"', LOG_SEVERITY_ERROR); |
|
185 | 185 | return false; |
186 | 186 | } |
187 | 187 | } else { |
@@ -214,7 +214,7 @@ discard block |
||
214 | 214 | // Sanitize input. |
215 | 215 | $pid = max(intval($pid), 0); |
216 | 216 | if (!$pid) { |
217 | - Helper::log('Invalid PID ' . $pid . ' for metadata configuration', LOG_SEVERITY_ERROR); |
|
217 | + Helper::log('Invalid PID '.$pid.' for metadata configuration', LOG_SEVERITY_ERROR); |
|
218 | 218 | return ''; |
219 | 219 | } |
220 | 220 | // Load metadata configuration. |
@@ -223,7 +223,7 @@ discard block |
||
223 | 223 | $suffix = (in_array($index_name, self::$fields['tokenized']) ? 't' : 'u'); |
224 | 224 | $suffix .= (in_array($index_name, self::$fields['stored']) ? 's' : 'u'); |
225 | 225 | $suffix .= (in_array($index_name, self::$fields['indexed']) ? 'i' : 'u'); |
226 | - $index_name .= '_' . $suffix; |
|
226 | + $index_name .= '_'.$suffix; |
|
227 | 227 | return $index_name; |
228 | 228 | } |
229 | 229 | |
@@ -337,7 +337,7 @@ discard block |
||
337 | 337 | $solrDoc->setField('title', $metadata['title'][0], self::$fields['fieldboost']['title']); |
338 | 338 | $solrDoc->setField('volume', $metadata['volume'][0], self::$fields['fieldboost']['volume']); |
339 | 339 | // verify date formatting |
340 | - if(strtotime($metadata['date'][0])) { |
|
340 | + if (strtotime($metadata['date'][0])) { |
|
341 | 341 | // do not alter dates YYYY or YYYY-MM or YYYY-MM-DD |
342 | 342 | if ( |
343 | 343 | preg_match("/^[0-9]{4}$/", $metadata['date'][0]) |
@@ -346,7 +346,7 @@ discard block |
||
346 | 346 | ) { |
347 | 347 | $solrDoc->setField('date', $metadata['date'][0]); |
348 | 348 | // change date YYYYMMDD to YYYY-MM-DD |
349 | - } elseif (preg_match("/^[0-9]{8}$/", $metadata['date'][0])){ |
|
349 | + } elseif (preg_match("/^[0-9]{8}$/", $metadata['date'][0])) { |
|
350 | 350 | $solrDoc->setField('date', date("Y-m-d", strtotime($metadata['date'][0]))); |
351 | 351 | // convert any datetime to proper ISO extended datetime format and timezone for SOLR |
352 | 352 | } else { |
@@ -374,11 +374,11 @@ discard block |
||
374 | 374 | $solrDoc->setField(self::getIndexFieldName($index_name, $document->getPid()), $data, self::$fields['fieldboost'][$index_name]); |
375 | 375 | if (in_array($index_name, self::$fields['sortables'])) { |
376 | 376 | // Add sortable fields to index. |
377 | - $solrDoc->setField($index_name . '_sorting', $metadata[$index_name . '_sorting'][0]); |
|
377 | + $solrDoc->setField($index_name.'_sorting', $metadata[$index_name.'_sorting'][0]); |
|
378 | 378 | } |
379 | 379 | if (in_array($index_name, self::$fields['facets'])) { |
380 | 380 | // Add facets to index. |
381 | - $solrDoc->setField($index_name . '_faceting', $data); |
|
381 | + $solrDoc->setField($index_name.'_faceting', $data); |
|
382 | 382 | } |
383 | 383 | if (in_array($index_name, self::$fields['autocomplete'])) { |
384 | 384 | $autocomplete = array_merge($autocomplete, $data); |
@@ -403,14 +403,14 @@ discard block |
||
403 | 403 | } catch (\Exception $e) { |
404 | 404 | if (!(\TYPO3_REQUESTTYPE & \TYPO3_REQUESTTYPE_CLI)) { |
405 | 405 | Helper::addMessage( |
406 | - Helper::getLanguageService()->getLL('flash.solrException') . '<br />' . htmlspecialchars($e->getMessage()), |
|
406 | + Helper::getLanguageService()->getLL('flash.solrException').'<br />'.htmlspecialchars($e->getMessage()), |
|
407 | 407 | Helper::getLanguageService()->getLL('flash.error'), |
408 | 408 | FlashMessage::ERROR, |
409 | 409 | true, |
410 | 410 | 'core.template.flashMessages' |
411 | 411 | ); |
412 | 412 | } |
413 | - Helper::log('Apache Solr threw exception: "' . $e->getMessage() . '"', LOG_SEVERITY_ERROR); |
|
413 | + Helper::log('Apache Solr threw exception: "'.$e->getMessage().'"', LOG_SEVERITY_ERROR); |
|
414 | 414 | return false; |
415 | 415 | } |
416 | 416 | } |
@@ -476,7 +476,7 @@ discard block |
||
476 | 476 | $data = self::removeAppendsFromAuthor($data); |
477 | 477 | } |
478 | 478 | // Add facets to index. |
479 | - $solrDoc->setField($index_name . '_faceting', $data); |
|
479 | + $solrDoc->setField($index_name.'_faceting', $data); |
|
480 | 480 | } |
481 | 481 | } |
482 | 482 | } |
@@ -494,14 +494,14 @@ discard block |
||
494 | 494 | } catch (\Exception $e) { |
495 | 495 | if (!(\TYPO3_REQUESTTYPE & \TYPO3_REQUESTTYPE_CLI)) { |
496 | 496 | Helper::addMessage( |
497 | - Helper::getLanguageService()->getLL('flash.solrException') . '<br />' . htmlspecialchars($e->getMessage()), |
|
497 | + Helper::getLanguageService()->getLL('flash.solrException').'<br />'.htmlspecialchars($e->getMessage()), |
|
498 | 498 | Helper::getLanguageService()->getLL('flash.error'), |
499 | 499 | FlashMessage::ERROR, |
500 | 500 | true, |
501 | 501 | 'core.template.flashMessages' |
502 | 502 | ); |
503 | 503 | } |
504 | - Helper::log('Apache Solr threw exception: "' . $e->getMessage() . '"', LOG_SEVERITY_ERROR); |
|
504 | + Helper::log('Apache Solr threw exception: "'.$e->getMessage().'"', LOG_SEVERITY_ERROR); |
|
505 | 505 | return false; |
506 | 506 | } |
507 | 507 | } |
@@ -552,7 +552,7 @@ discard block |
||
552 | 552 | private static function getSolrDocument($updateQuery, $document, $unit, $fullText = '') { |
553 | 553 | $solrDoc = $updateQuery->createDocument(); |
554 | 554 | // Create unique identifier from document's UID and unit's XML ID. |
555 | - $solrDoc->setField('id', $document->getUid() . $unit['id']); |
|
555 | + $solrDoc->setField('id', $document->getUid().$unit['id']); |
|
556 | 556 | $solrDoc->setField('uid', $document->getUid()); |
557 | 557 | $solrDoc->setField('pid', $document->getPid()); |
558 | 558 | $solrDoc->setField('partof', $document->getPartof()); |