@@ -21,13 +21,13 @@ |
||
21 | 21 | { |
22 | 22 | |
23 | 23 | private static array $databaseFixtures = [ |
24 | - __DIR__ . '/../../Fixtures/Common/documents_1.csv', |
|
25 | - __DIR__ . '/../../Fixtures/Common/pages.csv', |
|
26 | - __DIR__ . '/../../Fixtures/Common/solrcores.csv' |
|
24 | + __DIR__.'/../../Fixtures/Common/documents_1.csv', |
|
25 | + __DIR__.'/../../Fixtures/Common/pages.csv', |
|
26 | + __DIR__.'/../../Fixtures/Common/solrcores.csv' |
|
27 | 27 | ]; |
28 | 28 | |
29 | 29 | private static array $solrFixtures = [ |
30 | - __DIR__ . '/../../Fixtures/Common/documents_1.solr.json' |
|
30 | + __DIR__.'/../../Fixtures/Common/documents_1.solr.json' |
|
31 | 31 | ]; |
32 | 32 | |
33 | 33 | /** |
@@ -98,7 +98,7 @@ discard block |
||
98 | 98 | $this->configurationToUseInTestInstance['EXTENSIONS']['dlf'] = $this->getDlfConfiguration(); |
99 | 99 | |
100 | 100 | if ($this->disableJsonWrappedResponse) { |
101 | - $this->frameworkExtensionsToLoad = array_filter($this->frameworkExtensionsToLoad, function ($ext) { |
|
101 | + $this->frameworkExtensionsToLoad = array_filter($this->frameworkExtensionsToLoad, function($ext) { |
|
102 | 102 | return $ext !== 'Resources/Core/Functional/Extensions/json_response'; |
103 | 103 | }); |
104 | 104 | } |
@@ -111,9 +111,9 @@ discard block |
||
111 | 111 | $this->objectManager = GeneralUtility::makeInstance(ObjectManager::class); |
112 | 112 | $this->persistenceManager = GeneralUtility::makeInstance(PersistenceManager::class); |
113 | 113 | |
114 | - $this->baseUrl = 'http://web:8000/public/typo3temp/var/tests/functional-' . $this->identifier . '/'; |
|
114 | + $this->baseUrl = 'http://web:8000/public/typo3temp/var/tests/functional-'.$this->identifier.'/'; |
|
115 | 115 | $this->httpClient = new HttpClient([ |
116 | - 'base_uri' => $this->baseUrl . 'index.php', |
|
116 | + 'base_uri' => $this->baseUrl.'index.php', |
|
117 | 117 | 'http_errors' => false, |
118 | 118 | ]); |
119 | 119 | |
@@ -164,13 +164,13 @@ discard block |
||
164 | 164 | |
165 | 165 | protected function addSiteConfig($identifier) |
166 | 166 | { |
167 | - $siteConfig = Yaml::parseFile(__DIR__ . '/../Fixtures/siteconfig.yaml'); |
|
167 | + $siteConfig = Yaml::parseFile(__DIR__.'/../Fixtures/siteconfig.yaml'); |
|
168 | 168 | $siteConfig['base'] = $this->baseUrl; |
169 | 169 | $siteConfig['languages'][0]['base'] = $this->baseUrl; |
170 | 170 | |
171 | - $siteConfigPath = $this->instancePath . '/typo3conf/sites/' . $identifier; |
|
171 | + $siteConfigPath = $this->instancePath.'/typo3conf/sites/'.$identifier; |
|
172 | 172 | @mkdir($siteConfigPath, 0775, true); |
173 | - file_put_contents($siteConfigPath . '/config.yaml', Yaml::dump($siteConfig)); |
|
173 | + file_put_contents($siteConfigPath.'/config.yaml', Yaml::dump($siteConfig)); |
|
174 | 174 | } |
175 | 175 | |
176 | 176 | protected function initializeRepository(string $className, int $storagePid) |
@@ -189,7 +189,7 @@ discard block |
||
189 | 189 | $jsonDocuments = json_decode(file_get_contents($path), true); |
190 | 190 | |
191 | 191 | $updateQuery = $solr->service->createUpdate(); |
192 | - $documents = array_map(function ($jsonDoc) use ($updateQuery) { |
|
192 | + $documents = array_map(function($jsonDoc) use ($updateQuery) { |
|
193 | 193 | $document = $updateQuery->createDocument(); |
194 | 194 | foreach ($jsonDoc as $key => $value) { |
195 | 195 | $document->setField($key, $value); |
@@ -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 | } |
@@ -99,7 +99,7 @@ discard block |
||
99 | 99 | $this->renderToolByName('renderSearchInDocumentTool'); |
100 | 100 | break; |
101 | 101 | default: |
102 | - $this->logger->warning('Incorrect tool configuration: "' . $this->settings['tools'] . '". Tool "' . $tool . '" does not exist.'); |
|
102 | + $this->logger->warning('Incorrect tool configuration: "'.$this->settings['tools'].'". Tool "'.$tool.'" does not exist.'); |
|
103 | 103 | } |
104 | 104 | } |
105 | 105 | } |
@@ -262,7 +262,7 @@ discard block |
||
262 | 262 | } |
263 | 263 | break; |
264 | 264 | } else { |
265 | - $this->logger->warning('File not found in fileGrp "' . $fileGrp . '"'); |
|
265 | + $this->logger->warning('File not found in fileGrp "'.$fileGrp.'"'); |
|
266 | 266 | } |
267 | 267 | } |
268 | 268 | return $image; |
@@ -346,7 +346,7 @@ discard block |
||
346 | 346 | empty($firstPageLink) |
347 | 347 | && empty($secondPageLink) |
348 | 348 | ) { |
349 | - $this->logger->warning('File not found in fileGrps "' . $this->extConf['files']['fileGrpDownload'] . '"'); |
|
349 | + $this->logger->warning('File not found in fileGrps "'.$this->extConf['files']['fileGrpDownload'].'"'); |
|
350 | 350 | } |
351 | 351 | |
352 | 352 | if (!empty($firstPageLink)) { |
@@ -384,7 +384,7 @@ discard block |
||
384 | 384 | } |
385 | 385 | } |
386 | 386 | if (empty($workLink)) { |
387 | - $this->logger->warning('File not found in fileGrps "' . $this->extConf['files']['fileGrpDownload'] . '"'); |
|
387 | + $this->logger->warning('File not found in fileGrps "'.$this->extConf['files']['fileGrpDownload'].'"'); |
|
388 | 388 | } |
389 | 389 | return $workLink; |
390 | 390 | } |
@@ -119,11 +119,11 @@ discard block |
||
119 | 119 | $fulltext['mimetype'] = $file['mimeType']; |
120 | 120 | break; |
121 | 121 | } else { |
122 | - $this->logger->notice('No full-text file found for page "' . $page . '" in fileGrp "' . $fileGrpFulltext . '"'); |
|
122 | + $this->logger->notice('No full-text file found for page "'.$page.'" in fileGrp "'.$fileGrpFulltext.'"'); |
|
123 | 123 | } |
124 | 124 | } |
125 | 125 | if (empty($fulltext)) { |
126 | - $this->logger->notice('No full-text file found for page "' . $page . '" in fileGrps "' . $this->extConf['files']['fileGrpFulltext'] . '"'); |
|
126 | + $this->logger->notice('No full-text file found for page "'.$page.'" in fileGrps "'.$this->extConf['files']['fileGrpFulltext'].'"'); |
|
127 | 127 | } |
128 | 128 | return $fulltext; |
129 | 129 | } |
@@ -141,13 +141,13 @@ discard block |
||
141 | 141 | $viewerConfiguration = '$(document).ready(function() { |
142 | 142 | if (dlfUtils.exists(dlfViewer)) { |
143 | 143 | tx_dlf_viewer = new dlfViewer({ |
144 | - controls: ["' . implode('", "', $this->controls) . '"], |
|
145 | - div: "' . $this->settings['elementId'] . '", |
|
146 | - progressElementId: "' . $this->settings['progressElementId'] . '", |
|
147 | - images: ' . json_encode($this->images) . ', |
|
148 | - fulltexts: ' . json_encode($this->fulltexts) . ', |
|
149 | - annotationContainers: ' . json_encode($this->annotationContainers) . ', |
|
150 | - useInternalProxy: ' . ($this->settings['useInternalProxy'] ? 1 : 0) . ' |
|
144 | + controls: ["' . implode('", "', $this->controls).'"], |
|
145 | + div: "' . $this->settings['elementId'].'", |
|
146 | + progressElementId: "' . $this->settings['progressElementId'].'", |
|
147 | + images: ' . json_encode($this->images).', |
|
148 | + fulltexts: ' . json_encode($this->fulltexts).', |
|
149 | + annotationContainers: ' . json_encode($this->annotationContainers).', |
|
150 | + useInternalProxy: ' . ($this->settings['useInternalProxy'] ? 1 : 0).' |
|
151 | 151 | }); |
152 | 152 | } |
153 | 153 | });'; |
@@ -240,11 +240,11 @@ discard block |
||
240 | 240 | } |
241 | 241 | break; |
242 | 242 | } else { |
243 | - $this->logger->notice('No image file found for page "' . $page . '" in fileGrp "' . $fileGrpImages . '"'); |
|
243 | + $this->logger->notice('No image file found for page "'.$page.'" in fileGrp "'.$fileGrpImages.'"'); |
|
244 | 244 | } |
245 | 245 | } |
246 | 246 | if (empty($image)) { |
247 | - $this->logger->warning('No image file found for page "' . $page . '" in fileGrps "' . $this->extConf['files']['fileGrpImages'] . '"'); |
|
247 | + $this->logger->warning('No image file found for page "'.$page.'" in fileGrps "'.$this->extConf['files']['fileGrpImages'].'"'); |
|
248 | 248 | } |
249 | 249 | return $image; |
250 | 250 | } |
@@ -188,7 +188,7 @@ discard block |
||
188 | 188 | { |
189 | 189 | $file = $this->getFileInfo($id); |
190 | 190 | if ($file['mimeType'] === 'application/vnd.kitodo.iiif') { |
191 | - $file['location'] = (strrpos($file['location'], 'info.json') === strlen($file['location']) - 9) ? $file['location'] : (strrpos($file['location'], '/') === strlen($file['location']) ? $file['location'] . 'info.json' : $file['location'] . '/info.json'); |
|
191 | + $file['location'] = (strrpos($file['location'], 'info.json') === strlen($file['location']) - 9) ? $file['location'] : (strrpos($file['location'], '/') === strlen($file['location']) ? $file['location'].'info.json' : $file['location'].'/info.json'); |
|
192 | 192 | $conf = GeneralUtility::makeInstance(ExtensionConfiguration::class)->get(self::$extKey, 'iiif'); |
193 | 193 | IiifHelper::setUrlReader(IiifUrlReader::getInstance()); |
194 | 194 | IiifHelper::setMaxThumbnailHeight($conf['thumbnailHeight']); |
@@ -198,9 +198,9 @@ discard block |
||
198 | 198 | return $service->getImageUrl(); |
199 | 199 | } |
200 | 200 | } elseif ($file['mimeType'] === 'application/vnd.netfpx') { |
201 | - $baseURL = $file['location'] . (strpos($file['location'], '?') === false ? '?' : ''); |
|
201 | + $baseURL = $file['location'].(strpos($file['location'], '?') === false ? '?' : ''); |
|
202 | 202 | // TODO CVT is an optional IIP server capability; in theory, capabilities should be determined in the object request with '&obj=IIP-server' |
203 | - return $baseURL . '&CVT=jpeg'; |
|
203 | + return $baseURL.'&CVT=jpeg'; |
|
204 | 204 | } |
205 | 205 | return $file['location']; |
206 | 206 | } |
@@ -229,14 +229,14 @@ discard block |
||
229 | 229 | */ |
230 | 230 | public function getFileLocation(string $id): string |
231 | 231 | { |
232 | - $location = $this->mets->xpath('./mets:fileSec/mets:fileGrp/mets:file[@ID="' . $id . '"]/mets:FLocat[@LOCTYPE="URL"]'); |
|
232 | + $location = $this->mets->xpath('./mets:fileSec/mets:fileGrp/mets:file[@ID="'.$id.'"]/mets:FLocat[@LOCTYPE="URL"]'); |
|
233 | 233 | if ( |
234 | 234 | !empty($id) |
235 | 235 | && !empty($location) |
236 | 236 | ) { |
237 | 237 | return (string) $location[0]->attributes('http://www.w3.org/1999/xlink')->href; |
238 | 238 | } else { |
239 | - $this->logger->warning('There is no file node with @ID "' . $id . '"'); |
|
239 | + $this->logger->warning('There is no file node with @ID "'.$id.'"'); |
|
240 | 240 | return ''; |
241 | 241 | } |
242 | 242 | } |
@@ -246,14 +246,14 @@ discard block |
||
246 | 246 | */ |
247 | 247 | public function getFileMimeType(string $id): string |
248 | 248 | { |
249 | - $mimetype = $this->mets->xpath('./mets:fileSec/mets:fileGrp/mets:file[@ID="' . $id . '"]/@MIMETYPE'); |
|
249 | + $mimetype = $this->mets->xpath('./mets:fileSec/mets:fileGrp/mets:file[@ID="'.$id.'"]/@MIMETYPE'); |
|
250 | 250 | if ( |
251 | 251 | !empty($id) |
252 | 252 | && !empty($mimetype) |
253 | 253 | ) { |
254 | 254 | return (string) $mimetype[0]; |
255 | 255 | } else { |
256 | - $this->logger->warning('There is no file node with @ID "' . $id . '" or no MIME type specified'); |
|
256 | + $this->logger->warning('There is no file node with @ID "'.$id.'" or no MIME type specified'); |
|
257 | 257 | return ''; |
258 | 258 | } |
259 | 259 | } |
@@ -273,7 +273,7 @@ discard block |
||
273 | 273 | return $this->logicalUnits[$id]; |
274 | 274 | } elseif (!empty($id)) { |
275 | 275 | // Get specified logical unit. |
276 | - $divs = $this->mets->xpath('./mets:structMap[@TYPE="LOGICAL"]//mets:div[@ID="' . $id . '"]'); |
|
276 | + $divs = $this->mets->xpath('./mets:structMap[@TYPE="LOGICAL"]//mets:div[@ID="'.$id.'"]'); |
|
277 | 277 | } else { |
278 | 278 | // Get all logical units at top level. |
279 | 279 | $divs = $this->mets->xpath('./mets:structMap[@TYPE="LOGICAL"]/mets:div'); |
@@ -461,7 +461,7 @@ discard block |
||
461 | 461 | $cPid = max($cPid, 0); |
462 | 462 | if ($cPid == 0 && ($this->cPid || $this->pid)) { |
463 | 463 | // Retain current PID. |
464 | - $cPid = $this->cPid ?: $this->pid; |
|
464 | + $cPid = $this->cPid ? : $this->pid; |
|
465 | 465 | } |
466 | 466 | return $cPid; |
467 | 467 | } |
@@ -528,7 +528,7 @@ discard block |
||
528 | 528 | if (isset($this->fileInfos[$id]) || isset($hasMetadataSection['dmdSec'])) { |
529 | 529 | return $metadata; |
530 | 530 | } else { |
531 | - $this->logger->warning('No supported descriptive metadata found for logical structure with @ID "' . $id . '"'); |
|
531 | + $this->logger->warning('No supported descriptive metadata found for logical structure with @ID "'.$id.'"'); |
|
532 | 532 | return []; |
533 | 533 | } |
534 | 534 | } |
@@ -547,7 +547,7 @@ discard block |
||
547 | 547 | if (!empty($this->logicalUnits[$id])) { |
548 | 548 | return [$this->logicalUnits[$id]['type']]; |
549 | 549 | } else { |
550 | - $struct = $this->mets->xpath('./mets:structMap[@TYPE="LOGICAL"]//mets:div[@ID="' . $id . '"]/@TYPE'); |
|
550 | + $struct = $this->mets->xpath('./mets:structMap[@TYPE="LOGICAL"]//mets:div[@ID="'.$id.'"]/@TYPE'); |
|
551 | 551 | if (!empty($struct)) { |
552 | 552 | return [(string) $struct[0]]; |
553 | 553 | } |
@@ -674,13 +674,13 @@ discard block |
||
674 | 674 | if ($resArray['format'] > 0 && !empty($resArray['xpath_sorting'])) { |
675 | 675 | $values = $domXPath->evaluate($resArray['xpath_sorting'], $domNode); |
676 | 676 | if ($values instanceof \DOMNodeList && $values->length > 0) { |
677 | - $metadata[$resArray['index_name'] . '_sorting'][0] = trim((string) $values->item(0)->nodeValue); |
|
677 | + $metadata[$resArray['index_name'].'_sorting'][0] = trim((string) $values->item(0)->nodeValue); |
|
678 | 678 | } elseif (!($values instanceof \DOMNodeList)) { |
679 | - $metadata[$resArray['index_name'] . '_sorting'][0] = trim((string) $values); |
|
679 | + $metadata[$resArray['index_name'].'_sorting'][0] = trim((string) $values); |
|
680 | 680 | } |
681 | 681 | } |
682 | - if (empty($metadata[$resArray['index_name'] . '_sorting'][0])) { |
|
683 | - $metadata[$resArray['index_name'] . '_sorting'][0] = $metadata[$resArray['index_name']][0]; |
|
682 | + if (empty($metadata[$resArray['index_name'].'_sorting'][0])) { |
|
683 | + $metadata[$resArray['index_name'].'_sorting'][0] = $metadata[$resArray['index_name']][0]; |
|
684 | 684 | } |
685 | 685 | } |
686 | 686 | } |
@@ -740,11 +740,11 @@ discard block |
||
740 | 740 | return true; |
741 | 741 | } |
742 | 742 | } else { |
743 | - $this->logger->warning('Invalid class/method "' . $class . '->extractMetadata()" for metadata format "' . $this->mdSec[$dmdId]['type'] . '"'); |
|
743 | + $this->logger->warning('Invalid class/method "'.$class.'->extractMetadata()" for metadata format "'.$this->mdSec[$dmdId]['type'].'"'); |
|
744 | 744 | } |
745 | 745 | } |
746 | 746 | } else { |
747 | - $this->logger->notice('Unsupported metadata format "' . $this->mdSec[$dmdId]['type'] . '" in ' . $mdSectionType . ' with @ID "' . $dmdId . '"'); |
|
747 | + $this->logger->notice('Unsupported metadata format "'.$this->mdSec[$dmdId]['type'].'" in '.$mdSectionType.' with @ID "'.$dmdId.'"'); |
|
748 | 748 | } |
749 | 749 | return false; |
750 | 750 | } |
@@ -851,7 +851,7 @@ discard block |
||
851 | 851 | $dmdIds = $this->logicalUnits[$id]['dmdId'] ?? ''; |
852 | 852 | $admIds = $this->logicalUnits[$id]['admId'] ?? ''; |
853 | 853 | } else { |
854 | - $mdSec = $this->mets->xpath('./mets:structMap[@TYPE="LOGICAL"]//mets:div[@ID="' . $id . '"]')[0]; |
|
854 | + $mdSec = $this->mets->xpath('./mets:structMap[@TYPE="LOGICAL"]//mets:div[@ID="'.$id.'"]')[0]; |
|
855 | 855 | if ($mdSec) { |
856 | 856 | $dmdIds = (string) $mdSec->attributes()->DMDID; |
857 | 857 | $admIds = (string) $mdSec->attributes()->ADMID; |
@@ -881,7 +881,7 @@ discard block |
||
881 | 881 | |
882 | 882 | return array_filter( |
883 | 883 | $allMdIds, |
884 | - function ($element) { |
|
884 | + function($element) { |
|
885 | 885 | return !empty($element); |
886 | 886 | } |
887 | 887 | ); |
@@ -907,7 +907,7 @@ discard block |
||
907 | 907 | */ |
908 | 908 | public function getStructureDepth(string $logId) |
909 | 909 | { |
910 | - $ancestors = $this->mets->xpath('./mets:structMap[@TYPE="LOGICAL"]//mets:div[@ID="' . $logId . '"]/ancestor::*'); |
|
910 | + $ancestors = $this->mets->xpath('./mets:structMap[@TYPE="LOGICAL"]//mets:div[@ID="'.$logId.'"]/ancestor::*'); |
|
911 | 911 | if (!empty($ancestors)) { |
912 | 912 | return count($ancestors); |
913 | 913 | } else { |
@@ -931,9 +931,9 @@ discard block |
||
931 | 931 | $this->registerNamespaces($this->mets); |
932 | 932 | } else { |
933 | 933 | if (!empty($location)) { |
934 | - $this->logger->error('No METS part found in document with location "' . $location . '".'); |
|
934 | + $this->logger->error('No METS part found in document with location "'.$location.'".'); |
|
935 | 935 | } elseif (!empty($this->recordId)) { |
936 | - $this->logger->error('No METS part found in document with recordId "' . $this->recordId . '".'); |
|
936 | + $this->logger->error('No METS part found in document with recordId "'.$this->recordId.'".'); |
|
937 | 937 | } else { |
938 | 938 | $this->logger->error('No METS part found in current document.'); |
939 | 939 | } |
@@ -954,7 +954,7 @@ discard block |
||
954 | 954 | return true; |
955 | 955 | } |
956 | 956 | } |
957 | - $this->logger->error('Could not load XML file from "' . $location . '"'); |
|
957 | + $this->logger->error('Could not load XML file from "'.$location.'"'); |
|
958 | 958 | return false; |
959 | 959 | } |
960 | 960 | |
@@ -1077,10 +1077,10 @@ discard block |
||
1077 | 1077 | |
1078 | 1078 | if (!empty($mdType) && !empty($this->formats[(string) $mdType[0]])) { |
1079 | 1079 | $type = (string) $mdType[0]; |
1080 | - $xml = $element->xpath('./mets:mdWrap[@MDTYPE="' . $type . '"]/mets:xmlData/' . strtolower($type) . ':' . $this->formats[$type]['rootElement']); |
|
1080 | + $xml = $element->xpath('./mets:mdWrap[@MDTYPE="'.$type.'"]/mets:xmlData/'.strtolower($type).':'.$this->formats[$type]['rootElement']); |
|
1081 | 1081 | } elseif (!empty($otherMdType) && !empty($this->formats[(string) $otherMdType[0]])) { |
1082 | 1082 | $type = (string) $otherMdType[0]; |
1083 | - $xml = $element->xpath('./mets:mdWrap[@MDTYPE="OTHER"][@OTHERMDTYPE="' . $type . '"]/mets:xmlData/' . strtolower($type) . ':' . $this->formats[$type]['rootElement']); |
|
1083 | + $xml = $element->xpath('./mets:mdWrap[@MDTYPE="OTHER"][@OTHERMDTYPE="'.$type.'"]/mets:xmlData/'.strtolower($type).':'.$this->formats[$type]['rootElement']); |
|
1084 | 1084 | } |
1085 | 1085 | |
1086 | 1086 | if (empty($xml)) { |
@@ -1273,9 +1273,9 @@ discard block |
||
1273 | 1273 | || $forceReload |
1274 | 1274 | ) { |
1275 | 1275 | // Retain current PID. |
1276 | - $cPid = $this->cPid ?: $this->pid; |
|
1276 | + $cPid = $this->cPid ? : $this->pid; |
|
1277 | 1277 | if (!$cPid) { |
1278 | - $this->logger->error('Invalid PID ' . $cPid . ' for structure definitions'); |
|
1278 | + $this->logger->error('Invalid PID '.$cPid.' for structure definitions'); |
|
1279 | 1279 | $this->thumbnailLoaded = true; |
1280 | 1280 | return $this->thumbnail; |
1281 | 1281 | } |
@@ -1312,7 +1312,7 @@ discard block |
||
1312 | 1312 | if (!empty($resArray['thumbnail'])) { |
1313 | 1313 | $strctType = Helper::getIndexNameFromUid($resArray['thumbnail'], 'tx_dlf_structures', $cPid); |
1314 | 1314 | // Check if this document has a structure element of the desired type. |
1315 | - $strctIds = $this->mets->xpath('./mets:structMap[@TYPE="LOGICAL"]//mets:div[@TYPE="' . $strctType . '"]/@ID'); |
|
1315 | + $strctIds = $this->mets->xpath('./mets:structMap[@TYPE="LOGICAL"]//mets:div[@TYPE="'.$strctType.'"]/@ID'); |
|
1316 | 1316 | if (!empty($strctIds)) { |
1317 | 1317 | $strctId = (string) $strctIds[0]; |
1318 | 1318 | } |
@@ -1335,7 +1335,7 @@ discard block |
||
1335 | 1335 | } |
1336 | 1336 | } |
1337 | 1337 | } else { |
1338 | - $this->logger->error('No structure of type "' . $metadata['type'][0] . '" found in database'); |
|
1338 | + $this->logger->error('No structure of type "'.$metadata['type'][0].'" found in database'); |
|
1339 | 1339 | } |
1340 | 1340 | $this->thumbnailLoaded = true; |
1341 | 1341 | } |
@@ -1381,7 +1381,7 @@ discard block |
||
1381 | 1381 | { |
1382 | 1382 | if (empty($this->parentHref)) { |
1383 | 1383 | // Get the closest ancestor of the current document which has a MPTR child. |
1384 | - $parentMptr = $this->mets->xpath('./mets:structMap[@TYPE="LOGICAL"]//mets:div[@ID="' . $this->toplevelId . '"]/ancestor::mets:div[./mets:mptr][1]/mets:mptr'); |
|
1384 | + $parentMptr = $this->mets->xpath('./mets:structMap[@TYPE="LOGICAL"]//mets:div[@ID="'.$this->toplevelId.'"]/ancestor::mets:div[./mets:mptr][1]/mets:mptr'); |
|
1385 | 1385 | if (!empty($parentMptr)) { |
1386 | 1386 | $this->parentHref = (string) $parentMptr[0]->attributes('http://www.w3.org/1999/xlink')->href; |
1387 | 1387 | } |
@@ -66,20 +66,20 @@ |
||
66 | 66 | $_EXTKEY = 'dlf'; |
67 | 67 | // Register tools for toolbox plugin. |
68 | 68 | $GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['dlf/Classes/Plugin/Toolbox.php']['tools'] = []; |
69 | -$GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['dlf/Classes/Plugin/Toolbox.php']['tools'][\TYPO3\CMS\Core\Utility\ExtensionManagementUtility::getCN($_EXTKEY) . '_fulltexttool'] = 'LLL:EXT:dlf/Resources/Private/Language/locallang_labels.xlf:tx_dlf_toolbox.fulltexttool'; |
|
70 | -$GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['dlf/Classes/Plugin/Toolbox.php']['tools'][\TYPO3\CMS\Core\Utility\ExtensionManagementUtility::getCN($_EXTKEY) . '_annotationtool'] = 'LLL:EXT:dlf/Resources/Private/Language/locallang_labels.xlf:tx_dlf_toolbox.annotationtool'; |
|
71 | -$GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['dlf/Classes/Plugin/Toolbox.php']['tools'][\TYPO3\CMS\Core\Utility\ExtensionManagementUtility::getCN($_EXTKEY) . '_fulltextdownloadtool'] = 'LLL:EXT:dlf/Resources/Private/Language/locallang_labels.xlf:tx_dlf_toolbox.fulltextdownloadtool'; |
|
72 | -$GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['dlf/Classes/Plugin/Toolbox.php']['tools'][\TYPO3\CMS\Core\Utility\ExtensionManagementUtility::getCN($_EXTKEY) . '_imagedownloadtool'] = 'LLL:EXT:dlf/Resources/Private/Language/locallang_labels.xlf:tx_dlf_toolbox.imagedownloadtool'; |
|
73 | -$GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['dlf/Classes/Plugin/Toolbox.php']['tools'][\TYPO3\CMS\Core\Utility\ExtensionManagementUtility::getCN($_EXTKEY) . '_imagemanipulationtool'] = 'LLL:EXT:dlf/Resources/Private/Language/locallang_labels.xlf:tx_dlf_toolbox.imagemanipulationtool'; |
|
74 | -$GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['dlf/Classes/Plugin/Toolbox.php']['tools'][\TYPO3\CMS\Core\Utility\ExtensionManagementUtility::getCN($_EXTKEY) . '_pdfdownloadtool'] = 'LLL:EXT:dlf/Resources/Private/Language/locallang_labels.xlf:tx_dlf_toolbox.pdfdownloadtool'; |
|
75 | -$GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['dlf/Classes/Plugin/Toolbox.php']['tools'][\TYPO3\CMS\Core\Utility\ExtensionManagementUtility::getCN($_EXTKEY) . '_searchindocumenttool'] = 'LLL:EXT:dlf/Resources/Private/Language/locallang_labels.xlf:tx_dlf_toolbox.searchindocumenttool'; |
|
69 | +$GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['dlf/Classes/Plugin/Toolbox.php']['tools'][\TYPO3\CMS\Core\Utility\ExtensionManagementUtility::getCN($_EXTKEY).'_fulltexttool'] = 'LLL:EXT:dlf/Resources/Private/Language/locallang_labels.xlf:tx_dlf_toolbox.fulltexttool'; |
|
70 | +$GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['dlf/Classes/Plugin/Toolbox.php']['tools'][\TYPO3\CMS\Core\Utility\ExtensionManagementUtility::getCN($_EXTKEY).'_annotationtool'] = 'LLL:EXT:dlf/Resources/Private/Language/locallang_labels.xlf:tx_dlf_toolbox.annotationtool'; |
|
71 | +$GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['dlf/Classes/Plugin/Toolbox.php']['tools'][\TYPO3\CMS\Core\Utility\ExtensionManagementUtility::getCN($_EXTKEY).'_fulltextdownloadtool'] = 'LLL:EXT:dlf/Resources/Private/Language/locallang_labels.xlf:tx_dlf_toolbox.fulltextdownloadtool'; |
|
72 | +$GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['dlf/Classes/Plugin/Toolbox.php']['tools'][\TYPO3\CMS\Core\Utility\ExtensionManagementUtility::getCN($_EXTKEY).'_imagedownloadtool'] = 'LLL:EXT:dlf/Resources/Private/Language/locallang_labels.xlf:tx_dlf_toolbox.imagedownloadtool'; |
|
73 | +$GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['dlf/Classes/Plugin/Toolbox.php']['tools'][\TYPO3\CMS\Core\Utility\ExtensionManagementUtility::getCN($_EXTKEY).'_imagemanipulationtool'] = 'LLL:EXT:dlf/Resources/Private/Language/locallang_labels.xlf:tx_dlf_toolbox.imagemanipulationtool'; |
|
74 | +$GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['dlf/Classes/Plugin/Toolbox.php']['tools'][\TYPO3\CMS\Core\Utility\ExtensionManagementUtility::getCN($_EXTKEY).'_pdfdownloadtool'] = 'LLL:EXT:dlf/Resources/Private/Language/locallang_labels.xlf:tx_dlf_toolbox.pdfdownloadtool'; |
|
75 | +$GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['dlf/Classes/Plugin/Toolbox.php']['tools'][\TYPO3\CMS\Core\Utility\ExtensionManagementUtility::getCN($_EXTKEY).'_searchindocumenttool'] = 'LLL:EXT:dlf/Resources/Private/Language/locallang_labels.xlf:tx_dlf_toolbox.searchindocumenttool'; |
|
76 | 76 | // Register hooks. |
77 | 77 | $GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['t3lib/class.t3lib_tcemain.php']['processDatamapClass'][] = \Kitodo\Dlf\Hooks\DataHandler::class; |
78 | 78 | $GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['t3lib/class.t3lib_tcemain.php']['processCmdmapClass'][] = \Kitodo\Dlf\Hooks\DataHandler::class; |
79 | 79 | $GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['dlf/Classes/Common/MetsDocument.php']['hookClass'][] = \Kitodo\Dlf\Hooks\KitodoProductionHacks::class; |
80 | 80 | // Register AJAX eID handlers. |
81 | 81 | if ($GLOBALS['TYPO3_CONF_VARS']['EXTENSIONS']['dlf']['general']['enableInternalProxy'] ?? false) { |
82 | - $GLOBALS['TYPO3_CONF_VARS']['FE']['eID_include']['tx_dlf_pageview_proxy'] = \Kitodo\Dlf\Eid\PageViewProxy::class . '::main'; |
|
82 | + $GLOBALS['TYPO3_CONF_VARS']['FE']['eID_include']['tx_dlf_pageview_proxy'] = \Kitodo\Dlf\Eid\PageViewProxy::class.'::main'; |
|
83 | 83 | } |
84 | 84 | // Use Caching Framework for Solr queries |
85 | 85 | if (!isset($GLOBALS['TYPO3_CONF_VARS']['SYS']['caching']['cacheConfigurations']['tx_dlf_solr']) || !is_array($GLOBALS['TYPO3_CONF_VARS']['SYS']['caching']['cacheConfigurations']['tx_dlf_solr'])) { |
@@ -21,14 +21,14 @@ |
||
21 | 21 | { |
22 | 22 | parent::setUp(); |
23 | 23 | |
24 | - $this->importCSVDataSet(__DIR__ . '/../../Fixtures/Common/documents_1.csv'); |
|
25 | - $this->importCSVDataSet(__DIR__ . '/../../Fixtures/Common/metadata.csv'); |
|
26 | - $this->importCSVDataSet(__DIR__ . '/../../Fixtures/MetsDocument/metadata_mets.csv'); |
|
24 | + $this->importCSVDataSet(__DIR__.'/../../Fixtures/Common/documents_1.csv'); |
|
25 | + $this->importCSVDataSet(__DIR__.'/../../Fixtures/Common/metadata.csv'); |
|
26 | + $this->importCSVDataSet(__DIR__.'/../../Fixtures/MetsDocument/metadata_mets.csv'); |
|
27 | 27 | } |
28 | 28 | |
29 | 29 | protected function doc(string $file) |
30 | 30 | { |
31 | - $url = 'http://web:8001/Tests/Fixtures/MetsDocument/' . $file; |
|
31 | + $url = 'http://web:8001/Tests/Fixtures/MetsDocument/'.$file; |
|
32 | 32 | $doc = AbstractDocument::getInstance($url, ['general' => ['useExternalApisForMetadata' => 0]]); |
33 | 33 | self::assertNotNull($doc); |
34 | 34 | return $doc; |
@@ -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 |