@@ -16,8 +16,7 @@ |
||
| 16 | 16 | |
| 17 | 17 | use TYPO3\CMS\Core\Pagination\AbstractPaginator; |
| 18 | 18 | |
| 19 | -final class PageGridPaginator extends AbstractPaginator |
|
| 20 | -{ |
|
| 19 | +final class PageGridPaginator extends AbstractPaginator { |
|
| 21 | 20 | /** |
| 22 | 21 | * @var array |
| 23 | 22 | */ |
@@ -250,10 +250,10 @@ discard block |
||
| 250 | 250 | if ($root->item(0) instanceof \DOMNode) { |
| 251 | 251 | $mets = $xml->saveXML($root->item(0)); |
| 252 | 252 | } else { |
| 253 | - $this->logger->error('No METS part found in document with location "' . $record['location'] . '"'); |
|
| 253 | + $this->logger->error('No METS part found in document with location "'.$record['location'].'"'); |
|
| 254 | 254 | } |
| 255 | 255 | } else { |
| 256 | - $this->logger->error('Could not load XML file from "' . $record['location'] . '"'); |
|
| 256 | + $this->logger->error('Could not load XML file from "'.$record['location'].'"'); |
|
| 257 | 257 | } |
| 258 | 258 | return $mets; |
| 259 | 259 | } |
@@ -421,7 +421,7 @@ discard block |
||
| 421 | 421 | $pageSettings = $this->configurationManager->getConfiguration($this->configurationManager::CONFIGURATION_TYPE_FULL_TYPOSCRIPT); |
| 422 | 422 | $storagePid = $pageSettings["plugin."]["tx_dlf."]["persistence."]["storagePid"]; |
| 423 | 423 | if ($storagePid > 0) { |
| 424 | - $this->logger->notice('No records found with PID ' . $storagePid); |
|
| 424 | + $this->logger->notice('No records found with PID '.$storagePid); |
|
| 425 | 425 | } else { |
| 426 | 426 | $this->logger->notice('No records found'); |
| 427 | 427 | } |
@@ -504,7 +504,7 @@ discard block |
||
| 504 | 504 | if (!empty($resArray)) { |
| 505 | 505 | // check, if all required fields are available for a given identifier |
| 506 | 506 | foreach ($details['requiredFields'] as $required) { |
| 507 | - $methodName = 'get' . GeneralUtility::underscoredToUpperCamelCase($required); |
|
| 507 | + $methodName = 'get'.GeneralUtility::underscoredToUpperCamelCase($required); |
|
| 508 | 508 | if (empty($resArray->$methodName())) { |
| 509 | 509 | // Skip metadata formats whose requirements are not met. |
| 510 | 510 | continue 2; |
@@ -610,9 +610,9 @@ discard block |
||
| 610 | 610 | $resArray = $result->fetchAssociative(); |
| 611 | 611 | if ($resArray) { |
| 612 | 612 | if ($resArray['index_query'] != "") { |
| 613 | - $solrQuery .= '(' . $resArray['index_query'] . ')'; |
|
| 613 | + $solrQuery .= '('.$resArray['index_query'].')'; |
|
| 614 | 614 | } else { |
| 615 | - $solrQuery .= 'collection:' . '"' . $resArray['index_name'] . '"'; |
|
| 615 | + $solrQuery .= 'collection:'.'"'.$resArray['index_name'].'"'; |
|
| 616 | 616 | } |
| 617 | 617 | } else { |
| 618 | 618 | $this->error = 'noSetHierarchy'; |
@@ -624,7 +624,7 @@ discard block |
||
| 624 | 624 | } |
| 625 | 625 | // Check for required fields. |
| 626 | 626 | foreach ($this->formats[$this->parameters['metadataPrefix']]['requiredFields'] as $required) { |
| 627 | - $solrQuery .= ' NOT ' . $required . ':""'; |
|
| 627 | + $solrQuery .= ' NOT '.$required.':""'; |
|
| 628 | 628 | } |
| 629 | 629 | // toplevel="true" is always required |
| 630 | 630 | $solrQuery .= ' AND toplevel:true'; |
@@ -638,7 +638,7 @@ discard block |
||
| 638 | 638 | return $documentSet; |
| 639 | 639 | } |
| 640 | 640 | |
| 641 | - $solrQuery .= ' AND timestamp:[' . $from . ' TO ' . $until . ']'; |
|
| 641 | + $solrQuery .= ' AND timestamp:['.$from.' TO '.$until.']'; |
|
| 642 | 642 | |
| 643 | 643 | $solr = Solr::getInstance($this->settings['solrcore']); |
| 644 | 644 | if (!$solr->ready) { |
@@ -729,7 +729,7 @@ discard block |
||
| 729 | 729 | */ |
| 730 | 730 | private function getDate(string $dateType) |
| 731 | 731 | { |
| 732 | - return strptime($this->parameters[$dateType], '%Y-%m-%dT%H:%M:%SZ') ?: strptime($this->parameters[$dateType], '%Y-%m-%d'); |
|
| 732 | + return strptime($this->parameters[$dateType], '%Y-%m-%dT%H:%M:%SZ') ? : strptime($this->parameters[$dateType], '%Y-%m-%d'); |
|
| 733 | 733 | } |
| 734 | 734 | |
| 735 | 735 | /** |
@@ -752,7 +752,7 @@ discard block |
||
| 752 | 752 | $date['tm_mday'], |
| 753 | 753 | $date['tm_year'] + 1900 |
| 754 | 754 | ); |
| 755 | - return date("Y-m-d", $timestamp) . 'T' . date("H:i:s", $timestamp) . $end; |
|
| 755 | + return date("Y-m-d", $timestamp).'T'.date("H:i:s", $timestamp).$end; |
|
| 756 | 756 | } |
| 757 | 757 | |
| 758 | 758 | /** |
@@ -865,7 +865,7 @@ discard block |
||
| 865 | 865 | $resumptionTokenInfo['cursor'] = $currentCursor; |
| 866 | 866 | $resumptionTokenInfo['completeListSize'] = $documentListSet['metadata']['completeListSize']; |
| 867 | 867 | $expireDateTime = new \DateTime(); |
| 868 | - $expireDateTime->add(new \DateInterval('PT' . $this->settings['expired'] . 'S')); |
|
| 868 | + $expireDateTime->add(new \DateInterval('PT'.$this->settings['expired'].'S')); |
|
| 869 | 869 | $resumptionTokenInfo['expired'] = $expireDateTime; |
| 870 | 870 | |
| 871 | 871 | $omitResumptionToken = $currentCursor === 0 && $numShownDocuments >= $documentListSet['metadata']['completeListSize']; |
@@ -26,8 +26,7 @@ discard block |
||
| 26 | 26 | * |
| 27 | 27 | * @access public |
| 28 | 28 | */ |
| 29 | -class OaiPmhController extends AbstractController |
|
| 30 | -{ |
|
| 29 | +class OaiPmhController extends AbstractController { |
|
| 31 | 30 | /** |
| 32 | 31 | * @access protected |
| 33 | 32 | * @var TokenRepository |
@@ -41,8 +40,7 @@ discard block |
||
| 41 | 40 | * |
| 42 | 41 | * @return void |
| 43 | 42 | */ |
| 44 | - public function injectTokenRepository(TokenRepository $tokenRepository) |
|
| 45 | - { |
|
| 43 | + public function injectTokenRepository(TokenRepository $tokenRepository) { |
|
| 46 | 44 | $this->tokenRepository = $tokenRepository; |
| 47 | 45 | } |
| 48 | 46 | |
@@ -59,8 +57,7 @@ discard block |
||
| 59 | 57 | * |
| 60 | 58 | * @return void |
| 61 | 59 | */ |
| 62 | - public function injectCollectionRepository(CollectionRepository $collectionRepository) |
|
| 63 | - { |
|
| 60 | + public function injectCollectionRepository(CollectionRepository $collectionRepository) { |
|
| 64 | 61 | $this->collectionRepository = $collectionRepository; |
| 65 | 62 | } |
| 66 | 63 | |
@@ -77,8 +74,7 @@ discard block |
||
| 77 | 74 | * |
| 78 | 75 | * @return void |
| 79 | 76 | */ |
| 80 | - public function injectLibraryRepository(LibraryRepository $libraryRepository) |
|
| 81 | - { |
|
| 77 | + public function injectLibraryRepository(LibraryRepository $libraryRepository) { |
|
| 82 | 78 | $this->libraryRepository = $libraryRepository; |
| 83 | 79 | } |
| 84 | 80 | |
@@ -89,8 +85,7 @@ discard block |
||
| 89 | 85 | * |
| 90 | 86 | * @return void |
| 91 | 87 | */ |
| 92 | - public function initializeAction() |
|
| 93 | - { |
|
| 88 | + public function initializeAction() { |
|
| 94 | 89 | $this->request->setFormat('xml'); |
| 95 | 90 | } |
| 96 | 91 | |
@@ -135,8 +130,7 @@ discard block |
||
| 135 | 130 | * |
| 136 | 131 | * @return void |
| 137 | 132 | */ |
| 138 | - protected function deleteExpiredTokens() |
|
| 139 | - { |
|
| 133 | + protected function deleteExpiredTokens() { |
|
| 140 | 134 | // Delete expired resumption tokens. |
| 141 | 135 | $this->tokenRepository->deleteExpiredTokens($this->settings['expired']); |
| 142 | 136 | } |
@@ -148,8 +142,7 @@ discard block |
||
| 148 | 142 | * |
| 149 | 143 | * @return void |
| 150 | 144 | */ |
| 151 | - protected function getUrlParams() |
|
| 152 | - { |
|
| 145 | + protected function getUrlParams() { |
|
| 153 | 146 | $allowedParams = [ |
| 154 | 147 | 'verb', |
| 155 | 148 | 'identifier', |
@@ -179,8 +172,7 @@ discard block |
||
| 179 | 172 | * |
| 180 | 173 | * @return array The mapped metadata array |
| 181 | 174 | */ |
| 182 | - private function getDublinCoreData(array $record) |
|
| 183 | - { |
|
| 175 | + private function getDublinCoreData(array $record) { |
|
| 184 | 176 | $metadata = []; |
| 185 | 177 | |
| 186 | 178 | $metadata[] = ['dc:identifier' => $record['record_id']]; |
@@ -222,8 +214,7 @@ discard block |
||
| 222 | 214 | * |
| 223 | 215 | * @return void |
| 224 | 216 | */ |
| 225 | - private function addDublinCoreData(&$metadata, $key, $value) |
|
| 226 | - { |
|
| 217 | + private function addDublinCoreData(&$metadata, $key, $value) { |
|
| 227 | 218 | if (!empty($value)) { |
| 228 | 219 | $metadata[] = [$key => $value]; |
| 229 | 220 | } |
@@ -239,8 +230,7 @@ discard block |
||
| 239 | 230 | * |
| 240 | 231 | * @return string The fetched METS XML |
| 241 | 232 | */ |
| 242 | - protected function getMetsData(array $record) |
|
| 243 | - { |
|
| 233 | + protected function getMetsData(array $record) { |
|
| 244 | 234 | $mets = null; |
| 245 | 235 | // Load METS file. |
| 246 | 236 | $xml = new \DOMDocument(); |
@@ -265,8 +255,7 @@ discard block |
||
| 265 | 255 | * |
| 266 | 256 | * @return void |
| 267 | 257 | */ |
| 268 | - public function mainAction() |
|
| 269 | - { |
|
| 258 | + public function mainAction() { |
|
| 270 | 259 | // Get allowed GET and POST variables. |
| 271 | 260 | $this->getUrlParams(); |
| 272 | 261 | |
@@ -333,8 +322,7 @@ discard block |
||
| 333 | 322 | * |
| 334 | 323 | * @return void |
| 335 | 324 | */ |
| 336 | - protected function verbGetRecord() |
|
| 337 | - { |
|
| 325 | + protected function verbGetRecord() { |
|
| 338 | 326 | if (count($this->parameters) !== 3 || empty($this->parameters['metadataPrefix']) || empty($this->parameters['identifier'])) { |
| 339 | 327 | $this->error = 'badArgument'; |
| 340 | 328 | return; |
@@ -386,8 +374,7 @@ discard block |
||
| 386 | 374 | * |
| 387 | 375 | * @return void |
| 388 | 376 | */ |
| 389 | - protected function verbIdentify() |
|
| 390 | - { |
|
| 377 | + protected function verbIdentify() { |
|
| 391 | 378 | $library = $this->libraryRepository->findByUid($this->settings['library']); |
| 392 | 379 | |
| 393 | 380 | $oaiIdentifyInfo = []; |
@@ -436,8 +423,7 @@ discard block |
||
| 436 | 423 | * |
| 437 | 424 | * @return void |
| 438 | 425 | */ |
| 439 | - protected function verbListIdentifiers() |
|
| 440 | - { |
|
| 426 | + protected function verbListIdentifiers() { |
|
| 441 | 427 | // If we have a resumption token we can continue our work |
| 442 | 428 | if (!empty($this->parameters['resumptionToken'])) { |
| 443 | 429 | // "resumptionToken" is an exclusive argument. |
@@ -491,8 +477,7 @@ discard block |
||
| 491 | 477 | * |
| 492 | 478 | * @return void |
| 493 | 479 | */ |
| 494 | - protected function verbListMetadataFormats() |
|
| 495 | - { |
|
| 480 | + protected function verbListMetadataFormats() { |
|
| 496 | 481 | $resArray = []; |
| 497 | 482 | // check for the optional "identifier" parameter |
| 498 | 483 | if (isset($this->parameters['identifier'])) { |
@@ -524,8 +509,7 @@ discard block |
||
| 524 | 509 | * |
| 525 | 510 | * @return void |
| 526 | 511 | */ |
| 527 | - protected function verbListRecords() |
|
| 528 | - { |
|
| 512 | + protected function verbListRecords() { |
|
| 529 | 513 | // Check for invalid arguments. |
| 530 | 514 | if (!empty($this->parameters['resumptionToken'])) { |
| 531 | 515 | // "resumptionToken" is an exclusive argument. |
@@ -580,8 +564,7 @@ discard block |
||
| 580 | 564 | * |
| 581 | 565 | * @return void |
| 582 | 566 | */ |
| 583 | - protected function verbListSets() |
|
| 584 | - { |
|
| 567 | + protected function verbListSets() { |
|
| 585 | 568 | // It is required to set a oai_name inside the collection record to be shown in oai-pmh plugin. |
| 586 | 569 | $this->settings['hideEmptyOaiNames'] = true; |
| 587 | 570 | |
@@ -727,8 +710,7 @@ discard block |
||
| 727 | 710 | * |
| 728 | 711 | * @return array|false |
| 729 | 712 | */ |
| 730 | - private function getDate(string $dateType) |
|
| 731 | - { |
|
| 713 | + private function getDate(string $dateType) { |
|
| 732 | 714 | return strptime($this->parameters[$dateType], '%Y-%m-%dT%H:%M:%SZ') ?: strptime($this->parameters[$dateType], '%Y-%m-%d'); |
| 733 | 715 | } |
| 734 | 716 | |
@@ -783,8 +765,7 @@ discard block |
||
| 783 | 765 | * |
| 784 | 766 | * @return array of enriched records |
| 785 | 767 | */ |
| 786 | - protected function generateOutputForDocumentList(array $documentListSet) |
|
| 787 | - { |
|
| 768 | + protected function generateOutputForDocumentList(array $documentListSet) { |
|
| 788 | 769 | $documentsToProcess = array_splice($documentListSet['elements'], 0, (int) $this->settings['limit']); |
| 789 | 770 | if (empty($documentsToProcess)) { |
| 790 | 771 | $this->error = 'noRecordsMatch'; |
@@ -837,8 +818,7 @@ discard block |
||
| 837 | 818 | * |
| 838 | 819 | * @return void |
| 839 | 820 | */ |
| 840 | - protected function generateResumptionTokenForDocumentListSet(array $documentListSet, int $numShownDocuments) |
|
| 841 | - { |
|
| 821 | + protected function generateResumptionTokenForDocumentListSet(array $documentListSet, int $numShownDocuments) { |
|
| 842 | 822 | // The cursor specifies how many elements have already been returned in previous requests |
| 843 | 823 | // See http://www.openarchives.org/OAI/openarchivesprotocol.html#FlowControl |
| 844 | 824 | $currentCursor = $documentListSet['metadata']['cursor']; |
@@ -241,7 +241,7 @@ discard block |
||
| 241 | 241 | */ |
| 242 | 242 | protected function getMetsData(array $record) |
| 243 | 243 | { |
| 244 | - $mets = null; |
|
| 244 | + $mets = NULL; |
|
| 245 | 245 | // Load METS file. |
| 246 | 246 | $xml = new \DOMDocument(); |
| 247 | 247 | if ($xml->load($record['location'])) { |
@@ -322,7 +322,7 @@ discard block |
||
| 322 | 322 | } else { |
| 323 | 323 | // No resumption token found or resumption token expired. |
| 324 | 324 | $this->error = 'badResumptionToken'; |
| 325 | - return null; |
|
| 325 | + return NULL; |
|
| 326 | 326 | } |
| 327 | 327 | } |
| 328 | 328 | |
@@ -583,7 +583,7 @@ discard block |
||
| 583 | 583 | protected function verbListSets() |
| 584 | 584 | { |
| 585 | 585 | // It is required to set a oai_name inside the collection record to be shown in oai-pmh plugin. |
| 586 | - $this->settings['hideEmptyOaiNames'] = true; |
|
| 586 | + $this->settings['hideEmptyOaiNames'] = TRUE; |
|
| 587 | 587 | |
| 588 | 588 | $oaiSets = $this->collectionRepository->findCollectionsBySettings($this->settings); |
| 589 | 589 | |
@@ -844,7 +844,7 @@ discard block |
||
| 844 | 844 | $currentCursor = $documentListSet['metadata']['cursor']; |
| 845 | 845 | |
| 846 | 846 | if (count($documentListSet['elements']) !== 0) { |
| 847 | - $resumptionToken = uniqid('', false); |
|
| 847 | + $resumptionToken = uniqid('', FALSE); |
|
| 848 | 848 | |
| 849 | 849 | $documentListSet['metadata']['cursor'] += $numShownDocuments; |
| 850 | 850 | |
@@ -24,8 +24,7 @@ |
||
| 24 | 24 | * |
| 25 | 25 | * @access public |
| 26 | 26 | */ |
| 27 | -class ListViewController extends AbstractController |
|
| 28 | -{ |
|
| 27 | +class ListViewController extends AbstractController { |
|
| 29 | 28 | /** |
| 30 | 29 | * @access protected |
| 31 | 30 | * @var CollectionRepository |
@@ -82,7 +82,7 @@ discard block |
||
| 82 | 82 | // extract collection(s) from collection parameter |
| 83 | 83 | $collections = []; |
| 84 | 84 | if (array_key_exists('collection', $this->searchParams)) { |
| 85 | - foreach(explode(',', $this->searchParams['collection']) as $collectionEntry) { |
|
| 85 | + foreach (explode(',', $this->searchParams['collection']) as $collectionEntry) { |
|
| 86 | 86 | $collections[] = $this->collectionRepository->findByUid((int) $collectionEntry); |
| 87 | 87 | } |
| 88 | 88 | } |
@@ -110,7 +110,7 @@ discard block |
||
| 110 | 110 | $simplePagination = new SimplePagination($solrPaginator); |
| 111 | 111 | |
| 112 | 112 | $pagination = $this->buildSimplePagination($simplePagination, $solrPaginator); |
| 113 | - $this->view->assignMultiple([ 'pagination' => $pagination, 'paginator' => $solrPaginator ]); |
|
| 113 | + $this->view->assignMultiple(['pagination' => $pagination, 'paginator' => $solrPaginator]); |
|
| 114 | 114 | } |
| 115 | 115 | |
| 116 | 116 | $this->view->assign('viewData', $this->viewData); |
@@ -91,15 +91,15 @@ |
||
| 91 | 91 | $currentPage = $this->requestData['page'] ?? 1; |
| 92 | 92 | |
| 93 | 93 | // get all sortable metadata records |
| 94 | - $sortableMetadata = $this->metadataRepository->findByIsSortable(true); |
|
| 94 | + $sortableMetadata = $this->metadataRepository->findByIsSortable(TRUE); |
|
| 95 | 95 | |
| 96 | 96 | // get all metadata records to be shown in results |
| 97 | - $listedMetadata = $this->metadataRepository->findByIsListed(true); |
|
| 97 | + $listedMetadata = $this->metadataRepository->findByIsListed(TRUE); |
|
| 98 | 98 | |
| 99 | 99 | // get all indexed metadata fields |
| 100 | - $indexedMetadata = $this->metadataRepository->findByIndexIndexed(true); |
|
| 100 | + $indexedMetadata = $this->metadataRepository->findByIndexIndexed(TRUE); |
|
| 101 | 101 | |
| 102 | - $solrResults = null; |
|
| 102 | + $solrResults = NULL; |
|
| 103 | 103 | $numResults = 0; |
| 104 | 104 | if (is_array($this->searchParams) && !empty($this->searchParams)) { |
| 105 | 105 | $solrResults = $this->documentRepository->findSolrByCollections($collections, $this->settings, $this->searchParams, $listedMetadata, $indexedMetadata); |
@@ -22,8 +22,7 @@ |
||
| 22 | 22 | * |
| 23 | 23 | * @access public |
| 24 | 24 | */ |
| 25 | -class NavigationController extends AbstractController |
|
| 26 | -{ |
|
| 25 | +class NavigationController extends AbstractController { |
|
| 27 | 26 | /** |
| 28 | 27 | * Method to get the page select values and use them with cHash |
| 29 | 28 | * |
@@ -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 | |
@@ -113,7 +113,7 @@ |
||
| 113 | 113 | // prepare feature array for fluid |
| 114 | 114 | $features = []; |
| 115 | 115 | foreach (explode(',', $this->settings['features']) as $feature) { |
| 116 | - $features[$feature] = true; |
|
| 116 | + $features[$feature] = TRUE; |
|
| 117 | 117 | } |
| 118 | 118 | $this->view->assign('features', $features); |
| 119 | 119 | |
@@ -68,7 +68,7 @@ |
||
| 68 | 68 | $pageGridPagination = new PageGridPagination($pageGridPaginator); |
| 69 | 69 | |
| 70 | 70 | $pagination = $this->buildSimplePagination($pageGridPagination, $pageGridPaginator); |
| 71 | - $this->view->assignMultiple([ 'pagination' => $pagination, 'paginator' => $pageGridPaginator ]); |
|
| 71 | + $this->view->assignMultiple(['pagination' => $pagination, 'paginator' => $pageGridPaginator]); |
|
| 72 | 72 | |
| 73 | 73 | $this->view->assign('docUid', $this->requestData['id']); |
| 74 | 74 | } |
@@ -23,8 +23,7 @@ |
||
| 23 | 23 | * |
| 24 | 24 | * @access public |
| 25 | 25 | */ |
| 26 | -class PageGridController extends AbstractController |
|
| 27 | -{ |
|
| 26 | +class PageGridController extends AbstractController { |
|
| 28 | 27 | /** |
| 29 | 28 | * The main method of the plugin |
| 30 | 29 | * |
@@ -27,8 +27,7 @@ |
||
| 27 | 27 | * |
| 28 | 28 | * @access public |
| 29 | 29 | */ |
| 30 | -class MetadataController extends AbstractController |
|
| 31 | -{ |
|
| 30 | +class MetadataController extends AbstractController { |
|
| 32 | 31 | /** |
| 33 | 32 | * @access private |
| 34 | 33 | * @var AbstractDocument |
@@ -155,7 +155,7 @@ discard block |
||
| 155 | 155 | protected function printMetadata(array $metadata): void |
| 156 | 156 | { |
| 157 | 157 | if ($this->useOriginalIiifManifestMetadata) { |
| 158 | - $this->view->assign('useIiif', true); |
|
| 158 | + $this->view->assign('useIiif', TRUE); |
|
| 159 | 159 | $this->view->assign('iiifData', $this->buildIiifData($metadata)); |
| 160 | 160 | } else { |
| 161 | 161 | // findBySettings also sorts entries by the `sorting` field |
@@ -245,9 +245,9 @@ discard block |
||
| 245 | 245 | if (IRI::isAbsoluteIri($value) && ($scheme == 'http' || $scheme == 'https')) { |
| 246 | 246 | //TODO: should really label be converted to empty string if equal to value? |
| 247 | 247 | $label = $value == $label ? '' : $label; |
| 248 | - $buildUrl = true; |
|
| 248 | + $buildUrl = TRUE; |
|
| 249 | 249 | } else { |
| 250 | - $buildUrl = false; |
|
| 250 | + $buildUrl = FALSE; |
|
| 251 | 251 | } |
| 252 | 252 | |
| 253 | 253 | return [ |
@@ -388,7 +388,7 @@ discard block |
||
| 388 | 388 | private function parseParentTitle(int $i, $value, array &$metadata) : void |
| 389 | 389 | { |
| 390 | 390 | if (empty(implode('', $value)) && $this->settings['getTitle'] && $this->document->getPartof()) { |
| 391 | - $superiorTitle = AbstractDocument::getTitle($this->document->getPartof(), true); |
|
| 391 | + $superiorTitle = AbstractDocument::getTitle($this->document->getPartof(), TRUE); |
|
| 392 | 392 | if (!empty($superiorTitle)) { |
| 393 | 393 | $metadata[$i]['title'] = ['[' . $superiorTitle . ']']; |
| 394 | 394 | } |
@@ -136,7 +136,7 @@ discard block |
||
| 136 | 136 | } |
| 137 | 137 | |
| 138 | 138 | if (empty(array_filter($metadata))) { |
| 139 | - $this->logger->warning('No metadata found for document with UID ' . $this->document->getUid()); |
|
| 139 | + $this->logger->warning('No metadata found for document with UID '.$this->document->getUid()); |
|
| 140 | 140 | return; |
| 141 | 141 | } |
| 142 | 142 | ksort($metadata); |
@@ -174,7 +174,7 @@ discard block |
||
| 174 | 174 | $this->parseMetadata($i, $name, $value, $metadata); |
| 175 | 175 | |
| 176 | 176 | if (is_array($metadata[$i][$name])) { |
| 177 | - $metadata[$i][$name] = array_values(array_filter($metadata[$i][$name], function ($metadataValue) { |
|
| 177 | + $metadata[$i][$name] = array_values(array_filter($metadata[$i][$name], function($metadataValue) { |
|
| 178 | 178 | return !empty($metadataValue); |
| 179 | 179 | })); |
| 180 | 180 | } |
@@ -391,7 +391,7 @@ discard block |
||
| 391 | 391 | if (empty(implode('', $value)) && $this->settings['getTitle'] && $this->document->getPartof()) { |
| 392 | 392 | $superiorTitle = AbstractDocument::getTitle($this->document->getPartof(), true); |
| 393 | 393 | if (!empty($superiorTitle)) { |
| 394 | - $metadata[$i]['title'] = ['[' . $superiorTitle . ']']; |
|
| 394 | + $metadata[$i]['title'] = ['['.$superiorTitle.']']; |
|
| 395 | 395 | } |
| 396 | 396 | } |
| 397 | 397 | } |
@@ -23,8 +23,7 @@ |
||
| 23 | 23 | * |
| 24 | 24 | * @access public |
| 25 | 25 | */ |
| 26 | -class TableOfContentsController extends AbstractController |
|
| 27 | -{ |
|
| 26 | +class TableOfContentsController extends AbstractController { |
|
| 28 | 27 | /** |
| 29 | 28 | * This holds the active entries according to the currently selected page |
| 30 | 29 | * |
@@ -72,12 +72,12 @@ discard block |
||
| 72 | 72 | $this->getAllLogicalUnits(); |
| 73 | 73 | // Go through table of contents and create all menu entries. |
| 74 | 74 | foreach ($this->document->getCurrentDocument()->tableOfContents as $entry) { |
| 75 | - $menuArray[] = $this->getMenuEntry($entry, true); |
|
| 75 | + $menuArray[] = $this->getMenuEntry($entry, TRUE); |
|
| 76 | 76 | } |
| 77 | 77 | } else { |
| 78 | 78 | // Go through table of contents and create top-level menu entries. |
| 79 | 79 | foreach ($this->document->getCurrentDocument()->tableOfContents as $entry) { |
| 80 | - $menuArray[] = $this->getMenuEntry($entry, false); |
|
| 80 | + $menuArray[] = $this->getMenuEntry($entry, FALSE); |
|
| 81 | 81 | } |
| 82 | 82 | // Build table of contents from database. |
| 83 | 83 | $result = $this->documentRepository->getTableOfContentsFromDb($this->document->getUid(), $this->document->getPid(), $this->settings); |
@@ -97,7 +97,7 @@ discard block |
||
| 97 | 97 | 'pagination' => '', |
| 98 | 98 | 'targetUid' => $resArray['uid'] |
| 99 | 99 | ]; |
| 100 | - $menuArray[0]['_SUB_MENU'][] = $this->getMenuEntry($entry, false); |
|
| 100 | + $menuArray[0]['_SUB_MENU'][] = $this->getMenuEntry($entry, FALSE); |
|
| 101 | 101 | } |
| 102 | 102 | } |
| 103 | 103 | } |
@@ -115,7 +115,7 @@ discard block |
||
| 115 | 115 | * |
| 116 | 116 | * @return array HMENU array for menu entry |
| 117 | 117 | */ |
| 118 | - private function getMenuEntry(array $entry, bool $recursive = false): array |
|
| 118 | + private function getMenuEntry(array $entry, bool $recursive = FALSE): array |
|
| 119 | 119 | { |
| 120 | 120 | $entry = $this->resolveMenuEntry($entry); |
| 121 | 121 | |
@@ -175,7 +175,7 @@ discard block |
||
| 175 | 175 | } |
| 176 | 176 | // Build sub-menu if available and called recursively. |
| 177 | 177 | if ( |
| 178 | - $recursive === true |
|
| 178 | + $recursive === TRUE |
|
| 179 | 179 | && !empty($entry['children']) |
| 180 | 180 | ) { |
| 181 | 181 | // Build sub-menu only if one of the following conditions apply: |
@@ -193,7 +193,7 @@ discard block |
||
| 193 | 193 | if (in_array($child['id'], $this->activeEntries)) { |
| 194 | 194 | $entryArray['ITEM_STATE'] = 'ACT'; |
| 195 | 195 | } |
| 196 | - $entryArray['_SUB_MENU'][] = $this->getMenuEntry($child, true); |
|
| 196 | + $entryArray['_SUB_MENU'][] = $this->getMenuEntry($child, TRUE); |
|
| 197 | 197 | } |
| 198 | 198 | } |
| 199 | 199 | // Append "IFSUB" to "ITEM_STATE" if this entry has sub-entries. |
@@ -161,7 +161,7 @@ discard block |
||
| 161 | 161 | } |
| 162 | 162 | } |
| 163 | 163 | // Append "IFSUB" to "ITEM_STATE" if this entry has sub-entries. |
| 164 | - $entryArray['ITEM_STATE'] = ($entryArray['ITEM_STATE'] == 'NO' ? 'IFSUB' : $entryArray['ITEM_STATE'] . 'IFSUB'); |
|
| 164 | + $entryArray['ITEM_STATE'] = ($entryArray['ITEM_STATE'] == 'NO' ? 'IFSUB' : $entryArray['ITEM_STATE'].'IFSUB'); |
|
| 165 | 165 | } |
| 166 | 166 | return $entryArray; |
| 167 | 167 | } |
@@ -338,16 +338,16 @@ discard block |
||
| 338 | 338 | $title = ''; |
| 339 | 339 | foreach ($fields as $field) { |
| 340 | 340 | if ($field == 'type') { |
| 341 | - $title .= $this->getTranslatedType($entry['type']) . ' '; |
|
| 341 | + $title .= $this->getTranslatedType($entry['type']).' '; |
|
| 342 | 342 | } else { |
| 343 | - $title .= $entry[$field] . ' '; |
|
| 343 | + $title .= $entry[$field].' '; |
|
| 344 | 344 | } |
| 345 | 345 | } |
| 346 | 346 | return trim($title); |
| 347 | 347 | } |
| 348 | 348 | } |
| 349 | 349 | } |
| 350 | - return $label ?: $orderLabel; |
|
| 350 | + return $label ? : $orderLabel; |
|
| 351 | 351 | } |
| 352 | 352 | |
| 353 | 353 | /** |
@@ -382,7 +382,7 @@ discard block |
||
| 382 | 382 | { |
| 383 | 383 | usort( |
| 384 | 384 | $menu[0]['_SUB_MENU'], |
| 385 | - function ($firstElement, $secondElement) { |
|
| 385 | + function($firstElement, $secondElement) { |
|
| 386 | 386 | if (!empty($firstElement['orderlabel'])) { |
| 387 | 387 | return $firstElement['orderlabel'] <=> $secondElement['orderlabel']; |
| 388 | 388 | } |
@@ -75,7 +75,7 @@ discard block |
||
| 75 | 75 | if ($library) { |
| 76 | 76 | $feedMeta['copyright'] = $library->getLabel(); |
| 77 | 77 | } else { |
| 78 | - $this->logger->error('Failed to fetch label of selected library with "' . $this->settings['library'] . '"'); |
|
| 78 | + $this->logger->error('Failed to fetch label of selected library with "'.$this->settings['library'].'"'); |
|
| 79 | 79 | } |
| 80 | 80 | |
| 81 | 81 | if ( |
@@ -95,12 +95,12 @@ discard block |
||
| 95 | 95 | ) { |
| 96 | 96 | $superiorTitle = AbstractDocument::getTitle($document->getPartof(), true); |
| 97 | 97 | if (!empty($superiorTitle)) { |
| 98 | - $title .= '[' . $superiorTitle . ']'; |
|
| 98 | + $title .= '['.$superiorTitle.']'; |
|
| 99 | 99 | } |
| 100 | 100 | } |
| 101 | 101 | // Get title of document. |
| 102 | 102 | if (!empty($document->getTitle())) { |
| 103 | - $title .= ' ' . $document->getTitle(); |
|
| 103 | + $title .= ' '.$document->getTitle(); |
|
| 104 | 104 | } |
| 105 | 105 | // Set default title if empty. |
| 106 | 106 | if (empty($title)) { |
@@ -108,13 +108,13 @@ discard block |
||
| 108 | 108 | } |
| 109 | 109 | // Append volume information. |
| 110 | 110 | if (!empty($document->getVolume())) { |
| 111 | - $title .= ', ' . LocalizationUtility::translate('volume', 'dlf') . ' ' . $document->getVolume(); |
|
| 111 | + $title .= ', '.LocalizationUtility::translate('volume', 'dlf').' '.$document->getVolume(); |
|
| 112 | 112 | } |
| 113 | 113 | // Is this document new or updated? |
| 114 | 114 | if ($document->getCrdate() == $document->getTstamp()) { |
| 115 | - $title = LocalizationUtility::translate('plugins.feeds.new', 'dlf') . ' ' . trim($title); |
|
| 115 | + $title = LocalizationUtility::translate('plugins.feeds.new', 'dlf').' '.trim($title); |
|
| 116 | 116 | } else { |
| 117 | - $title = LocalizationUtility::translate('plugins.feeds.update', 'dlf') . ' ' . trim($title); |
|
| 117 | + $title = LocalizationUtility::translate('plugins.feeds.update', 'dlf').' '.trim($title); |
|
| 118 | 118 | } |
| 119 | 119 | |
| 120 | 120 | $document->setTitle($title); |
@@ -24,8 +24,7 @@ |
||
| 24 | 24 | * |
| 25 | 25 | * @access public |
| 26 | 26 | */ |
| 27 | -class FeedsController extends AbstractController |
|
| 28 | -{ |
|
| 27 | +class FeedsController extends AbstractController { |
|
| 29 | 28 | |
| 30 | 29 | /** |
| 31 | 30 | * @access protected |
@@ -84,7 +84,7 @@ discard block |
||
| 84 | 84 | || GeneralUtility::inList($this->settings['collections'], $requestData['collection']) |
| 85 | 85 | ) { |
| 86 | 86 | |
| 87 | - $documents = $this->documentRepository->findAllByCollectionsLimited(GeneralUtility::intExplode(',', $requestData['collection'], true), $this->settings['limit']); |
|
| 87 | + $documents = $this->documentRepository->findAllByCollectionsLimited(GeneralUtility::intExplode(',', $requestData['collection'], TRUE), $this->settings['limit']); |
|
| 88 | 88 | |
| 89 | 89 | foreach ($documents as $document) { |
| 90 | 90 | |
@@ -93,7 +93,7 @@ discard block |
||
| 93 | 93 | if ((empty($document->getTitle()) || !empty($this->settings['prependSuperiorTitle'])) |
| 94 | 94 | && !empty($document->getPartof()) |
| 95 | 95 | ) { |
| 96 | - $superiorTitle = AbstractDocument::getTitle($document->getPartof(), true); |
|
| 96 | + $superiorTitle = AbstractDocument::getTitle($document->getPartof(), TRUE); |
|
| 97 | 97 | if (!empty($superiorTitle)) { |
| 98 | 98 | $title .= '[' . $superiorTitle . ']'; |
| 99 | 99 | } |
@@ -134,8 +134,8 @@ discard block |
||
| 134 | 134 | $this->view->assign('calendarData', $calendarData); |
| 135 | 135 | $this->view->assign('documentId', $this->document->getUid()); |
| 136 | 136 | $this->view->assign('yearLinkTitle', $yearLinkTitle); |
| 137 | - $this->view->assign('parentDocumentId', $this->document->getPartof() ?: $this->document->getCurrentDocument()->tableOfContents[0]['points']); |
|
| 138 | - $this->view->assign('allYearDocTitle', $this->document->getCurrentDocument()->getTitle($this->document->getPartof()) ?: $this->document->getCurrentDocument()->tableOfContents[0]['label']); |
|
| 137 | + $this->view->assign('parentDocumentId', $this->document->getPartof() ? : $this->document->getCurrentDocument()->tableOfContents[0]['points']); |
|
| 138 | + $this->view->assign('allYearDocTitle', $this->document->getCurrentDocument()->getTitle($this->document->getPartof()) ? : $this->document->getCurrentDocument()->tableOfContents[0]['label']); |
|
| 139 | 139 | } |
| 140 | 140 | |
| 141 | 141 | /** |
@@ -220,7 +220,7 @@ discard block |
||
| 220 | 220 | } |
| 221 | 221 | |
| 222 | 222 | $this->view->assign('documentId', $this->document->getUid()); |
| 223 | - $this->view->assign('allYearDocTitle', $this->document->getCurrentDocument()->getTitle((int) $this->document->getUid()) ?: $this->document->getCurrentDocument()->tableOfContents[0]['label']); |
|
| 223 | + $this->view->assign('allYearDocTitle', $this->document->getCurrentDocument()->getTitle((int) $this->document->getUid()) ? : $this->document->getCurrentDocument()->tableOfContents[0]['label']); |
|
| 224 | 224 | } |
| 225 | 225 | |
| 226 | 226 | /** |
@@ -239,7 +239,7 @@ discard block |
||
| 239 | 239 | protected function getCalendarYear(array &$calendarData, array $calendarIssuesByMonth, int $year, int $firstMonth = 1, int $lastMonth = 12): void |
| 240 | 240 | { |
| 241 | 241 | for ($i = $firstMonth; $i <= $lastMonth; $i++) { |
| 242 | - $key = $year . '-' . $i; |
|
| 242 | + $key = $year.'-'.$i; |
|
| 243 | 243 | |
| 244 | 244 | $calendarData[$key] = [ |
| 245 | 245 | 'DAYMON_NAME' => strftime('%a', strtotime('last Monday')), |
@@ -249,16 +249,16 @@ discard block |
||
| 249 | 249 | 'DAYFRI_NAME' => strftime('%a', strtotime('last Friday')), |
| 250 | 250 | 'DAYSAT_NAME' => strftime('%a', strtotime('last Saturday')), |
| 251 | 251 | 'DAYSUN_NAME' => strftime('%a', strtotime('last Sunday')), |
| 252 | - 'MONTHNAME' => strftime('%B', strtotime($year . '-' . $i . '-1')) . ' ' . $year, |
|
| 252 | + 'MONTHNAME' => strftime('%B', strtotime($year.'-'.$i.'-1')).' '.$year, |
|
| 253 | 253 | 'CALYEAR' => ($i == $firstMonth) ? $year : '' |
| 254 | 254 | ]; |
| 255 | 255 | |
| 256 | - $firstOfMonth = strtotime($year . '-' . $i . '-1'); |
|
| 256 | + $firstOfMonth = strtotime($year.'-'.$i.'-1'); |
|
| 257 | 257 | $lastOfMonth = strtotime('last day of', ($firstOfMonth)); |
| 258 | 258 | $firstOfMonthStart = strtotime('last Monday', $firstOfMonth); |
| 259 | 259 | // There are never more than 6 weeks in a month. |
| 260 | 260 | for ($j = 0; $j <= 5; $j++) { |
| 261 | - $firstDayOfWeek = strtotime('+ ' . $j . ' Week', $firstOfMonthStart); |
|
| 261 | + $firstDayOfWeek = strtotime('+ '.$j.' Week', $firstOfMonthStart); |
|
| 262 | 262 | |
| 263 | 263 | $calendarData[$key]['week'][$j] = [ |
| 264 | 264 | 'DAYMON' => ['dayValue' => ' '], |
@@ -271,7 +271,7 @@ discard block |
||
| 271 | 271 | ]; |
| 272 | 272 | // Every week has seven days. ;-) |
| 273 | 273 | for ($k = 0; $k <= 6; $k++) { |
| 274 | - $currentDayTime = strtotime('+ ' . $k . ' Day', $firstDayOfWeek); |
|
| 274 | + $currentDayTime = strtotime('+ '.$k.' Day', $firstDayOfWeek); |
|
| 275 | 275 | if ( |
| 276 | 276 | $currentDayTime >= $firstOfMonth |
| 277 | 277 | && $currentDayTime <= $lastOfMonth |
@@ -342,7 +342,7 @@ discard block |
||
| 342 | 342 | */ |
| 343 | 343 | private function fillCalendar(array &$calendarData, int $currentDayTime, string $dayLinks, array $dayLinkDiv, int $firstDayOfWeek, int $k): void |
| 344 | 344 | { |
| 345 | - switch (strftime('%w', strtotime('+ ' . $k . ' Day', $firstDayOfWeek))) { |
|
| 345 | + switch (strftime('%w', strtotime('+ '.$k.' Day', $firstDayOfWeek))) { |
|
| 346 | 346 | case '0': |
| 347 | 347 | $this->fillDay($calendarData, $currentDayTime, 'DAYSUN', $dayLinks, $dayLinkDiv); |
| 348 | 348 | break; |
@@ -446,7 +446,7 @@ discard block |
||
| 446 | 446 | $_day = date('j', $dateTimestamp); |
| 447 | 447 | $issuesByYear[$_year][$_month][$_day][] = $issue; |
| 448 | 448 | } else { |
| 449 | - $this->logger->warning('Document with UID ' . $issue['uid'] . 'has no valid date of publication'); |
|
| 449 | + $this->logger->warning('Document with UID '.$issue['uid'].'has no valid date of publication'); |
|
| 450 | 450 | } |
| 451 | 451 | } |
| 452 | 452 | // Sort by years. |
@@ -489,7 +489,7 @@ discard block |
||
| 489 | 489 | foreach ($year['children'] as $month) { |
| 490 | 490 | foreach ($month['children'] as $day) { |
| 491 | 491 | foreach ($day['children'] as $issue) { |
| 492 | - $title = $issue['label'] ?: $issue['orderlabel']; |
|
| 492 | + $title = $issue['label'] ? : $issue['orderlabel']; |
|
| 493 | 493 | if (strtotime($title) !== false) { |
| 494 | 494 | $title = strftime('%x', strtotime($title)); |
| 495 | 495 | } |
@@ -25,8 +25,7 @@ |
||
| 25 | 25 | * |
| 26 | 26 | * @access public |
| 27 | 27 | */ |
| 28 | -class CalendarController extends AbstractController |
|
| 29 | -{ |
|
| 28 | +class CalendarController extends AbstractController { |
|
| 30 | 29 | /** |
| 31 | 30 | * @access protected |
| 32 | 31 | * @var StructureRepository |
@@ -82,9 +82,9 @@ discard block |
||
| 82 | 82 | switch ($type) { |
| 83 | 83 | case 'newspaper': |
| 84 | 84 | case 'ephemera': |
| 85 | - $this->forward('years', null, null, $this->requestData); |
|
| 85 | + $this->forward('years', NULL, NULL, $this->requestData); |
|
| 86 | 86 | case 'year': |
| 87 | - $this->forward('calendar', null, null, $this->requestData); |
|
| 87 | + $this->forward('calendar', NULL, NULL, $this->requestData); |
|
| 88 | 88 | case 'issue': |
| 89 | 89 | default: |
| 90 | 90 | break; |
@@ -440,7 +440,7 @@ discard block |
||
| 440 | 440 | |
| 441 | 441 | foreach ($this->getIssues() as $issue) { |
| 442 | 442 | $dateTimestamp = strtotime($issue['year']); |
| 443 | - if ($dateTimestamp !== false) { |
|
| 443 | + if ($dateTimestamp !== FALSE) { |
|
| 444 | 444 | $_year = date('Y', $dateTimestamp); |
| 445 | 445 | $_month = date('n', $dateTimestamp); |
| 446 | 446 | $_day = date('j', $dateTimestamp); |
@@ -490,7 +490,7 @@ discard block |
||
| 490 | 490 | foreach ($month['children'] as $day) { |
| 491 | 491 | foreach ($day['children'] as $issue) { |
| 492 | 492 | $title = $issue['label'] ?: $issue['orderlabel']; |
| 493 | - if (strtotime($title) !== false) { |
|
| 493 | + if (strtotime($title) !== FALSE) { |
|
| 494 | 494 | $title = strftime('%x', strtotime($title)); |
| 495 | 495 | } |
| 496 | 496 | |
@@ -523,7 +523,7 @@ discard block |
||
| 523 | 523 | $title = $document->getTitle(); |
| 524 | 524 | } else { |
| 525 | 525 | $title = !empty($document->getMetsLabel()) ? $document->getMetsLabel() : $document->getMetsOrderlabel(); |
| 526 | - if (strtotime($title) !== false) { |
|
| 526 | + if (strtotime($title) !== FALSE) { |
|
| 527 | 527 | $title = strftime('%x', strtotime($title)); |
| 528 | 528 | } |
| 529 | 529 | } |