@@ -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 = []; |
@@ -28,8 +28,7 @@ |
||
| 28 | 28 | * |
| 29 | 29 | * @access public |
| 30 | 30 | */ |
| 31 | -class CollectionController extends AbstractController |
|
| 32 | -{ |
|
| 31 | +class CollectionController extends AbstractController { |
|
| 33 | 32 | /** |
| 34 | 33 | * @access protected |
| 35 | 34 | * @var CollectionRepository |
@@ -98,7 +98,7 @@ discard block |
||
| 98 | 98 | } |
| 99 | 99 | |
| 100 | 100 | if (count($collections) == 1 && empty($this->settings['dont_show_single']) && is_array($collections)) { |
| 101 | - $this->forward('show', null, null, ['collection' => array_pop($collections)]); |
|
| 101 | + $this->forward('show', NULL, NULL, ['collection' => array_pop($collections)]); |
|
| 102 | 102 | } |
| 103 | 103 | |
| 104 | 104 | $processedCollections = $this->processCollections($collections, $solr); |
@@ -140,7 +140,7 @@ discard block |
||
| 140 | 140 | $searchParams['collection'] = $collection; |
| 141 | 141 | // If a targetPid is given, the results will be shown by ListView on the target page. |
| 142 | 142 | if (!empty($this->settings['targetPid'])) { |
| 143 | - $this->redirect('main', 'ListView', null, |
|
| 143 | + $this->redirect('main', 'ListView', NULL, |
|
| 144 | 144 | [ |
| 145 | 145 | 'searchParameter' => $searchParams, |
| 146 | 146 | 'page' => $currentPage |
@@ -149,13 +149,13 @@ discard block |
||
| 149 | 149 | } |
| 150 | 150 | |
| 151 | 151 | // get all metadata records to be shown in results |
| 152 | - $listedMetadata = $this->metadataRepository->findByIsListed(true); |
|
| 152 | + $listedMetadata = $this->metadataRepository->findByIsListed(TRUE); |
|
| 153 | 153 | |
| 154 | 154 | // get all sortable metadata records |
| 155 | - $sortableMetadata = $this->metadataRepository->findByIsSortable(true); |
|
| 155 | + $sortableMetadata = $this->metadataRepository->findByIsSortable(TRUE); |
|
| 156 | 156 | |
| 157 | 157 | // get all documents of given collection |
| 158 | - $solrResults = null; |
|
| 158 | + $solrResults = NULL; |
|
| 159 | 159 | if (is_array($searchParams) && !empty($searchParams)) { |
| 160 | 160 | $solrResults = $this->documentRepository->findSolrByCollection($collection, $this->settings, $searchParams, $listedMetadata); |
| 161 | 161 | |
@@ -191,13 +191,13 @@ discard block |
||
| 191 | 191 | // if search was triggered, get search parameters from POST variables |
| 192 | 192 | $searchParams = $this->getParametersSafely('searchParameter'); |
| 193 | 193 | |
| 194 | - $collection = null; |
|
| 194 | + $collection = NULL; |
|
| 195 | 195 | if ($searchParams['collection']['__identity'] && MathUtility::canBeInterpretedAsInteger($searchParams['collection']['__identity'])) { |
| 196 | 196 | $collection = $this->collectionRepository->findByUid($searchParams['collection']['__identity']); |
| 197 | 197 | } |
| 198 | 198 | |
| 199 | 199 | // output is done by show action |
| 200 | - $this->forward('show', null, null, ['searchParameter' => $searchParams, 'collection' => $collection]); |
|
| 200 | + $this->forward('show', NULL, NULL, ['searchParameter' => $searchParams, 'collection' => $collection]); |
|
| 201 | 201 | |
| 202 | 202 | } |
| 203 | 203 | |
@@ -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 | } |