@@ -167,7 +167,7 @@ discard block |
||
| 167 | 167 | $simplePagination = new SimplePagination($solrPaginator); |
| 168 | 168 | |
| 169 | 169 | $pagination = $this->buildSimplePagination($simplePagination, $solrPaginator); |
| 170 | - $this->view->assignMultiple([ 'pagination' => $pagination, 'paginator' => $solrPaginator ]); |
|
| 170 | + $this->view->assignMultiple(['pagination' => $pagination, 'paginator' => $solrPaginator]); |
|
| 171 | 171 | } |
| 172 | 172 | |
| 173 | 173 | $this->view->assign('viewData', $this->viewData); |
@@ -219,20 +219,20 @@ discard block |
||
| 219 | 219 | foreach ($collections as $collection) { |
| 220 | 220 | $solr_query = ''; |
| 221 | 221 | if ($collection->getIndexSearch() != '') { |
| 222 | - $solr_query .= '(' . $collection->getIndexSearch() . ')'; |
|
| 222 | + $solr_query .= '('.$collection->getIndexSearch().')'; |
|
| 223 | 223 | } else { |
| 224 | - $solr_query .= 'collection:("' . Solr::escapeQuery($collection->getIndexName()) . '")'; |
|
| 224 | + $solr_query .= 'collection:("'.Solr::escapeQuery($collection->getIndexName()).'")'; |
|
| 225 | 225 | } |
| 226 | 226 | |
| 227 | 227 | // virtual collection might yield documents, that are not toplevel true or partof anything |
| 228 | 228 | if ($collection->getIndexSearch()) { |
| 229 | 229 | $params['query'] = $solr_query; |
| 230 | 230 | } else { |
| 231 | - $params['query'] = $solr_query . ' AND partof:0 AND toplevel:true'; |
|
| 231 | + $params['query'] = $solr_query.' AND partof:0 AND toplevel:true'; |
|
| 232 | 232 | } |
| 233 | 233 | $partOfNothing = $solr->searchRaw($params); |
| 234 | 234 | |
| 235 | - $params['query'] = $solr_query . ' AND NOT partof:0 AND toplevel:true'; |
|
| 235 | + $params['query'] = $solr_query.' AND NOT partof:0 AND toplevel:true'; |
|
| 236 | 236 | $partOfSomething = $solr->searchRaw($params); |
| 237 | 237 | |
| 238 | 238 | $collectionInfo = []; |
@@ -117,7 +117,7 @@ discard block |
||
| 117 | 117 | $listRequestData = GeneralUtility::_GPmerged('tx_dlf_listview'); |
| 118 | 118 | |
| 119 | 119 | if (isset($listRequestData['searchParameter']) && is_array($listRequestData['searchParameter'])) { |
| 120 | - $this->searchParams = array_merge($this->searchParams ?: [], $listRequestData['searchParameter']); |
|
| 120 | + $this->searchParams = array_merge($this->searchParams ? : [], $listRequestData['searchParameter']); |
|
| 121 | 121 | $listViewSearch = true; |
| 122 | 122 | $GLOBALS['TSFE']->fe_user->setKey('ses', 'search', $this->searchParams); |
| 123 | 123 | } |
@@ -178,7 +178,7 @@ discard block |
||
| 178 | 178 | $simplePagination = new SimplePagination($solrPaginator); |
| 179 | 179 | |
| 180 | 180 | $pagination = $this->buildSimplePagination($simplePagination, $solrPaginator); |
| 181 | - $this->view->assignMultiple([ 'pagination' => $pagination, 'paginator' => $solrPaginator ]); |
|
| 181 | + $this->view->assignMultiple(['pagination' => $pagination, 'paginator' => $solrPaginator]); |
|
| 182 | 182 | } |
| 183 | 183 | |
| 184 | 184 | $this->view->assign('documents', !empty($solrResults) ? $solrResults : []); |
@@ -203,7 +203,7 @@ discard block |
||
| 203 | 203 | |
| 204 | 204 | // Add uHash parameter to suggest parameter to make a basic protection of this form. |
| 205 | 205 | if ($this->settings['suggest']) { |
| 206 | - $this->view->assign('uHash', GeneralUtility::hmac((string) (new Typo3Version()) . Environment::getExtensionsPath(), 'SearchSuggest')); |
|
| 206 | + $this->view->assign('uHash', GeneralUtility::hmac((string) (new Typo3Version()).Environment::getExtensionsPath(), 'SearchSuggest')); |
|
| 207 | 207 | } |
| 208 | 208 | |
| 209 | 209 | $this->view->assign('viewData', $this->viewData); |
@@ -224,7 +224,7 @@ discard block |
||
| 224 | 224 | // Get facets from plugin configuration. |
| 225 | 225 | $facets = []; |
| 226 | 226 | foreach (GeneralUtility::trimExplode(',', $this->settings['facets'], true) as $facet) { |
| 227 | - $facets[$facet . '_faceting'] = Helper::translate($facet, 'tx_dlf_metadata', $this->settings['storagePid']); |
|
| 227 | + $facets[$facet.'_faceting'] = Helper::translate($facet, 'tx_dlf_metadata', $this->settings['storagePid']); |
|
| 228 | 228 | } |
| 229 | 229 | |
| 230 | 230 | $this->view->assign('facetsMenu', $this->makeFacetsMenuArray($facets)); |
@@ -260,13 +260,13 @@ discard block |
||
| 260 | 260 | $searchParams = $this->searchParams; |
| 261 | 261 | if ( |
| 262 | 262 | (!empty($searchParams['fulltext'])) |
| 263 | - || preg_match('/' . $fields['fulltext'] . ':\((.*)\)/', trim($searchParams['query']), $matches) |
|
| 263 | + || preg_match('/'.$fields['fulltext'].':\((.*)\)/', trim($searchParams['query']), $matches) |
|
| 264 | 264 | ) { |
| 265 | 265 | // If the query already is a fulltext query e.g using the facets |
| 266 | 266 | $searchParams['query'] = empty($matches[1]) ? $searchParams['query'] : $matches[1]; |
| 267 | 267 | // Search in fulltext field if applicable. Query must not be empty! |
| 268 | 268 | if (!empty($searchParams['query'])) { |
| 269 | - $search['query'] = $fields['fulltext'] . ':(' . Solr::escapeQuery(trim($searchParams['query'])) . ')'; |
|
| 269 | + $search['query'] = $fields['fulltext'].':('.Solr::escapeQuery(trim($searchParams['query'])).')'; |
|
| 270 | 270 | } |
| 271 | 271 | } else { |
| 272 | 272 | // Retain given search field if valid. |
@@ -283,7 +283,7 @@ discard block |
||
| 283 | 283 | // add filter query for date search |
| 284 | 284 | if (!empty($this->searchParams['dateFrom']) && !empty($this->searchParams['dateTo'])) { |
| 285 | 285 | // combine dateFrom and dateTo into filterquery as range search |
| 286 | - $search['params']['filterquery'][]['query'] = '{!join from=' . $fields['uid'] . ' to=' . $fields['uid'] . '}' . $fields['date'] . ':[' . $this->searchParams['dateFrom'] . ' TO ' . $this->searchParams['dateTo'] . ']'; |
|
| 286 | + $search['params']['filterquery'][]['query'] = '{!join from='.$fields['uid'].' to='.$fields['uid'].'}'.$fields['date'].':['.$this->searchParams['dateFrom'].' TO '.$this->searchParams['dateTo'].']'; |
|
| 287 | 287 | } |
| 288 | 288 | |
| 289 | 289 | // Add extended search query. |
@@ -301,9 +301,9 @@ discard block |
||
| 301 | 301 | in_array($searchParams['extOperator'][$i], $allowedOperators) |
| 302 | 302 | ) { |
| 303 | 303 | if (!empty($search['query'])) { |
| 304 | - $search['query'] .= ' ' . $searchParams['extOperator'][$i] . ' '; |
|
| 304 | + $search['query'] .= ' '.$searchParams['extOperator'][$i].' '; |
|
| 305 | 305 | } |
| 306 | - $search['query'] .= Indexer::getIndexFieldName($searchParams['extField'][$i], $this->settings['storagePid']) . ':(' . Solr::escapeQuery($searchParams['extQuery'][$i]) . ')'; |
|
| 306 | + $search['query'] .= Indexer::getIndexFieldName($searchParams['extField'][$i], $this->settings['storagePid']).':('.Solr::escapeQuery($searchParams['extQuery'][$i]).')'; |
|
| 307 | 307 | } |
| 308 | 308 | } |
| 309 | 309 | } |
@@ -392,24 +392,24 @@ discard block |
||
| 392 | 392 | foreach ($collections as $collectionEntry) { |
| 393 | 393 | // check for virtual collections query string |
| 394 | 394 | if ($collectionEntry->getIndexSearch()) { |
| 395 | - $virtualCollectionsQueryString .= empty($virtualCollectionsQueryString) ? '(' . $collectionEntry->getIndexSearch() . ')' : ' OR (' . $collectionEntry->getIndexSearch() . ')'; |
|
| 395 | + $virtualCollectionsQueryString .= empty($virtualCollectionsQueryString) ? '('.$collectionEntry->getIndexSearch().')' : ' OR ('.$collectionEntry->getIndexSearch().')'; |
|
| 396 | 396 | } else { |
| 397 | - $collectionsQueryString .= empty($collectionsQueryString) ? '"' . $collectionEntry->getIndexName() . '"' : ' OR "' . $collectionEntry->getIndexName() . '"'; |
|
| 397 | + $collectionsQueryString .= empty($collectionsQueryString) ? '"'.$collectionEntry->getIndexName().'"' : ' OR "'.$collectionEntry->getIndexName().'"'; |
|
| 398 | 398 | } |
| 399 | 399 | } |
| 400 | 400 | |
| 401 | 401 | // distinguish between simple collection browsing and actual searching within the collection(s) |
| 402 | 402 | if (!empty($collectionsQueryString)) { |
| 403 | 403 | if (empty($query)) { |
| 404 | - $collectionsQueryString = '(collection_faceting:(' . $collectionsQueryString . ') AND toplevel:true AND partof:0)'; |
|
| 404 | + $collectionsQueryString = '(collection_faceting:('.$collectionsQueryString.') AND toplevel:true AND partof:0)'; |
|
| 405 | 405 | } else { |
| 406 | - $collectionsQueryString = '(collection_faceting:(' . $collectionsQueryString . '))'; |
|
| 406 | + $collectionsQueryString = '(collection_faceting:('.$collectionsQueryString.'))'; |
|
| 407 | 407 | } |
| 408 | 408 | } |
| 409 | 409 | |
| 410 | 410 | // virtual collections might query documents that are neither toplevel:true nor partof:0 and need to be searched separately |
| 411 | 411 | if (!empty($virtualCollectionsQueryString)) { |
| 412 | - $virtualCollectionsQueryString = '(' . $virtualCollectionsQueryString . ')'; |
|
| 412 | + $virtualCollectionsQueryString = '('.$virtualCollectionsQueryString.')'; |
|
| 413 | 413 | } |
| 414 | 414 | |
| 415 | 415 | // combine both querystrings into a single filterquery via OR if both are given, otherwise pass either of those |
@@ -439,7 +439,7 @@ discard block |
||
| 439 | 439 | $entryArray['doNotLinkIt'] = 0; |
| 440 | 440 | // Check if facet is already selected. |
| 441 | 441 | $queryColumn = array_column($search['params']['filterquery'], 'query'); |
| 442 | - $index = array_search($field . ':("' . Solr::escapeQuery($value) . '")', $queryColumn); |
|
| 442 | + $index = array_search($field.':("'.Solr::escapeQuery($value).'")', $queryColumn); |
|
| 443 | 443 | if ($index !== false) { |
| 444 | 444 | // Facet is selected, thus remove it from filter. |
| 445 | 445 | unset($queryColumn[$index]); |
@@ -453,7 +453,7 @@ discard block |
||
| 453 | 453 | } |
| 454 | 454 | } else { |
| 455 | 455 | // Facet is not selected, thus add it to filter. |
| 456 | - $queryColumn[] = $field . ':("' . Solr::escapeQuery($value) . '")'; |
|
| 456 | + $queryColumn[] = $field.':("'.Solr::escapeQuery($value).'")'; |
|
| 457 | 457 | $entryArray['ITEM_STATE'] = 'NO'; |
| 458 | 458 | } |
| 459 | 459 | $entryArray['queryColumn'] = $queryColumn; |
@@ -53,7 +53,7 @@ |
||
| 53 | 53 | $metadata['video_duration'] = [$videoDuration]; |
| 54 | 54 | } |
| 55 | 55 | |
| 56 | - $metadata['duration'] = $metadata['video_duration'] ?: $metadata['audio_duration'] ?: []; |
|
| 56 | + $metadata['duration'] = $metadata['video_duration'] ? : $metadata['audio_duration'] ? : []; |
|
| 57 | 57 | |
| 58 | 58 | if ($useExternalApis) { |
| 59 | 59 | // TODO? |
@@ -123,7 +123,7 @@ discard block |
||
| 123 | 123 | } |
| 124 | 124 | return ' '; |
| 125 | 125 | } |
| 126 | - return htmlspecialchars((string) $attributes['CONTENT']) . ' '; |
|
| 126 | + return htmlspecialchars((string) $attributes['CONTENT']).' '; |
|
| 127 | 127 | } |
| 128 | 128 | |
| 129 | 129 | /** |
@@ -137,7 +137,7 @@ discard block |
||
| 137 | 137 | */ |
| 138 | 138 | private function getCoordinates(\SimpleXMLElement $attributes): string |
| 139 | 139 | { |
| 140 | - return (string) $attributes['HPOS'] . ' ' . (string) $attributes['VPOS'] . ' ' . (string) $attributes['WIDTH'] . ' ' . (string) $attributes['HEIGHT']; |
|
| 140 | + return (string) $attributes['HPOS'].' '.(string) $attributes['VPOS'].' '.(string) $attributes['WIDTH'].' '.(string) $attributes['HEIGHT']; |
|
| 141 | 141 | } |
| 142 | 142 | |
| 143 | 143 | /** |
@@ -119,7 +119,7 @@ discard block |
||
| 119 | 119 | if (!empty($name)) { |
| 120 | 120 | $this->metadata['author'][$i] = [ |
| 121 | 121 | 'name' => $name, |
| 122 | - 'url' => 'https://orcid.org/' . $orcidId |
|
| 122 | + 'url' => 'https://orcid.org/'.$orcidId |
|
| 123 | 123 | ]; |
| 124 | 124 | } else { |
| 125 | 125 | //fallback into display form |
@@ -177,7 +177,7 @@ discard block |
||
| 177 | 177 | } |
| 178 | 178 | // Append "valueURI" to name using Unicode unit separator. |
| 179 | 179 | if (isset($authors[$i]['valueURI'])) { |
| 180 | - $this->metadata['author'][$i] .= pack('C', 31) . (string) $authors[$i]['valueURI']; |
|
| 180 | + $this->metadata['author'][$i] .= pack('C', 31).(string) $authors[$i]['valueURI']; |
|
| 181 | 181 | } |
| 182 | 182 | } |
| 183 | 183 | |
@@ -242,7 +242,7 @@ discard block |
||
| 242 | 242 | if (!empty($name)) { |
| 243 | 243 | $this->metadata['holder'][$i] = [ |
| 244 | 244 | 'name' => $name, |
| 245 | - 'url' => 'http://viaf.org/viaf/' . $viafId |
|
| 245 | + 'url' => 'http://viaf.org/viaf/'.$viafId |
|
| 246 | 246 | ]; |
| 247 | 247 | } else { |
| 248 | 248 | //fallback into display form |
@@ -265,7 +265,7 @@ discard block |
||
| 265 | 265 | $this->getHolderFromXmlDisplayForm($holders, $i); |
| 266 | 266 | // Append "valueURI" to name using Unicode unit separator. |
| 267 | 267 | if (isset($holders[$i]['valueURI'])) { |
| 268 | - $this->metadata['holder'][$i] .= pack('C', 31) . (string) $holders[$i]['valueURI']; |
|
| 268 | + $this->metadata['holder'][$i] .= pack('C', 31).(string) $holders[$i]['valueURI']; |
|
| 269 | 269 | } |
| 270 | 270 | } |
| 271 | 271 | |
@@ -65,7 +65,7 @@ discard block |
||
| 65 | 65 | public function __construct(string $viaf, RequestFactory $requestFactory) |
| 66 | 66 | { |
| 67 | 67 | $this->logger = GeneralUtility::makeInstance(LogManager::class)->getLogger(static::class); |
| 68 | - $this->viafUrl = 'http://viaf.org/viaf/' . $viaf; |
|
| 68 | + $this->viafUrl = 'http://viaf.org/viaf/'.$viaf; |
|
| 69 | 69 | $this->requestFactory = $requestFactory; |
| 70 | 70 | } |
| 71 | 71 | |
@@ -95,7 +95,7 @@ discard block |
||
| 95 | 95 | try { |
| 96 | 96 | $response = $this->requestFactory->request($url); |
| 97 | 97 | } catch (\Exception $e) { |
| 98 | - $this->logger->warning('Could not fetch data from URL "' . $url . '". Error: ' . $e->getMessage() . '.'); |
|
| 98 | + $this->logger->warning('Could not fetch data from URL "'.$url.'". Error: '.$e->getMessage().'.'); |
|
| 99 | 99 | return false; |
| 100 | 100 | } |
| 101 | 101 | return $response->getBody()->getContents(); |
@@ -110,6 +110,6 @@ discard block |
||
| 110 | 110 | **/ |
| 111 | 111 | private function getApiEndpoint(): string |
| 112 | 112 | { |
| 113 | - return $this->viafUrl . '/' . $this->endpoint; |
|
| 113 | + return $this->viafUrl.'/'.$this->endpoint; |
|
| 114 | 114 | } |
| 115 | 115 | } |
@@ -111,7 +111,7 @@ discard block |
||
| 111 | 111 | try { |
| 112 | 112 | $response = $this->requestFactory->request($url); |
| 113 | 113 | } catch (\Exception $e) { |
| 114 | - $this->logger->warning('Could not fetch data from URL "' . $url . '". Error: ' . $e->getMessage() . '.'); |
|
| 114 | + $this->logger->warning('Could not fetch data from URL "'.$url.'". Error: '.$e->getMessage().'.'); |
|
| 115 | 115 | return false; |
| 116 | 116 | } |
| 117 | 117 | return $response->getBody()->getContents(); |
@@ -126,10 +126,10 @@ discard block |
||
| 126 | 126 | **/ |
| 127 | 127 | private function getApiEndpoint(): string |
| 128 | 128 | { |
| 129 | - $url = 'https://' . $this->level . '.' . self::HOSTNAME; |
|
| 130 | - $url .= '/v' . self::VERSION . '/'; |
|
| 129 | + $url = 'https://'.$this->level.'.'.self::HOSTNAME; |
|
| 130 | + $url .= '/v'.self::VERSION.'/'; |
|
| 131 | 131 | $url .= $this->orcid; |
| 132 | - $url .= '/' . $this->endpoint; |
|
| 132 | + $url .= '/'.$this->endpoint; |
|
| 133 | 133 | return $url; |
| 134 | 134 | } |
| 135 | 135 | } |
@@ -653,16 +653,16 @@ discard block |
||
| 653 | 653 | if ($resArray['format'] > 0 && !empty($resArray['xpath_sorting'])) { |
| 654 | 654 | $values = $iiifResource->jsonPath($resArray['xpath_sorting']); |
| 655 | 655 | if (is_string($values)) { |
| 656 | - $metadata[$resArray['index_name'] . '_sorting'][0] = [trim((string) $values)]; |
|
| 656 | + $metadata[$resArray['index_name'].'_sorting'][0] = [trim((string) $values)]; |
|
| 657 | 657 | } elseif ($values instanceof JSONPath && is_array($values->data()) && count($values->data()) > 1) { |
| 658 | 658 | $metadata[$resArray['index_name']] = []; |
| 659 | 659 | foreach ($values->data() as $value) { |
| 660 | - $metadata[$resArray['index_name'] . '_sorting'][0] = trim((string) $value); |
|
| 660 | + $metadata[$resArray['index_name'].'_sorting'][0] = trim((string) $value); |
|
| 661 | 661 | } |
| 662 | 662 | } |
| 663 | 663 | } |
| 664 | - if (empty($metadata[$resArray['index_name'] . '_sorting'][0])) { |
|
| 665 | - $metadata[$resArray['index_name'] . '_sorting'][0] = $metadata[$resArray['index_name']][0]; |
|
| 664 | + if (empty($metadata[$resArray['index_name'].'_sorting'][0])) { |
|
| 665 | + $metadata[$resArray['index_name'].'_sorting'][0] = $metadata[$resArray['index_name']][0]; |
|
| 666 | 666 | } |
| 667 | 667 | } |
| 668 | 668 | } |
@@ -772,7 +772,7 @@ discard block |
||
| 772 | 772 | } |
| 773 | 773 | } |
| 774 | 774 | } else { |
| 775 | - $this->logger->warning('Invalid structure resource @id "' . $id . '"'); |
|
| 775 | + $this->logger->warning('Invalid structure resource @id "'.$id.'"'); |
|
| 776 | 776 | return $rawText; |
| 777 | 777 | } |
| 778 | 778 | $this->rawTextArray[$id] = $rawText; |
@@ -817,7 +817,7 @@ discard block |
||
| 817 | 817 | return true; |
| 818 | 818 | } |
| 819 | 819 | } |
| 820 | - $this->logger->error('Could not load IIIF manifest from "' . $location . '"'); |
|
| 820 | + $this->logger->error('Could not load IIIF manifest from "'.$location.'"'); |
|
| 821 | 821 | return false; |
| 822 | 822 | } |
| 823 | 823 | |
@@ -87,7 +87,7 @@ |
||
| 87 | 87 | $this->xEndPosition = $highlight['lrx']; |
| 88 | 88 | $this->yBeginPosition = $highlight['uly']; |
| 89 | 89 | $this->yEndPosition = $highlight['lry']; |
| 90 | - $this->id = $this->xBeginPosition . '_' . $this->yBeginPosition; |
|
| 90 | + $this->id = $this->xBeginPosition.'_'.$this->yBeginPosition; |
|
| 91 | 91 | } |
| 92 | 92 | |
| 93 | 93 | /** |