@@ -42,8 +42,7 @@ |
||
42 | 42 | * |
43 | 43 | * @access public |
44 | 44 | */ |
45 | -class NewTenantController extends AbstractController |
|
46 | -{ |
|
45 | +class NewTenantController extends AbstractController { |
|
47 | 46 | /** |
48 | 47 | * @access protected |
49 | 48 | * @var int |
@@ -179,7 +179,7 @@ discard block |
||
179 | 179 | public function addFormatAction(): void |
180 | 180 | { |
181 | 181 | // Include formats definition file. |
182 | - $formatsDefaults = include(ExtensionManagementUtility::extPath('dlf') . 'Resources/Private/Data/FormatDefaults.php'); |
|
182 | + $formatsDefaults = include(ExtensionManagementUtility::extPath('dlf').'Resources/Private/Data/FormatDefaults.php'); |
|
183 | 183 | |
184 | 184 | $frameworkConfiguration = $this->configurationManager->getConfiguration($this->configurationManager::CONFIGURATION_TYPE_FRAMEWORK); |
185 | 185 | // tx_dlf_formats are stored on PID = 0 |
@@ -221,7 +221,7 @@ discard block |
||
221 | 221 | public function addMetadataAction(): void |
222 | 222 | { |
223 | 223 | // Include metadata definition file. |
224 | - $metadataDefaults = include(ExtensionManagementUtility::extPath('dlf') . 'Resources/Private/Data/MetadataDefaults.php'); |
|
224 | + $metadataDefaults = include(ExtensionManagementUtility::extPath('dlf').'Resources/Private/Data/MetadataDefaults.php'); |
|
225 | 225 | |
226 | 226 | // load language file in own array |
227 | 227 | $metadataLabels = $this->languageFactory->getParsedData('EXT:dlf/Resources/Private/Language/locallang_metadata.xlf', $this->siteLanguages[0]->getTypo3Language()); |
@@ -249,7 +249,7 @@ discard block |
||
249 | 249 | |
250 | 250 | $data['tx_dlf_metadata'][uniqid('NEW')] = [ |
251 | 251 | 'pid' => $this->pid, |
252 | - 'label' => $this->getLLL('metadata.' . $indexName, $this->siteLanguages[0]->getTypo3Language(), $metadataLabels), |
|
252 | + 'label' => $this->getLLL('metadata.'.$indexName, $this->siteLanguages[0]->getTypo3Language(), $metadataLabels), |
|
253 | 253 | 'index_name' => $indexName, |
254 | 254 | 'format' => implode(',', $formatIds), |
255 | 255 | 'default_value' => $values['default_value'], |
@@ -288,7 +288,7 @@ discard block |
||
288 | 288 | 'pid' => $this->pid, |
289 | 289 | 'sys_language_uid' => $siteLanguage->getLanguageId(), |
290 | 290 | 'l18n_parent' => $id, |
291 | - 'label' => $this->getLLL('metadata.' . $indexName, $siteLanguage->getTypo3Language(), $metadataLabels), |
|
291 | + 'label' => $this->getLLL('metadata.'.$indexName, $siteLanguage->getTypo3Language(), $metadataLabels), |
|
292 | 292 | ]; |
293 | 293 | } |
294 | 294 | |
@@ -314,7 +314,7 @@ discard block |
||
314 | 314 | |
315 | 315 | if ($this->solrCoreRepository->findOneByPid($this->pid) === null) { |
316 | 316 | $newRecord = GeneralUtility::makeInstance(SolrCore::class); |
317 | - $newRecord->setLabel($this->getLLL('flexform.solrcore', $this->siteLanguages[0]->getTypo3Language(), $beLabels). ' (PID ' . $this->pid . ')'); |
|
317 | + $newRecord->setLabel($this->getLLL('flexform.solrcore', $this->siteLanguages[0]->getTypo3Language(), $beLabels).' (PID '.$this->pid.')'); |
|
318 | 318 | $indexName = Solr::createCore(''); |
319 | 319 | if (!empty($indexName)) { |
320 | 320 | $newRecord->setIndexName($indexName); |
@@ -344,7 +344,7 @@ discard block |
||
344 | 344 | public function addStructureAction(): void |
345 | 345 | { |
346 | 346 | // Include structure definition file. |
347 | - $structureDefaults = include(ExtensionManagementUtility::extPath('dlf') . 'Resources/Private/Data/StructureDefaults.php'); |
|
347 | + $structureDefaults = include(ExtensionManagementUtility::extPath('dlf').'Resources/Private/Data/StructureDefaults.php'); |
|
348 | 348 | |
349 | 349 | // load language file in own array |
350 | 350 | $structureLabels = $this->languageFactory->getParsedData('EXT:dlf/Resources/Private/Language/locallang_structure.xlf', $this->siteLanguages[0]->getTypo3Language()); |
@@ -354,7 +354,7 @@ discard block |
||
354 | 354 | $data['tx_dlf_structures'][uniqid('NEW')] = [ |
355 | 355 | 'pid' => $this->pid, |
356 | 356 | 'toplevel' => $values['toplevel'], |
357 | - 'label' => $this->getLLL('structure.' . $indexName, $this->siteLanguages[0]->getTypo3Language(), $structureLabels), |
|
357 | + 'label' => $this->getLLL('structure.'.$indexName, $this->siteLanguages[0]->getTypo3Language(), $structureLabels), |
|
358 | 358 | 'index_name' => $indexName, |
359 | 359 | 'oai_name' => $values['oai_name'], |
360 | 360 | 'thumbnail' => 0, |
@@ -379,7 +379,7 @@ discard block |
||
379 | 379 | 'pid' => $this->pid, |
380 | 380 | 'sys_language_uid' => $siteLanguage->getLanguageId(), |
381 | 381 | 'l18n_parent' => $id, |
382 | - 'label' => $this->getLLL('structure.' . $indexName, $siteLanguage->getTypo3Language(), $structureLabels), |
|
382 | + 'label' => $this->getLLL('structure.'.$indexName, $siteLanguage->getTypo3Language(), $structureLabels), |
|
383 | 383 | ]; |
384 | 384 | } |
385 | 385 | |
@@ -426,15 +426,15 @@ discard block |
||
426 | 426 | $this->forward('error'); |
427 | 427 | } |
428 | 428 | |
429 | - $formatsDefaults = include(ExtensionManagementUtility::extPath('dlf') . 'Resources/Private/Data/FormatDefaults.php'); |
|
429 | + $formatsDefaults = include(ExtensionManagementUtility::extPath('dlf').'Resources/Private/Data/FormatDefaults.php'); |
|
430 | 430 | $recordInfos['formats']['numCurrent'] = $this->formatRepository->countAll(); |
431 | 431 | $recordInfos['formats']['numDefault'] = count($formatsDefaults); |
432 | 432 | |
433 | - $structuresDefaults = include(ExtensionManagementUtility::extPath('dlf') . 'Resources/Private/Data/StructureDefaults.php'); |
|
433 | + $structuresDefaults = include(ExtensionManagementUtility::extPath('dlf').'Resources/Private/Data/StructureDefaults.php'); |
|
434 | 434 | $recordInfos['structures']['numCurrent'] = $this->structureRepository->countByPid($this->pid); |
435 | 435 | $recordInfos['structures']['numDefault'] = count($structuresDefaults); |
436 | 436 | |
437 | - $metadataDefaults = include(ExtensionManagementUtility::extPath('dlf') . 'Resources/Private/Data/MetadataDefaults.php'); |
|
437 | + $metadataDefaults = include(ExtensionManagementUtility::extPath('dlf').'Resources/Private/Data/MetadataDefaults.php'); |
|
438 | 438 | $recordInfos['metadata']['numCurrent'] = $this->metadataRepository->countByPid($this->pid); |
439 | 439 | $recordInfos['metadata']['numDefault'] = count($metadataDefaults); |
440 | 440 | |
@@ -474,7 +474,7 @@ discard block |
||
474 | 474 | } elseif (isset($langArray['default'][$index][0]['target'])) { |
475 | 475 | return $langArray['default'][$index][0]['target']; |
476 | 476 | } else { |
477 | - return 'Missing translation for ' . $index; |
|
477 | + return 'Missing translation for '.$index; |
|
478 | 478 | } |
479 | 479 | } |
480 | 480 | } |
@@ -186,11 +186,11 @@ discard block |
||
186 | 186 | $frameworkConfiguration['persistence']['storagePid'] = 0; |
187 | 187 | $this->configurationManager->setConfiguration($frameworkConfiguration); |
188 | 188 | |
189 | - $doPersist = false; |
|
189 | + $doPersist = FALSE; |
|
190 | 190 | |
191 | 191 | foreach ($formatsDefaults as $type => $values) { |
192 | 192 | // if default format record is not found, add it to the repository |
193 | - if ($this->formatRepository->findOneByType($type) === null) { |
|
193 | + if ($this->formatRepository->findOneByType($type) === NULL) { |
|
194 | 194 | $newRecord = GeneralUtility::makeInstance(Format::class); |
195 | 195 | $newRecord->setType($type); |
196 | 196 | $newRecord->setRoot($values['root']); |
@@ -198,12 +198,12 @@ discard block |
||
198 | 198 | $newRecord->setClass($values['class']); |
199 | 199 | $this->formatRepository->add($newRecord); |
200 | 200 | |
201 | - $doPersist = true; |
|
201 | + $doPersist = TRUE; |
|
202 | 202 | } |
203 | 203 | } |
204 | 204 | |
205 | 205 | // We must persist here, if we changed anything. |
206 | - if ($doPersist === true) { |
|
206 | + if ($doPersist === TRUE) { |
|
207 | 207 | $persistenceManager = GeneralUtility::makeInstance(PersistenceManager::class); |
208 | 208 | $persistenceManager->persistAll(); |
209 | 209 | } |
@@ -265,13 +265,13 @@ discard block |
||
265 | 265 | ]; |
266 | 266 | } |
267 | 267 | |
268 | - $metadataIds = Helper::processDatabaseAsAdmin($data, [], true); |
|
268 | + $metadataIds = Helper::processDatabaseAsAdmin($data, [], TRUE); |
|
269 | 269 | |
270 | 270 | $insertedMetadata = []; |
271 | 271 | foreach ($metadataIds as $id => $uid) { |
272 | 272 | $metadata = $this->metadataRepository->findByUid($uid); |
273 | 273 | // id array contains also ids of formats |
274 | - if ($metadata != null) { |
|
274 | + if ($metadata != NULL) { |
|
275 | 275 | $insertedMetadata[$uid] = $metadata->getIndexName(); |
276 | 276 | } |
277 | 277 | } |
@@ -307,12 +307,12 @@ discard block |
||
307 | 307 | */ |
308 | 308 | public function addSolrCoreAction(): void |
309 | 309 | { |
310 | - $doPersist = false; |
|
310 | + $doPersist = FALSE; |
|
311 | 311 | |
312 | 312 | // load language file in own array |
313 | 313 | $beLabels = $this->languageFactory->getParsedData('EXT:dlf/Resources/Private/Language/locallang_be.xlf', $this->siteLanguages[0]->getTypo3Language()); |
314 | 314 | |
315 | - if ($this->solrCoreRepository->findOneByPid($this->pid) === null) { |
|
315 | + if ($this->solrCoreRepository->findOneByPid($this->pid) === NULL) { |
|
316 | 316 | $newRecord = GeneralUtility::makeInstance(SolrCore::class); |
317 | 317 | $newRecord->setLabel($this->getLLL('flexform.solrcore', $this->siteLanguages[0]->getTypo3Language(), $beLabels). ' (PID ' . $this->pid . ')'); |
318 | 318 | $indexName = Solr::createCore(''); |
@@ -321,12 +321,12 @@ discard block |
||
321 | 321 | |
322 | 322 | $this->solrCoreRepository->add($newRecord); |
323 | 323 | |
324 | - $doPersist = true; |
|
324 | + $doPersist = TRUE; |
|
325 | 325 | } |
326 | 326 | } |
327 | 327 | |
328 | 328 | // We must persist here, if we changed anything. |
329 | - if ($doPersist === true) { |
|
329 | + if ($doPersist === TRUE) { |
|
330 | 330 | $persistenceManager = GeneralUtility::makeInstance(PersistenceManager::class); |
331 | 331 | $persistenceManager->persistAll(); |
332 | 332 | } |
@@ -360,7 +360,7 @@ discard block |
||
360 | 360 | 'thumbnail' => 0, |
361 | 361 | ]; |
362 | 362 | } |
363 | - $structureIds = Helper::processDatabaseAsAdmin($data, [], true); |
|
363 | + $structureIds = Helper::processDatabaseAsAdmin($data, [], TRUE); |
|
364 | 364 | |
365 | 365 | $insertedStructures = []; |
366 | 366 | foreach ($structureIds as $id => $uid) { |
@@ -19,8 +19,7 @@ |
||
19 | 19 | * |
20 | 20 | * @access public |
21 | 21 | */ |
22 | -class View3DController extends AbstractController |
|
23 | -{ |
|
22 | +class View3DController extends AbstractController { |
|
24 | 23 | /** |
25 | 24 | * @access public |
26 | 25 | * |
@@ -33,8 +33,7 @@ |
||
33 | 33 | * |
34 | 34 | * @access public |
35 | 35 | */ |
36 | -class SearchController extends AbstractController |
|
37 | -{ |
|
36 | +class SearchController extends AbstractController { |
|
38 | 37 | /** |
39 | 38 | * @access protected |
40 | 39 | * @var CollectionRepository |
@@ -90,7 +90,7 @@ discard block |
||
90 | 90 | $this->searchParams = $this->getParametersSafely('searchParameter'); |
91 | 91 | |
92 | 92 | // output is done by main action |
93 | - $this->forward('main', null, null, ['searchParameter' => $this->searchParams]); |
|
93 | + $this->forward('main', NULL, NULL, ['searchParameter' => $this->searchParams]); |
|
94 | 94 | } |
95 | 95 | |
96 | 96 | /** |
@@ -104,7 +104,7 @@ discard block |
||
104 | 104 | */ |
105 | 105 | public function mainAction(): void |
106 | 106 | { |
107 | - $listViewSearch = false; |
|
107 | + $listViewSearch = FALSE; |
|
108 | 108 | // Quit without doing anything if required variables are not set. |
109 | 109 | if (empty($this->settings['solrcore'])) { |
110 | 110 | $this->logger->warning('Incomplete plugin configuration'); |
@@ -118,7 +118,7 @@ discard block |
||
118 | 118 | |
119 | 119 | if (isset($listRequestData['searchParameter']) && is_array($listRequestData['searchParameter'])) { |
120 | 120 | $this->searchParams = array_merge($this->searchParams ?: [], $listRequestData['searchParameter']); |
121 | - $listViewSearch = true; |
|
121 | + $listViewSearch = TRUE; |
|
122 | 122 | $GLOBALS['TSFE']->fe_user->setKey('ses', 'search', $this->searchParams); |
123 | 123 | } |
124 | 124 | |
@@ -146,7 +146,7 @@ discard block |
||
146 | 146 | $this->redirect( |
147 | 147 | 'main', |
148 | 148 | 'ListView', |
149 | - null, |
|
149 | + NULL, |
|
150 | 150 | [ |
151 | 151 | 'searchParameter' => $this->searchParams, |
152 | 152 | 'page' => $currentPage |
@@ -158,12 +158,12 @@ discard block |
||
158 | 158 | // An empty form will be shown. |
159 | 159 | if (is_array($this->searchParams) && !empty($this->searchParams)) { |
160 | 160 | // get all sortable metadata records |
161 | - $sortableMetadata = $this->metadataRepository->findByIsSortable(true); |
|
161 | + $sortableMetadata = $this->metadataRepository->findByIsSortable(TRUE); |
|
162 | 162 | |
163 | 163 | // get all metadata records to be shown in results |
164 | - $listedMetadata = $this->metadataRepository->findByIsListed(true); |
|
164 | + $listedMetadata = $this->metadataRepository->findByIsListed(TRUE); |
|
165 | 165 | |
166 | - $solrResults = null; |
|
166 | + $solrResults = NULL; |
|
167 | 167 | $numResults = 0; |
168 | 168 | // Do not execute the Solr search if used together with ListView plugin. |
169 | 169 | if (!$listViewSearch) { |
@@ -223,7 +223,7 @@ discard block |
||
223 | 223 | |
224 | 224 | // Get facets from plugin configuration. |
225 | 225 | $facets = []; |
226 | - foreach (GeneralUtility::trimExplode(',', $this->settings['facets'], true) as $facet) { |
|
226 | + foreach (GeneralUtility::trimExplode(',', $this->settings['facets'], TRUE) as $facet) { |
|
227 | 227 | $facets[$facet . '_faceting'] = Helper::translate($facet, 'tx_dlf_metadata', $this->settings['storagePid']); |
228 | 228 | } |
229 | 229 | |
@@ -380,7 +380,7 @@ discard block |
||
380 | 380 | { |
381 | 381 | // if collections are given, we prepare the collections query string |
382 | 382 | // extract collections from collection parameter |
383 | - $collections = null; |
|
383 | + $collections = NULL; |
|
384 | 384 | if ($this->searchParams['collection']) { |
385 | 385 | foreach (explode(',', $this->searchParams['collection']) as $collectionEntry) { |
386 | 386 | $collections[] = $this->collectionRepository->findByUid((int) $collectionEntry); |
@@ -440,7 +440,7 @@ discard block |
||
440 | 440 | // Check if facet is already selected. |
441 | 441 | $queryColumn = array_column($search['params']['filterquery'], 'query'); |
442 | 442 | $index = array_search($field . ':("' . Solr::escapeQuery($value) . '")', $queryColumn); |
443 | - if ($index !== false) { |
|
443 | + if ($index !== FALSE) { |
|
444 | 444 | // Facet is selected, thus remove it from filter. |
445 | 445 | unset($queryColumn[$index]); |
446 | 446 | $queryColumn = array_values($queryColumn); |
@@ -448,7 +448,7 @@ discard block |
||
448 | 448 | $state = 'ACTIFSUB'; |
449 | 449 | // Reset facets |
450 | 450 | if ($this->settings['resetFacets']) { |
451 | - $entryArray['resetFacet'] = true; |
|
451 | + $entryArray['resetFacet'] = TRUE; |
|
452 | 452 | $entryArray['queryColumn'] = $queryColumn; |
453 | 453 | } |
454 | 454 | } else { |
@@ -559,7 +559,7 @@ discard block |
||
559 | 559 | } |
560 | 560 | |
561 | 561 | // Get field selector options. |
562 | - $searchFields = GeneralUtility::trimExplode(',', $this->settings['extendedFields'], true); |
|
562 | + $searchFields = GeneralUtility::trimExplode(',', $this->settings['extendedFields'], TRUE); |
|
563 | 563 | |
564 | 564 | $slotCountArray = []; |
565 | 565 | for ($i = 0; $i < $this->settings['extendedSlotCount']; $i++) { |
@@ -122,7 +122,7 @@ discard block |
||
122 | 122 | } |
123 | 123 | |
124 | 124 | if (isset($listRequestData['searchParameter']) && is_array($listRequestData['searchParameter'])) { |
125 | - $this->searchParams = array_merge($this->searchParams ?: [], $listRequestData['searchParameter']); |
|
125 | + $this->searchParams = array_merge($this->searchParams ? : [], $listRequestData['searchParameter']); |
|
126 | 126 | $listViewSearch = true; |
127 | 127 | $GLOBALS['TSFE']->fe_user->setKey('ses', 'search', $this->searchParams); |
128 | 128 | } |
@@ -183,7 +183,7 @@ discard block |
||
183 | 183 | $simplePagination = new SimplePagination($solrPaginator); |
184 | 184 | |
185 | 185 | $pagination = $this->buildSimplePagination($simplePagination, $solrPaginator); |
186 | - $this->view->assignMultiple([ 'pagination' => $pagination, 'paginator' => $solrPaginator ]); |
|
186 | + $this->view->assignMultiple(['pagination' => $pagination, 'paginator' => $solrPaginator]); |
|
187 | 187 | } |
188 | 188 | |
189 | 189 | $this->view->assign('documents', !empty($solrResults) ? $solrResults : []); |
@@ -208,7 +208,7 @@ discard block |
||
208 | 208 | |
209 | 209 | // Add uHash parameter to suggest parameter to make a basic protection of this form. |
210 | 210 | if ($this->settings['suggest']) { |
211 | - $this->view->assign('uHash', GeneralUtility::hmac((string) (new Typo3Version()) . Environment::getExtensionsPath(), 'SearchSuggest')); |
|
211 | + $this->view->assign('uHash', GeneralUtility::hmac((string) (new Typo3Version()).Environment::getExtensionsPath(), 'SearchSuggest')); |
|
212 | 212 | } |
213 | 213 | |
214 | 214 | $this->view->assign('viewData', $this->viewData); |
@@ -229,7 +229,7 @@ discard block |
||
229 | 229 | // Get facets from plugin configuration. |
230 | 230 | $facets = []; |
231 | 231 | foreach (GeneralUtility::trimExplode(',', $this->settings['facets'], true) as $facet) { |
232 | - $facets[$facet . '_faceting'] = Helper::translate($facet, 'tx_dlf_metadata', $this->settings['storagePid']); |
|
232 | + $facets[$facet.'_faceting'] = Helper::translate($facet, 'tx_dlf_metadata', $this->settings['storagePid']); |
|
233 | 233 | } |
234 | 234 | |
235 | 235 | $this->view->assign('facetsMenu', $this->makeFacetsMenuArray($facets)); |
@@ -265,13 +265,13 @@ discard block |
||
265 | 265 | $searchParams = $this->searchParams; |
266 | 266 | if ( |
267 | 267 | (!empty($searchParams['fulltext'])) |
268 | - || preg_match('/' . $fields['fulltext'] . ':\((.*)\)/', trim($searchParams['query']), $matches) |
|
268 | + || preg_match('/'.$fields['fulltext'].':\((.*)\)/', trim($searchParams['query']), $matches) |
|
269 | 269 | ) { |
270 | 270 | // If the query already is a fulltext query e.g using the facets |
271 | 271 | $searchParams['query'] = empty($matches[1]) ? $searchParams['query'] : $matches[1]; |
272 | 272 | // Search in fulltext field if applicable. Query must not be empty! |
273 | 273 | if (!empty($searchParams['query'])) { |
274 | - $search['query'] = $fields['fulltext'] . ':(' . Solr::escapeQuery(trim($searchParams['query'])) . ')'; |
|
274 | + $search['query'] = $fields['fulltext'].':('.Solr::escapeQuery(trim($searchParams['query'])).')'; |
|
275 | 275 | } |
276 | 276 | } else { |
277 | 277 | // Retain given search field if valid. |
@@ -288,7 +288,7 @@ discard block |
||
288 | 288 | // add filter query for date search |
289 | 289 | if (!empty($this->searchParams['dateFrom']) && !empty($this->searchParams['dateTo'])) { |
290 | 290 | // combine dateFrom and dateTo into filterquery as range search |
291 | - $search['params']['filterquery'][]['query'] = '{!join from=' . $fields['uid'] . ' to=' . $fields['uid'] . '}' . $fields['date'] . ':[' . $this->searchParams['dateFrom'] . ' TO ' . $this->searchParams['dateTo'] . ']'; |
|
291 | + $search['params']['filterquery'][]['query'] = '{!join from='.$fields['uid'].' to='.$fields['uid'].'}'.$fields['date'].':['.$this->searchParams['dateFrom'].' TO '.$this->searchParams['dateTo'].']'; |
|
292 | 292 | } |
293 | 293 | |
294 | 294 | // Add extended search query. |
@@ -306,9 +306,9 @@ discard block |
||
306 | 306 | in_array($searchParams['extOperator'][$i], $allowedOperators) |
307 | 307 | ) { |
308 | 308 | if (!empty($search['query'])) { |
309 | - $search['query'] .= ' ' . $searchParams['extOperator'][$i] . ' '; |
|
309 | + $search['query'] .= ' '.$searchParams['extOperator'][$i].' '; |
|
310 | 310 | } |
311 | - $search['query'] .= Indexer::getIndexFieldName($searchParams['extField'][$i], $this->settings['storagePid']) . ':(' . Solr::escapeQuery($searchParams['extQuery'][$i]) . ')'; |
|
311 | + $search['query'] .= Indexer::getIndexFieldName($searchParams['extField'][$i], $this->settings['storagePid']).':('.Solr::escapeQuery($searchParams['extQuery'][$i]).')'; |
|
312 | 312 | } |
313 | 313 | } |
314 | 314 | } |
@@ -397,24 +397,24 @@ discard block |
||
397 | 397 | foreach ($collections as $collectionEntry) { |
398 | 398 | // check for virtual collections query string |
399 | 399 | if ($collectionEntry->getIndexSearch()) { |
400 | - $virtualCollectionsQueryString .= empty($virtualCollectionsQueryString) ? '(' . $collectionEntry->getIndexSearch() . ')' : ' OR (' . $collectionEntry->getIndexSearch() . ')'; |
|
400 | + $virtualCollectionsQueryString .= empty($virtualCollectionsQueryString) ? '('.$collectionEntry->getIndexSearch().')' : ' OR ('.$collectionEntry->getIndexSearch().')'; |
|
401 | 401 | } else { |
402 | - $collectionsQueryString .= empty($collectionsQueryString) ? '"' . $collectionEntry->getIndexName() . '"' : ' OR "' . $collectionEntry->getIndexName() . '"'; |
|
402 | + $collectionsQueryString .= empty($collectionsQueryString) ? '"'.$collectionEntry->getIndexName().'"' : ' OR "'.$collectionEntry->getIndexName().'"'; |
|
403 | 403 | } |
404 | 404 | } |
405 | 405 | |
406 | 406 | // distinguish between simple collection browsing and actual searching within the collection(s) |
407 | 407 | if (!empty($collectionsQueryString)) { |
408 | 408 | if (empty($query)) { |
409 | - $collectionsQueryString = '(collection_faceting:(' . $collectionsQueryString . ') AND toplevel:true AND partof:0)'; |
|
409 | + $collectionsQueryString = '(collection_faceting:('.$collectionsQueryString.') AND toplevel:true AND partof:0)'; |
|
410 | 410 | } else { |
411 | - $collectionsQueryString = '(collection_faceting:(' . $collectionsQueryString . '))'; |
|
411 | + $collectionsQueryString = '(collection_faceting:('.$collectionsQueryString.'))'; |
|
412 | 412 | } |
413 | 413 | } |
414 | 414 | |
415 | 415 | // virtual collections might query documents that are neither toplevel:true nor partof:0 and need to be searched separately |
416 | 416 | if (!empty($virtualCollectionsQueryString)) { |
417 | - $virtualCollectionsQueryString = '(' . $virtualCollectionsQueryString . ')'; |
|
417 | + $virtualCollectionsQueryString = '('.$virtualCollectionsQueryString.')'; |
|
418 | 418 | } |
419 | 419 | |
420 | 420 | // combine both querystrings into a single filterquery via OR if both are given, otherwise pass either of those |
@@ -444,7 +444,7 @@ discard block |
||
444 | 444 | $entryArray['doNotLinkIt'] = 0; |
445 | 445 | // Check if facet is already selected. |
446 | 446 | $queryColumn = array_column($search['params']['filterquery'], 'query'); |
447 | - $index = array_search($field . ':("' . Solr::escapeQuery($value) . '")', $queryColumn); |
|
447 | + $index = array_search($field.':("'.Solr::escapeQuery($value).'")', $queryColumn); |
|
448 | 448 | if ($index !== false) { |
449 | 449 | // Facet is selected, thus remove it from filter. |
450 | 450 | unset($queryColumn[$index]); |
@@ -458,7 +458,7 @@ discard block |
||
458 | 458 | } |
459 | 459 | } else { |
460 | 460 | // Facet is not selected, thus add it to filter. |
461 | - $queryColumn[] = $field . ':("' . Solr::escapeQuery($value) . '")'; |
|
461 | + $queryColumn[] = $field.':("'.Solr::escapeQuery($value).'")'; |
|
462 | 462 | $entryArray['ITEM_STATE'] = 'NO'; |
463 | 463 | } |
464 | 464 | $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? |
@@ -25,8 +25,7 @@ |
||
25 | 25 | * |
26 | 26 | * @access public |
27 | 27 | */ |
28 | -class AudioVideoMD implements MetadataInterface |
|
29 | -{ |
|
28 | +class AudioVideoMD implements MetadataInterface { |
|
30 | 29 | /** |
31 | 30 | * Extract some essential AudioMD/VideoMD metadata. |
32 | 31 | * |
@@ -38,7 +38,7 @@ |
||
38 | 38 | * |
39 | 39 | * @return void |
40 | 40 | */ |
41 | - public function extractMetadata(\SimpleXMLElement $xml, array &$metadata, bool $useExternalApis = false): void |
|
41 | + public function extractMetadata(\SimpleXMLElement $xml, array &$metadata, bool $useExternalApis = FALSE): void |
|
42 | 42 | { |
43 | 43 | $xml->registerXPathNamespace('audiomd', 'http://www.loc.gov/audioMD/'); |
44 | 44 | $xml->registerXPathNamespace('videomd', 'http://www.loc.gov/videoMD/'); |
@@ -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 | /** |
@@ -147,8 +147,7 @@ |
||
147 | 147 | * |
148 | 148 | * @param \SimpleXMLElement &$xml: The XML to register the namespace for |
149 | 149 | */ |
150 | - private function registerAltoNamespace(\SimpleXMLElement &$xml) |
|
151 | - { |
|
150 | + private function registerAltoNamespace(\SimpleXMLElement &$xml) { |
|
152 | 151 | $namespace = $xml->getDocNamespaces(); |
153 | 152 | |
154 | 153 | if (in_array('http://www.loc.gov/standards/alto/ns-v2#', $namespace, true)) { |
@@ -151,11 +151,11 @@ |
||
151 | 151 | { |
152 | 152 | $namespace = $xml->getDocNamespaces(); |
153 | 153 | |
154 | - if (in_array('http://www.loc.gov/standards/alto/ns-v2#', $namespace, true)) { |
|
154 | + if (in_array('http://www.loc.gov/standards/alto/ns-v2#', $namespace, TRUE)) { |
|
155 | 155 | $xml->registerXPathNamespace('alto', 'http://www.loc.gov/standards/alto/ns-v2#'); |
156 | - } elseif (in_array('http://www.loc.gov/standards/alto/ns-v3#', $namespace, true)) { |
|
156 | + } elseif (in_array('http://www.loc.gov/standards/alto/ns-v3#', $namespace, TRUE)) { |
|
157 | 157 | $xml->registerXPathNamespace('alto', 'http://www.loc.gov/standards/alto/ns-v3#'); |
158 | - } elseif (in_array('http://www.loc.gov/standards/alto/ns-v4#', $namespace, true)) { |
|
158 | + } elseif (in_array('http://www.loc.gov/standards/alto/ns-v4#', $namespace, TRUE)) { |
|
159 | 159 | $xml->registerXPathNamespace('alto', 'http://www.loc.gov/standards/alto/ns-v4#'); |
160 | 160 | } |
161 | 161 | } |
@@ -24,8 +24,7 @@ |
||
24 | 24 | * |
25 | 25 | * @access public |
26 | 26 | */ |
27 | -class Mods implements MetadataInterface |
|
28 | -{ |
|
27 | +class Mods implements MetadataInterface { |
|
29 | 28 | /** |
30 | 29 | * @access private |
31 | 30 | * @var \SimpleXMLElement The metadata XML |
@@ -124,7 +124,7 @@ discard block |
||
124 | 124 | if (!empty($name)) { |
125 | 125 | $this->metadata['author'][$i] = [ |
126 | 126 | 'name' => $name, |
127 | - 'url' => 'https://orcid.org/' . $orcidId |
|
127 | + 'url' => 'https://orcid.org/'.$orcidId |
|
128 | 128 | ]; |
129 | 129 | } else { |
130 | 130 | //fallback into display form |
@@ -181,7 +181,7 @@ discard block |
||
181 | 181 | } |
182 | 182 | // Append "valueURI" to name using Unicode unit separator. |
183 | 183 | if (!empty($authors[$i]->getValueURI())) { |
184 | - $this->metadata['author'][$i] .= pack('C', 31) . $authors[$i]->getValueURI(); |
|
184 | + $this->metadata['author'][$i] .= pack('C', 31).$authors[$i]->getValueURI(); |
|
185 | 185 | } |
186 | 186 | } |
187 | 187 | |
@@ -244,7 +244,7 @@ discard block |
||
244 | 244 | if (!empty($name)) { |
245 | 245 | $this->metadata['holder'][$i] = [ |
246 | 246 | 'name' => $name, |
247 | - 'url' => 'http://viaf.org/viaf/' . $viafId |
|
247 | + 'url' => 'http://viaf.org/viaf/'.$viafId |
|
248 | 248 | ]; |
249 | 249 | } else { |
250 | 250 | //fallback into display form |
@@ -267,7 +267,7 @@ discard block |
||
267 | 267 | $this->getHolderFromXmlDisplayForm($holders, $i); |
268 | 268 | // Append "valueURI" to name using Unicode unit separator. |
269 | 269 | if (!empty($holders[$i]->getValueURI())) { |
270 | - $this->metadata['holder'][$i] .= pack('C', 31) . $holders[$i]->getValueURI(); |
|
270 | + $this->metadata['holder'][$i] .= pack('C', 31).$holders[$i]->getValueURI(); |
|
271 | 271 | } |
272 | 272 | } |
273 | 273 |
@@ -22,8 +22,7 @@ |
||
22 | 22 | * |
23 | 23 | * @access public |
24 | 24 | */ |
25 | -class TeiHeader implements MetadataInterface |
|
26 | -{ |
|
25 | +class TeiHeader implements MetadataInterface { |
|
27 | 26 | /** |
28 | 27 | * This extracts the essential TEIHDR metadata from XML |
29 | 28 | * |
@@ -35,7 +35,7 @@ |
||
35 | 35 | * |
36 | 36 | * @return void |
37 | 37 | */ |
38 | - public function extractMetadata(\SimpleXMLElement $xml, array &$metadata, bool $useExternalApis = false): void |
|
38 | + public function extractMetadata(\SimpleXMLElement $xml, array &$metadata, bool $useExternalApis = FALSE): void |
|
39 | 39 | { |
40 | 40 | $xml->registerXPathNamespace('teihdr', 'http://www.tei-c.org/ns/1.0'); |
41 | 41 | } |
@@ -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 | } |
@@ -26,8 +26,7 @@ discard block |
||
26 | 26 | * |
27 | 27 | * @access public |
28 | 28 | **/ |
29 | -class Client |
|
30 | -{ |
|
29 | +class Client { |
|
31 | 30 | /** |
32 | 31 | * @access protected |
33 | 32 | * @var Logger This holds the logger |
@@ -62,8 +61,7 @@ discard block |
||
62 | 61 | * |
63 | 62 | * @return void |
64 | 63 | **/ |
65 | - public function __construct(string $viaf, RequestFactory $requestFactory) |
|
66 | - { |
|
64 | + public function __construct(string $viaf, RequestFactory $requestFactory) { |
|
67 | 65 | $this->logger = GeneralUtility::makeInstance(LogManager::class)->getLogger(static::class); |
68 | 66 | $this->viafUrl = 'http://viaf.org/viaf/' . $viaf; |
69 | 67 | $this->requestFactory = $requestFactory; |
@@ -89,8 +87,7 @@ discard block |
||
89 | 87 | * |
90 | 88 | * @return object|bool |
91 | 89 | **/ |
92 | - public function getData() |
|
93 | - { |
|
90 | + public function getData() { |
|
94 | 91 | $url = $this->getApiEndpoint(); |
95 | 92 | try { |
96 | 93 | $response = $this->requestFactory->request($url); |
@@ -96,7 +96,7 @@ |
||
96 | 96 | $response = $this->requestFactory->request($url); |
97 | 97 | } catch (\Exception $e) { |
98 | 98 | $this->logger->warning('Could not fetch data from URL "' . $url . '". Error: ' . $e->getMessage() . '.'); |
99 | - return false; |
|
99 | + return FALSE; |
|
100 | 100 | } |
101 | 101 | return $response->getBody()->getContents(); |
102 | 102 | } |
@@ -26,8 +26,7 @@ discard block |
||
26 | 26 | * |
27 | 27 | * @access public |
28 | 28 | **/ |
29 | -class Profile |
|
30 | -{ |
|
29 | +class Profile { |
|
31 | 30 | /** |
32 | 31 | * @access private |
33 | 32 | * @var Logger This holds the logger |
@@ -55,8 +54,7 @@ discard block |
||
55 | 54 | * |
56 | 55 | * @return void |
57 | 56 | **/ |
58 | - public function __construct(string $viaf) |
|
59 | - { |
|
57 | + public function __construct(string $viaf) { |
|
60 | 58 | $this->logger = GeneralUtility::makeInstance(LogManager::class)->getLogger(static::class); |
61 | 59 | $this->client = new Client($viaf, GeneralUtility::makeInstance(RequestFactory::class)); |
62 | 60 | } |
@@ -68,8 +66,7 @@ discard block |
||
68 | 66 | * |
69 | 67 | * @return array|false |
70 | 68 | **/ |
71 | - public function getData() |
|
72 | - { |
|
69 | + public function getData() { |
|
73 | 70 | $this->getRaw(); |
74 | 71 | if ($this->raw !== false && !empty($this->raw)) { |
75 | 72 | $data = []; |
@@ -89,8 +86,7 @@ discard block |
||
89 | 86 | * |
90 | 87 | * @return string|false |
91 | 88 | **/ |
92 | - public function getAddress() |
|
93 | - { |
|
89 | + public function getAddress() { |
|
94 | 90 | $this->getRaw(); |
95 | 91 | if ($this->raw !== false && !empty($this->raw->asXML())) { |
96 | 92 | return (string) $this->raw->xpath('./ns1:nationalityOfEntity/ns1:data/ns1:text')[0]; |
@@ -107,8 +103,7 @@ discard block |
||
107 | 103 | * |
108 | 104 | * @return string|false |
109 | 105 | **/ |
110 | - public function getFullName() |
|
111 | - { |
|
106 | + public function getFullName() { |
|
112 | 107 | $this->getRaw(); |
113 | 108 | if ($this->raw !== false && !empty($this->raw->asXML())) { |
114 | 109 | $rawName = $this->raw->xpath('./ns1:mainHeadings/ns1:data/ns1:text'); |
@@ -44,7 +44,7 @@ discard block |
||
44 | 44 | * @access private |
45 | 45 | * @var \SimpleXmlElement|false The raw VIAF profile or false if not found |
46 | 46 | **/ |
47 | - private $raw = false; |
|
47 | + private $raw = FALSE; |
|
48 | 48 | |
49 | 49 | /** |
50 | 50 | * Constructs client instance |
@@ -71,14 +71,14 @@ discard block |
||
71 | 71 | public function getData() |
72 | 72 | { |
73 | 73 | $this->getRaw(); |
74 | - if ($this->raw !== false && !empty($this->raw)) { |
|
74 | + if ($this->raw !== FALSE && !empty($this->raw)) { |
|
75 | 75 | $data = []; |
76 | 76 | $data['address'] = $this->getAddress(); |
77 | 77 | $data['fullName'] = $this->getFullName(); |
78 | 78 | return $data; |
79 | 79 | } else { |
80 | 80 | $this->logger->warning('No data found for given VIAF URL'); |
81 | - return false; |
|
81 | + return FALSE; |
|
82 | 82 | } |
83 | 83 | } |
84 | 84 | |
@@ -92,11 +92,11 @@ discard block |
||
92 | 92 | public function getAddress() |
93 | 93 | { |
94 | 94 | $this->getRaw(); |
95 | - if ($this->raw !== false && !empty($this->raw->asXML())) { |
|
95 | + if ($this->raw !== FALSE && !empty($this->raw->asXML())) { |
|
96 | 96 | return (string) $this->raw->xpath('./ns1:nationalityOfEntity/ns1:data/ns1:text')[0]; |
97 | 97 | } else { |
98 | 98 | $this->logger->warning('No address found for given VIAF URL'); |
99 | - return false; |
|
99 | + return FALSE; |
|
100 | 100 | } |
101 | 101 | } |
102 | 102 | |
@@ -110,14 +110,14 @@ discard block |
||
110 | 110 | public function getFullName() |
111 | 111 | { |
112 | 112 | $this->getRaw(); |
113 | - if ($this->raw !== false && !empty($this->raw->asXML())) { |
|
113 | + if ($this->raw !== FALSE && !empty($this->raw->asXML())) { |
|
114 | 114 | $rawName = $this->raw->xpath('./ns1:mainHeadings/ns1:data/ns1:text'); |
115 | 115 | $name = (string) $rawName[0]; |
116 | 116 | $name = trim(trim(trim($name), ','), '.'); |
117 | 117 | return $name; |
118 | 118 | } else { |
119 | 119 | $this->logger->warning('No name found for given VIAF URL'); |
120 | - return false; |
|
120 | + return FALSE; |
|
121 | 121 | } |
122 | 122 | } |
123 | 123 | |
@@ -131,9 +131,9 @@ discard block |
||
131 | 131 | private function getRaw(): void |
132 | 132 | { |
133 | 133 | $data = $this->client->getData(); |
134 | - if ($data != false) { |
|
134 | + if ($data != FALSE) { |
|
135 | 135 | $this->raw = Helper::getXmlFileAsString($data); |
136 | - if ($this->raw != false && !empty($this->raw->asXML())) { |
|
136 | + if ($this->raw != FALSE && !empty($this->raw->asXML())) { |
|
137 | 137 | $this->raw->registerXPathNamespace('ns1', 'http://viaf.org/viaf/terms#'); |
138 | 138 | } |
139 | 139 | } |