@@ -22,7 +22,7 @@ |
||
22 | 22 | // parameters are available in $this->data['parameterArray']['fieldConf']['config']['parameters'] |
23 | 23 | $result = $this->initializeResultArray(); |
24 | 24 | if (!empty($this->data['databaseRow']['thumbnail'])) { |
25 | - $result['html'] = '<img alt="Thumbnail" title="" src="' . $this->data['databaseRow']['thumbnail'] . '" />'; |
|
25 | + $result['html'] = '<img alt="Thumbnail" title="" src="'.$this->data['databaseRow']['thumbnail'].'" />'; |
|
26 | 26 | } else { |
27 | 27 | $result['html'] = ''; |
28 | 28 | } |
@@ -394,7 +394,7 @@ discard block |
||
394 | 394 | |
395 | 395 | $excludeOtherWhere = ''; |
396 | 396 | if ($settings['excludeOther']) { |
397 | - $excludeOtherWhere = 'tx_dlf_documents.pid=' . intval($settings['pages']); |
|
397 | + $excludeOtherWhere = 'tx_dlf_documents.pid='.intval($settings['pages']); |
|
398 | 398 | } |
399 | 399 | // Check if there are any metadata to suggest. |
400 | 400 | $result = $queryBuilder |
@@ -446,12 +446,12 @@ discard block |
||
446 | 446 | $connection = GeneralUtility::makeInstance(ConnectionPool::class) |
447 | 447 | ->getConnectionForTable('tx_dlf_documents'); |
448 | 448 | |
449 | - $sql = 'SELECT `tx_dlf_documents`.*, GROUP_CONCAT(DISTINCT `tx_dlf_collections`.`oai_name` ORDER BY `tx_dlf_collections`.`oai_name` SEPARATOR " ") AS `collections` ' . |
|
450 | - 'FROM `tx_dlf_documents` ' . |
|
451 | - 'INNER JOIN `tx_dlf_relations` ON `tx_dlf_relations`.`uid_local` = `tx_dlf_documents`.`uid` ' . |
|
452 | - 'INNER JOIN `tx_dlf_collections` ON `tx_dlf_collections`.`uid` = `tx_dlf_relations`.`uid_foreign` ' . |
|
453 | - 'WHERE `tx_dlf_documents`.`record_id` = ? ' . |
|
454 | - 'AND `tx_dlf_relations`.`ident`="docs_colls" ' . |
|
449 | + $sql = 'SELECT `tx_dlf_documents`.*, GROUP_CONCAT(DISTINCT `tx_dlf_collections`.`oai_name` ORDER BY `tx_dlf_collections`.`oai_name` SEPARATOR " ") AS `collections` '. |
|
450 | + 'FROM `tx_dlf_documents` '. |
|
451 | + 'INNER JOIN `tx_dlf_relations` ON `tx_dlf_relations`.`uid_local` = `tx_dlf_documents`.`uid` '. |
|
452 | + 'INNER JOIN `tx_dlf_collections` ON `tx_dlf_collections`.`uid` = `tx_dlf_relations`.`uid_foreign` '. |
|
453 | + 'WHERE `tx_dlf_documents`.`record_id` = ? '. |
|
454 | + 'AND `tx_dlf_relations`.`ident`="docs_colls" '. |
|
455 | 455 | $where; |
456 | 456 | |
457 | 457 | $values = [ |
@@ -481,13 +481,13 @@ discard block |
||
481 | 481 | $connection = GeneralUtility::makeInstance(ConnectionPool::class) |
482 | 482 | ->getConnectionForTable('tx_dlf_documents'); |
483 | 483 | |
484 | - $sql = 'SELECT `tx_dlf_documents`.*, GROUP_CONCAT(DISTINCT `tx_dlf_collections`.`oai_name` ORDER BY `tx_dlf_collections`.`oai_name` SEPARATOR " ") AS `collections` ' . |
|
485 | - 'FROM `tx_dlf_documents` ' . |
|
486 | - 'INNER JOIN `tx_dlf_relations` ON `tx_dlf_relations`.`uid_local` = `tx_dlf_documents`.`uid` ' . |
|
487 | - 'INNER JOIN `tx_dlf_collections` ON `tx_dlf_collections`.`uid` = `tx_dlf_relations`.`uid_foreign` ' . |
|
488 | - 'WHERE `tx_dlf_documents`.`uid` IN ( ? ) ' . |
|
489 | - 'AND `tx_dlf_relations`.`ident`="docs_colls" ' . |
|
490 | - 'AND ' . Helper::whereExpression('tx_dlf_collections') . ' ' . |
|
484 | + $sql = 'SELECT `tx_dlf_documents`.*, GROUP_CONCAT(DISTINCT `tx_dlf_collections`.`oai_name` ORDER BY `tx_dlf_collections`.`oai_name` SEPARATOR " ") AS `collections` '. |
|
485 | + 'FROM `tx_dlf_documents` '. |
|
486 | + 'INNER JOIN `tx_dlf_relations` ON `tx_dlf_relations`.`uid_local` = `tx_dlf_documents`.`uid` '. |
|
487 | + 'INNER JOIN `tx_dlf_collections` ON `tx_dlf_collections`.`uid` = `tx_dlf_relations`.`uid_foreign` '. |
|
488 | + 'WHERE `tx_dlf_documents`.`uid` IN ( ? ) '. |
|
489 | + 'AND `tx_dlf_relations`.`ident`="docs_colls" '. |
|
490 | + 'AND '.Helper::whereExpression('tx_dlf_collections').' '. |
|
491 | 491 | 'GROUP BY `tx_dlf_documents`.`uid` '; |
492 | 492 | |
493 | 493 | $values = [ |
@@ -569,13 +569,13 @@ discard block |
||
569 | 569 | // Set search query. |
570 | 570 | if ( |
571 | 571 | (!empty($searchParams['fulltext'])) |
572 | - || preg_match('/' . $fields['fulltext'] . ':\((.*)\)/', trim($searchParams['query']), $matches) |
|
572 | + || preg_match('/'.$fields['fulltext'].':\((.*)\)/', trim($searchParams['query']), $matches) |
|
573 | 573 | ) { |
574 | 574 | // If the query already is a fulltext query e.g using the facets |
575 | 575 | $searchParams['query'] = empty($matches[1]) ? $searchParams['query'] : $matches[1]; |
576 | 576 | // Search in fulltext field if applicable. Query must not be empty! |
577 | 577 | if (!empty($searchParams['query'])) { |
578 | - $query = $fields['fulltext'] . ':(' . Solr::escapeQuery(trim($searchParams['query'])) . ')'; |
|
578 | + $query = $fields['fulltext'].':('.Solr::escapeQuery(trim($searchParams['query'])).')'; |
|
579 | 579 | } |
580 | 580 | $params['fulltext'] = true; |
581 | 581 | } else { |
@@ -598,9 +598,9 @@ discard block |
||
598 | 598 | in_array($searchParams['extOperator'][$i], $allowedOperators) |
599 | 599 | ) { |
600 | 600 | if (!empty($query)) { |
601 | - $query .= ' ' . $searchParams['extOperator'][$i] . ' '; |
|
601 | + $query .= ' '.$searchParams['extOperator'][$i].' '; |
|
602 | 602 | } |
603 | - $query .= Indexer::getIndexFieldName($searchParams['extField'][$i], $this->settings['storagePid']) . ':(' . Solr::escapeQuery($searchParams['extQuery'][$i]) . ')'; |
|
603 | + $query .= Indexer::getIndexFieldName($searchParams['extField'][$i], $this->settings['storagePid']).':('.Solr::escapeQuery($searchParams['extQuery'][$i]).')'; |
|
604 | 604 | } |
605 | 605 | } |
606 | 606 | } |
@@ -620,12 +620,12 @@ discard block |
||
620 | 620 | ) { |
621 | 621 | // Search in document and all subordinates (valid for up to three levels of hierarchy). |
622 | 622 | $params['filterquery'][]['query'] = '_query_:"{!join from=' |
623 | - . $fields['uid'] . ' to=' . $fields['partof'] . '}' |
|
624 | - . $fields['uid'] . ':{!join from=' . $fields['uid'] . ' to=' . $fields['partof'] . '}' |
|
625 | - . $fields['uid'] . ':' . $searchParams['documentId'] . '"' . ' OR {!join from=' |
|
626 | - . $fields['uid'] . ' to=' . $fields['partof'] . '}' |
|
627 | - . $fields['uid'] . ':' . $searchParams['documentId'] . ' OR ' |
|
628 | - . $fields['uid'] . ':' . $searchParams['documentId']; |
|
623 | + . $fields['uid'].' to='.$fields['partof'].'}' |
|
624 | + . $fields['uid'].':{!join from='.$fields['uid'].' to='.$fields['partof'].'}' |
|
625 | + . $fields['uid'].':'.$searchParams['documentId'].'"'.' OR {!join from=' |
|
626 | + . $fields['uid'].' to='.$fields['partof'].'}' |
|
627 | + . $fields['uid'].':'.$searchParams['documentId'].' OR ' |
|
628 | + . $fields['uid'].':'.$searchParams['documentId']; |
|
629 | 629 | } |
630 | 630 | |
631 | 631 | // if a collection is given, we prepare the collection query string |
@@ -633,7 +633,7 @@ discard block |
||
633 | 633 | $collecionsQueryString = $collection->getIndexName(); |
634 | 634 | $params['filterquery'][]['query'] = 'toplevel:true'; |
635 | 635 | $params['filterquery'][]['query'] = 'partof:0'; |
636 | - $params['filterquery'][]['query'] = 'collection_faceting:("' . $collecionsQueryString . '")'; |
|
636 | + $params['filterquery'][]['query'] = 'collection_faceting:("'.$collecionsQueryString.'")'; |
|
637 | 637 | } |
638 | 638 | |
639 | 639 | // Set some query parameters. |
@@ -662,8 +662,8 @@ discard block |
||
662 | 662 | if ($listedMetadata) { |
663 | 663 | foreach ($listedMetadata as $metadata) { |
664 | 664 | if ($metadata->getIndexStored() || $metadata->getIndexIndexed()) { |
665 | - $listMetadataRecord = $metadata->getIndexName() . '_' . ($metadata->getIndexTokenized() ? 't' : 'u') . ($metadata->getIndexStored() ? 's' : 'u') . ($metadata->getIndexIndexed() ? 'i' : 'u'); |
|
666 | - $params['fields'] .= ',' . $listMetadataRecord; |
|
665 | + $listMetadataRecord = $metadata->getIndexName().'_'.($metadata->getIndexTokenized() ? 't' : 'u').($metadata->getIndexStored() ? 's' : 'u').($metadata->getIndexIndexed() ? 'i' : 'u'); |
|
666 | + $params['fields'] .= ','.$listMetadataRecord; |
|
667 | 667 | $params['listMetadataRecords'][$metadata->getIndexName()] = $listMetadataRecord; |
668 | 668 | } |
669 | 669 | } |
@@ -749,7 +749,7 @@ discard block |
||
749 | 749 | if (empty($documents[$doc['uid']]['title']) && ($documents[$doc['uid']]['partOf'] > 0)) { |
750 | 750 | $parentDocument = $this->findByUid($documents[$doc['uid']]['partOf']); |
751 | 751 | if ($parentDocument) { |
752 | - $documents[$doc['uid']]['title'] = '[' . $parentDocument->getTitle() . ']'; |
|
752 | + $documents[$doc['uid']]['title'] = '['.$parentDocument->getTitle().']'; |
|
753 | 753 | } |
754 | 754 | } |
755 | 755 | } |
@@ -773,7 +773,7 @@ discard block |
||
773 | 773 | $metadataArray = []; |
774 | 774 | |
775 | 775 | // Set some query parameters. |
776 | - $params['query'] = 'uid:' . $uid; |
|
776 | + $params['query'] = 'uid:'.$uid; |
|
777 | 777 | $params['start'] = 0; |
778 | 778 | $params['rows'] = 1; |
779 | 779 | $params['sort'] = ['score' => 'desc']; |
@@ -785,8 +785,8 @@ discard block |
||
785 | 785 | if ($listedMetadata) { |
786 | 786 | foreach ($listedMetadata as $metadata) { |
787 | 787 | if ($metadata->getIndexIndexed()) { |
788 | - $listMetadataRecord = $metadata->getIndexName() . '_' . ($metadata->getIndexTokenized() ? 't' : 'u') . ($metadata->getIndexStored() ? 's' : 'u') . 'i'; |
|
789 | - $params['fields'] .= ',' . $listMetadataRecord; |
|
788 | + $listMetadataRecord = $metadata->getIndexName().'_'.($metadata->getIndexTokenized() ? 't' : 'u').($metadata->getIndexStored() ? 's' : 'u').'i'; |
|
789 | + $params['fields'] .= ','.$listMetadataRecord; |
|
790 | 790 | $params['listMetadataRecords'][$metadata->getIndexName()] = $listMetadataRecord; |
791 | 791 | } |
792 | 792 | } |
@@ -836,7 +836,7 @@ discard block |
||
836 | 836 | $cache = null; |
837 | 837 | // Calculate cache identifier. |
838 | 838 | if ($enableCache === true) { |
839 | - $cacheIdentifier = Helper::digest($solr->core . print_r($parameters, true)); |
|
839 | + $cacheIdentifier = Helper::digest($solr->core.print_r($parameters, true)); |
|
840 | 840 | $cache = GeneralUtility::makeInstance(CacheManager::class)->getCache('tx_dlf_solr'); |
841 | 841 | } |
842 | 842 | $resultSet = [ |
@@ -47,7 +47,7 @@ |
||
47 | 47 | |
48 | 48 | // order by oai_name |
49 | 49 | $query->setOrderings( |
50 | - array('sorting' => QueryInterface::ORDER_ASCENDING) |
|
50 | + array ('sorting' => QueryInterface::ORDER_ASCENDING) |
|
51 | 51 | ); |
52 | 52 | |
53 | 53 | return $query->execute(); |
@@ -98,7 +98,7 @@ |
||
98 | 98 | |
99 | 99 | // order by oai_name |
100 | 100 | $query->setOrderings( |
101 | - array('oai_name' => QueryInterface::ORDER_ASCENDING) |
|
101 | + array ('oai_name' => QueryInterface::ORDER_ASCENDING) |
|
102 | 102 | ); |
103 | 103 | |
104 | 104 | return $query->execute(); |
@@ -157,7 +157,7 @@ discard block |
||
157 | 157 | if ($this->document) { |
158 | 158 | $doc = Doc::getInstance($this->document->getLocation(), ['storagePid' => $pid], true); |
159 | 159 | } else { |
160 | - $this->logger->error('Invalid UID "' . $requestData['id'] . '" or PID "' . $pid . '" for document loading'); |
|
160 | + $this->logger->error('Invalid UID "'.$requestData['id'].'" or PID "'.$pid.'" for document loading'); |
|
161 | 161 | } |
162 | 162 | } else if (GeneralUtility::isValidUrl($requestData['id'])) { |
163 | 163 | |
@@ -175,7 +175,7 @@ discard block |
||
175 | 175 | |
176 | 176 | $this->document->setLocation($requestData['id']); |
177 | 177 | } else { |
178 | - $this->logger->error('Invalid location given "' . $requestData['id'] . '" for document loading'); |
|
178 | + $this->logger->error('Invalid location given "'.$requestData['id'].'" for document loading'); |
|
179 | 179 | } |
180 | 180 | } |
181 | 181 | |
@@ -192,11 +192,11 @@ discard block |
||
192 | 192 | if ($this->document !== null && $doc !== null) { |
193 | 193 | $this->document->setDoc($doc); |
194 | 194 | } else { |
195 | - $this->logger->error('Failed to load document with record ID "' . $requestData['recordId'] . '"'); |
|
195 | + $this->logger->error('Failed to load document with record ID "'.$requestData['recordId'].'"'); |
|
196 | 196 | } |
197 | 197 | } |
198 | 198 | } else { |
199 | - $this->logger->error('Invalid UID "' . $requestData['id'] . '" or PID "' . $pid . '" for document loading'); |
|
199 | + $this->logger->error('Invalid UID "'.$requestData['id'].'" or PID "'.$pid.'" for document loading'); |
|
200 | 200 | } |
201 | 201 | } |
202 | 202 | } |
@@ -134,7 +134,7 @@ discard block |
||
134 | 134 | { |
135 | 135 | // Get next available core name if none given. |
136 | 136 | if (empty($core)) { |
137 | - $core = 'dlfCore' . self::getNextCoreNumber(); |
|
137 | + $core = 'dlfCore'.self::getNextCoreNumber(); |
|
138 | 138 | } |
139 | 139 | // Get Solr service instance. |
140 | 140 | $solr = self::getInstance($core); |
@@ -230,13 +230,13 @@ discard block |
||
230 | 230 | ->execute(); |
231 | 231 | |
232 | 232 | while ($resArray = $result->fetch()) { |
233 | - $fields[] = $resArray['index_name'] . '_' . ($resArray['index_tokenized'] ? 't' : 'u') . ($resArray['index_stored'] ? 's' : 'u') . 'i'; |
|
233 | + $fields[] = $resArray['index_name'].'_'.($resArray['index_tokenized'] ? 't' : 'u').($resArray['index_stored'] ? 's' : 'u').'i'; |
|
234 | 234 | } |
235 | 235 | |
236 | 236 | // Check if queried field is valid. |
237 | 237 | $splitQuery = explode(':', $query, 2); |
238 | 238 | if (in_array($splitQuery[0], $fields)) { |
239 | - $query = $splitQuery[0] . ':(' . self::escapeQuery(trim($splitQuery[1], '()')) . ')'; |
|
239 | + $query = $splitQuery[0].':('.self::escapeQuery(trim($splitQuery[1], '()')).')'; |
|
240 | 240 | } else { |
241 | 241 | $query = self::escapeQuery($query); |
242 | 242 | } |
@@ -341,7 +341,7 @@ discard block |
||
341 | 341 | { |
342 | 342 | $number = max(intval($number), 0); |
343 | 343 | // Check if core already exists. |
344 | - $solr = self::getInstance('dlfCore' . $number); |
|
344 | + $solr = self::getInstance('dlfCore'.$number); |
|
345 | 345 | if (!$solr->ready) { |
346 | 346 | return $number; |
347 | 347 | } else { |
@@ -403,7 +403,7 @@ discard block |
||
403 | 403 | $parameters['start'] = 0; |
404 | 404 | $parameters['rows'] = $this->limit; |
405 | 405 | // Calculate cache identifier. |
406 | - $cacheIdentifier = Helper::digest($this->core . print_r(array_merge($this->params, $parameters), true)); |
|
406 | + $cacheIdentifier = Helper::digest($this->core.print_r(array_merge($this->params, $parameters), true)); |
|
407 | 407 | $cache = GeneralUtility::makeInstance(CacheManager::class)->getCache('tx_dlf_solr'); |
408 | 408 | $resultSet = []; |
409 | 409 | if (($entry = $cache->get($cacheIdentifier)) === false) { |
@@ -534,12 +534,12 @@ discard block |
||
534 | 534 | */ |
535 | 535 | public function __get($var) |
536 | 536 | { |
537 | - $method = '_get' . ucfirst($var); |
|
537 | + $method = '_get'.ucfirst($var); |
|
538 | 538 | if ( |
539 | 539 | !property_exists($this, $var) |
540 | 540 | || !method_exists($this, $method) |
541 | 541 | ) { |
542 | - $this->logger->warning('There is no getter function for property "' . $var . '"'); |
|
542 | + $this->logger->warning('There is no getter function for property "'.$var.'"'); |
|
543 | 543 | return; |
544 | 544 | } else { |
545 | 545 | return $this->$method(); |
@@ -572,12 +572,12 @@ discard block |
||
572 | 572 | */ |
573 | 573 | public function __set($var, $value) |
574 | 574 | { |
575 | - $method = '_set' . ucfirst($var); |
|
575 | + $method = '_set'.ucfirst($var); |
|
576 | 576 | if ( |
577 | 577 | !property_exists($this, $var) |
578 | 578 | || !method_exists($this, $method) |
579 | 579 | ) { |
580 | - $this->logger->warning('There is no setter function for property "' . $var . '"'); |
|
580 | + $this->logger->warning('There is no setter function for property "'.$var.'"'); |
|
581 | 581 | } else { |
582 | 582 | $this->$method($value); |
583 | 583 | } |
@@ -614,7 +614,7 @@ discard block |
||
614 | 614 | 'scheme' => $this->config['scheme'], |
615 | 615 | 'host' => $this->config['host'], |
616 | 616 | 'port' => $this->config['port'], |
617 | - 'path' => '/' . $this->config['path'], |
|
617 | + 'path' => '/'.$this->config['path'], |
|
618 | 618 | 'core' => $core, |
619 | 619 | 'username' => $this->config['username'], |
620 | 620 | 'password' => $this->config['password'], |
@@ -168,7 +168,7 @@ discard block |
||
168 | 168 | $fileMimeType = $this->getFileMimeType($id); |
169 | 169 | $fileLocation = $this->getFileLocation($id); |
170 | 170 | if ($fileMimeType === 'application/vnd.kitodo.iiif') { |
171 | - $fileLocation = (strrpos($fileLocation, 'info.json') === strlen($fileLocation) - 9) ? $fileLocation : (strrpos($fileLocation, '/') === strlen($fileLocation) ? $fileLocation . 'info.json' : $fileLocation . '/info.json'); |
|
171 | + $fileLocation = (strrpos($fileLocation, 'info.json') === strlen($fileLocation) - 9) ? $fileLocation : (strrpos($fileLocation, '/') === strlen($fileLocation) ? $fileLocation.'info.json' : $fileLocation.'/info.json'); |
|
172 | 172 | $conf = GeneralUtility::makeInstance(ExtensionConfiguration::class)->get(self::$extKey); |
173 | 173 | IiifHelper::setUrlReader(IiifUrlReader::getInstance()); |
174 | 174 | IiifHelper::setMaxThumbnailHeight($conf['iiifThumbnailHeight']); |
@@ -178,9 +178,9 @@ discard block |
||
178 | 178 | return $service->getImageUrl(); |
179 | 179 | } |
180 | 180 | } elseif ($fileMimeType === 'application/vnd.netfpx') { |
181 | - $baseURL = $fileLocation . (strpos($fileLocation, '?') === false ? '?' : ''); |
|
181 | + $baseURL = $fileLocation.(strpos($fileLocation, '?') === false ? '?' : ''); |
|
182 | 182 | // TODO CVT is an optional IIP server capability; in theory, capabilities should be determined in the object request with '&obj=IIP-server' |
183 | - return $baseURL . '&CVT=jpeg'; |
|
183 | + return $baseURL.'&CVT=jpeg'; |
|
184 | 184 | } |
185 | 185 | return $fileLocation; |
186 | 186 | } |
@@ -191,14 +191,14 @@ discard block |
||
191 | 191 | */ |
192 | 192 | public function getFileLocation($id) |
193 | 193 | { |
194 | - $location = $this->mets->xpath('./mets:fileSec/mets:fileGrp/mets:file[@ID="' . $id . '"]/mets:FLocat[@LOCTYPE="URL"]'); |
|
194 | + $location = $this->mets->xpath('./mets:fileSec/mets:fileGrp/mets:file[@ID="'.$id.'"]/mets:FLocat[@LOCTYPE="URL"]'); |
|
195 | 195 | if ( |
196 | 196 | !empty($id) |
197 | 197 | && !empty($location) |
198 | 198 | ) { |
199 | 199 | return (string) $location[0]->attributes('http://www.w3.org/1999/xlink')->href; |
200 | 200 | } else { |
201 | - $this->logger->warning('There is no file node with @ID "' . $id . '"'); |
|
201 | + $this->logger->warning('There is no file node with @ID "'.$id.'"'); |
|
202 | 202 | return ''; |
203 | 203 | } |
204 | 204 | } |
@@ -209,14 +209,14 @@ discard block |
||
209 | 209 | */ |
210 | 210 | public function getFileMimeType($id) |
211 | 211 | { |
212 | - $mimetype = $this->mets->xpath('./mets:fileSec/mets:fileGrp/mets:file[@ID="' . $id . '"]/@MIMETYPE'); |
|
212 | + $mimetype = $this->mets->xpath('./mets:fileSec/mets:fileGrp/mets:file[@ID="'.$id.'"]/@MIMETYPE'); |
|
213 | 213 | if ( |
214 | 214 | !empty($id) |
215 | 215 | && !empty($mimetype) |
216 | 216 | ) { |
217 | 217 | return (string) $mimetype[0]; |
218 | 218 | } else { |
219 | - $this->logger->warning('There is no file node with @ID "' . $id . '" or no MIME type specified'); |
|
219 | + $this->logger->warning('There is no file node with @ID "'.$id.'" or no MIME type specified'); |
|
220 | 220 | return ''; |
221 | 221 | } |
222 | 222 | } |
@@ -237,7 +237,7 @@ discard block |
||
237 | 237 | return $this->logicalUnits[$id]; |
238 | 238 | } elseif (!empty($id)) { |
239 | 239 | // Get specified logical unit. |
240 | - $divs = $this->mets->xpath('./mets:structMap[@TYPE="LOGICAL"]//mets:div[@ID="' . $id . '"]'); |
|
240 | + $divs = $this->mets->xpath('./mets:structMap[@TYPE="LOGICAL"]//mets:div[@ID="'.$id.'"]'); |
|
241 | 241 | } else { |
242 | 242 | // Get all logical units at top level. |
243 | 243 | $divs = $this->mets->xpath('./mets:structMap[@TYPE="LOGICAL"]/mets:div'); |
@@ -377,7 +377,7 @@ discard block |
||
377 | 377 | // Retain current PID. |
378 | 378 | $cPid = ($this->cPid ? $this->cPid : $this->pid); |
379 | 379 | } elseif (!$cPid) { |
380 | - $this->logger->warning('Invalid PID ' . $cPid . ' for metadata definitions'); |
|
380 | + $this->logger->warning('Invalid PID '.$cPid.' for metadata definitions'); |
|
381 | 381 | return []; |
382 | 382 | } |
383 | 383 | // Get metadata from parsed metadata array if available. |
@@ -418,7 +418,7 @@ discard block |
||
418 | 418 | if (!empty($this->logicalUnits[$id])) { |
419 | 419 | $dmdIds = $this->logicalUnits[$id]['dmdId']; |
420 | 420 | } else { |
421 | - $dmdIds = $this->mets->xpath('./mets:structMap[@TYPE="LOGICAL"]//mets:div[@ID="' . $id . '"]/@DMDID'); |
|
421 | + $dmdIds = $this->mets->xpath('./mets:structMap[@TYPE="LOGICAL"]//mets:div[@ID="'.$id.'"]/@DMDID'); |
|
422 | 422 | $dmdIds = (string) $dmdIds[0]; |
423 | 423 | } |
424 | 424 | if (!empty($dmdIds)) { |
@@ -444,11 +444,11 @@ discard block |
||
444 | 444 | ) { |
445 | 445 | $obj->extractMetadata($this->dmdSec[$dmdId]['xml'], $metadata); |
446 | 446 | } else { |
447 | - $this->logger->warning('Invalid class/method "' . $class . '->extractMetadata()" for metadata format "' . $this->dmdSec[$dmdId]['type'] . '"'); |
|
447 | + $this->logger->warning('Invalid class/method "'.$class.'->extractMetadata()" for metadata format "'.$this->dmdSec[$dmdId]['type'].'"'); |
|
448 | 448 | } |
449 | 449 | } |
450 | 450 | } else { |
451 | - $this->logger->notice('Unsupported metadata format "' . $this->dmdSec[$dmdId]['type'] . '" in dmdSec with @ID "' . $dmdId . '"'); |
|
451 | + $this->logger->notice('Unsupported metadata format "'.$this->dmdSec[$dmdId]['type'].'" in dmdSec with @ID "'.$dmdId.'"'); |
|
452 | 452 | // Continue searching for supported metadata with next @DMDID. |
453 | 453 | continue; |
454 | 454 | } |
@@ -456,7 +456,7 @@ discard block |
||
456 | 456 | if (!empty($this->logicalUnits[$id])) { |
457 | 457 | $metadata['type'] = [$this->logicalUnits[$id]['type']]; |
458 | 458 | } else { |
459 | - $struct = $this->mets->xpath('./mets:structMap[@TYPE="LOGICAL"]//mets:div[@ID="' . $id . '"]/@TYPE'); |
|
459 | + $struct = $this->mets->xpath('./mets:structMap[@TYPE="LOGICAL"]//mets:div[@ID="'.$id.'"]/@TYPE'); |
|
460 | 460 | if (!empty($struct)) { |
461 | 461 | $metadata['type'] = [(string) $struct[0]]; |
462 | 462 | } |
@@ -573,13 +573,13 @@ discard block |
||
573 | 573 | $values instanceof \DOMNodeList |
574 | 574 | && $values->length > 0 |
575 | 575 | ) { |
576 | - $metadata[$resArray['index_name'] . '_sorting'][0] = trim((string) $values->item(0)->nodeValue); |
|
576 | + $metadata[$resArray['index_name'].'_sorting'][0] = trim((string) $values->item(0)->nodeValue); |
|
577 | 577 | } elseif (!($values instanceof \DOMNodeList)) { |
578 | - $metadata[$resArray['index_name'] . '_sorting'][0] = trim((string) $values); |
|
578 | + $metadata[$resArray['index_name'].'_sorting'][0] = trim((string) $values); |
|
579 | 579 | } |
580 | 580 | } |
581 | - if (empty($metadata[$resArray['index_name'] . '_sorting'][0])) { |
|
582 | - $metadata[$resArray['index_name'] . '_sorting'][0] = $metadata[$resArray['index_name']][0]; |
|
581 | + if (empty($metadata[$resArray['index_name'].'_sorting'][0])) { |
|
582 | + $metadata[$resArray['index_name'].'_sorting'][0] = $metadata[$resArray['index_name']][0]; |
|
583 | 583 | } |
584 | 584 | } |
585 | 585 | } |
@@ -595,7 +595,7 @@ discard block |
||
595 | 595 | if ($hasSupportedMetadata) { |
596 | 596 | return $metadata; |
597 | 597 | } else { |
598 | - $this->logger->warning('No supported metadata found for logical structure with @ID "' . $id . '"'); |
|
598 | + $this->logger->warning('No supported metadata found for logical structure with @ID "'.$id.'"'); |
|
599 | 599 | return []; |
600 | 600 | } |
601 | 601 | } |
@@ -622,7 +622,7 @@ discard block |
||
622 | 622 | */ |
623 | 623 | public function getStructureDepth($logId) |
624 | 624 | { |
625 | - $ancestors = $this->mets->xpath('./mets:structMap[@TYPE="LOGICAL"]//mets:div[@ID="' . $logId . '"]/ancestor::*'); |
|
625 | + $ancestors = $this->mets->xpath('./mets:structMap[@TYPE="LOGICAL"]//mets:div[@ID="'.$logId.'"]/ancestor::*'); |
|
626 | 626 | if (!empty($ancestors)) { |
627 | 627 | return count($ancestors); |
628 | 628 | } else { |
@@ -646,9 +646,9 @@ discard block |
||
646 | 646 | $this->registerNamespaces($this->mets); |
647 | 647 | } else { |
648 | 648 | if (!empty($location)) { |
649 | - $this->logger->error('No METS part found in document with location "' . $location . '".'); |
|
649 | + $this->logger->error('No METS part found in document with location "'.$location.'".'); |
|
650 | 650 | } else if (!empty($this->recordId)) { |
651 | - $this->logger->error('No METS part found in document with recordId "' . $this->recordId . '".'); |
|
651 | + $this->logger->error('No METS part found in document with recordId "'.$this->recordId.'".'); |
|
652 | 652 | } else { |
653 | 653 | $this->logger->error('No METS part found in current document.'); |
654 | 654 | } |
@@ -670,7 +670,7 @@ discard block |
||
670 | 670 | return true; |
671 | 671 | } |
672 | 672 | } |
673 | - $this->logger->error('Could not load XML file from "' . $location . '"'); |
|
673 | + $this->logger->error('Could not load XML file from "'.$location.'"'); |
|
674 | 674 | return false; |
675 | 675 | } |
676 | 676 | |
@@ -725,15 +725,15 @@ discard block |
||
725 | 725 | $dmdIds = $this->mets->xpath('./mets:dmdSec/@ID'); |
726 | 726 | if (!empty($dmdIds)) { |
727 | 727 | foreach ($dmdIds as $dmdId) { |
728 | - if ($type = $this->mets->xpath('./mets:dmdSec[@ID="' . (string) $dmdId . '"]/mets:mdWrap[not(@MDTYPE="OTHER")]/@MDTYPE')) { |
|
728 | + if ($type = $this->mets->xpath('./mets:dmdSec[@ID="'.(string) $dmdId.'"]/mets:mdWrap[not(@MDTYPE="OTHER")]/@MDTYPE')) { |
|
729 | 729 | if (!empty($this->formats[(string) $type[0]])) { |
730 | 730 | $type = (string) $type[0]; |
731 | - $xml = $this->mets->xpath('./mets:dmdSec[@ID="' . (string) $dmdId . '"]/mets:mdWrap[@MDTYPE="' . $type . '"]/mets:xmlData/' . strtolower($type) . ':' . $this->formats[$type]['rootElement']); |
|
731 | + $xml = $this->mets->xpath('./mets:dmdSec[@ID="'.(string) $dmdId.'"]/mets:mdWrap[@MDTYPE="'.$type.'"]/mets:xmlData/'.strtolower($type).':'.$this->formats[$type]['rootElement']); |
|
732 | 732 | } |
733 | - } elseif ($type = $this->mets->xpath('./mets:dmdSec[@ID="' . (string) $dmdId . '"]/mets:mdWrap[@MDTYPE="OTHER"]/@OTHERMDTYPE')) { |
|
733 | + } elseif ($type = $this->mets->xpath('./mets:dmdSec[@ID="'.(string) $dmdId.'"]/mets:mdWrap[@MDTYPE="OTHER"]/@OTHERMDTYPE')) { |
|
734 | 734 | if (!empty($this->formats[(string) $type[0]])) { |
735 | 735 | $type = (string) $type[0]; |
736 | - $xml = $this->mets->xpath('./mets:dmdSec[@ID="' . (string) $dmdId . '"]/mets:mdWrap[@MDTYPE="OTHER"][@OTHERMDTYPE="' . $type . '"]/mets:xmlData/' . strtolower($type) . ':' . $this->formats[$type]['rootElement']); |
|
736 | + $xml = $this->mets->xpath('./mets:dmdSec[@ID="'.(string) $dmdId.'"]/mets:mdWrap[@MDTYPE="OTHER"][@OTHERMDTYPE="'.$type.'"]/mets:xmlData/'.strtolower($type).':'.$this->formats[$type]['rootElement']); |
|
737 | 737 | } |
738 | 738 | } |
739 | 739 | if (!empty($xml)) { |
@@ -918,7 +918,7 @@ discard block |
||
918 | 918 | // Retain current PID. |
919 | 919 | $cPid = ($this->cPid ? $this->cPid : $this->pid); |
920 | 920 | if (!$cPid) { |
921 | - $this->logger->error('Invalid PID ' . $cPid . ' for structure definitions'); |
|
921 | + $this->logger->error('Invalid PID '.$cPid.' for structure definitions'); |
|
922 | 922 | $this->thumbnailLoaded = true; |
923 | 923 | return $this->thumbnail; |
924 | 924 | } |
@@ -955,7 +955,7 @@ discard block |
||
955 | 955 | if (!empty($resArray['thumbnail'])) { |
956 | 956 | $strctType = Helper::getIndexNameFromUid($resArray['thumbnail'], 'tx_dlf_structures', $cPid); |
957 | 957 | // Check if this document has a structure element of the desired type. |
958 | - $strctIds = $this->mets->xpath('./mets:structMap[@TYPE="LOGICAL"]//mets:div[@TYPE="' . $strctType . '"]/@ID'); |
|
958 | + $strctIds = $this->mets->xpath('./mets:structMap[@TYPE="LOGICAL"]//mets:div[@TYPE="'.$strctType.'"]/@ID'); |
|
959 | 959 | if (!empty($strctIds)) { |
960 | 960 | $strctId = (string) $strctIds[0]; |
961 | 961 | } |
@@ -978,7 +978,7 @@ discard block |
||
978 | 978 | } |
979 | 979 | } |
980 | 980 | } else { |
981 | - $this->logger->error('No structure of type "' . $metadata['type'][0] . '" found in database'); |
|
981 | + $this->logger->error('No structure of type "'.$metadata['type'][0].'" found in database'); |
|
982 | 982 | } |
983 | 983 | $this->thumbnailLoaded = true; |
984 | 984 | } |
@@ -569,14 +569,14 @@ discard block |
||
569 | 569 | if ($fileContent !== false) { |
570 | 570 | $textFormat = $this->getTextFormat($fileContent); |
571 | 571 | } else { |
572 | - $this->logger->warning('Couldn\'t load full text file for structure node @ID "' . $id . '"'); |
|
572 | + $this->logger->warning('Couldn\'t load full text file for structure node @ID "'.$id.'"'); |
|
573 | 573 | return $fullText; |
574 | 574 | } |
575 | 575 | break; |
576 | 576 | } |
577 | 577 | } |
578 | 578 | } else { |
579 | - $this->logger->warning('Invalid structure node @ID "' . $id . '"'); |
|
579 | + $this->logger->warning('Invalid structure node @ID "'.$id.'"'); |
|
580 | 580 | return $fullText; |
581 | 581 | } |
582 | 582 | // Is this text format supported? |
@@ -595,12 +595,12 @@ discard block |
||
595 | 595 | $textMiniOcr = $obj->getTextAsMiniOcr($ocrTextXml); |
596 | 596 | $this->rawTextArray[$id] = $textMiniOcr; |
597 | 597 | } else { |
598 | - $this->logger->warning('Invalid class/method "' . $class . '->getRawText()" for text format "' . $textFormat . '"'); |
|
598 | + $this->logger->warning('Invalid class/method "'.$class.'->getRawText()" for text format "'.$textFormat.'"'); |
|
599 | 599 | } |
600 | 600 | } |
601 | 601 | $fullText = $textMiniOcr; |
602 | 602 | } else { |
603 | - $this->logger->warning('Unsupported text format "' . $textFormat . '" in physical node with @ID "' . $id . '"'); |
|
603 | + $this->logger->warning('Unsupported text format "'.$textFormat.'" in physical node with @ID "'.$id.'"'); |
|
604 | 604 | } |
605 | 605 | return $fullText; |
606 | 606 | } |
@@ -674,10 +674,10 @@ discard block |
||
674 | 674 | $title = self::getTitle($partof, true); |
675 | 675 | } |
676 | 676 | } else { |
677 | - Helper::log('No document with UID ' . $uid . ' found or document not accessible', LOG_SEVERITY_WARNING); |
|
677 | + Helper::log('No document with UID '.$uid.' found or document not accessible', LOG_SEVERITY_WARNING); |
|
678 | 678 | } |
679 | 679 | } else { |
680 | - Helper::log('Invalid UID ' . $uid . ' for document', LOG_SEVERITY_ERROR); |
|
680 | + Helper::log('Invalid UID '.$uid.' for document', LOG_SEVERITY_ERROR); |
|
681 | 681 | } |
682 | 682 | return $title; |
683 | 683 | } |
@@ -808,7 +808,7 @@ discard block |
||
808 | 808 | // the actual loading is format specific |
809 | 809 | return $this->loadLocation($location); |
810 | 810 | } else { |
811 | - $this->logger->error('Invalid file location "' . $location . '" for document loading'); |
|
811 | + $this->logger->error('Invalid file location "'.$location.'" for document loading'); |
|
812 | 812 | } |
813 | 813 | return false; |
814 | 814 | } |
@@ -949,7 +949,7 @@ discard block |
||
949 | 949 | // Set metadata definitions' PID. |
950 | 950 | $cPid = ($this->cPid ? $this->cPid : $this->pid); |
951 | 951 | if (!$cPid) { |
952 | - $this->logger->error('Invalid PID ' . $cPid . ' for metadata definitions'); |
|
952 | + $this->logger->error('Invalid PID '.$cPid.' for metadata definitions'); |
|
953 | 953 | return []; |
954 | 954 | } |
955 | 955 | if ( |
@@ -1184,12 +1184,12 @@ discard block |
||
1184 | 1184 | */ |
1185 | 1185 | public function __get($var) |
1186 | 1186 | { |
1187 | - $method = '_get' . ucfirst($var); |
|
1187 | + $method = '_get'.ucfirst($var); |
|
1188 | 1188 | if ( |
1189 | 1189 | !property_exists($this, $var) |
1190 | 1190 | || !method_exists($this, $method) |
1191 | 1191 | ) { |
1192 | - $this->logger->warning('There is no getter function for property "' . $var . '"'); |
|
1192 | + $this->logger->warning('There is no getter function for property "'.$var.'"'); |
|
1193 | 1193 | return; |
1194 | 1194 | } else { |
1195 | 1195 | return $this->$method(); |
@@ -1222,12 +1222,12 @@ discard block |
||
1222 | 1222 | */ |
1223 | 1223 | public function __set($var, $value) |
1224 | 1224 | { |
1225 | - $method = '_set' . ucfirst($var); |
|
1225 | + $method = '_set'.ucfirst($var); |
|
1226 | 1226 | if ( |
1227 | 1227 | !property_exists($this, $var) |
1228 | 1228 | || !method_exists($this, $method) |
1229 | 1229 | ) { |
1230 | - $this->logger->warning('There is no setter function for property "' . $var . '"'); |
|
1230 | + $this->logger->warning('There is no setter function for property "'.$var.'"'); |
|
1231 | 1231 | } else { |
1232 | 1232 | $this->$method($value); |
1233 | 1233 | } |
@@ -142,7 +142,7 @@ discard block |
||
142 | 142 | if (!preg_match('/[0-9]{8}-[0-9]{1}/i', $id)) { |
143 | 143 | return false; |
144 | 144 | } elseif ($checksum == 10) { |
145 | - return self::checkIdentifier(($digits + 1) . substr($id, -2, 2), 'SWD'); |
|
145 | + return self::checkIdentifier(($digits + 1).substr($id, -2, 2), 'SWD'); |
|
146 | 146 | } elseif (substr($id, -1, 1) != $checksum) { |
147 | 147 | return false; |
148 | 148 | } |
@@ -307,7 +307,7 @@ discard block |
||
307 | 307 | $encrypted = openssl_encrypt($string, self::$cipherAlgorithm, $key, OPENSSL_RAW_DATA, $iv); |
308 | 308 | // Merge initialisation vector and encrypted data. |
309 | 309 | if ($encrypted !== false) { |
310 | - $encrypted = base64_encode($iv . $encrypted); |
|
310 | + $encrypted = base64_encode($iv.$encrypted); |
|
311 | 311 | } |
312 | 312 | return $encrypted; |
313 | 313 | } |
@@ -361,8 +361,8 @@ discard block |
||
361 | 361 | public static function getHookObjects($scriptRelPath) |
362 | 362 | { |
363 | 363 | $hookObjects = []; |
364 | - if (is_array($GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS'][self::$extKey . '/' . $scriptRelPath]['hookClass'])) { |
|
365 | - foreach ($GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS'][self::$extKey . '/' . $scriptRelPath]['hookClass'] as $classRef) { |
|
364 | + if (is_array($GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS'][self::$extKey.'/'.$scriptRelPath]['hookClass'])) { |
|
365 | + foreach ($GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS'][self::$extKey.'/'.$scriptRelPath]['hookClass'] as $classRef) { |
|
366 | 366 | $hookObjects[] = GeneralUtility::makeInstance($classRef); |
367 | 367 | } |
368 | 368 | } |
@@ -388,7 +388,7 @@ discard block |
||
388 | 388 | !$uid |
389 | 389 | || !in_array($table, ['tx_dlf_collections', 'tx_dlf_libraries', 'tx_dlf_metadata', 'tx_dlf_structures', 'tx_dlf_solrcores']) |
390 | 390 | ) { |
391 | - self::log('Invalid UID "' . $uid . '" or table "' . $table . '"', LOG_SEVERITY_ERROR); |
|
391 | + self::log('Invalid UID "'.$uid.'" or table "'.$table.'"', LOG_SEVERITY_ERROR); |
|
392 | 392 | return ''; |
393 | 393 | } |
394 | 394 | |
@@ -399,15 +399,15 @@ discard block |
||
399 | 399 | // Should we check for a specific PID, too? |
400 | 400 | if ($pid !== -1) { |
401 | 401 | $pid = max(intval($pid), 0); |
402 | - $where = $queryBuilder->expr()->eq($table . '.pid', $pid); |
|
402 | + $where = $queryBuilder->expr()->eq($table.'.pid', $pid); |
|
403 | 403 | } |
404 | 404 | |
405 | 405 | // Get index_name from database. |
406 | 406 | $result = $queryBuilder |
407 | - ->select($table . '.index_name AS index_name') |
|
407 | + ->select($table.'.index_name AS index_name') |
|
408 | 408 | ->from($table) |
409 | 409 | ->where( |
410 | - $queryBuilder->expr()->eq($table . '.uid', $uid), |
|
410 | + $queryBuilder->expr()->eq($table.'.uid', $uid), |
|
411 | 411 | $where, |
412 | 412 | self::whereExpression($table) |
413 | 413 | ) |
@@ -417,7 +417,7 @@ discard block |
||
417 | 417 | if ($resArray = $result->fetch()) { |
418 | 418 | return $resArray['index_name']; |
419 | 419 | } else { |
420 | - self::log('No "index_name" with UID ' . $uid . ' and PID ' . $pid . ' found in table "' . $table . '"', LOG_SEVERITY_WARNING); |
|
420 | + self::log('No "index_name" with UID '.$uid.' and PID '.$pid.' found in table "'.$table.'"', LOG_SEVERITY_WARNING); |
|
421 | 421 | return ''; |
422 | 422 | } |
423 | 423 | } |
@@ -436,9 +436,9 @@ discard block |
||
436 | 436 | // Analyze code and set appropriate ISO table. |
437 | 437 | $isoCode = strtolower(trim($code)); |
438 | 438 | if (preg_match('/^[a-z]{3}$/', $isoCode)) { |
439 | - $file = \TYPO3\CMS\Core\Utility\ExtensionManagementUtility::extPath(self::$extKey) . 'Resources/Private/Data/iso-639-2b.xml'; |
|
439 | + $file = \TYPO3\CMS\Core\Utility\ExtensionManagementUtility::extPath(self::$extKey).'Resources/Private/Data/iso-639-2b.xml'; |
|
440 | 440 | } elseif (preg_match('/^[a-z]{2}$/', $isoCode)) { |
441 | - $file = \TYPO3\CMS\Core\Utility\ExtensionManagementUtility::extPath(self::$extKey) . 'Resources/Private/Data/iso-639-1.xml'; |
|
441 | + $file = \TYPO3\CMS\Core\Utility\ExtensionManagementUtility::extPath(self::$extKey).'Resources/Private/Data/iso-639-1.xml'; |
|
442 | 442 | } else { |
443 | 443 | // No ISO code, return unchanged. |
444 | 444 | return $code; |
@@ -456,13 +456,13 @@ discard block |
||
456 | 456 | $lang = $languageService->getLLL($isoCode, $iso639); |
457 | 457 | } |
458 | 458 | } else { |
459 | - self::log('Unexpected TYPO3_MODE "' . \TYPO3_MODE . '"', LOG_SEVERITY_ERROR); |
|
459 | + self::log('Unexpected TYPO3_MODE "'.\TYPO3_MODE.'"', LOG_SEVERITY_ERROR); |
|
460 | 460 | return $code; |
461 | 461 | } |
462 | 462 | if (!empty($lang)) { |
463 | 463 | return $lang; |
464 | 464 | } else { |
465 | - self::log('Language code "' . $code . '" not found in ISO-639 table', LOG_SEVERITY_NOTICE); |
|
465 | + self::log('Language code "'.$code.'" not found in ISO-639 table', LOG_SEVERITY_NOTICE); |
|
466 | 466 | return $code; |
467 | 467 | } |
468 | 468 | } |
@@ -557,7 +557,7 @@ discard block |
||
557 | 557 | '-' => 39, |
558 | 558 | ':' => 17, |
559 | 559 | ]; |
560 | - $urn = strtolower($base . $id); |
|
560 | + $urn = strtolower($base.$id); |
|
561 | 561 | if (preg_match('/[^a-z0-9:-]/', $urn)) { |
562 | 562 | self::log('Invalid chars in given parameters', LOG_SEVERITY_WARNING); |
563 | 563 | return ''; |
@@ -571,7 +571,7 @@ discard block |
||
571 | 571 | $checksum += ($i + 1) * intval(substr($digits, $i, 1)); |
572 | 572 | } |
573 | 573 | $checksum = substr(intval($checksum / intval(substr($digits, -1, 1))), -1, 1); |
574 | - return $base . $id . $checksum; |
|
574 | + return $base.$id.$checksum; |
|
575 | 575 | } |
576 | 576 | |
577 | 577 | /** |
@@ -665,7 +665,7 @@ discard block |
||
665 | 665 | // Sanitize input. |
666 | 666 | $pid = max(intval($pid), 0); |
667 | 667 | if (!$pid) { |
668 | - self::log('Invalid PID ' . $pid . ' for translation', LOG_SEVERITY_WARNING); |
|
668 | + self::log('Invalid PID '.$pid.' for translation', LOG_SEVERITY_WARNING); |
|
669 | 669 | return $index_name; |
670 | 670 | } |
671 | 671 | /** @var \TYPO3\CMS\Frontend\Page\PageRepository $pageRepository */ |
@@ -687,13 +687,13 @@ discard block |
||
687 | 687 | // First fetch the uid of the received index_name |
688 | 688 | $result = $queryBuilder |
689 | 689 | ->select( |
690 | - $table . '.uid AS uid', |
|
691 | - $table . '.l18n_parent AS l18n_parent' |
|
690 | + $table.'.uid AS uid', |
|
691 | + $table.'.l18n_parent AS l18n_parent' |
|
692 | 692 | ) |
693 | 693 | ->from($table) |
694 | 694 | ->where( |
695 | - $queryBuilder->expr()->eq($table . '.pid', $pid), |
|
696 | - $queryBuilder->expr()->eq($table . '.index_name', $queryBuilder->expr()->literal($index_name)), |
|
695 | + $queryBuilder->expr()->eq($table.'.pid', $pid), |
|
696 | + $queryBuilder->expr()->eq($table.'.index_name', $queryBuilder->expr()->literal($index_name)), |
|
697 | 697 | self::whereExpression($table, true) |
698 | 698 | ) |
699 | 699 | ->setMaxResults(1) |
@@ -706,12 +706,12 @@ discard block |
||
706 | 706 | $resArray = $allResults[0]; |
707 | 707 | |
708 | 708 | $result = $queryBuilder |
709 | - ->select($table . '.index_name AS index_name') |
|
709 | + ->select($table.'.index_name AS index_name') |
|
710 | 710 | ->from($table) |
711 | 711 | ->where( |
712 | - $queryBuilder->expr()->eq($table . '.pid', $pid), |
|
713 | - $queryBuilder->expr()->eq($table . '.uid', $resArray['l18n_parent']), |
|
714 | - $queryBuilder->expr()->eq($table . '.sys_language_uid', intval($languageAspect->getContentId())), |
|
712 | + $queryBuilder->expr()->eq($table.'.pid', $pid), |
|
713 | + $queryBuilder->expr()->eq($table.'.uid', $resArray['l18n_parent']), |
|
714 | + $queryBuilder->expr()->eq($table.'.sys_language_uid', intval($languageAspect->getContentId())), |
|
715 | 715 | self::whereExpression($table, true) |
716 | 716 | ) |
717 | 717 | ->setMaxResults(1) |
@@ -729,14 +729,14 @@ discard block |
||
729 | 729 | if (empty($labels[$table][$pid][$languageAspect->getContentId()][$index_name])) { |
730 | 730 | // Check if this table is allowed for translation. |
731 | 731 | if (in_array($table, ['tx_dlf_collections', 'tx_dlf_libraries', 'tx_dlf_metadata', 'tx_dlf_structures'])) { |
732 | - $additionalWhere = $queryBuilder->expr()->in($table . '.sys_language_uid', [-1, 0]); |
|
732 | + $additionalWhere = $queryBuilder->expr()->in($table.'.sys_language_uid', [-1, 0]); |
|
733 | 733 | if ($languageAspect->getContentId() > 0) { |
734 | 734 | $additionalWhere = $queryBuilder->expr()->andX( |
735 | 735 | $queryBuilder->expr()->orX( |
736 | - $queryBuilder->expr()->in($table . '.sys_language_uid', [-1, 0]), |
|
737 | - $queryBuilder->expr()->eq($table . '.sys_language_uid', intval($languageAspect->getContentId())) |
|
736 | + $queryBuilder->expr()->in($table.'.sys_language_uid', [-1, 0]), |
|
737 | + $queryBuilder->expr()->eq($table.'.sys_language_uid', intval($languageAspect->getContentId())) |
|
738 | 738 | ), |
739 | - $queryBuilder->expr()->eq($table . '.l18n_parent', 0) |
|
739 | + $queryBuilder->expr()->eq($table.'.l18n_parent', 0) |
|
740 | 740 | ); |
741 | 741 | } |
742 | 742 | |
@@ -745,7 +745,7 @@ discard block |
||
745 | 745 | ->select('*') |
746 | 746 | ->from($table) |
747 | 747 | ->where( |
748 | - $queryBuilder->expr()->eq($table . '.pid', $pid), |
|
748 | + $queryBuilder->expr()->eq($table.'.pid', $pid), |
|
749 | 749 | $additionalWhere, |
750 | 750 | self::whereExpression($table, true) |
751 | 751 | ) |
@@ -763,10 +763,10 @@ discard block |
||
763 | 763 | } |
764 | 764 | } |
765 | 765 | } else { |
766 | - self::log('No translation with PID ' . $pid . ' available in table "' . $table . '" or translation not accessible', LOG_SEVERITY_NOTICE); |
|
766 | + self::log('No translation with PID '.$pid.' available in table "'.$table.'" or translation not accessible', LOG_SEVERITY_NOTICE); |
|
767 | 767 | } |
768 | 768 | } else { |
769 | - self::log('No translations available for table "' . $table . '"', LOG_SEVERITY_WARNING); |
|
769 | + self::log('No translations available for table "'.$table.'"', LOG_SEVERITY_WARNING); |
|
770 | 770 | } |
771 | 771 | } |
772 | 772 | |
@@ -808,9 +808,9 @@ discard block |
||
808 | 808 | return GeneralUtility::makeInstance(ConnectionPool::class) |
809 | 809 | ->getQueryBuilderForTable($table) |
810 | 810 | ->expr() |
811 | - ->eq($table . '.' . $GLOBALS['TCA'][$table]['ctrl']['delete'], 0); |
|
811 | + ->eq($table.'.'.$GLOBALS['TCA'][$table]['ctrl']['delete'], 0); |
|
812 | 812 | } else { |
813 | - self::log('Unexpected TYPO3_MODE "' . \TYPO3_MODE . '"', LOG_SEVERITY_ERROR); |
|
813 | + self::log('Unexpected TYPO3_MODE "'.\TYPO3_MODE.'"', LOG_SEVERITY_ERROR); |
|
814 | 814 | return '1=-1'; |
815 | 815 | } |
816 | 816 | } |
@@ -849,7 +849,7 @@ discard block |
||
849 | 849 | */ |
850 | 850 | public static function polyfillExtbaseClassesForTYPO3v9() |
851 | 851 | { |
852 | - $classes = require __DIR__ . '/../../Configuration/Extbase/Persistence/Classes.php'; |
|
852 | + $classes = require __DIR__.'/../../Configuration/Extbase/Persistence/Classes.php'; |
|
853 | 853 | |
854 | 854 | $objectManager = GeneralUtility::makeInstance(ObjectManager::class); |
855 | 855 | $configurationManager = $objectManager->get(ConfigurationManager::class); |