@@ -11,16 +11,16 @@ |
||
11 | 11 | * LICENSE.txt file that was distributed with this source code. |
12 | 12 | */ |
13 | 13 | |
14 | -$classLoader = require_once __DIR__ . '/../../../vendor/autoload.php'; |
|
14 | +$classLoader = require_once __DIR__.'/../../../vendor/autoload.php'; |
|
15 | 15 | |
16 | 16 | $outputPath = $argv[1] ?? null; |
17 | 17 | if (empty($outputPath) || !is_writable(($outputPath))) { |
18 | - echo 'Error: Output path not specified or not writable' . "\n"; |
|
18 | + echo 'Error: Output path not specified or not writable'."\n"; |
|
19 | 19 | exit(1); |
20 | 20 | } |
21 | 21 | |
22 | -putenv('TYPO3_PATH_ROOT=' . __DIR__ . '/public'); |
|
23 | -putenv('TYPO3_PATH_APP=' . __DIR__); |
|
22 | +putenv('TYPO3_PATH_ROOT='.__DIR__.'/public'); |
|
23 | +putenv('TYPO3_PATH_APP='.__DIR__); |
|
24 | 24 | |
25 | 25 | // For compatibility with TYPO v9 |
26 | 26 | define('PATH_thisScript', __FILE__); |
@@ -13,7 +13,7 @@ discard block |
||
13 | 13 | |
14 | 14 | $classLoader = require_once __DIR__ . '/../../../vendor/autoload.php'; |
15 | 15 | |
16 | -$outputPath = $argv[1] ?? null; |
|
16 | +$outputPath = $argv[1] ?? NULL; |
|
17 | 17 | if (empty($outputPath) || !is_writable(($outputPath))) { |
18 | 18 | echo 'Error: Output path not specified or not writable' . "\n"; |
19 | 19 | exit(1); |
@@ -27,7 +27,7 @@ discard block |
||
27 | 27 | |
28 | 28 | // For request types other than "FE", the configuration manager would try to access the database. |
29 | 29 | \TYPO3\CMS\Core\Core\SystemEnvironmentBuilder::run(1, \TYPO3\CMS\Core\Core\SystemEnvironmentBuilder::REQUESTTYPE_FE); |
30 | -\TYPO3\CMS\Core\Core\Bootstrap::init($classLoader, false); |
|
30 | +\TYPO3\CMS\Core\Core\Bootstrap::init($classLoader, FALSE); |
|
31 | 31 | |
32 | 32 | $generator = new \Kitodo\DbDocs\Generator(); |
33 | 33 | $tables = $generator->collectTables(); |
@@ -35,13 +35,11 @@ |
||
35 | 35 | * {typoscript -> kitodo:metadataWrapVariable(name: 'wrapInfo')} |
36 | 36 | * |
37 | 37 | */ |
38 | -class MetadataWrapVariableViewHelper extends AbstractViewHelper |
|
39 | -{ |
|
38 | +class MetadataWrapVariableViewHelper extends AbstractViewHelper { |
|
40 | 39 | /** |
41 | 40 | * @return void |
42 | 41 | */ |
43 | - public function initializeArguments() |
|
44 | - { |
|
42 | + public function initializeArguments() { |
|
45 | 43 | $this->registerArgument('name', 'string', 'Name of variable to create', true); |
46 | 44 | } |
47 | 45 |
@@ -42,7 +42,7 @@ |
||
42 | 42 | */ |
43 | 43 | public function initializeArguments() |
44 | 44 | { |
45 | - $this->registerArgument('name', 'string', 'Name of variable to create', true); |
|
45 | + $this->registerArgument('name', 'string', 'Name of variable to create', TRUE); |
|
46 | 46 | } |
47 | 47 | |
48 | 48 | /** |
@@ -71,7 +71,7 @@ discard block |
||
71 | 71 | if ($library) { |
72 | 72 | $feedMeta['copyright'] = $library->getLabel(); |
73 | 73 | } else { |
74 | - $this->logger->error('Failed to fetch label of selected library with "' . $this->settings['library'] . '"'); |
|
74 | + $this->logger->error('Failed to fetch label of selected library with "'.$this->settings['library'].'"'); |
|
75 | 75 | } |
76 | 76 | |
77 | 77 | if ( |
@@ -91,12 +91,12 @@ discard block |
||
91 | 91 | ) { |
92 | 92 | $superiorTitle = Doc::getTitle($document->getPartof(), true); |
93 | 93 | if (!empty($superiorTitle)) { |
94 | - $title .= '[' . $superiorTitle . ']'; |
|
94 | + $title .= '['.$superiorTitle.']'; |
|
95 | 95 | } |
96 | 96 | } |
97 | 97 | // Get title of document. |
98 | 98 | if (!empty($document->getTitle())) { |
99 | - $title .= ' ' . $document->getTitle(); |
|
99 | + $title .= ' '.$document->getTitle(); |
|
100 | 100 | } |
101 | 101 | // Set default title if empty. |
102 | 102 | if (empty($title)) { |
@@ -104,13 +104,13 @@ discard block |
||
104 | 104 | } |
105 | 105 | // Append volume information. |
106 | 106 | if (!empty($document->getVolume())) { |
107 | - $title .= ', ' . LocalizationUtility::translate('volume', 'dlf') . ' ' . $document->getVolume(); |
|
107 | + $title .= ', '.LocalizationUtility::translate('volume', 'dlf').' '.$document->getVolume(); |
|
108 | 108 | } |
109 | 109 | // Is this document new or updated? |
110 | 110 | if ($document->getCrdate() == $document->getTstamp()) { |
111 | - $title = LocalizationUtility::translate('plugins.feeds.new', 'dlf') . ' ' . trim($title); |
|
111 | + $title = LocalizationUtility::translate('plugins.feeds.new', 'dlf').' '.trim($title); |
|
112 | 112 | } else { |
113 | - $title = LocalizationUtility::translate('plugins.feeds.update', 'dlf') . ' ' . trim($title); |
|
113 | + $title = LocalizationUtility::translate('plugins.feeds.update', 'dlf').' '.trim($title); |
|
114 | 114 | } |
115 | 115 | |
116 | 116 | $document->setTitle($title); |
@@ -25,8 +25,7 @@ discard block |
||
25 | 25 | * @subpackage dlf |
26 | 26 | * @access public |
27 | 27 | */ |
28 | -class FeedsController extends AbstractController |
|
29 | -{ |
|
28 | +class FeedsController extends AbstractController { |
|
30 | 29 | |
31 | 30 | /** |
32 | 31 | * @var LibraryRepository |
@@ -36,8 +35,7 @@ discard block |
||
36 | 35 | /** |
37 | 36 | * @param LibraryRepository $libraryRepository |
38 | 37 | */ |
39 | - public function injectLibraryRepository(LibraryRepository $libraryRepository) |
|
40 | - { |
|
38 | + public function injectLibraryRepository(LibraryRepository $libraryRepository) { |
|
41 | 39 | $this->libraryRepository = $libraryRepository; |
42 | 40 | } |
43 | 41 | |
@@ -46,8 +44,7 @@ discard block |
||
46 | 44 | * |
47 | 45 | * @return void |
48 | 46 | */ |
49 | - public function initializeAction() |
|
50 | - { |
|
47 | + public function initializeAction() { |
|
51 | 48 | $this->request->setFormat('xml'); |
52 | 49 | } |
53 | 50 | |
@@ -56,8 +53,7 @@ discard block |
||
56 | 53 | * |
57 | 54 | * @return void |
58 | 55 | */ |
59 | - public function mainAction() |
|
60 | - { |
|
56 | + public function mainAction() { |
|
61 | 57 | // access to GET parameter tx_dlf_feeds['collection'] |
62 | 58 | $requestData = $this->request->getArguments(); |
63 | 59 |
@@ -80,7 +80,7 @@ discard block |
||
80 | 80 | || GeneralUtility::inList($this->settings['collections'], $requestData['collection']) |
81 | 81 | ) { |
82 | 82 | |
83 | - $documents = $this->documentRepository->findAllByCollectionsLimited(GeneralUtility::intExplode(',', $requestData['collection'], true), $this->settings['limit']); |
|
83 | + $documents = $this->documentRepository->findAllByCollectionsLimited(GeneralUtility::intExplode(',', $requestData['collection'], TRUE), $this->settings['limit']); |
|
84 | 84 | |
85 | 85 | foreach ($documents as $document) { |
86 | 86 | |
@@ -89,7 +89,7 @@ discard block |
||
89 | 89 | if ((empty($document->getTitle()) || !empty($this->settings['prependSuperiorTitle'])) |
90 | 90 | && !empty($document->getPartof()) |
91 | 91 | ) { |
92 | - $superiorTitle = Doc::getTitle($document->getPartof(), true); |
|
92 | + $superiorTitle = Doc::getTitle($document->getPartof(), TRUE); |
|
93 | 93 | if (!empty($superiorTitle)) { |
94 | 94 | $title .= '[' . $superiorTitle . ']'; |
95 | 95 | } |
@@ -243,10 +243,10 @@ discard block |
||
243 | 243 | if ($root->item(0) instanceof \DOMNode) { |
244 | 244 | $mets = $xml->saveXML($root->item(0)); |
245 | 245 | } else { |
246 | - $this->logger->error('No METS part found in document with location "' . $record['location'] . '"'); |
|
246 | + $this->logger->error('No METS part found in document with location "'.$record['location'].'"'); |
|
247 | 247 | } |
248 | 248 | } else { |
249 | - $this->logger->error('Could not load XML file from "' . $record['location'] . '"'); |
|
249 | + $this->logger->error('Could not load XML file from "'.$record['location'].'"'); |
|
250 | 250 | } |
251 | 251 | return $mets; |
252 | 252 | } |
@@ -412,7 +412,7 @@ discard block |
||
412 | 412 | $pageSettings = $this->configurationManager->getConfiguration($this->configurationManager::CONFIGURATION_TYPE_FULL_TYPOSCRIPT); |
413 | 413 | $storagePid = $pageSettings["plugin."]["tx_dlf."]["persistence."]["storagePid"]; |
414 | 414 | if ($storagePid > 0) { |
415 | - $this->logger->notice('No records found with PID ' . $storagePid); |
|
415 | + $this->logger->notice('No records found with PID '.$storagePid); |
|
416 | 416 | } else { |
417 | 417 | $this->logger->notice('No records found'); |
418 | 418 | } |
@@ -495,7 +495,7 @@ discard block |
||
495 | 495 | if (!empty($resArray)) { |
496 | 496 | // check, if all required fields are available for a given identifier |
497 | 497 | foreach ($details['requiredFields'] as $required) { |
498 | - $methodName = 'get' . GeneralUtility::underscoredToUpperCamelCase($required); |
|
498 | + $methodName = 'get'.GeneralUtility::underscoredToUpperCamelCase($required); |
|
499 | 499 | if (empty($resArray->$methodName())) { |
500 | 500 | // Skip metadata formats whose requirements are not met. |
501 | 501 | continue 2; |
@@ -600,9 +600,9 @@ discard block |
||
600 | 600 | |
601 | 601 | if ($resArray = $result->fetch()) { |
602 | 602 | if ($resArray['index_query'] != "") { |
603 | - $solr_query .= '(' . $resArray['index_query'] . ')'; |
|
603 | + $solr_query .= '('.$resArray['index_query'].')'; |
|
604 | 604 | } else { |
605 | - $solr_query .= 'collection:' . '"' . $resArray['index_name'] . '"'; |
|
605 | + $solr_query .= 'collection:'.'"'.$resArray['index_name'].'"'; |
|
606 | 606 | } |
607 | 607 | } else { |
608 | 608 | $this->error = 'noSetHierarchy'; |
@@ -614,7 +614,7 @@ discard block |
||
614 | 614 | } |
615 | 615 | // Check for required fields. |
616 | 616 | foreach ($this->formats[$this->parameters['metadataPrefix']]['requiredFields'] as $required) { |
617 | - $solr_query .= ' NOT ' . $required . ':""'; |
|
617 | + $solr_query .= ' NOT '.$required.':""'; |
|
618 | 618 | } |
619 | 619 | // toplevel="true" is always required |
620 | 620 | $solr_query .= ' AND toplevel:true'; |
@@ -628,7 +628,7 @@ discard block |
||
628 | 628 | ) { |
629 | 629 | $timestamp = gmmktime($date_array['tm_hour'], $date_array['tm_min'], $date_array['tm_sec'], |
630 | 630 | $date_array['tm_mon'] + 1, $date_array['tm_mday'], $date_array['tm_year'] + 1900); |
631 | - $from = date("Y-m-d", $timestamp) . 'T' . date("H:i:s", $timestamp) . '.000Z'; |
|
631 | + $from = date("Y-m-d", $timestamp).'T'.date("H:i:s", $timestamp).'.000Z'; |
|
632 | 632 | } else { |
633 | 633 | $this->error = 'badArgument'; |
634 | 634 | return; |
@@ -644,7 +644,7 @@ discard block |
||
644 | 644 | ) { |
645 | 645 | $timestamp = gmmktime($date_array['tm_hour'], $date_array['tm_min'], $date_array['tm_sec'], |
646 | 646 | $date_array['tm_mon'] + 1, $date_array['tm_mday'], $date_array['tm_year'] + 1900); |
647 | - $until = date("Y-m-d", $timestamp) . 'T' . date("H:i:s", $timestamp) . '.999Z'; |
|
647 | + $until = date("Y-m-d", $timestamp).'T'.date("H:i:s", $timestamp).'.999Z'; |
|
648 | 648 | if ($from != "*" && $from > $until) { |
649 | 649 | $this->error = 'badArgument'; |
650 | 650 | } |
@@ -661,7 +661,7 @@ discard block |
||
661 | 661 | $this->error = 'badArgument'; |
662 | 662 | } |
663 | 663 | } |
664 | - $solr_query .= ' AND timestamp:[' . $from . ' TO ' . $until . ']'; |
|
664 | + $solr_query .= ' AND timestamp:['.$from.' TO '.$until.']'; |
|
665 | 665 | $documentSet = []; |
666 | 666 | $solr = Solr::getInstance($this->settings['solrcore']); |
667 | 667 | if (!$solr->ready) { |
@@ -780,7 +780,7 @@ discard block |
||
780 | 780 | $resumptionTokenInfo['cursor'] = $currentCursor; |
781 | 781 | $resumptionTokenInfo['completeListSize'] = $documentListSet['metadata']['completeListSize']; |
782 | 782 | $expireDateTime = new \DateTime(); |
783 | - $expireDateTime->add(new \DateInterval('PT' . $this->settings['expired'] . 'S')); |
|
783 | + $expireDateTime->add(new \DateInterval('PT'.$this->settings['expired'].'S')); |
|
784 | 784 | $resumptionTokenInfo['expired'] = $expireDateTime; |
785 | 785 | |
786 | 786 | $omitResumptionToken = $currentCursor === 0 && $numShownDocuments >= $documentListSet['metadata']['completeListSize']; |
@@ -27,8 +27,7 @@ discard block |
||
27 | 27 | * @subpackage dlf |
28 | 28 | * @access public |
29 | 29 | */ |
30 | -class OaiPmhController extends AbstractController |
|
31 | -{ |
|
30 | +class OaiPmhController extends AbstractController { |
|
32 | 31 | /** |
33 | 32 | * @var TokenRepository |
34 | 33 | */ |
@@ -37,8 +36,7 @@ discard block |
||
37 | 36 | /** |
38 | 37 | * @param TokenRepository $tokenRepository |
39 | 38 | */ |
40 | - public function injectTokenRepository(TokenRepository $tokenRepository) |
|
41 | - { |
|
39 | + public function injectTokenRepository(TokenRepository $tokenRepository) { |
|
42 | 40 | $this->tokenRepository = $tokenRepository; |
43 | 41 | } |
44 | 42 | |
@@ -50,8 +48,7 @@ discard block |
||
50 | 48 | /** |
51 | 49 | * @param CollectionRepository $collectionRepository |
52 | 50 | */ |
53 | - public function injectCollectionRepository(CollectionRepository $collectionRepository) |
|
54 | - { |
|
51 | + public function injectCollectionRepository(CollectionRepository $collectionRepository) { |
|
55 | 52 | $this->collectionRepository = $collectionRepository; |
56 | 53 | } |
57 | 54 | |
@@ -63,8 +60,7 @@ discard block |
||
63 | 60 | /** |
64 | 61 | * @param LibraryRepository $libraryRepository |
65 | 62 | */ |
66 | - public function injectLibraryRepository(LibraryRepository $libraryRepository) |
|
67 | - { |
|
63 | + public function injectLibraryRepository(LibraryRepository $libraryRepository) { |
|
68 | 64 | $this->libraryRepository = $libraryRepository; |
69 | 65 | } |
70 | 66 | |
@@ -73,8 +69,7 @@ discard block |
||
73 | 69 | * |
74 | 70 | * @return void |
75 | 71 | */ |
76 | - public function initializeAction() |
|
77 | - { |
|
72 | + public function initializeAction() { |
|
78 | 73 | $this->request->setFormat('xml'); |
79 | 74 | } |
80 | 75 | |
@@ -122,8 +117,7 @@ discard block |
||
122 | 117 | * |
123 | 118 | * @return void |
124 | 119 | */ |
125 | - protected function deleteExpiredTokens() |
|
126 | - { |
|
120 | + protected function deleteExpiredTokens() { |
|
127 | 121 | // Delete expired resumption tokens. |
128 | 122 | $this->tokenRepository->deleteExpiredTokens($this->settings['expired']); |
129 | 123 | } |
@@ -135,8 +129,7 @@ discard block |
||
135 | 129 | * |
136 | 130 | * @return void |
137 | 131 | */ |
138 | - protected function getUrlParams() |
|
139 | - { |
|
132 | + protected function getUrlParams() { |
|
140 | 133 | $allowedParams = [ |
141 | 134 | 'verb', |
142 | 135 | 'identifier', |
@@ -166,8 +159,7 @@ discard block |
||
166 | 159 | * |
167 | 160 | * @return array $metadata: The mapped metadata array |
168 | 161 | */ |
169 | - protected function getDcData(array $record) |
|
170 | - { |
|
162 | + protected function getDcData(array $record) { |
|
171 | 163 | $metadata = []; |
172 | 164 | |
173 | 165 | $metadata[] = ['dc:identifier' => $record['record_id']]; |
@@ -232,8 +224,7 @@ discard block |
||
232 | 224 | * |
233 | 225 | * @return string: The fetched METS XML |
234 | 226 | */ |
235 | - protected function getMetsData(array $record) |
|
236 | - { |
|
227 | + protected function getMetsData(array $record) { |
|
237 | 228 | $mets = null; |
238 | 229 | // Load METS file. |
239 | 230 | $xml = new \DOMDocument(); |
@@ -256,8 +247,7 @@ discard block |
||
256 | 247 | * |
257 | 248 | * @return void |
258 | 249 | */ |
259 | - public function mainAction() |
|
260 | - { |
|
250 | + public function mainAction() { |
|
261 | 251 | // Get allowed GET and POST variables. |
262 | 252 | $this->getUrlParams(); |
263 | 253 | |
@@ -324,8 +314,7 @@ discard block |
||
324 | 314 | * |
325 | 315 | * @return void |
326 | 316 | */ |
327 | - protected function verbGetRecord() |
|
328 | - { |
|
317 | + protected function verbGetRecord() { |
|
329 | 318 | if (count($this->parameters) !== 3 || empty($this->parameters['metadataPrefix']) || empty($this->parameters['identifier'])) { |
330 | 319 | $this->error = 'badArgument'; |
331 | 320 | return; |
@@ -377,8 +366,7 @@ discard block |
||
377 | 366 | * |
378 | 367 | * @return void |
379 | 368 | */ |
380 | - protected function verbIdentify() |
|
381 | - { |
|
369 | + protected function verbIdentify() { |
|
382 | 370 | $library = $this->libraryRepository->findByUid($this->settings['library']); |
383 | 371 | |
384 | 372 | $oaiIdentifyInfo = []; |
@@ -427,8 +415,7 @@ discard block |
||
427 | 415 | * |
428 | 416 | * @return void |
429 | 417 | */ |
430 | - protected function verbListIdentifiers() |
|
431 | - { |
|
418 | + protected function verbListIdentifiers() { |
|
432 | 419 | // If we have a resumption token we can continue our work |
433 | 420 | if (!empty($this->parameters['resumptionToken'])) { |
434 | 421 | // "resumptionToken" is an exclusive argument. |
@@ -482,8 +469,7 @@ discard block |
||
482 | 469 | * |
483 | 470 | * @return void |
484 | 471 | */ |
485 | - protected function verbListMetadataFormats() |
|
486 | - { |
|
472 | + protected function verbListMetadataFormats() { |
|
487 | 473 | $resArray = []; |
488 | 474 | // check for the optional "identifier" parameter |
489 | 475 | if (isset($this->parameters['identifier'])) { |
@@ -515,8 +501,7 @@ discard block |
||
515 | 501 | * |
516 | 502 | * @return void |
517 | 503 | */ |
518 | - protected function verbListRecords() |
|
519 | - { |
|
504 | + protected function verbListRecords() { |
|
520 | 505 | // Check for invalid arguments. |
521 | 506 | if (!empty($this->parameters['resumptionToken'])) { |
522 | 507 | // "resumptionToken" is an exclusive argument. |
@@ -571,8 +556,7 @@ discard block |
||
571 | 556 | * |
572 | 557 | * @return void |
573 | 558 | */ |
574 | - protected function verbListSets() |
|
575 | - { |
|
559 | + protected function verbListSets() { |
|
576 | 560 | // It is required to set a oai_name inside the collection record to be shown in oai-pmh plugin. |
577 | 561 | $this->settings['hideEmptyOaiNames'] = true; |
578 | 562 | |
@@ -588,8 +572,7 @@ discard block |
||
588 | 572 | * |
589 | 573 | * @return array|null Array of matching records |
590 | 574 | */ |
591 | - protected function fetchDocumentUIDs() |
|
592 | - { |
|
575 | + protected function fetchDocumentUIDs() { |
|
593 | 576 | $solr_query = ''; |
594 | 577 | // Check "set" for valid value. |
595 | 578 | if (!empty($this->parameters['set'])) { |
@@ -698,8 +681,7 @@ discard block |
||
698 | 681 | * |
699 | 682 | * @return array of enriched records |
700 | 683 | */ |
701 | - protected function generateOutputForDocumentList(array $documentListSet) |
|
702 | - { |
|
684 | + protected function generateOutputForDocumentList(array $documentListSet) { |
|
703 | 685 | $documentsToProcess = array_splice($documentListSet['elements'], 0, (int) $this->settings['limit']); |
704 | 686 | if (empty($documentsToProcess)) { |
705 | 687 | $this->error = 'noRecordsMatch'; |
@@ -752,8 +734,7 @@ discard block |
||
752 | 734 | * |
753 | 735 | * @return void |
754 | 736 | */ |
755 | - protected function generateResumptionTokenForDocumentListSet(array $documentListSet, int $numShownDocuments) |
|
756 | - { |
|
737 | + protected function generateResumptionTokenForDocumentListSet(array $documentListSet, int $numShownDocuments) { |
|
757 | 738 | // The cursor specifies how many elements have already been returned in previous requests |
758 | 739 | // See http://www.openarchives.org/OAI/openarchivesprotocol.html#FlowControl |
759 | 740 | $currentCursor = $documentListSet['metadata']['cursor']; |
@@ -234,7 +234,7 @@ discard block |
||
234 | 234 | */ |
235 | 235 | protected function getMetsData(array $record) |
236 | 236 | { |
237 | - $mets = null; |
|
237 | + $mets = NULL; |
|
238 | 238 | // Load METS file. |
239 | 239 | $xml = new \DOMDocument(); |
240 | 240 | if ($xml->load($record['location'])) { |
@@ -313,7 +313,7 @@ discard block |
||
313 | 313 | } else { |
314 | 314 | // No resumption token found or resumption token expired. |
315 | 315 | $this->error = 'badResumptionToken'; |
316 | - return null; |
|
316 | + return NULL; |
|
317 | 317 | } |
318 | 318 | } |
319 | 319 | |
@@ -574,7 +574,7 @@ discard block |
||
574 | 574 | protected function verbListSets() |
575 | 575 | { |
576 | 576 | // It is required to set a oai_name inside the collection record to be shown in oai-pmh plugin. |
577 | - $this->settings['hideEmptyOaiNames'] = true; |
|
577 | + $this->settings['hideEmptyOaiNames'] = TRUE; |
|
578 | 578 | |
579 | 579 | $oaiSets = $this->collectionRepository->findCollectionsBySettings($this->settings); |
580 | 580 | |
@@ -606,7 +606,7 @@ discard block |
||
606 | 606 | } |
607 | 607 | } else { |
608 | 608 | $this->error = 'noSetHierarchy'; |
609 | - return null; |
|
609 | + return NULL; |
|
610 | 610 | } |
611 | 611 | } else { |
612 | 612 | // If no set is specified we have to query for all collections |
@@ -759,7 +759,7 @@ discard block |
||
759 | 759 | $currentCursor = $documentListSet['metadata']['cursor']; |
760 | 760 | |
761 | 761 | if (count($documentListSet['elements']) !== 0) { |
762 | - $resumptionToken = uniqid('', false); |
|
762 | + $resumptionToken = uniqid('', FALSE); |
|
763 | 763 | |
764 | 764 | $documentListSet['metadata']['cursor'] += $numShownDocuments; |
765 | 765 |
@@ -125,7 +125,7 @@ discard block |
||
125 | 125 | if ($this->document) { |
126 | 126 | $doc = Doc::getInstance($this->document->getLocation(), $this->settings, true); |
127 | 127 | } else { |
128 | - $this->logger->error('Invalid UID "' . $requestData['id'] . '" or PID "' . $this->settings['storagePid'] . '" for document loading'); |
|
128 | + $this->logger->error('Invalid UID "'.$requestData['id'].'" or PID "'.$this->settings['storagePid'].'" for document loading'); |
|
129 | 129 | } |
130 | 130 | } else if (GeneralUtility::isValidUrl($requestData['id'])) { |
131 | 131 | |
@@ -143,7 +143,7 @@ discard block |
||
143 | 143 | |
144 | 144 | $this->document->setLocation($requestData['id']); |
145 | 145 | } else { |
146 | - $this->logger->error('Invalid location given "' . $requestData['id'] . '" for document loading'); |
|
146 | + $this->logger->error('Invalid location given "'.$requestData['id'].'" for document loading'); |
|
147 | 147 | } |
148 | 148 | } |
149 | 149 | |
@@ -160,11 +160,11 @@ discard block |
||
160 | 160 | if ($this->document !== null && $doc !== null) { |
161 | 161 | $this->document->setDoc($doc); |
162 | 162 | } else { |
163 | - $this->logger->error('Failed to load document with record ID "' . $requestData['recordId'] . '"'); |
|
163 | + $this->logger->error('Failed to load document with record ID "'.$requestData['recordId'].'"'); |
|
164 | 164 | } |
165 | 165 | } |
166 | 166 | } else { |
167 | - $this->logger->error('Invalid ID "' . $requestData['id'] . '" or PID "' . $this->settings['storagePid'] . '" for document loading'); |
|
167 | + $this->logger->error('Invalid ID "'.$requestData['id'].'" or PID "'.$this->settings['storagePid'].'" for document loading'); |
|
168 | 168 | } |
169 | 169 | } |
170 | 170 |
@@ -117,26 +117,26 @@ discard block |
||
117 | 117 | // Try to get document format from database |
118 | 118 | if (!empty($requestData['id'])) { |
119 | 119 | |
120 | - $doc = null; |
|
120 | + $doc = NULL; |
|
121 | 121 | |
122 | 122 | if (MathUtility::canBeInterpretedAsInteger($requestData['id'])) { |
123 | 123 | // find document from repository by uid |
124 | 124 | $this->document = $this->documentRepository->findOneByIdAndSettings((int) $requestData['id']); |
125 | 125 | if ($this->document) { |
126 | - $doc = Doc::getInstance($this->document->getLocation(), $this->settings, true); |
|
126 | + $doc = Doc::getInstance($this->document->getLocation(), $this->settings, TRUE); |
|
127 | 127 | } else { |
128 | 128 | $this->logger->error('Invalid UID "' . $requestData['id'] . '" or PID "' . $this->settings['storagePid'] . '" for document loading'); |
129 | 129 | } |
130 | 130 | } else if (GeneralUtility::isValidUrl($requestData['id'])) { |
131 | 131 | |
132 | - $doc = Doc::getInstance($requestData['id'], $this->settings, true); |
|
132 | + $doc = Doc::getInstance($requestData['id'], $this->settings, TRUE); |
|
133 | 133 | |
134 | - if ($doc !== null) { |
|
134 | + if ($doc !== NULL) { |
|
135 | 135 | if ($doc->recordId) { |
136 | 136 | $this->document = $this->documentRepository->findOneByRecordId($doc->recordId); |
137 | 137 | } |
138 | 138 | |
139 | - if ($this->document === null) { |
|
139 | + if ($this->document === NULL) { |
|
140 | 140 | // create new dummy Document object |
141 | 141 | $this->document = GeneralUtility::makeInstance(Document::class); |
142 | 142 | } |
@@ -147,7 +147,7 @@ discard block |
||
147 | 147 | } |
148 | 148 | } |
149 | 149 | |
150 | - if ($this->document !== null && $doc !== null) { |
|
150 | + if ($this->document !== NULL && $doc !== NULL) { |
|
151 | 151 | $this->document->setDoc($doc); |
152 | 152 | } |
153 | 153 | |
@@ -155,9 +155,9 @@ discard block |
||
155 | 155 | |
156 | 156 | $this->document = $this->documentRepository->findOneByRecordId($requestData['recordId']); |
157 | 157 | |
158 | - if ($this->document !== null) { |
|
159 | - $doc = Doc::getInstance($this->document->getLocation(), $this->settings, true); |
|
160 | - if ($this->document !== null && $doc !== null) { |
|
158 | + if ($this->document !== NULL) { |
|
159 | + $doc = Doc::getInstance($this->document->getLocation(), $this->settings, TRUE); |
|
160 | + if ($this->document !== NULL && $doc !== NULL) { |
|
161 | 161 | $this->document->setDoc($doc); |
162 | 162 | } else { |
163 | 163 | $this->logger->error('Failed to load document with record ID "' . $requestData['recordId'] . '"'); |
@@ -191,7 +191,7 @@ discard block |
||
191 | 191 | if ($this->request->hasArgument($parameterName)) { |
192 | 192 | return $this->request->getArgument($parameterName); |
193 | 193 | } |
194 | - return null; |
|
194 | + return NULL; |
|
195 | 195 | } |
196 | 196 | |
197 | 197 | /** |
@@ -44,8 +44,7 @@ discard block |
||
44 | 44 | /** |
45 | 45 | * @param DocumentRepository $documentRepository |
46 | 46 | */ |
47 | - public function injectDocumentRepository(DocumentRepository $documentRepository) |
|
48 | - { |
|
47 | + public function injectDocumentRepository(DocumentRepository $documentRepository) { |
|
49 | 48 | $this->documentRepository = $documentRepository; |
50 | 49 | } |
51 | 50 | |
@@ -85,8 +84,7 @@ discard block |
||
85 | 84 | * @access protected |
86 | 85 | * @return void |
87 | 86 | */ |
88 | - protected function initialize() |
|
89 | - { |
|
87 | + protected function initialize() { |
|
90 | 88 | $this->requestData = GeneralUtility::_GPmerged('tx_dlf'); |
91 | 89 | if (empty($this->requestData['page'])) { |
92 | 90 | $this->requestData['page'] = 1; |
@@ -112,8 +110,7 @@ discard block |
||
112 | 110 | * |
113 | 111 | * @return void |
114 | 112 | */ |
115 | - protected function loadDocument($requestData) |
|
116 | - { |
|
113 | + protected function loadDocument($requestData) { |
|
117 | 114 | // Try to get document format from database |
118 | 115 | if (!empty($requestData['id'])) { |
119 | 116 | |
@@ -186,8 +183,7 @@ discard block |
||
186 | 183 | * |
187 | 184 | * @return null|string|array |
188 | 185 | */ |
189 | - protected function getParametersSafely($parameterName) |
|
190 | - { |
|
186 | + protected function getParametersSafely($parameterName) { |
|
191 | 187 | if ($this->request->hasArgument($parameterName)) { |
192 | 188 | return $this->request->getArgument($parameterName); |
193 | 189 | } |
@@ -201,8 +197,7 @@ discard block |
||
201 | 197 | * |
202 | 198 | * @return void |
203 | 199 | */ |
204 | - public function __construct() |
|
205 | - { |
|
200 | + public function __construct() { |
|
206 | 201 | $this->initialize(); |
207 | 202 | } |
208 | 203 | } |
@@ -96,14 +96,14 @@ |
||
96 | 96 | foreach ($collections as $collection) { |
97 | 97 | $solr_query = ''; |
98 | 98 | if ($collection->getIndexSearch() != '') { |
99 | - $solr_query .= '(' . $collection->getIndexSearch() . ')'; |
|
99 | + $solr_query .= '('.$collection->getIndexSearch().')'; |
|
100 | 100 | } else { |
101 | - $solr_query .= 'collection:("' . Solr::escapeQuery($collection->getIndexName()) . '")'; |
|
101 | + $solr_query .= 'collection:("'.Solr::escapeQuery($collection->getIndexName()).'")'; |
|
102 | 102 | } |
103 | - $params['query'] = $solr_query . ' AND partof:0 AND toplevel:true'; |
|
103 | + $params['query'] = $solr_query.' AND partof:0 AND toplevel:true'; |
|
104 | 104 | $partOfNothing = $solr->search_raw($params); |
105 | 105 | |
106 | - $params['query'] = $solr_query . ' AND NOT partof:0 AND toplevel:true'; |
|
106 | + $params['query'] = $solr_query.' AND NOT partof:0 AND toplevel:true'; |
|
107 | 107 | $partOfSomething = $solr->search_raw($params); |
108 | 108 | // Titles are all documents that are "root" elements i.e. partof == 0 |
109 | 109 | $collectionInfo['titles'] = []; |
@@ -29,8 +29,7 @@ discard block |
||
29 | 29 | * @subpackage dlf |
30 | 30 | * @access public |
31 | 31 | */ |
32 | -class CollectionController extends AbstractController |
|
33 | -{ |
|
32 | +class CollectionController extends AbstractController { |
|
34 | 33 | /** |
35 | 34 | * @var CollectionRepository |
36 | 35 | */ |
@@ -39,8 +38,7 @@ discard block |
||
39 | 38 | /** |
40 | 39 | * @param CollectionRepository $collectionRepository |
41 | 40 | */ |
42 | - public function injectCollectionRepository(CollectionRepository $collectionRepository) |
|
43 | - { |
|
41 | + public function injectCollectionRepository(CollectionRepository $collectionRepository) { |
|
44 | 42 | $this->collectionRepository = $collectionRepository; |
45 | 43 | } |
46 | 44 | |
@@ -52,8 +50,7 @@ discard block |
||
52 | 50 | /** |
53 | 51 | * @param MetadataRepository $metadataRepository |
54 | 52 | */ |
55 | - public function injectMetadataRepository(MetadataRepository $metadataRepository) |
|
56 | - { |
|
53 | + public function injectMetadataRepository(MetadataRepository $metadataRepository) { |
|
57 | 54 | $this->metadataRepository = $metadataRepository; |
58 | 55 | } |
59 | 56 | |
@@ -62,8 +59,7 @@ discard block |
||
62 | 59 | * |
63 | 60 | * @return void |
64 | 61 | */ |
65 | - public function listAction() |
|
66 | - { |
|
62 | + public function listAction() { |
|
67 | 63 | $solr = Solr::getInstance($this->settings['solrcore']); |
68 | 64 | |
69 | 65 | if (!$solr->ready) { |
@@ -146,8 +142,7 @@ discard block |
||
146 | 142 | * |
147 | 143 | * @return void |
148 | 144 | */ |
149 | - public function showAction(\Kitodo\Dlf\Domain\Model\Collection $collection) |
|
150 | - { |
|
145 | + public function showAction(\Kitodo\Dlf\Domain\Model\Collection $collection) { |
|
151 | 146 | $searchParams = $this->getParametersSafely('searchParameter'); |
152 | 147 | |
153 | 148 | // Instaniate the Solr. Without Solr present, we can't do anything. |
@@ -199,8 +194,7 @@ discard block |
||
199 | 194 | * |
200 | 195 | * @return void |
201 | 196 | */ |
202 | - public function showSortedAction() |
|
203 | - { |
|
197 | + public function showSortedAction() { |
|
204 | 198 | // if search was triggered, get search parameters from POST variables |
205 | 199 | $searchParams = $this->getParametersSafely('searchParameter'); |
206 | 200 |
@@ -87,7 +87,7 @@ discard block |
||
87 | 87 | } |
88 | 88 | |
89 | 89 | if (count($collections) == 1 && empty($this->settings['dont_show_single']) && is_array($collections)) { |
90 | - $this->forward('show', null, null, ['collection' => array_pop($collections)]); |
|
90 | + $this->forward('show', NULL, NULL, ['collection' => array_pop($collections)]); |
|
91 | 91 | } |
92 | 92 | |
93 | 93 | $processedCollections = []; |
@@ -166,7 +166,7 @@ discard block |
||
166 | 166 | $searchParams['collection'] = $collection; |
167 | 167 | // If a targetPid is given, the results will be shown by ListView on the target page. |
168 | 168 | if (!empty($this->settings['targetPid'])) { |
169 | - $this->redirect('main', 'ListView', null, |
|
169 | + $this->redirect('main', 'ListView', NULL, |
|
170 | 170 | [ |
171 | 171 | 'searchParameter' => $searchParams, |
172 | 172 | 'widgetPage' => $widgetPage |
@@ -175,10 +175,10 @@ discard block |
||
175 | 175 | } |
176 | 176 | |
177 | 177 | // get all metadata records to be shown in results |
178 | - $listedMetadata = $this->metadataRepository->findByIsListed(true); |
|
178 | + $listedMetadata = $this->metadataRepository->findByIsListed(TRUE); |
|
179 | 179 | |
180 | 180 | // get all sortable metadata records |
181 | - $sortableMetadata = $this->metadataRepository->findByIsSortable(true); |
|
181 | + $sortableMetadata = $this->metadataRepository->findByIsSortable(TRUE); |
|
182 | 182 | |
183 | 183 | // get all documents of given collection |
184 | 184 | $solrResults = $this->documentRepository->findSolrByCollection($collection, $this->settings, $searchParams, $listedMetadata); |
@@ -204,13 +204,13 @@ discard block |
||
204 | 204 | // if search was triggered, get search parameters from POST variables |
205 | 205 | $searchParams = $this->getParametersSafely('searchParameter'); |
206 | 206 | |
207 | - $collection = null; |
|
207 | + $collection = NULL; |
|
208 | 208 | if ($searchParams['collection']['__identity'] && MathUtility::canBeInterpretedAsInteger($searchParams['collection']['__identity'])) { |
209 | 209 | $collection = $this->collectionRepository->findByUid($searchParams['collection']['__identity']); |
210 | 210 | } |
211 | 211 | |
212 | 212 | // output is done by show action |
213 | - $this->forward('show', null, null, ['searchParameter' => $searchParams, 'collection' => $collection]); |
|
213 | + $this->forward('show', NULL, NULL, ['searchParameter' => $searchParams, 'collection' => $collection]); |
|
214 | 214 | |
215 | 215 | } |
216 | 216 | } |
@@ -25,8 +25,7 @@ discard block |
||
25 | 25 | * @subpackage dlf |
26 | 26 | * @access public |
27 | 27 | */ |
28 | -class AudioplayerController extends AbstractController |
|
29 | -{ |
|
28 | +class AudioplayerController extends AbstractController { |
|
30 | 29 | /** |
31 | 30 | * Holds the current audio file's URL, MIME type and optional label |
32 | 31 | * |
@@ -42,8 +41,7 @@ discard block |
||
42 | 41 | * |
43 | 42 | * @return void |
44 | 43 | */ |
45 | - protected function addPlayerJS() |
|
46 | - { |
|
44 | + protected function addPlayerJS() { |
|
47 | 45 | // Inline CSS. |
48 | 46 | $inlineCSS = '#tx-dlf-audio { width: 100px; height: 100px; }'; |
49 | 47 | |
@@ -72,8 +70,7 @@ discard block |
||
72 | 70 | * |
73 | 71 | * @return void |
74 | 72 | */ |
75 | - public function mainAction() |
|
76 | - { |
|
73 | + public function mainAction() { |
|
77 | 74 | // Load current document. |
78 | 75 | $this->loadDocument($this->requestData); |
79 | 76 | if ( |
@@ -77,8 +77,8 @@ |
||
77 | 77 | // Load current document. |
78 | 78 | $this->loadDocument($this->requestData); |
79 | 79 | if ( |
80 | - $this->document === null |
|
81 | - || $this->document->getDoc() === null |
|
80 | + $this->document === NULL |
|
81 | + || $this->document->getDoc() === NULL |
|
82 | 82 | || $this->document->getDoc()->numPages < 1 |
83 | 83 | ) { |
84 | 84 | // Quit without doing anything if required variables are not set. |
@@ -52,12 +52,12 @@ |
||
52 | 52 | $(document).ready(function() { |
53 | 53 | AudioPlayer = new dlfAudioPlayer({ |
54 | 54 | audio: { |
55 | - mimeType: "' . $this->audio['mimetype'] . '", |
|
56 | - title: "' . $this->audio['label'] . '", |
|
57 | - url: "' . $this->audio['url'] . '" |
|
55 | + mimeType: "' . $this->audio['mimetype'].'", |
|
56 | + title: "' . $this->audio['label'].'", |
|
57 | + url: "' . $this->audio['url'].'" |
|
58 | 58 | }, |
59 | 59 | parentElId: "tx-dlf-audio", |
60 | - swfPath: "' . PathUtility::stripPathSitePrefix(ExtensionManagementUtility::extPath('dlf')) . 'Resources/Public/JavaScript/jPlayer/jquery.jplayer.swf" |
|
60 | + swfPath: "' . PathUtility::stripPathSitePrefix(ExtensionManagementUtility::extPath('dlf')).'Resources/Public/JavaScript/jPlayer/jquery.jplayer.swf" |
|
61 | 61 | }); |
62 | 62 | }); |
63 | 63 | '; |
@@ -29,8 +29,7 @@ discard block |
||
29 | 29 | * @subpackage dlf |
30 | 30 | * @access public |
31 | 31 | */ |
32 | -class ListViewController extends AbstractController |
|
33 | -{ |
|
32 | +class ListViewController extends AbstractController { |
|
34 | 33 | /** |
35 | 34 | * @var CollectionRepository |
36 | 35 | */ |
@@ -39,8 +38,7 @@ discard block |
||
39 | 38 | /** |
40 | 39 | * @param CollectionRepository $collectionRepository |
41 | 40 | */ |
42 | - public function injectCollectionRepository(CollectionRepository $collectionRepository) |
|
43 | - { |
|
41 | + public function injectCollectionRepository(CollectionRepository $collectionRepository) { |
|
44 | 42 | $this->collectionRepository = $collectionRepository; |
45 | 43 | } |
46 | 44 | |
@@ -52,8 +50,7 @@ discard block |
||
52 | 50 | /** |
53 | 51 | * @param MetadataRepository $metadataRepository |
54 | 52 | */ |
55 | - public function injectMetadataRepository(MetadataRepository $metadataRepository) |
|
56 | - { |
|
53 | + public function injectMetadataRepository(MetadataRepository $metadataRepository) { |
|
57 | 54 | $this->metadataRepository = $metadataRepository; |
58 | 55 | } |
59 | 56 | |
@@ -68,8 +65,7 @@ discard block |
||
68 | 65 | * |
69 | 66 | * @return void |
70 | 67 | */ |
71 | - public function mainAction() |
|
72 | - { |
|
68 | + public function mainAction() { |
|
73 | 69 | $this->searchParams = $this->getParametersSafely('searchParameter'); |
74 | 70 | |
75 | 71 | $collection = null; |
@@ -72,7 +72,7 @@ discard block |
||
72 | 72 | { |
73 | 73 | $this->searchParams = $this->getParametersSafely('searchParameter'); |
74 | 74 | |
75 | - $collection = null; |
|
75 | + $collection = NULL; |
|
76 | 76 | if ($this->searchParams['collection'] && MathUtility::canBeInterpretedAsInteger($this->searchParams['collection'])) { |
77 | 77 | $collection = $this->collectionRepository->findByUid($this->searchParams['collection']); |
78 | 78 | } |
@@ -83,15 +83,15 @@ discard block |
||
83 | 83 | } |
84 | 84 | |
85 | 85 | // get all sortable metadata records |
86 | - $sortableMetadata = $this->metadataRepository->findByIsSortable(true); |
|
86 | + $sortableMetadata = $this->metadataRepository->findByIsSortable(TRUE); |
|
87 | 87 | |
88 | 88 | // get all metadata records to be shown in results |
89 | - $listedMetadata = $this->metadataRepository->findByIsListed(true); |
|
89 | + $listedMetadata = $this->metadataRepository->findByIsListed(TRUE); |
|
90 | 90 | |
91 | 91 | $solrResults = []; |
92 | 92 | $numResults = 0; |
93 | 93 | if (is_array($this->searchParams) && !empty($this->searchParams)) { |
94 | - $solrResults = $this->documentRepository->findSolrByCollection($collection ? : null, $this->settings, $this->searchParams, $listedMetadata); |
|
94 | + $solrResults = $this->documentRepository->findSolrByCollection($collection ? : NULL, $this->settings, $this->searchParams, $listedMetadata); |
|
95 | 95 | $numResults = $solrResults->getNumFound(); |
96 | 96 | } |
97 | 97 |
@@ -22,15 +22,13 @@ discard block |
||
22 | 22 | * @subpackage dlf |
23 | 23 | * @access public |
24 | 24 | */ |
25 | -class PageGridController extends AbstractController |
|
26 | -{ |
|
25 | +class PageGridController extends AbstractController { |
|
27 | 26 | /** |
28 | 27 | * The main method of the plugin |
29 | 28 | * |
30 | 29 | * @return void |
31 | 30 | */ |
32 | - public function mainAction() |
|
33 | - { |
|
31 | + public function mainAction() { |
|
34 | 32 | $this->loadDocument($this->requestData); |
35 | 33 | if ( |
36 | 34 | $this->document === null |
@@ -65,8 +63,7 @@ discard block |
||
65 | 63 | * |
66 | 64 | * @return array The rendered entry ready for fluid |
67 | 65 | */ |
68 | - protected function getEntry($number, $fileGrpThumbs) |
|
69 | - { |
|
66 | + protected function getEntry($number, $fileGrpThumbs) { |
|
70 | 67 | // Set pagination. |
71 | 68 | $entry['pagination'] = htmlspecialchars($this->document->getDoc()->physicalStructureInfo[$this->document->getDoc()->physicalStructure[$number]]['orderlabel']); |
72 | 69 | $entry['page'] = $number; |
@@ -33,7 +33,7 @@ |
||
33 | 33 | { |
34 | 34 | $this->loadDocument($this->requestData); |
35 | 35 | if ( |
36 | - $this->document === null |
|
36 | + $this->document === NULL |
|
37 | 37 | || $this->document->getDoc()->numPages < 1 |
38 | 38 | || empty($this->extConf['fileGrpThumbs']) |
39 | 39 | ) { |