@@ -62,7 +62,7 @@ discard block |
||
62 | 62 | |
63 | 63 | if (isset($submittedData['doc']) && empty($submittedData['doc'])) { |
64 | 64 | Helper::addMessage( |
65 | - Helper::getLanguageService()->getLL('additionalFields.doc') . ' ' . Helper::getLanguageService()->getLL('additionalFields.valid'), |
|
65 | + Helper::getLanguageService()->getLL('additionalFields.doc').' '.Helper::getLanguageService()->getLL('additionalFields.valid'), |
|
66 | 66 | $messageTitle, |
67 | 67 | $messageSeverity, |
68 | 68 | true, |
@@ -73,7 +73,7 @@ discard block |
||
73 | 73 | |
74 | 74 | if ((isset($submittedData['pid']) && (int) $submittedData['pid'] <= 0) || !isset($submittedData['pid'])) { |
75 | 75 | Helper::addMessage( |
76 | - Helper::getLanguageService()->getLL('additionalFields.pid') . ' ' . Helper::getLanguageService()->getLL('additionalFields.valid'), |
|
76 | + Helper::getLanguageService()->getLL('additionalFields.pid').' '.Helper::getLanguageService()->getLL('additionalFields.valid'), |
|
77 | 77 | $messageTitle, |
78 | 78 | $messageSeverity, |
79 | 79 | true, |
@@ -89,7 +89,7 @@ discard block |
||
89 | 89 | |
90 | 90 | if ((isset($submittedData['lib']) && (int) $submittedData['lib'] <= 0)) { |
91 | 91 | Helper::addMessage( |
92 | - Helper::getLanguageService()->getLL('additionalFields.lib') . ' ' . Helper::getLanguageService()->getLL('additionalFields.valid'), |
|
92 | + Helper::getLanguageService()->getLL('additionalFields.lib').' '.Helper::getLanguageService()->getLL('additionalFields.valid'), |
|
93 | 93 | $messageTitle, |
94 | 94 | $messageSeverity, |
95 | 95 | true, |
@@ -100,7 +100,7 @@ discard block |
||
100 | 100 | |
101 | 101 | if ((isset($submittedData['solr']) && (int) $submittedData['solr'] <= 0) || !isset($submittedData['solr'])) { |
102 | 102 | Helper::addMessage( |
103 | - Helper::getLanguageService()->getLL('additionalFields.solr') . ' ' . Helper::getLanguageService()->getLL('additionalFields.valid'), |
|
103 | + Helper::getLanguageService()->getLL('additionalFields.solr').' '.Helper::getLanguageService()->getLL('additionalFields.valid'), |
|
104 | 104 | $messageTitle, |
105 | 105 | $messageSeverity, |
106 | 106 | true, |
@@ -178,8 +178,8 @@ discard block |
||
178 | 178 | protected function getDryRunField(bool $dryRun): array |
179 | 179 | { |
180 | 180 | $fieldName = 'dryRun'; |
181 | - $fieldId = 'task_' . $fieldName; |
|
182 | - $fieldHtml = '<input type="checkbox" name="tx_scheduler[' . $fieldName . ']" id="' . $fieldId . '" value="1"' . ($dryRun ? ' checked="checked"' : '') . '>'; |
|
181 | + $fieldId = 'task_'.$fieldName; |
|
182 | + $fieldHtml = '<input type="checkbox" name="tx_scheduler['.$fieldName.']" id="'.$fieldId.'" value="1"'.($dryRun ? ' checked="checked"' : '').'>'; |
|
183 | 183 | return [ |
184 | 184 | 'code' => $fieldHtml, |
185 | 185 | 'label' => 'LLL:EXT:dlf/Resources/Private/Language/locallang_tasks.xlf:additionalFields.dryRun', |
@@ -201,15 +201,15 @@ discard block |
||
201 | 201 | protected function getSolrField(int $solr, int $pid): array |
202 | 202 | { |
203 | 203 | $fieldName = 'solr'; |
204 | - $fieldId = 'task_' . $fieldName; |
|
204 | + $fieldId = 'task_'.$fieldName; |
|
205 | 205 | |
206 | 206 | $allSolrCores = $this->getSolrCores($pid); |
207 | 207 | $options = []; |
208 | 208 | $options[] = '<option value="-1"></option>'; |
209 | 209 | foreach ($allSolrCores as $label => $uid) { |
210 | - $options[] = '<option value="' . $uid . '" ' . ($solr == $uid ? 'selected' : '') . ' >' . $label . '</option>'; |
|
210 | + $options[] = '<option value="'.$uid.'" '.($solr == $uid ? 'selected' : '').' >'.$label.'</option>'; |
|
211 | 211 | }; |
212 | - $fieldHtml = '<select name="tx_scheduler[' . $fieldName . ']" id="' . $fieldId . '">' . implode("\n", $options) . '</select>'; |
|
212 | + $fieldHtml = '<select name="tx_scheduler['.$fieldName.']" id="'.$fieldId.'">'.implode("\n", $options).'</select>'; |
|
213 | 213 | return [ |
214 | 214 | 'code' => $fieldHtml, |
215 | 215 | 'label' => 'LLL:EXT:dlf/Resources/Private/Language/locallang_tasks.xlf:additionalFields.solr', |
@@ -230,7 +230,7 @@ discard block |
||
230 | 230 | protected function getPidField(int $pid): array |
231 | 231 | { |
232 | 232 | $fieldName = 'pid'; |
233 | - $fieldId = 'task_' . $fieldName; |
|
233 | + $fieldId = 'task_'.$fieldName; |
|
234 | 234 | |
235 | 235 | $pageRepository = GeneralUtility::makeInstance(PageTreeRepository::class); |
236 | 236 | $pages = $pageRepository->getTree(0); |
@@ -238,11 +238,11 @@ discard block |
||
238 | 238 | $options = []; |
239 | 239 | foreach ($pages['_children'] as $page) { |
240 | 240 | if ($page['doktype'] == 254) { |
241 | - $options[] = '<option value="' . $page['uid'] . '" ' . ($pid == $page['uid'] ? 'selected' : '') . ' >' . $page['title'] . '</option>'; |
|
241 | + $options[] = '<option value="'.$page['uid'].'" '.($pid == $page['uid'] ? 'selected' : '').' >'.$page['title'].'</option>'; |
|
242 | 242 | } |
243 | 243 | } |
244 | 244 | |
245 | - $fieldHtml = '<select name="tx_scheduler[' . $fieldName . ']" id="' . $fieldId . '">' . implode("\n", $options) . '</select>'; |
|
245 | + $fieldHtml = '<select name="tx_scheduler['.$fieldName.']" id="'.$fieldId.'">'.implode("\n", $options).'</select>'; |
|
246 | 246 | return [ |
247 | 247 | 'code' => $fieldHtml, |
248 | 248 | 'label' => 'LLL:EXT:dlf/Resources/Private/Language/locallang_tasks.xlf:additionalFields.pid', |
@@ -263,8 +263,8 @@ discard block |
||
263 | 263 | protected function getOwnerField(string $owner): array |
264 | 264 | { |
265 | 265 | $fieldName = 'owner'; |
266 | - $fieldId = 'task_' . $fieldName; |
|
267 | - $fieldHtml = '<input type="text" name="tx_scheduler[' . $fieldName . ']" id="' . $fieldId . '" value="' . $owner . '" >'; |
|
266 | + $fieldId = 'task_'.$fieldName; |
|
267 | + $fieldHtml = '<input type="text" name="tx_scheduler['.$fieldName.']" id="'.$fieldId.'" value="'.$owner.'" >'; |
|
268 | 268 | return [ |
269 | 269 | 'code' => $fieldHtml, |
270 | 270 | 'label' => 'LLL:EXT:dlf/Resources/Private/Language/locallang_tasks.xlf:additionalFields.owner', |
@@ -63,10 +63,10 @@ discard block |
||
63 | 63 | |
64 | 64 | // Select for collection(s) |
65 | 65 | $fieldName = 'coll'; |
66 | - $fieldId = 'task_' . $fieldName; |
|
66 | + $fieldId = 'task_'.$fieldName; |
|
67 | 67 | $options = $this->getCollOptions($taskInfo['coll'], $taskInfo['pid']); |
68 | 68 | ; |
69 | - $fieldHtml = '<select name="tx_scheduler[' . $fieldName . '][]" id="' . $fieldId . '" size="10" multiple="multiple">' . implode("\n", $options) . '</select>'; |
|
69 | + $fieldHtml = '<select name="tx_scheduler['.$fieldName.'][]" id="'.$fieldId.'" size="10" multiple="multiple">'.implode("\n", $options).'</select>'; |
|
70 | 70 | $additionalFields[$fieldId] = [ |
71 | 71 | 'code' => $fieldHtml, |
72 | 72 | 'label' => 'LLL:EXT:dlf/Resources/Private/Language/locallang_tasks.xlf:additionalFields.coll', |
@@ -85,9 +85,9 @@ discard block |
||
85 | 85 | |
86 | 86 | // Checkbox for all |
87 | 87 | $fieldName = 'all'; |
88 | - $fieldId = 'task_' . $fieldName; |
|
89 | - $fieldHtml = '<input type="checkbox" name="tx_scheduler[' . $fieldName . ']" id="' . $fieldId . '" value="1"' . |
|
90 | - ($taskInfo['all'] ? ' checked="checked"' : '') . '>'; |
|
88 | + $fieldId = 'task_'.$fieldName; |
|
89 | + $fieldHtml = '<input type="checkbox" name="tx_scheduler['.$fieldName.']" id="'.$fieldId.'" value="1"'. |
|
90 | + ($taskInfo['all'] ? ' checked="checked"' : '').'>'; |
|
91 | 91 | $additionalFields[$fieldId] = [ |
92 | 92 | 'code' => $fieldHtml, |
93 | 93 | 'label' => 'LLL:EXT:dlf/Resources/Private/Language/locallang_tasks.xlf:additionalFields.all', |
@@ -111,7 +111,7 @@ discard block |
||
111 | 111 | $options = []; |
112 | 112 | $collections = $this->getCollections($pid); |
113 | 113 | foreach ($collections as $label => $uid) { |
114 | - $options[] = '<option value="' . $uid . '" ' . (in_array($uid, $coll) ? 'selected' : '') . ' >' . $label . '</option>'; |
|
114 | + $options[] = '<option value="'.$uid.'" '.(in_array($uid, $coll) ? 'selected' : '').' >'.$label.'</option>'; |
|
115 | 115 | } |
116 | 116 | return $options; |
117 | 117 | } |
@@ -105,7 +105,7 @@ discard block |
||
105 | 105 | $pageOptions = []; |
106 | 106 | for ($i = 1; $i <= $this->document->getCurrentDocument()->numPages; $i++) { |
107 | 107 | $orderLabel = $this->document->getCurrentDocument()->physicalStructureInfo[$this->document->getCurrentDocument()->physicalStructure[$i]]['orderlabel']; |
108 | - $pageOptions[$i] = '[' . $i . ']' . ($orderLabel ? ' - ' . htmlspecialchars($orderLabel) : ''); |
|
108 | + $pageOptions[$i] = '['.$i.']'.($orderLabel ? ' - '.htmlspecialchars($orderLabel) : ''); |
|
109 | 109 | } |
110 | 110 | |
111 | 111 | $this->view->assign('pageOptions', $pageOptions); |
@@ -122,7 +122,7 @@ discard block |
||
122 | 122 | $measureOptions = []; |
123 | 123 | $measurePages = []; |
124 | 124 | for ($i = 1; $i <= $this->document->getCurrentDocument()->numMeasures; $i++) { |
125 | - $measureOptions[$i] = '[' . $i . ']' . ($this->document->getCurrentDocument()->musicalStructureInfo[$this->document->getCurrentDocument()->musicalStructure[$i]['measureid']]['orderlabel'] ? ' - ' . htmlspecialchars($this->document->getCurrentDocument()->musicalStructureInfo[$this->document->getCurrentDocument()->musicalStructureInfo[$i]]['orderlabel']) : ''); |
|
125 | + $measureOptions[$i] = '['.$i.']'.($this->document->getCurrentDocument()->musicalStructureInfo[$this->document->getCurrentDocument()->musicalStructure[$i]['measureid']]['orderlabel'] ? ' - '.htmlspecialchars($this->document->getCurrentDocument()->musicalStructureInfo[$this->document->getCurrentDocument()->musicalStructureInfo[$i]]['orderlabel']) : ''); |
|
126 | 126 | $measurePages[$i] = $this->document->getCurrentDocument()->musicalStructure[$i]['page']; |
127 | 127 | } |
128 | 128 |
@@ -102,7 +102,7 @@ discard block |
||
102 | 102 | $this->renderToolByName('renderScoreTool'); |
103 | 103 | break; |
104 | 104 | default: |
105 | - $this->logger->warning('Incorrect tool configuration: "' . $this->settings['tools'] . '". Tool "' . $tool . '" does not exist.'); |
|
105 | + $this->logger->warning('Incorrect tool configuration: "'.$this->settings['tools'].'". Tool "'.$tool.'" does not exist.'); |
|
106 | 106 | } |
107 | 107 | } |
108 | 108 | } |
@@ -301,7 +301,7 @@ discard block |
||
301 | 301 | } |
302 | 302 | break; |
303 | 303 | } else { |
304 | - $this->logger->warning('File not found in fileGrp "' . $fileGrp . '"'); |
|
304 | + $this->logger->warning('File not found in fileGrp "'.$fileGrp.'"'); |
|
305 | 305 | } |
306 | 306 | } |
307 | 307 | return $image; |
@@ -385,7 +385,7 @@ discard block |
||
385 | 385 | empty($firstPageLink) |
386 | 386 | && empty($secondPageLink) |
387 | 387 | ) { |
388 | - $this->logger->warning('File not found in fileGrps "' . $this->extConf['files']['fileGrpDownload'] . '"'); |
|
388 | + $this->logger->warning('File not found in fileGrps "'.$this->extConf['files']['fileGrpDownload'].'"'); |
|
389 | 389 | } |
390 | 390 | |
391 | 391 | if (!empty($firstPageLink)) { |
@@ -423,7 +423,7 @@ discard block |
||
423 | 423 | } |
424 | 424 | } |
425 | 425 | if (empty($workLink)) { |
426 | - $this->logger->warning('File not found in fileGrps "' . $this->extConf['files']['fileGrpDownload'] . '"'); |
|
426 | + $this->logger->warning('File not found in fileGrps "'.$this->extConf['files']['fileGrpDownload'].'"'); |
|
427 | 427 | } |
428 | 428 | return $workLink; |
429 | 429 | } |
@@ -158,11 +158,11 @@ discard block |
||
158 | 158 | if ($doc !== null) { |
159 | 159 | $this->document->setCurrentDocument($doc); |
160 | 160 | } else { |
161 | - $this->logger->error('Failed to load document with record ID "' . $this->requestData['recordId'] . '"'); |
|
161 | + $this->logger->error('Failed to load document with record ID "'.$this->requestData['recordId'].'"'); |
|
162 | 162 | } |
163 | 163 | } |
164 | 164 | } else { |
165 | - $this->logger->error('Invalid ID "' . $documentId . '" or PID "' . $this->settings['storagePid'] . '" for document loading'); |
|
165 | + $this->logger->error('Invalid ID "'.$documentId.'" or PID "'.$this->settings['storagePid'].'" for document loading'); |
|
166 | 166 | } |
167 | 167 | } |
168 | 168 | |
@@ -259,7 +259,7 @@ discard block |
||
259 | 259 | && !MathUtility::canBeInterpretedAsInteger($this->requestData['id']) |
260 | 260 | && !GeneralUtility::isValidUrl($this->requestData['id']) |
261 | 261 | ) { |
262 | - $this->logger->warning('Invalid ID or URI "' . $this->requestData['id'] . '" for document loading'); |
|
262 | + $this->logger->warning('Invalid ID or URI "'.$this->requestData['id'].'" for document loading'); |
|
263 | 263 | unset($this->requestData['id']); |
264 | 264 | } |
265 | 265 | |
@@ -355,7 +355,7 @@ discard block |
||
355 | 355 | $pages = []; |
356 | 356 | $pagesSect = []; |
357 | 357 | $aRange = []; |
358 | - $nRange = 5; // ToDo: should be made configurable |
|
358 | + $nRange = 5; // ToDo: should be made configurable |
|
359 | 359 | |
360 | 360 | // lower limit of the range |
361 | 361 | $nBottom = $currentPageNumber - $nRange; |
@@ -370,7 +370,7 @@ discard block |
||
370 | 370 | |
371 | 371 | // check whether the first screen page is > 1, if yes then points must be added |
372 | 372 | if ($aRange[0] > 1) { |
373 | - array_push($pagesSect, ['label' => '...','startRecordNumber' => '...']); |
|
373 | + array_push($pagesSect, ['label' => '...', 'startRecordNumber' => '...']); |
|
374 | 374 | }; |
375 | 375 | $lastStartRecordNumberGrid = 0; // due to validity outside the loop |
376 | 376 | foreach (range($firstPage, $lastPage) as $i) { |
@@ -413,7 +413,7 @@ discard block |
||
413 | 413 | |
414 | 414 | // Check if screen page is in range |
415 | 415 | if (in_array($i, $aRange)) { |
416 | - array_push($pagesSect, ['label' => $i,'startRecordNumber' => $startRecordNumber]); |
|
416 | + array_push($pagesSect, ['label' => $i, 'startRecordNumber' => $startRecordNumber]); |
|
417 | 417 | }; |
418 | 418 | }; |
419 | 419 | }; |
@@ -476,7 +476,7 @@ discard block |
||
476 | 476 | if ($this->document) { |
477 | 477 | $doc = AbstractDocument::getInstance($this->document->getLocation(), $this->settings, true); |
478 | 478 | } else { |
479 | - $this->logger->error('Invalid UID "' . $documentId . '" or PID "' . $this->settings['storagePid'] . '" for document loading'); |
|
479 | + $this->logger->error('Invalid UID "'.$documentId.'" or PID "'.$this->settings['storagePid'].'" for document loading'); |
|
480 | 480 | } |
481 | 481 | |
482 | 482 | return $doc; |
@@ -514,7 +514,7 @@ discard block |
||
514 | 514 | foreach ($this->requestData['multipleSource'] as $location) { |
515 | 515 | $document = AbstractDocument::getInstance($location, $this->settings, true); |
516 | 516 | if ($document !== null) { |
517 | - $this->documentArray['extra_' . $i] = $document; |
|
517 | + $this->documentArray['extra_'.$i] = $document; |
|
518 | 518 | } |
519 | 519 | $i++; |
520 | 520 | } |
@@ -538,7 +538,7 @@ discard block |
||
538 | 538 | |
539 | 539 | $this->document->setLocation($documentId); |
540 | 540 | } else { |
541 | - $this->logger->error('Invalid location given "' . $documentId . '" for document loading'); |
|
541 | + $this->logger->error('Invalid location given "'.$documentId.'" for document loading'); |
|
542 | 542 | } |
543 | 543 | |
544 | 544 | return $doc; |
@@ -181,18 +181,18 @@ discard block |
||
181 | 181 | } |
182 | 182 | |
183 | 183 | $navigationArray[$i]['next'] = [ |
184 | - 'tx_dlf[docPage][' . $i . ']' => |
|
184 | + 'tx_dlf[docPage]['.$i.']' => |
|
185 | 185 | MathUtility::forceIntegerInRange((int) $this->requestData['docPage'][$i] + 1, 1, $document->numPages, 1) |
186 | 186 | ]; |
187 | 187 | $navigationArray[$i]['prev'] = [ |
188 | - 'tx_dlf[docPage][' . $i . ']' => |
|
188 | + 'tx_dlf[docPage]['.$i.']' => |
|
189 | 189 | MathUtility::forceIntegerInRange((int) $this->requestData['docPage'][$i] - 1, 1, $document->numPages, 1) |
190 | 190 | ]; |
191 | 191 | |
192 | 192 | $navigateAllPageNext = array_merge( |
193 | 193 | $navigateAllPageNext, |
194 | 194 | [ |
195 | - 'tx_dlf[docPage][' . $i . ']' => |
|
195 | + 'tx_dlf[docPage]['.$i.']' => |
|
196 | 196 | MathUtility::forceIntegerInRange((int) $this->requestData['docPage'][$i] + 1, 1, $document->numPages, 1) |
197 | 197 | ] |
198 | 198 | ); |
@@ -200,7 +200,7 @@ discard block |
||
200 | 200 | $navigateAllPagePrev = array_merge( |
201 | 201 | $navigateAllPagePrev, |
202 | 202 | [ |
203 | - 'tx_dlf[docPage][' . $i . ']' => |
|
203 | + 'tx_dlf[docPage]['.$i.']' => |
|
204 | 204 | MathUtility::forceIntegerInRange((int) $this->requestData['docPage'][$i] - 1, 1, $document->numPages, 1) |
205 | 205 | ] |
206 | 206 | ); |
@@ -208,7 +208,7 @@ discard block |
||
208 | 208 | $navigateAllMeasureNext = array_merge( |
209 | 209 | $navigateAllMeasureNext, |
210 | 210 | [ |
211 | - 'tx_dlf[docMeasure][' . $i . ']' => |
|
211 | + 'tx_dlf[docMeasure]['.$i.']' => |
|
212 | 212 | MathUtility::forceIntegerInRange((int) $this->requestData['docMeasure'][$i] + 1, 1, $document->numMeasures, 1) |
213 | 213 | ] |
214 | 214 | ); |
@@ -216,19 +216,19 @@ discard block |
||
216 | 216 | $navigateAllMeasurePrev = array_merge( |
217 | 217 | $navigateAllMeasurePrev, |
218 | 218 | [ |
219 | - 'tx_dlf[docMeasure][' . $i . ']' => |
|
219 | + 'tx_dlf[docMeasure]['.$i.']' => |
|
220 | 220 | MathUtility::forceIntegerInRange((int) $this->requestData['docMeasure'][$i] - 1, 1, $document->numMeasures, 1) |
221 | 221 | ] |
222 | 222 | ); |
223 | 223 | |
224 | 224 | if ($document->numMeasures > 0) { |
225 | 225 | $navigationMeasureArray[$i]['next'] = [ |
226 | - 'tx_dlf[docMeasure][' . $i . ']' => |
|
226 | + 'tx_dlf[docMeasure]['.$i.']' => |
|
227 | 227 | MathUtility::forceIntegerInRange((int) $this->requestData['docMeasure'][$i] + 1, 1, $document->numMeasures, 1) |
228 | 228 | ]; |
229 | 229 | |
230 | 230 | $navigationMeasureArray[$i]['prev'] = [ |
231 | - 'tx_dlf[docMeasure][' . $i . ']' => |
|
231 | + 'tx_dlf[docMeasure]['.$i.']' => |
|
232 | 232 | MathUtility::forceIntegerInRange((int) $this->requestData['docMeasure'][$i] - 1, 1, $document->numMeasures, 1) |
233 | 233 | ]; |
234 | 234 | } |
@@ -282,7 +282,7 @@ discard block |
||
282 | 282 | } |
283 | 283 | $params = array_merge( |
284 | 284 | ['tx_dlf' => $this->requestData], |
285 | - ['tx_dlf[multipleSource][' . $nextMultipleSourceKey . ']' => $formAddDocument->getLocation()], |
|
285 | + ['tx_dlf[multipleSource]['.$nextMultipleSourceKey.']' => $formAddDocument->getLocation()], |
|
286 | 286 | ['tx_dlf[multiview]' => 1] |
287 | 287 | ); |
288 | 288 | $uriBuilder = $this->uriBuilder; |
@@ -329,7 +329,7 @@ discard block |
||
329 | 329 | // build link for each measure |
330 | 330 | $params = [ |
331 | 331 | 'tx_dlf' => $this->requestData, |
332 | - 'tx_dlf[docMeasure][' . $docNumber . ']' => $i |
|
332 | + 'tx_dlf[docMeasure]['.$docNumber.']' => $i |
|
333 | 333 | ]; |
334 | 334 | } else { |
335 | 335 | // build link for each measure |
@@ -413,7 +413,7 @@ discard block |
||
413 | 413 | } |
414 | 414 | |
415 | 415 | if (empty($score)) { |
416 | - $this->logger->notice('No score file found for page "' . $page . '" in fileGrps "' . $this->settings['fileGrpScore'] . '"'); |
|
416 | + $this->logger->notice('No score file found for page "'.$page.'" in fileGrps "'.$this->settings['fileGrpScore'].'"'); |
|
417 | 417 | } |
418 | 418 | return $score; |
419 | 419 | } |
@@ -444,11 +444,11 @@ discard block |
||
444 | 444 | $fulltext['mimetype'] = $file['mimeType']; |
445 | 445 | break; |
446 | 446 | } else { |
447 | - $this->logger->notice('No full-text file found for page "' . $page . '" in fileGrp "' . $fileGrpFulltext . '"'); |
|
447 | + $this->logger->notice('No full-text file found for page "'.$page.'" in fileGrp "'.$fileGrpFulltext.'"'); |
|
448 | 448 | } |
449 | 449 | } |
450 | 450 | if (empty($fulltext)) { |
451 | - $this->logger->notice('No full-text file found for page "' . $page . '" in fileGrps "' . $this->extConf['files']['fileGrpFulltext'] . '"'); |
|
451 | + $this->logger->notice('No full-text file found for page "'.$page.'" in fileGrps "'.$this->extConf['files']['fileGrpFulltext'].'"'); |
|
452 | 452 | } |
453 | 453 | return $fulltext; |
454 | 454 | } |
@@ -493,19 +493,19 @@ discard block |
||
493 | 493 | $currentMeasureId = $docMeasures['measureCounterToMeasureId'][$this->requestData['docMeasure'][$i]]; |
494 | 494 | } |
495 | 495 | |
496 | - $jsViewer .= 'tx_dlf_viewer[' . $i . '] = new dlfViewer({ |
|
497 | - controls: ["' . implode('", "', $this->controls) . '"], |
|
498 | - div: "tx-dfgviewer-map-' . $i . '", |
|
499 | - progressElementId: "' . $this->settings['progressElementId'] . '", |
|
500 | - counter: "' . $i . '", |
|
501 | - images: ' . json_encode($docImage) . ', |
|
502 | - fulltexts: ' . json_encode($docFulltext) . ', |
|
503 | - score: ' . json_encode($docScore) . ', |
|
504 | - annotationContainers: ' . json_encode($docAnnotationContainers) . ', |
|
505 | - measureCoords: ' . json_encode($docMeasures['measureCoordsCurrentSite']) . ', |
|
506 | - useInternalProxy: ' . ($this->settings['useInternalProxy'] ? 1 : 0) . ', |
|
507 | - currentMeasureId: "' . $currentMeasureId . '", |
|
508 | - measureIdLinks: ' . json_encode($docMeasures['measureLinks']) . ' |
|
496 | + $jsViewer .= 'tx_dlf_viewer['.$i.'] = new dlfViewer({ |
|
497 | + controls: ["' . implode('", "', $this->controls).'"], |
|
498 | + div: "tx-dfgviewer-map-' . $i.'", |
|
499 | + progressElementId: "' . $this->settings['progressElementId'].'", |
|
500 | + counter: "' . $i.'", |
|
501 | + images: ' . json_encode($docImage).', |
|
502 | + fulltexts: ' . json_encode($docFulltext).', |
|
503 | + score: ' . json_encode($docScore).', |
|
504 | + annotationContainers: ' . json_encode($docAnnotationContainers).', |
|
505 | + measureCoords: ' . json_encode($docMeasures['measureCoordsCurrentSite']).', |
|
506 | + useInternalProxy: ' . ($this->settings['useInternalProxy'] ? 1 : 0).', |
|
507 | + currentMeasureId: "' . $currentMeasureId.'", |
|
508 | + measureIdLinks: ' . json_encode($docMeasures['measureLinks']).' |
|
509 | 509 | }); |
510 | 510 | '; |
511 | 511 | $i++; |
@@ -515,8 +515,8 @@ discard block |
||
515 | 515 | // Viewer configuration. |
516 | 516 | $viewerConfiguration = '$(document).ready(function() { |
517 | 517 | if (dlfUtils.exists(dlfViewer)) { |
518 | - ' . $jsViewer . ' |
|
519 | - viewerCount = ' . ($i - 1) . '; |
|
518 | + ' . $jsViewer.' |
|
519 | + viewerCount = ' . ($i - 1).'; |
|
520 | 520 | } |
521 | 521 | });'; |
522 | 522 | } else { |
@@ -532,18 +532,18 @@ discard block |
||
532 | 532 | $viewerConfiguration = '$(document).ready(function() { |
533 | 533 | if (dlfUtils.exists(dlfViewer)) { |
534 | 534 | tx_dlf_viewer = new dlfViewer({ |
535 | - controls: ["' . implode('", "', $this->controls) . '"], |
|
536 | - div: "' . $this->settings['elementId'] . '", |
|
537 | - progressElementId: "' . $this->settings['progressElementId'] . '", |
|
538 | - images: ' . json_encode($this->images) . ', |
|
539 | - fulltexts: ' . json_encode($this->fulltexts) . ', |
|
540 | - score: ' . json_encode($this->scores) . ', |
|
541 | - annotationContainers: ' . json_encode($this->annotationContainers) . ', |
|
542 | - measureCoords: ' . json_encode($docMeasures['measureCoordsCurrentSite']) . ', |
|
543 | - useInternalProxy: ' . ($this->settings['useInternalProxy'] ? 1 : 0) . ', |
|
544 | - verovioAnnotations: ' . json_encode($this->verovioAnnotations) . ', |
|
545 | - currentMeasureId: "' . $currentMeasureId . '", |
|
546 | - measureIdLinks: ' . json_encode($docMeasures['measureLinks']) . ' |
|
535 | + controls: ["' . implode('", "', $this->controls).'"], |
|
536 | + div: "' . $this->settings['elementId'].'", |
|
537 | + progressElementId: "' . $this->settings['progressElementId'].'", |
|
538 | + images: ' . json_encode($this->images).', |
|
539 | + fulltexts: ' . json_encode($this->fulltexts).', |
|
540 | + score: ' . json_encode($this->scores).', |
|
541 | + annotationContainers: ' . json_encode($this->annotationContainers).', |
|
542 | + measureCoords: ' . json_encode($docMeasures['measureCoordsCurrentSite']).', |
|
543 | + useInternalProxy: ' . ($this->settings['useInternalProxy'] ? 1 : 0).', |
|
544 | + verovioAnnotations: ' . json_encode($this->verovioAnnotations).', |
|
545 | + currentMeasureId: "' . $currentMeasureId.'", |
|
546 | + measureIdLinks: ' . json_encode($docMeasures['measureLinks']).' |
|
547 | 547 | }); |
548 | 548 | } |
549 | 549 | });'; |
@@ -640,7 +640,7 @@ discard block |
||
640 | 640 | } |
641 | 641 | break; |
642 | 642 | } else { |
643 | - $this->logger->notice('No image file found for page "' . $page . '" in fileGrp "' . $fileGrpImages . '"'); |
|
643 | + $this->logger->notice('No image file found for page "'.$page.'" in fileGrp "'.$fileGrpImages.'"'); |
|
644 | 644 | } |
645 | 645 | |
646 | 646 | } else { |
@@ -660,12 +660,12 @@ discard block |
||
660 | 660 | } |
661 | 661 | break; |
662 | 662 | } else { |
663 | - $this->logger->notice('No image file found for page "' . $page . '" in fileGrp "' . $fileGrpImages . '"'); |
|
663 | + $this->logger->notice('No image file found for page "'.$page.'" in fileGrp "'.$fileGrpImages.'"'); |
|
664 | 664 | } |
665 | 665 | } |
666 | 666 | } |
667 | 667 | if (empty($image)) { |
668 | - $this->logger->warning('No image file found for page "' . $page . '" in fileGrps "' . $this->extConf['files']['fileGrpImages'] . '"'); |
|
668 | + $this->logger->warning('No image file found for page "'.$page.'" in fileGrps "'.$this->extConf['files']['fileGrpImages'].'"'); |
|
669 | 669 | } |
670 | 670 | return $image; |
671 | 671 | } |
@@ -24,7 +24,7 @@ discard block |
||
24 | 24 | */ |
25 | 25 | public function __construct($apiUrl) |
26 | 26 | { |
27 | - $this->apiUrl = trim($apiUrl, "/ "); |
|
27 | + $this->apiUrl = trim($apiUrl, "/ "); |
|
28 | 28 | } |
29 | 29 | |
30 | 30 | |
@@ -59,7 +59,7 @@ discard block |
||
59 | 59 | { |
60 | 60 | $annotations = []; |
61 | 61 | |
62 | - $annotationData = $this->requestAnnotions($this->apiUrl . '?target=' . urlencode($id . '/*')); |
|
62 | + $annotationData = $this->requestAnnotions($this->apiUrl.'?target='.urlencode($id.'/*')); |
|
63 | 63 | |
64 | 64 | if (array_key_exists('first', $annotationData)) { |
65 | 65 | $annotationPageData = $annotationData['first']; |
@@ -148,7 +148,7 @@ discard block |
||
148 | 148 | } elseif ($checksum == 10) { |
149 | 149 | //TODO: Binary operation "+" between string and 1 results in an error. |
150 | 150 | // @phpstan-ignore-next-line |
151 | - return self::checkIdentifier(($digits + 1) . substr($id, -2, 2), 'SWD'); |
|
151 | + return self::checkIdentifier(($digits + 1).substr($id, -2, 2), 'SWD'); |
|
152 | 152 | } elseif (substr($id, -1, 1) != $checksum) { |
153 | 153 | return false; |
154 | 154 | } |
@@ -354,7 +354,7 @@ discard block |
||
354 | 354 | $encrypted = openssl_encrypt($string, self::$cipherAlgorithm, $key, OPENSSL_RAW_DATA, $iv); |
355 | 355 | // Merge initialization vector and encrypted data. |
356 | 356 | if ($encrypted !== false) { |
357 | - $encrypted = base64_encode($iv . $encrypted); |
|
357 | + $encrypted = base64_encode($iv.$encrypted); |
|
358 | 358 | } |
359 | 359 | return $encrypted; |
360 | 360 | } |
@@ -396,8 +396,8 @@ discard block |
||
396 | 396 | public static function getHookObjects(string $scriptRelPath): array |
397 | 397 | { |
398 | 398 | $hookObjects = []; |
399 | - if (is_array(self::getOptions()[self::$extKey . '/' . $scriptRelPath]['hookClass'])) { |
|
400 | - foreach (self::getOptions()[self::$extKey . '/' . $scriptRelPath]['hookClass'] as $classRef) { |
|
399 | + if (is_array(self::getOptions()[self::$extKey.'/'.$scriptRelPath]['hookClass'])) { |
|
400 | + foreach (self::getOptions()[self::$extKey.'/'.$scriptRelPath]['hookClass'] as $classRef) { |
|
401 | 401 | $hookObjects[] = GeneralUtility::makeInstance($classRef); |
402 | 402 | } |
403 | 403 | } |
@@ -426,12 +426,12 @@ discard block |
||
426 | 426 | // NOTE: Only use tables that don't have too many entries! |
427 | 427 | || !in_array($table, ['tx_dlf_collections', 'tx_dlf_libraries', 'tx_dlf_metadata', 'tx_dlf_metadatasubentries', 'tx_dlf_structures', 'tx_dlf_solrcores']) |
428 | 428 | ) { |
429 | - self::log('Invalid UID "' . $uid . '" or table "' . $table . '"', LOG_SEVERITY_ERROR); |
|
429 | + self::log('Invalid UID "'.$uid.'" or table "'.$table.'"', LOG_SEVERITY_ERROR); |
|
430 | 430 | return ''; |
431 | 431 | } |
432 | 432 | |
433 | - $makeCacheKey = function ($pid, $uid) { |
|
434 | - return $pid . '.' . $uid; |
|
433 | + $makeCacheKey = function($pid, $uid) { |
|
434 | + return $pid.'.'.$uid; |
|
435 | 435 | }; |
436 | 436 | |
437 | 437 | static $cache = []; |
@@ -441,9 +441,9 @@ discard block |
||
441 | 441 | |
442 | 442 | $result = $queryBuilder |
443 | 443 | ->select( |
444 | - $table . '.index_name AS index_name', |
|
445 | - $table . '.uid AS uid', |
|
446 | - $table . '.pid AS pid', |
|
444 | + $table.'.index_name AS index_name', |
|
445 | + $table.'.uid AS uid', |
|
446 | + $table.'.pid AS pid', |
|
447 | 447 | ) |
448 | 448 | ->from($table) |
449 | 449 | ->execute(); |
@@ -461,7 +461,7 @@ discard block |
||
461 | 461 | $result = $cache[$table][$cacheKey] ?? ''; |
462 | 462 | |
463 | 463 | if ($result === '') { |
464 | - self::log('No "index_name" with UID ' . $uid . ' and PID ' . $pid . ' found in table "' . $table . '"', LOG_SEVERITY_WARNING); |
|
464 | + self::log('No "index_name" with UID '.$uid.' and PID '.$pid.' found in table "'.$table.'"', LOG_SEVERITY_WARNING); |
|
465 | 465 | } |
466 | 466 | |
467 | 467 | return $result; |
@@ -490,11 +490,11 @@ discard block |
||
490 | 490 | // No ISO code, return unchanged. |
491 | 491 | return $code; |
492 | 492 | } |
493 | - $lang = LocalizationUtility::translate('LLL:' . $file . ':' . $code); |
|
493 | + $lang = LocalizationUtility::translate('LLL:'.$file.':'.$code); |
|
494 | 494 | if (!empty($lang)) { |
495 | 495 | return $lang; |
496 | 496 | } else { |
497 | - self::log('Language code "' . $code . '" not found in ISO-639 table', LOG_SEVERITY_NOTICE); |
|
497 | + self::log('Language code "'.$code.'" not found in ISO-639 table', LOG_SEVERITY_NOTICE); |
|
498 | 498 | return $code; |
499 | 499 | } |
500 | 500 | } |
@@ -658,7 +658,7 @@ discard block |
||
658 | 658 | // Sanitize input. |
659 | 659 | $pid = max((int) $pid, 0); |
660 | 660 | if (!$pid) { |
661 | - self::log('Invalid PID ' . $pid . ' for translation', LOG_SEVERITY_WARNING); |
|
661 | + self::log('Invalid PID '.$pid.' for translation', LOG_SEVERITY_WARNING); |
|
662 | 662 | return $indexName; |
663 | 663 | } |
664 | 664 | /** @var PageRepository $pageRepository */ |
@@ -681,13 +681,13 @@ discard block |
||
681 | 681 | // First fetch the uid of the received index_name |
682 | 682 | $result = $queryBuilder |
683 | 683 | ->select( |
684 | - $table . '.uid AS uid', |
|
685 | - $table . '.l18n_parent AS l18n_parent' |
|
684 | + $table.'.uid AS uid', |
|
685 | + $table.'.l18n_parent AS l18n_parent' |
|
686 | 686 | ) |
687 | 687 | ->from($table) |
688 | 688 | ->where( |
689 | - $queryBuilder->expr()->eq($table . '.pid', $pid), |
|
690 | - $queryBuilder->expr()->eq($table . '.index_name', $queryBuilder->expr()->literal($indexName)), |
|
689 | + $queryBuilder->expr()->eq($table.'.pid', $pid), |
|
690 | + $queryBuilder->expr()->eq($table.'.index_name', $queryBuilder->expr()->literal($indexName)), |
|
691 | 691 | self::whereExpression($table, true) |
692 | 692 | ) |
693 | 693 | ->setMaxResults(1) |
@@ -698,12 +698,12 @@ discard block |
||
698 | 698 | if ($row) { |
699 | 699 | // Now we use the uid of the l18_parent to fetch the index_name of the translated content element. |
700 | 700 | $result = $queryBuilder |
701 | - ->select($table . '.index_name AS index_name') |
|
701 | + ->select($table.'.index_name AS index_name') |
|
702 | 702 | ->from($table) |
703 | 703 | ->where( |
704 | - $queryBuilder->expr()->eq($table . '.pid', $pid), |
|
705 | - $queryBuilder->expr()->eq($table . '.uid', $row['l18n_parent']), |
|
706 | - $queryBuilder->expr()->eq($table . '.sys_language_uid', (int) $languageContentId), |
|
704 | + $queryBuilder->expr()->eq($table.'.pid', $pid), |
|
705 | + $queryBuilder->expr()->eq($table.'.uid', $row['l18n_parent']), |
|
706 | + $queryBuilder->expr()->eq($table.'.sys_language_uid', (int) $languageContentId), |
|
707 | 707 | self::whereExpression($table, true) |
708 | 708 | ) |
709 | 709 | ->setMaxResults(1) |
@@ -721,14 +721,14 @@ discard block |
||
721 | 721 | if (empty($labels[$table][$pid][$languageContentId][$indexName])) { |
722 | 722 | // Check if this table is allowed for translation. |
723 | 723 | if (in_array($table, ['tx_dlf_collections', 'tx_dlf_libraries', 'tx_dlf_metadata', 'tx_dlf_metadatasubentries', 'tx_dlf_structures'])) { |
724 | - $additionalWhere = $queryBuilder->expr()->in($table . '.sys_language_uid', [-1, 0]); |
|
724 | + $additionalWhere = $queryBuilder->expr()->in($table.'.sys_language_uid', [-1, 0]); |
|
725 | 725 | if ($languageContentId > 0) { |
726 | 726 | $additionalWhere = $queryBuilder->expr()->andX( |
727 | 727 | $queryBuilder->expr()->orX( |
728 | - $queryBuilder->expr()->in($table . '.sys_language_uid', [-1, 0]), |
|
729 | - $queryBuilder->expr()->eq($table . '.sys_language_uid', (int) $languageContentId) |
|
728 | + $queryBuilder->expr()->in($table.'.sys_language_uid', [-1, 0]), |
|
729 | + $queryBuilder->expr()->eq($table.'.sys_language_uid', (int) $languageContentId) |
|
730 | 730 | ), |
731 | - $queryBuilder->expr()->eq($table . '.l18n_parent', 0) |
|
731 | + $queryBuilder->expr()->eq($table.'.l18n_parent', 0) |
|
732 | 732 | ); |
733 | 733 | } |
734 | 734 | |
@@ -737,7 +737,7 @@ discard block |
||
737 | 737 | ->select('*') |
738 | 738 | ->from($table) |
739 | 739 | ->where( |
740 | - $queryBuilder->expr()->eq($table . '.pid', $pid), |
|
740 | + $queryBuilder->expr()->eq($table.'.pid', $pid), |
|
741 | 741 | $additionalWhere, |
742 | 742 | self::whereExpression($table, true) |
743 | 743 | ) |
@@ -755,10 +755,10 @@ discard block |
||
755 | 755 | } |
756 | 756 | } |
757 | 757 | } else { |
758 | - self::log('No translation with PID ' . $pid . ' available in table "' . $table . '" or translation not accessible', LOG_SEVERITY_NOTICE); |
|
758 | + self::log('No translation with PID '.$pid.' available in table "'.$table.'" or translation not accessible', LOG_SEVERITY_NOTICE); |
|
759 | 759 | } |
760 | 760 | } else { |
761 | - self::log('No translations available for table "' . $table . '"', LOG_SEVERITY_WARNING); |
|
761 | + self::log('No translations available for table "'.$table.'"', LOG_SEVERITY_WARNING); |
|
762 | 762 | } |
763 | 763 | } |
764 | 764 | |
@@ -804,7 +804,7 @@ discard block |
||
804 | 804 | return GeneralUtility::makeInstance(ConnectionPool::class) |
805 | 805 | ->getQueryBuilderForTable($table) |
806 | 806 | ->expr() |
807 | - ->eq($table . '.' . $GLOBALS['TCA'][$table]['ctrl']['delete'], 0); |
|
807 | + ->eq($table.'.'.$GLOBALS['TCA'][$table]['ctrl']['delete'], 0); |
|
808 | 808 | } else { |
809 | 809 | self::log('Unexpected TYPO3_MODE', LOG_SEVERITY_ERROR); |
810 | 810 | return '1=-1'; |
@@ -870,7 +870,7 @@ discard block |
||
870 | 870 | try { |
871 | 871 | $response = $requestFactory->request($url, 'GET', $configuration); |
872 | 872 | } catch (\Exception $e) { |
873 | - self::log('Could not fetch data from URL "' . $url . '". Error: ' . $e->getMessage() . '.', LOG_SEVERITY_WARNING); |
|
873 | + self::log('Could not fetch data from URL "'.$url.'". Error: '.$e->getMessage().'.', LOG_SEVERITY_WARNING); |
|
874 | 874 | return false; |
875 | 875 | } |
876 | 876 | return $response->getBody()->getContents(); |
@@ -230,7 +230,7 @@ discard block |
||
230 | 230 | { |
231 | 231 | $file = $this->getFileInfo($id); |
232 | 232 | if ($file['mimeType'] === 'application/vnd.kitodo.iiif') { |
233 | - $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'); |
|
233 | + $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'); |
|
234 | 234 | $conf = GeneralUtility::makeInstance(ExtensionConfiguration::class)->get(self::$extKey, 'iiif'); |
235 | 235 | IiifHelper::setUrlReader(IiifUrlReader::getInstance()); |
236 | 236 | IiifHelper::setMaxThumbnailHeight($conf['thumbnailHeight']); |
@@ -240,9 +240,9 @@ discard block |
||
240 | 240 | return $service->getImageUrl(); |
241 | 241 | } |
242 | 242 | } elseif ($file['mimeType'] === 'application/vnd.netfpx') { |
243 | - $baseURL = $file['location'] . (strpos($file['location'], '?') === false ? '?' : ''); |
|
243 | + $baseURL = $file['location'].(strpos($file['location'], '?') === false ? '?' : ''); |
|
244 | 244 | // TODO CVT is an optional IIP server capability; in theory, capabilities should be determined in the object request with '&obj=IIP-server' |
245 | - return $baseURL . '&CVT=jpeg'; |
|
245 | + return $baseURL.'&CVT=jpeg'; |
|
246 | 246 | } |
247 | 247 | return $file['location']; |
248 | 248 | } |
@@ -271,14 +271,14 @@ discard block |
||
271 | 271 | */ |
272 | 272 | public function getFileLocation(string $id): string |
273 | 273 | { |
274 | - $location = $this->mets->xpath('./mets:fileSec/mets:fileGrp/mets:file[@ID="' . $id . '"]/mets:FLocat[@LOCTYPE="URL"]'); |
|
274 | + $location = $this->mets->xpath('./mets:fileSec/mets:fileGrp/mets:file[@ID="'.$id.'"]/mets:FLocat[@LOCTYPE="URL"]'); |
|
275 | 275 | if ( |
276 | 276 | !empty($id) |
277 | 277 | && !empty($location) |
278 | 278 | ) { |
279 | 279 | return (string) $location[0]->attributes('http://www.w3.org/1999/xlink')->href; |
280 | 280 | } else { |
281 | - $this->logger->warning('There is no file node with @ID "' . $id . '"'); |
|
281 | + $this->logger->warning('There is no file node with @ID "'.$id.'"'); |
|
282 | 282 | return ''; |
283 | 283 | } |
284 | 284 | } |
@@ -290,9 +290,9 @@ discard block |
||
290 | 290 | { |
291 | 291 | $mets = $this->mets |
292 | 292 | ->xpath( |
293 | - './mets:structMap[@TYPE="PHYSICAL"]' . |
|
294 | - '//mets:div[@ID="' . $pageId . '"]' . |
|
295 | - '/mets:fptr[@FILEID="' . $fileId . '"]' . |
|
293 | + './mets:structMap[@TYPE="PHYSICAL"]'. |
|
294 | + '//mets:div[@ID="'.$pageId.'"]'. |
|
295 | + '/mets:fptr[@FILEID="'.$fileId.'"]'. |
|
296 | 296 | '/mets:area/@BEGIN' |
297 | 297 | ); |
298 | 298 | return empty($mets) ? '' : $mets[0]->__toString(); |
@@ -304,14 +304,14 @@ discard block |
||
304 | 304 | */ |
305 | 305 | public function getFileMimeType(string $id): string |
306 | 306 | { |
307 | - $mimetype = $this->mets->xpath('./mets:fileSec/mets:fileGrp/mets:file[@ID="' . $id . '"]/@MIMETYPE'); |
|
307 | + $mimetype = $this->mets->xpath('./mets:fileSec/mets:fileGrp/mets:file[@ID="'.$id.'"]/@MIMETYPE'); |
|
308 | 308 | if ( |
309 | 309 | !empty($id) |
310 | 310 | && !empty($mimetype) |
311 | 311 | ) { |
312 | 312 | return (string) $mimetype[0]; |
313 | 313 | } else { |
314 | - $this->logger->warning('There is no file node with @ID "' . $id . '" or no MIME type specified'); |
|
314 | + $this->logger->warning('There is no file node with @ID "'.$id.'" or no MIME type specified'); |
|
315 | 315 | return ''; |
316 | 316 | } |
317 | 317 | } |
@@ -331,7 +331,7 @@ discard block |
||
331 | 331 | return $this->logicalUnits[$id]; |
332 | 332 | } elseif (!empty($id)) { |
333 | 333 | // Get specified logical unit. |
334 | - $divs = $this->mets->xpath('./mets:structMap[@TYPE="LOGICAL"]//mets:div[@ID="' . $id . '"]'); |
|
334 | + $divs = $this->mets->xpath('./mets:structMap[@TYPE="LOGICAL"]//mets:div[@ID="'.$id.'"]'); |
|
335 | 335 | } else { |
336 | 336 | // Get all logical units at top level. |
337 | 337 | $divs = $this->mets->xpath('./mets:structMap[@TYPE="LOGICAL"]/mets:div'); |
@@ -546,7 +546,7 @@ discard block |
||
546 | 546 | $cPid = max($cPid, 0); |
547 | 547 | if ($cPid == 0 && ($this->cPid || $this->pid)) { |
548 | 548 | // Retain current PID. |
549 | - $cPid = $this->cPid ?: $this->pid; |
|
549 | + $cPid = $this->cPid ? : $this->pid; |
|
550 | 550 | } |
551 | 551 | return $cPid; |
552 | 552 | } |
@@ -613,7 +613,7 @@ discard block |
||
613 | 613 | if (isset($this->fileInfos[$id]) || in_array('dmdSec', $metadataSections)) { |
614 | 614 | return $metadata; |
615 | 615 | } else { |
616 | - $this->logger->warning('No supported descriptive metadata found for logical structure with @ID "' . $id . '"'); |
|
616 | + $this->logger->warning('No supported descriptive metadata found for logical structure with @ID "'.$id.'"'); |
|
617 | 617 | return []; |
618 | 618 | } |
619 | 619 | } |
@@ -692,7 +692,7 @@ discard block |
||
692 | 692 | if (!empty($this->logicalUnits[$id])) { |
693 | 693 | return [$this->logicalUnits[$id]['type']]; |
694 | 694 | } else { |
695 | - $struct = $this->mets->xpath('./mets:structMap[@TYPE="LOGICAL"]//mets:div[@ID="' . $id . '"]/@TYPE'); |
|
695 | + $struct = $this->mets->xpath('./mets:structMap[@TYPE="LOGICAL"]//mets:div[@ID="'.$id.'"]/@TYPE'); |
|
696 | 696 | if (!empty($struct)) { |
697 | 697 | return [(string) $struct[0]]; |
698 | 698 | } |
@@ -849,17 +849,17 @@ discard block |
||
849 | 849 | if ($resArray['format'] > 0 && !empty($resArray['xpath_sorting'])) { |
850 | 850 | $values = $domXPath->evaluate($resArray['xpath_sorting'], $domNode); |
851 | 851 | if ($values instanceof DOMNodeList && $values->length > 0) { |
852 | - $metadata[$indexName . '_sorting'][0] = trim((string) $values->item(0)->nodeValue); |
|
852 | + $metadata[$indexName.'_sorting'][0] = trim((string) $values->item(0)->nodeValue); |
|
853 | 853 | } elseif (!($values instanceof DOMNodeList)) { |
854 | - $metadata[$indexName . '_sorting'][0] = trim((string) $values); |
|
854 | + $metadata[$indexName.'_sorting'][0] = trim((string) $values); |
|
855 | 855 | } |
856 | 856 | } |
857 | - if (empty($metadata[$indexName . '_sorting'][0])) { |
|
857 | + if (empty($metadata[$indexName.'_sorting'][0])) { |
|
858 | 858 | if (is_array($currentMetadata)) { |
859 | 859 | $sortingValue = implode(',', array_column($currentMetadata, 0)); |
860 | - $metadata[$indexName . '_sorting'][0] = $sortingValue; |
|
860 | + $metadata[$indexName.'_sorting'][0] = $sortingValue; |
|
861 | 861 | } else { |
862 | - $metadata[$indexName . '_sorting'][0] = $currentMetadata; |
|
862 | + $metadata[$indexName.'_sorting'][0] = $currentMetadata; |
|
863 | 863 | } |
864 | 864 | } |
865 | 865 | } |
@@ -920,11 +920,11 @@ discard block |
||
920 | 920 | return true; |
921 | 921 | } |
922 | 922 | } else { |
923 | - $this->logger->warning('Invalid class/method "' . $class . '->extractMetadata()" for metadata format "' . $this->mdSec[$dmdId]['type'] . '"'); |
|
923 | + $this->logger->warning('Invalid class/method "'.$class.'->extractMetadata()" for metadata format "'.$this->mdSec[$dmdId]['type'].'"'); |
|
924 | 924 | } |
925 | 925 | } |
926 | 926 | } else { |
927 | - $this->logger->notice('Unsupported metadata format "' . $this->mdSec[$dmdId]['type'] . '" in ' . $mdSectionType . ' with @ID "' . $dmdId . '"'); |
|
927 | + $this->logger->notice('Unsupported metadata format "'.$this->mdSec[$dmdId]['type'].'" in '.$mdSectionType.' with @ID "'.$dmdId.'"'); |
|
928 | 928 | } |
929 | 929 | return false; |
930 | 930 | } |
@@ -1077,7 +1077,7 @@ discard block |
||
1077 | 1077 | $dmdIds = $this->logicalUnits[$id]['dmdId'] ?? ''; |
1078 | 1078 | $admIds = $this->logicalUnits[$id]['admId'] ?? ''; |
1079 | 1079 | } else { |
1080 | - $mdSec = $this->mets->xpath('./mets:structMap[@TYPE="LOGICAL"]//mets:div[@ID="' . $id . '"]')[0]; |
|
1080 | + $mdSec = $this->mets->xpath('./mets:structMap[@TYPE="LOGICAL"]//mets:div[@ID="'.$id.'"]')[0]; |
|
1081 | 1081 | if ($mdSec) { |
1082 | 1082 | $dmdIds = (string) $mdSec->attributes()->DMDID; |
1083 | 1083 | $admIds = (string) $mdSec->attributes()->ADMID; |
@@ -1107,7 +1107,7 @@ discard block |
||
1107 | 1107 | |
1108 | 1108 | return array_filter( |
1109 | 1109 | $allMdIds, |
1110 | - function ($element) { |
|
1110 | + function($element) { |
|
1111 | 1111 | return !empty($element); |
1112 | 1112 | } |
1113 | 1113 | ); |
@@ -1133,7 +1133,7 @@ discard block |
||
1133 | 1133 | */ |
1134 | 1134 | public function getStructureDepth(string $logId) |
1135 | 1135 | { |
1136 | - $ancestors = $this->mets->xpath('./mets:structMap[@TYPE="LOGICAL"]//mets:div[@ID="' . $logId . '"]/ancestor::*'); |
|
1136 | + $ancestors = $this->mets->xpath('./mets:structMap[@TYPE="LOGICAL"]//mets:div[@ID="'.$logId.'"]/ancestor::*'); |
|
1137 | 1137 | if (!empty($ancestors)) { |
1138 | 1138 | return count($ancestors); |
1139 | 1139 | } else { |
@@ -1157,9 +1157,9 @@ discard block |
||
1157 | 1157 | $this->registerNamespaces($this->mets); |
1158 | 1158 | } else { |
1159 | 1159 | if (!empty($location)) { |
1160 | - $this->logger->error('No METS part found in document with location "' . $location . '".'); |
|
1160 | + $this->logger->error('No METS part found in document with location "'.$location.'".'); |
|
1161 | 1161 | } elseif (!empty($this->recordId)) { |
1162 | - $this->logger->error('No METS part found in document with recordId "' . $this->recordId . '".'); |
|
1162 | + $this->logger->error('No METS part found in document with recordId "'.$this->recordId.'".'); |
|
1163 | 1163 | } else { |
1164 | 1164 | $this->logger->error('No METS part found in current document.'); |
1165 | 1165 | } |
@@ -1180,7 +1180,7 @@ discard block |
||
1180 | 1180 | return true; |
1181 | 1181 | } |
1182 | 1182 | } |
1183 | - $this->logger->error('Could not load XML file from "' . $location . '"'); |
|
1183 | + $this->logger->error('Could not load XML file from "'.$location.'"'); |
|
1184 | 1184 | return false; |
1185 | 1185 | } |
1186 | 1186 | |
@@ -1303,10 +1303,10 @@ discard block |
||
1303 | 1303 | |
1304 | 1304 | if (!empty($mdType) && !empty($this->formats[(string) $mdType[0]])) { |
1305 | 1305 | $type = (string) $mdType[0]; |
1306 | - $xml = $element->xpath('./mets:mdWrap[@MDTYPE="' . $type . '"]/mets:xmlData/' . strtolower($type) . ':' . $this->formats[$type]['rootElement']); |
|
1306 | + $xml = $element->xpath('./mets:mdWrap[@MDTYPE="'.$type.'"]/mets:xmlData/'.strtolower($type).':'.$this->formats[$type]['rootElement']); |
|
1307 | 1307 | } elseif (!empty($otherMdType) && !empty($this->formats[(string) $otherMdType[0]])) { |
1308 | 1308 | $type = (string) $otherMdType[0]; |
1309 | - $xml = $element->xpath('./mets:mdWrap[@MDTYPE="OTHER"][@OTHERMDTYPE="' . $type . '"]/mets:xmlData/' . strtolower($type) . ':' . $this->formats[$type]['rootElement']); |
|
1309 | + $xml = $element->xpath('./mets:mdWrap[@MDTYPE="OTHER"][@OTHERMDTYPE="'.$type.'"]/mets:xmlData/'.strtolower($type).':'.$this->formats[$type]['rootElement']); |
|
1310 | 1310 | } |
1311 | 1311 | |
1312 | 1312 | if (empty($xml)) { |
@@ -1513,7 +1513,7 @@ discard block |
||
1513 | 1513 | // Get track info wtih begin end extent time for later assignment with musical |
1514 | 1514 | if ((string) $elementNode['TYPE'] === 'track') { |
1515 | 1515 | foreach ($elementNode->children('http://www.loc.gov/METS/')->fptr as $fptr) { |
1516 | - if (isset($fptr->area) && ((string) $fptr->area->attributes()->BETYPE === 'TIME')) { |
|
1516 | + if (isset($fptr->area) && ((string) $fptr->area->attributes()->BETYPE === 'TIME')) { |
|
1517 | 1517 | // Check if file has valid @USE attribute. |
1518 | 1518 | if (!empty($fileUse[(string) $fptr->area->attributes()->FILEID])) { |
1519 | 1519 | $this->physicalStructureInfo[$elements[(int) $elementNode['ORDER']]]['tracks'][$fileUse[(string) $fptr->area->attributes()->FILEID]] = [ |
@@ -1567,9 +1567,9 @@ discard block |
||
1567 | 1567 | || $forceReload |
1568 | 1568 | ) { |
1569 | 1569 | // Retain current PID. |
1570 | - $cPid = $this->cPid ?: $this->pid; |
|
1570 | + $cPid = $this->cPid ? : $this->pid; |
|
1571 | 1571 | if (!$cPid) { |
1572 | - $this->logger->error('Invalid PID ' . $cPid . ' for structure definitions'); |
|
1572 | + $this->logger->error('Invalid PID '.$cPid.' for structure definitions'); |
|
1573 | 1573 | $this->thumbnailLoaded = true; |
1574 | 1574 | return $this->thumbnail; |
1575 | 1575 | } |
@@ -1606,7 +1606,7 @@ discard block |
||
1606 | 1606 | if (!empty($resArray['thumbnail'])) { |
1607 | 1607 | $strctType = Helper::getIndexNameFromUid($resArray['thumbnail'], 'tx_dlf_structures', $cPid); |
1608 | 1608 | // Check if this document has a structure element of the desired type. |
1609 | - $strctIds = $this->mets->xpath('./mets:structMap[@TYPE="LOGICAL"]//mets:div[@TYPE="' . $strctType . '"]/@ID'); |
|
1609 | + $strctIds = $this->mets->xpath('./mets:structMap[@TYPE="LOGICAL"]//mets:div[@TYPE="'.$strctType.'"]/@ID'); |
|
1610 | 1610 | if (!empty($strctIds)) { |
1611 | 1611 | $strctId = (string) $strctIds[0]; |
1612 | 1612 | } |
@@ -1629,7 +1629,7 @@ discard block |
||
1629 | 1629 | } |
1630 | 1630 | } |
1631 | 1631 | } else { |
1632 | - $this->logger->error('No structure of type "' . $metadata['type'][0] . '" found in database'); |
|
1632 | + $this->logger->error('No structure of type "'.$metadata['type'][0].'" found in database'); |
|
1633 | 1633 | } |
1634 | 1634 | $this->thumbnailLoaded = true; |
1635 | 1635 | } |
@@ -1675,7 +1675,7 @@ discard block |
||
1675 | 1675 | { |
1676 | 1676 | if (empty($this->parentHref)) { |
1677 | 1677 | // Get the closest ancestor of the current document which has a MPTR child. |
1678 | - $parentMptr = $this->mets->xpath('./mets:structMap[@TYPE="LOGICAL"]//mets:div[@ID="' . $this->toplevelId . '"]/ancestor::mets:div[./mets:mptr][1]/mets:mptr'); |
|
1678 | + $parentMptr = $this->mets->xpath('./mets:structMap[@TYPE="LOGICAL"]//mets:div[@ID="'.$this->toplevelId.'"]/ancestor::mets:div[./mets:mptr][1]/mets:mptr'); |
|
1679 | 1679 | if (!empty($parentMptr)) { |
1680 | 1680 | $this->parentHref = (string) $parentMptr[0]->attributes('http://www.w3.org/1999/xlink')->href; |
1681 | 1681 | } |