@@ -1,5 +1,5 @@ |
||
1 | 1 | <?php |
2 | -declare(strict_types = 1); |
|
2 | +declare(strict_types=1); |
|
3 | 3 | |
4 | 4 | return [ |
5 | 5 | \Kitodo\Dlf\Domain\Model\ActionLog::class => [ |
@@ -35,9 +35,9 @@ discard block |
||
35 | 35 | { |
36 | 36 | if (!empty($text)) { |
37 | 37 | if ($format['bold'] ?? false) { |
38 | - $text = '**' . $text . '**'; |
|
38 | + $text = '**'.$text.'**'; |
|
39 | 39 | } elseif ($format['italic'] ?? false) { |
40 | - $text = '*' . $text . '*'; |
|
40 | + $text = '*'.$text.'*'; |
|
41 | 41 | } |
42 | 42 | } |
43 | 43 | |
@@ -46,7 +46,7 @@ discard block |
||
46 | 46 | |
47 | 47 | public static function paragraphs(array $paragraphs) |
48 | 48 | { |
49 | - $paragraphs = array_values(array_filter($paragraphs, function ($entry) { |
|
49 | + $paragraphs = array_values(array_filter($paragraphs, function($entry) { |
|
50 | 50 | return !empty($entry); |
51 | 51 | })); |
52 | 52 | |
@@ -68,7 +68,7 @@ discard block |
||
68 | 68 | public function addText(string $text) |
69 | 69 | { |
70 | 70 | if (!empty($text)) { |
71 | - $this->text .= $text . "\n\n"; |
|
71 | + $this->text .= $text."\n\n"; |
|
72 | 72 | } |
73 | 73 | } |
74 | 74 | |
@@ -97,10 +97,10 @@ discard block |
||
97 | 97 | $numLines = count($valueLines); |
98 | 98 | for ($i = 0; $i < $numLines; $i++) { |
99 | 99 | $prefix = $i === 0 |
100 | - ? ' :' . $key . ':' |
|
100 | + ? ' :'.$key.':' |
|
101 | 101 | : ''; |
102 | 102 | |
103 | - $entry .= str_pad($prefix, 32) . trim($valueLines[$i]) . "\n"; |
|
103 | + $entry .= str_pad($prefix, 32).trim($valueLines[$i])."\n"; |
|
104 | 104 | } |
105 | 105 | } |
106 | 106 | |
@@ -138,10 +138,10 @@ discard block |
||
138 | 138 | $headerSep = str_repeat($headerChar, mb_strlen($this->header)); |
139 | 139 | |
140 | 140 | if ($level === 0) { |
141 | - $result .= $headerSep . "\n"; |
|
141 | + $result .= $headerSep."\n"; |
|
142 | 142 | } |
143 | 143 | |
144 | - $result .= $this->header . "\n" . $headerSep . "\n\n"; |
|
144 | + $result .= $this->header."\n".$headerSep."\n\n"; |
|
145 | 145 | |
146 | 146 | return $result; |
147 | 147 | } |
@@ -20,8 +20,7 @@ discard block |
||
20 | 20 | * @subpackage dlf |
21 | 21 | * @access public |
22 | 22 | */ |
23 | -class RstSection |
|
24 | -{ |
|
23 | +class RstSection { |
|
25 | 24 | /** @var string */ |
26 | 25 | protected $header = ''; |
27 | 26 | |
@@ -31,8 +30,7 @@ discard block |
||
31 | 30 | /** @var RstSection[] */ |
32 | 31 | protected $subsections = []; |
33 | 32 | |
34 | - public static function format(string $text, array $format = []) |
|
35 | - { |
|
33 | + public static function format(string $text, array $format = []) { |
|
36 | 34 | if (!empty($text)) { |
37 | 35 | if ($format['bold'] ?? false) { |
38 | 36 | $text = '**' . $text . '**'; |
@@ -44,8 +42,7 @@ discard block |
||
44 | 42 | return $text; |
45 | 43 | } |
46 | 44 | |
47 | - public static function paragraphs(array $paragraphs) |
|
48 | - { |
|
45 | + public static function paragraphs(array $paragraphs) { |
|
49 | 46 | $paragraphs = array_values(array_filter($paragraphs, function ($entry) { |
50 | 47 | return !empty($entry); |
51 | 48 | })); |
@@ -53,27 +50,23 @@ discard block |
||
53 | 50 | return implode("\n\n", $paragraphs); |
54 | 51 | } |
55 | 52 | |
56 | - public function subsection() |
|
57 | - { |
|
53 | + public function subsection() { |
|
58 | 54 | $section = new static(); |
59 | 55 | $this->subsections[] = $section; |
60 | 56 | return $section; |
61 | 57 | } |
62 | 58 | |
63 | - public function setHeader(string $text) |
|
64 | - { |
|
59 | + public function setHeader(string $text) { |
|
65 | 60 | $this->header = $text; |
66 | 61 | } |
67 | 62 | |
68 | - public function addText(string $text) |
|
69 | - { |
|
63 | + public function addText(string $text) { |
|
70 | 64 | if (!empty($text)) { |
71 | 65 | $this->text .= $text . "\n\n"; |
72 | 66 | } |
73 | 67 | } |
74 | 68 | |
75 | - public function addTable(array $rows, array $headerRows) |
|
76 | - { |
|
69 | + public function addTable(array $rows, array $headerRows) { |
|
77 | 70 | $numHeaderRows = count($headerRows); |
78 | 71 | |
79 | 72 | $tableRst = <<<RST |
@@ -115,8 +108,7 @@ discard block |
||
115 | 108 | $this->addText($tableRst); |
116 | 109 | } |
117 | 110 | |
118 | - public function render(int $level = 0) |
|
119 | - { |
|
111 | + public function render(int $level = 0) { |
|
120 | 112 | $result = ''; |
121 | 113 | |
122 | 114 | $result .= $this->renderHeader($level); |
@@ -130,8 +122,7 @@ discard block |
||
130 | 122 | return $result; |
131 | 123 | } |
132 | 124 | |
133 | - protected function renderHeader(int $level) |
|
134 | - { |
|
125 | + protected function renderHeader(int $level) { |
|
135 | 126 | $result = ''; |
136 | 127 | |
137 | 128 | $headerChar = ['=', '=', '-', '~', '"'][$level]; |
@@ -34,9 +34,9 @@ discard block |
||
34 | 34 | public static function format(string $text, array $format = []) |
35 | 35 | { |
36 | 36 | if (!empty($text)) { |
37 | - if ($format['bold'] ?? false) { |
|
37 | + if ($format['bold'] ?? FALSE) { |
|
38 | 38 | $text = '**' . $text . '**'; |
39 | - } elseif ($format['italic'] ?? false) { |
|
39 | + } elseif ($format['italic'] ?? FALSE) { |
|
40 | 40 | $text = '*' . $text . '*'; |
41 | 41 | } |
42 | 42 | } |
@@ -81,7 +81,7 @@ discard block |
||
81 | 81 | :header-rows: $numHeaderRows |
82 | 82 | |
83 | 83 | |
84 | -RST; |
|
84 | +rst; |
|
85 | 85 | |
86 | 86 | // Pattern for a row: |
87 | 87 | // |
@@ -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 |
@@ -31,8 +31,7 @@ discard block |
||
31 | 31 | * @subpackage dlf |
32 | 32 | * @access public |
33 | 33 | */ |
34 | -class BasketController extends AbstractController |
|
35 | -{ |
|
34 | +class BasketController extends AbstractController { |
|
36 | 35 | /** |
37 | 36 | * @var BasketRepository |
38 | 37 | */ |
@@ -41,8 +40,7 @@ discard block |
||
41 | 40 | /** |
42 | 41 | * @param BasketRepository $basketRepository |
43 | 42 | */ |
44 | - public function injectBasketRepository(BasketRepository $basketRepository) |
|
45 | - { |
|
43 | + public function injectBasketRepository(BasketRepository $basketRepository) { |
|
46 | 44 | $this->basketRepository = $basketRepository; |
47 | 45 | } |
48 | 46 | |
@@ -54,8 +52,7 @@ discard block |
||
54 | 52 | /** |
55 | 53 | * @param MailRepository $mailRepository |
56 | 54 | */ |
57 | - public function injectMailRepository(MailRepository $mailRepository) |
|
58 | - { |
|
55 | + public function injectMailRepository(MailRepository $mailRepository) { |
|
59 | 56 | $this->mailRepository = $mailRepository; |
60 | 57 | } |
61 | 58 | |
@@ -67,8 +64,7 @@ discard block |
||
67 | 64 | /** |
68 | 65 | * @param PrinterRepository $printerRepository |
69 | 66 | */ |
70 | - public function injectPrinterRepository(PrinterRepository $printerRepository) |
|
71 | - { |
|
67 | + public function injectPrinterRepository(PrinterRepository $printerRepository) { |
|
72 | 68 | $this->printerRepository = $printerRepository; |
73 | 69 | } |
74 | 70 | |
@@ -80,8 +76,7 @@ discard block |
||
80 | 76 | /** |
81 | 77 | * @param ActionLogRepository $actionLogRepository |
82 | 78 | */ |
83 | - public function injectActionLogRepository(ActionLogRepository $actionLogRepository) |
|
84 | - { |
|
79 | + public function injectActionLogRepository(ActionLogRepository $actionLogRepository) { |
|
85 | 80 | $this->actionLogRepository = $actionLogRepository; |
86 | 81 | } |
87 | 82 | |
@@ -90,8 +85,7 @@ discard block |
||
90 | 85 | * |
91 | 86 | * @return void |
92 | 87 | */ |
93 | - public function basketAction() |
|
94 | - { |
|
88 | + public function basketAction() { |
|
95 | 89 | $basket = $this->getBasketData(); |
96 | 90 | |
97 | 91 | // action remove from basket |
@@ -137,8 +131,7 @@ discard block |
||
137 | 131 | * |
138 | 132 | * @return void |
139 | 133 | */ |
140 | - public function addAction() |
|
141 | - { |
|
134 | + public function addAction() { |
|
142 | 135 | $basket = $this->getBasketData(); |
143 | 136 | |
144 | 137 | if ( |
@@ -156,8 +149,7 @@ discard block |
||
156 | 149 | * |
157 | 150 | * @return void |
158 | 151 | */ |
159 | - public function mainAction() |
|
160 | - { |
|
152 | + public function mainAction() { |
|
161 | 153 | $basket = $this->getBasketData(); |
162 | 154 | |
163 | 155 | $countDocs = 0; |
@@ -203,8 +195,7 @@ discard block |
||
203 | 195 | * |
204 | 196 | * @return Basket The found data from user session. |
205 | 197 | */ |
206 | - protected function getBasketData() |
|
207 | - { |
|
198 | + protected function getBasketData() { |
|
208 | 199 | // get user session |
209 | 200 | $sessionId = $GLOBALS['TSFE']->fe_user->id; |
210 | 201 | |
@@ -238,8 +229,7 @@ discard block |
||
238 | 229 | * |
239 | 230 | * @return string One basket entry |
240 | 231 | */ |
241 | - protected function getEntry($data) |
|
242 | - { |
|
232 | + protected function getEntry($data) { |
|
243 | 233 | if (is_object($data)) { |
244 | 234 | $data = get_object_vars($data); |
245 | 235 | } |
@@ -291,8 +281,7 @@ discard block |
||
291 | 281 | * |
292 | 282 | * @return mixed download url or false |
293 | 283 | */ |
294 | - protected function getDocumentData($id, $data) |
|
295 | - { |
|
284 | + protected function getDocumentData($id, $data) { |
|
296 | 285 | // get document instance to load further information |
297 | 286 | $this->loadDocument(['id' => $id]); |
298 | 287 | if ($this->document) { |
@@ -360,8 +349,7 @@ discard block |
||
360 | 349 | * |
361 | 350 | * @return array Basket data and Javascript output |
362 | 351 | */ |
363 | - protected function addToBasket($_piVars, $basket) |
|
364 | - { |
|
352 | + protected function addToBasket($_piVars, $basket) { |
|
365 | 353 | $output = ''; |
366 | 354 | |
367 | 355 | if (!$_piVars['startpage']) { |
@@ -468,8 +456,7 @@ discard block |
||
468 | 456 | * |
469 | 457 | * @return Basket basket |
470 | 458 | */ |
471 | - protected function removeFromBasket($_piVars, $basket) |
|
472 | - { |
|
459 | + protected function removeFromBasket($_piVars, $basket) { |
|
473 | 460 | if (!empty($basket->getDocIds())) { |
474 | 461 | $items = json_decode($basket->getDocIds()); |
475 | 462 | $items = get_object_vars($items); |
@@ -507,8 +494,7 @@ discard block |
||
507 | 494 | * |
508 | 495 | * @return void |
509 | 496 | */ |
510 | - protected function sendMail() |
|
511 | - { |
|
497 | + protected function sendMail() { |
|
512 | 498 | // send mail |
513 | 499 | $mailId = $this->requestData['mail_action']; |
514 | 500 | |
@@ -585,8 +571,7 @@ discard block |
||
585 | 571 | * |
586 | 572 | * @return void |
587 | 573 | */ |
588 | - protected function printDocument($basket) |
|
589 | - { |
|
574 | + protected function printDocument($basket) { |
|
590 | 575 | $pdfUrl = $this->settings['pdfprint']; |
591 | 576 | $numberOfPages = 0; |
592 | 577 | foreach ($this->requestData['selected'] as $docId => $docValue) { |
@@ -162,7 +162,7 @@ discard block |
||
162 | 162 | |
163 | 163 | $countDocs = 0; |
164 | 164 | if ($basket->getDocIds()) { |
165 | - $countDocs = count(json_decode($basket->getDocIds(), true)); |
|
165 | + $countDocs = count(json_decode($basket->getDocIds(), TRUE)); |
|
166 | 166 | } |
167 | 167 | $this->view->assign('countDocs', $countDocs); |
168 | 168 | |
@@ -212,13 +212,13 @@ discard block |
||
212 | 212 | $basket = $this->basketRepository->findOneByFeUserId((int) $GLOBALS['TSFE']->fe_user->user['uid']); |
213 | 213 | } else { |
214 | 214 | $GLOBALS['TSFE']->fe_user->setKey('ses', 'tx_dlf_basket', ''); |
215 | - $GLOBALS['TSFE']->fe_user->sesData_change = true; |
|
215 | + $GLOBALS['TSFE']->fe_user->sesData_change = TRUE; |
|
216 | 216 | $GLOBALS['TSFE']->fe_user->storeSessionData(); |
217 | 217 | |
218 | 218 | $basket = $this->basketRepository->findOneBySessionId($sessionId); |
219 | 219 | } |
220 | 220 | // session doesnt exists |
221 | - if ($basket === null) { |
|
221 | + if ($basket === NULL) { |
|
222 | 222 | // create new basket in db |
223 | 223 | $basket = GeneralUtility::makeInstance(Basket::class); |
224 | 224 | $basket->setSessionId($sessionId); |
@@ -347,7 +347,7 @@ discard block |
||
347 | 347 | 'record_id' => $this->document->getRecordId(), |
348 | 348 | ]; |
349 | 349 | } |
350 | - return false; |
|
350 | + return FALSE; |
|
351 | 351 | } |
352 | 352 | |
353 | 353 | /** |
@@ -369,7 +369,7 @@ discard block |
||
369 | 369 | } else { |
370 | 370 | $page = (int) $_piVars['startpage']; |
371 | 371 | } |
372 | - if ($page != null || $_piVars['addToBasket'] == 'list') { |
|
372 | + if ($page != NULL || $_piVars['addToBasket'] == 'list') { |
|
373 | 373 | $documentItem = [ |
374 | 374 | 'id' => (int) $_piVars['id'], |
375 | 375 | 'startpage' => (int) $_piVars['startpage'], |
@@ -391,8 +391,8 @@ discard block |
||
391 | 391 | // get document instance to load further information |
392 | 392 | $this->loadDocument(['id' => $documentItem['id']]); |
393 | 393 | if ( |
394 | - $this->document === null |
|
395 | - || $this->document->getDoc() === null |
|
394 | + $this->document === NULL |
|
395 | + || $this->document->getDoc() === NULL |
|
396 | 396 | ) { |
397 | 397 | // Quit without doing anything if required variables are not set. |
398 | 398 | return; |
@@ -447,7 +447,7 @@ discard block |
||
447 | 447 | } |
448 | 448 | |
449 | 449 | $basket->setDocIds(json_encode($items)); |
450 | - if ($basket->getUid() === null) { |
|
450 | + if ($basket->getUid() === NULL) { |
|
451 | 451 | $this->basketRepository->add($basket); |
452 | 452 | } else { |
453 | 453 | $this->basketRepository->update($basket); |
@@ -109,7 +109,7 @@ discard block |
||
109 | 109 | foreach ($this->requestData['selected'] as $docValue) { |
110 | 110 | if ($docValue['id']) { |
111 | 111 | $docData = $this->getDocumentData($docValue['id'], $docValue); |
112 | - $pdfUrl .= $docData['urlParams'] . $this->settings['pdfparamseparator']; |
|
112 | + $pdfUrl .= $docData['urlParams'].$this->settings['pdfparamseparator']; |
|
113 | 113 | $this->redirectToUri($pdfUrl); |
114 | 114 | } |
115 | 115 | } |
@@ -172,7 +172,7 @@ discard block |
||
172 | 172 | if ($allMails->count() > 0) { |
173 | 173 | $mailSelect[0] = htmlspecialchars(LocalizationUtility::translate('basket.chooseMail', 'dlf')); |
174 | 174 | foreach ($allMails as $mail) { |
175 | - $mailSelect[$mail->getUid()] = htmlspecialchars($mail->getName()) . ' (' . htmlspecialchars($mail->getMail()) . ')'; |
|
175 | + $mailSelect[$mail->getUid()] = htmlspecialchars($mail->getName()).' ('.htmlspecialchars($mail->getMail()).')'; |
|
176 | 176 | } |
177 | 177 | $this->view->assign('mailSelect', $mailSelect); |
178 | 178 | } |
@@ -256,12 +256,12 @@ discard block |
||
256 | 256 | |
257 | 257 | $entryArray['BASKETDATA'] = $docData; |
258 | 258 | |
259 | - $entryKey = $id . '_' . $startpage; |
|
259 | + $entryKey = $id.'_'.$startpage; |
|
260 | 260 | if (!empty($startX)) { |
261 | - $entryKey .= '_' . $startX; |
|
261 | + $entryKey .= '_'.$startX; |
|
262 | 262 | } |
263 | 263 | if (!empty($endX)) { |
264 | - $entryKey .= '_' . $endX; |
|
264 | + $entryKey .= '_'.$endX; |
|
265 | 265 | } |
266 | 266 | |
267 | 267 | $entryArray['id'] = $id; |
@@ -312,7 +312,7 @@ discard block |
||
312 | 312 | $urlParams = str_replace("##endy##", $data['endY'] === "" ? "" : (int) $data['endY'], $urlParams); |
313 | 313 | $urlParams = str_replace("##rotation##", $data['rotation'] === "" ? "" : (int) $data['rotation'], $urlParams); |
314 | 314 | |
315 | - $downloadUrl = $this->settings['pdfgenerate'] . $urlParams; |
|
315 | + $downloadUrl = $this->settings['pdfgenerate'].$urlParams; |
|
316 | 316 | |
317 | 317 | $title = $this->document->getTitle(); |
318 | 318 | if (empty($title)) { |
@@ -323,15 +323,15 @@ discard block |
||
323 | 323 | $info = ''; |
324 | 324 | if ($data['startX'] != '' && $data['endX'] != '') { |
325 | 325 | // cutout |
326 | - $info .= htmlspecialchars(LocalizationUtility::translate('basket.cutout', 'dlf')) . ' '; |
|
326 | + $info .= htmlspecialchars(LocalizationUtility::translate('basket.cutout', 'dlf')).' '; |
|
327 | 327 | } |
328 | 328 | if ($data['startpage'] == $data['endpage']) { |
329 | 329 | // One page |
330 | - $info .= htmlspecialchars(LocalizationUtility::translate('page', 'dlf')) . ' ' . $data['startpage']; |
|
330 | + $info .= htmlspecialchars(LocalizationUtility::translate('page', 'dlf')).' '.$data['startpage']; |
|
331 | 331 | } else { |
332 | - $info .= htmlspecialchars(LocalizationUtility::translate('page', 'dlf')) . ' ' . $data['startpage'] . '-' . $data['endpage']; |
|
332 | + $info .= htmlspecialchars(LocalizationUtility::translate('page', 'dlf')).' '.$data['startpage'].'-'.$data['endpage']; |
|
333 | 333 | } |
334 | - $downloadLink = '<a href="' . $downloadUrl . '" target="_blank">' . htmlspecialchars($title) . '</a> (' . $info . ')'; |
|
334 | + $downloadLink = '<a href="'.$downloadUrl.'" target="_blank">'.htmlspecialchars($title).'</a> ('.$info.')'; |
|
335 | 335 | if ($data['startpage'] == $data['endpage']) { |
336 | 336 | $pageNums = 1; |
337 | 337 | } else { |
@@ -407,12 +407,12 @@ discard block |
||
407 | 407 | if ($_piVars['addToBasket'] == 'list') { |
408 | 408 | $documentItem['endpage'] = $this->document->getDoc()->numPages; |
409 | 409 | } |
410 | - $arrayKey = $documentItem['id'] . '_' . $page; |
|
410 | + $arrayKey = $documentItem['id'].'_'.$page; |
|
411 | 411 | if (!empty($documentItem['startX'])) { |
412 | - $arrayKey .= '_' . $documentItem['startX']; |
|
412 | + $arrayKey .= '_'.$documentItem['startX']; |
|
413 | 413 | } |
414 | 414 | if (!empty($documentItem['endX'])) { |
415 | - $arrayKey .= '_' . $documentItem['endX']; |
|
415 | + $arrayKey .= '_'.$documentItem['endX']; |
|
416 | 416 | } |
417 | 417 | // do not add more than one identical object |
418 | 418 | if (!in_array($arrayKey, $items)) { |
@@ -431,14 +431,14 @@ discard block |
||
431 | 431 | // remove parameter endpage |
432 | 432 | $pdfParams = str_replace(",##endpage##", '', $pdfParams); |
433 | 433 | } |
434 | - $pdfGenerateUrl = $this->settings['pdfgenerate'] . $pdfParams; |
|
434 | + $pdfGenerateUrl = $this->settings['pdfgenerate'].$pdfParams; |
|
435 | 435 | if ($this->settings['pregeneration']) { |
436 | 436 | // send ajax request to webapp |
437 | 437 | $output .= ' |
438 | 438 | <script> |
439 | 439 | $(document).ready(function(){ |
440 | 440 | $.ajax({ |
441 | - url: "' . $pdfGenerateUrl . '", |
|
441 | + url: "' . $pdfGenerateUrl.'", |
|
442 | 442 | }).done(function() { |
443 | 443 | }); |
444 | 444 | }); |
@@ -476,12 +476,12 @@ discard block |
||
476 | 476 | } |
477 | 477 | foreach ($_piVars['selected'] as $value) { |
478 | 478 | if (isset($value['id'])) { |
479 | - $arrayKey = $value['id'] . '_' . $value['startpage']; |
|
479 | + $arrayKey = $value['id'].'_'.$value['startpage']; |
|
480 | 480 | if (!empty($value['startX'])) { |
481 | - $arrayKey .= '_' . $value['startX']; |
|
481 | + $arrayKey .= '_'.$value['startX']; |
|
482 | 482 | } |
483 | 483 | if (!empty($value['endX'])) { |
484 | - $arrayKey .= '_' . $value['endX']; |
|
484 | + $arrayKey .= '_'.$value['endX']; |
|
485 | 485 | } |
486 | 486 | if (isset($items[$arrayKey])) { |
487 | 487 | unset($items[$arrayKey]); |
@@ -514,7 +514,7 @@ discard block |
||
514 | 514 | |
515 | 515 | $mailObject = $this->mailRepository->findByUid(intval($mailId))->getFirst(); |
516 | 516 | |
517 | - $mailText = htmlspecialchars(LocalizationUtility::translate('basket.mailBody', 'dlf')) . "\n"; |
|
517 | + $mailText = htmlspecialchars(LocalizationUtility::translate('basket.mailBody', 'dlf'))."\n"; |
|
518 | 518 | $numberOfPages = 0; |
519 | 519 | $pdfUrl = $this->settings['pdfdownload']; |
520 | 520 | // prepare links |
@@ -522,7 +522,7 @@ discard block |
||
522 | 522 | if ($docValue['id']) { |
523 | 523 | $explodeId = explode("_", $docValue['id']); |
524 | 524 | $docData = $this->getDocumentData($explodeId[0], $docValue); |
525 | - $pdfUrl .= $docData['urlParams'] . $this->settings['pdfparamseparator']; |
|
525 | + $pdfUrl .= $docData['urlParams'].$this->settings['pdfparamseparator']; |
|
526 | 526 | $pages = (abs(intval($docValue['startpage']) - intval($docValue['endpage']))); |
527 | 527 | if ($pages === 0) { |
528 | 528 | $numberOfPages = $numberOfPages + 1; |
@@ -533,7 +533,7 @@ discard block |
||
533 | 533 | } |
534 | 534 | // Remove leading/tailing pdfparamseperator |
535 | 535 | $pdfUrl = trim($pdfUrl, $this->settings['pdfparamseparator']); |
536 | - $mailBody = $mailText . $pdfUrl; |
|
536 | + $mailBody = $mailText.$pdfUrl; |
|
537 | 537 | // Get hook objects. |
538 | 538 | $hookObjects = Helper::getHookObjects('Classes/Controller/BasketController.php'); |
539 | 539 | // Hook for getting a customized mail body. |
@@ -560,7 +560,7 @@ discard block |
||
560 | 560 | $newActionLog = GeneralUtility::makeInstance(ActionLog::class); |
561 | 561 | $newActionLog->setFileName($pdfUrl); |
562 | 562 | $newActionLog->setCountPages($numberOfPages); |
563 | - $newActionLog->setLabel('Mail: ' . $mailObject->getMail()); |
|
563 | + $newActionLog->setLabel('Mail: '.$mailObject->getMail()); |
|
564 | 564 | |
565 | 565 | if ($GLOBALS["TSFE"]->loginUser) { |
566 | 566 | // internal user |
@@ -592,7 +592,7 @@ discard block |
||
592 | 592 | foreach ($this->requestData['selected'] as $docId => $docValue) { |
593 | 593 | if ($docValue['id']) { |
594 | 594 | $docData = $this->getDocumentData($docValue['id'], $docValue); |
595 | - $pdfUrl .= $docData['urlParams'] . $this->settings['pdfparamseparator']; |
|
595 | + $pdfUrl .= $docData['urlParams'].$this->settings['pdfparamseparator']; |
|
596 | 596 | $numberOfPages += $docData['pageNums']; |
597 | 597 | } |
598 | 598 | } |
@@ -610,7 +610,7 @@ discard block |
||
610 | 610 | if ($docValue['id']) { |
611 | 611 | $explodeId = explode("_", $docId); |
612 | 612 | $docData = $this->getDocumentData($explodeId[0], $docValue); |
613 | - $pdfUrl .= $docData['urlParams'] . $this->settings['pdfparamseparator']; |
|
613 | + $pdfUrl .= $docData['urlParams'].$this->settings['pdfparamseparator']; |
|
614 | 614 | $numberOfPages += $docData['pageNums']; |
615 | 615 | } |
616 | 616 | } |
@@ -627,12 +627,12 @@ discard block |
||
627 | 627 | // internal user |
628 | 628 | $actionLog->setUserId($GLOBALS["TSFE"]->fe_user->user['uid']); |
629 | 629 | $actionLog->setName($GLOBALS["TSFE"]->fe_user->user['username']); |
630 | - $actionLog->setLabel('Print: ' . $printer->getLabel()); |
|
630 | + $actionLog->setLabel('Print: '.$printer->getLabel()); |
|
631 | 631 | } else { |
632 | 632 | // external user |
633 | 633 | $actionLog->setUserId(0); |
634 | 634 | $actionLog->setName('n/a'); |
635 | - $actionLog->setLabel('Print: ' . $printer->getLabel()); |
|
635 | + $actionLog->setLabel('Print: '.$printer->getLabel()); |
|
636 | 636 | } |
637 | 637 | // add action to protocol |
638 | 638 | $this->actionLogRepository->add($actionLog); |
@@ -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 | } |
@@ -148,7 +148,7 @@ discard block |
||
148 | 148 | $_day = date('j', $dateTimestamp); |
149 | 149 | $calendarIssuesByYear[$_year][$_month][$_day][] = $issue; |
150 | 150 | } else { |
151 | - $this->logger->warning('Document with UID ' . $issue['uid'] . 'has no valid date of publication'); |
|
151 | + $this->logger->warning('Document with UID '.$issue['uid'].'has no valid date of publication'); |
|
152 | 152 | } |
153 | 153 | } |
154 | 154 | // Sort by years. |
@@ -271,16 +271,16 @@ discard block |
||
271 | 271 | 'DAYFRI_NAME' => strftime('%a', strtotime('last Friday')), |
272 | 272 | 'DAYSAT_NAME' => strftime('%a', strtotime('last Saturday')), |
273 | 273 | 'DAYSUN_NAME' => strftime('%a', strtotime('last Sunday')), |
274 | - 'MONTHNAME' => strftime('%B', strtotime($year . '-' . $i . '-1')) . ' ' . $year, |
|
274 | + 'MONTHNAME' => strftime('%B', strtotime($year.'-'.$i.'-1')).' '.$year, |
|
275 | 275 | 'CALYEAR' => ($i == $firstMonth) ? $year : '' |
276 | 276 | ]; |
277 | 277 | |
278 | - $firstOfMonth = strtotime($year . '-' . $i . '-1'); |
|
278 | + $firstOfMonth = strtotime($year.'-'.$i.'-1'); |
|
279 | 279 | $lastOfMonth = strtotime('last day of', ($firstOfMonth)); |
280 | 280 | $firstOfMonthStart = strtotime('last Monday', $firstOfMonth); |
281 | 281 | // There are never more than 6 weeks in a month. |
282 | 282 | for ($j = 0; $j <= 5; $j++) { |
283 | - $firstDayOfWeek = strtotime('+ ' . $j . ' Week', $firstOfMonthStart); |
|
283 | + $firstDayOfWeek = strtotime('+ '.$j.' Week', $firstOfMonthStart); |
|
284 | 284 | |
285 | 285 | $calendarData[$i]['week'][$j] = [ |
286 | 286 | 'DAYMON' => ['dayValue' => ' '], |
@@ -293,7 +293,7 @@ discard block |
||
293 | 293 | ]; |
294 | 294 | // Every week has seven days. ;-) |
295 | 295 | for ($k = 0; $k <= 6; $k++) { |
296 | - $currentDayTime = strtotime('+ ' . $k . ' Day', $firstDayOfWeek); |
|
296 | + $currentDayTime = strtotime('+ '.$k.' Day', $firstDayOfWeek); |
|
297 | 297 | if ( |
298 | 298 | $currentDayTime >= $firstOfMonth |
299 | 299 | && $currentDayTime <= $lastOfMonth |
@@ -324,7 +324,7 @@ discard block |
||
324 | 324 | } |
325 | 325 | $dayLinkDiv = $dayLinksText; |
326 | 326 | } |
327 | - switch (strftime('%w', strtotime('+ ' . $k . ' Day', $firstDayOfWeek))) { |
|
327 | + switch (strftime('%w', strtotime('+ '.$k.' Day', $firstDayOfWeek))) { |
|
328 | 328 | case '0': |
329 | 329 | $calendarData[$i]['week'][$j]['DAYSUN']['dayValue'] = strftime('%d', $currentDayTime); |
330 | 330 | if ((int) $dayLinks === (int) date('j', $currentDayTime)) { |
@@ -26,8 +26,7 @@ discard block |
||
26 | 26 | * @subpackage dlf |
27 | 27 | * @access public |
28 | 28 | */ |
29 | -class CalendarController extends AbstractController |
|
30 | -{ |
|
29 | +class CalendarController extends AbstractController { |
|
31 | 30 | /** |
32 | 31 | * @var StructureRepository |
33 | 32 | */ |
@@ -36,8 +35,7 @@ discard block |
||
36 | 35 | /** |
37 | 36 | * @param StructureRepository $structureRepository |
38 | 37 | */ |
39 | - public function injectStructureRepository(StructureRepository $structureRepository) |
|
40 | - { |
|
38 | + public function injectStructureRepository(StructureRepository $structureRepository) { |
|
41 | 39 | $this->structureRepository = $structureRepository; |
42 | 40 | } |
43 | 41 | |
@@ -54,8 +52,7 @@ discard block |
||
54 | 52 | * |
55 | 53 | * @return void |
56 | 54 | */ |
57 | - public function mainAction() |
|
58 | - { |
|
55 | + public function mainAction() { |
|
59 | 56 | // Set initial document (anchor or year file) if configured. |
60 | 57 | if (empty($this->requestData['id']) && !empty($this->settings['initialDocument'])) { |
61 | 58 | $this->requestData['id'] = $this->settings['initialDocument']; |
@@ -100,8 +97,7 @@ discard block |
||
100 | 97 | * |
101 | 98 | * @return void |
102 | 99 | */ |
103 | - public function calendarAction() |
|
104 | - { |
|
100 | + public function calendarAction() { |
|
105 | 101 | // access arguments passed by the mainAction() |
106 | 102 | $mainrequestData = $this->request->getArguments(); |
107 | 103 | |
@@ -204,8 +200,7 @@ discard block |
||
204 | 200 | * |
205 | 201 | * @return void |
206 | 202 | */ |
207 | - public function yearsAction() |
|
208 | - { |
|
203 | + public function yearsAction() { |
|
209 | 204 | // access arguments passed by the mainAction() |
210 | 205 | $mainrequestData = $this->request->getArguments(); |
211 | 206 | |
@@ -259,8 +254,7 @@ discard block |
||
259 | 254 | * |
260 | 255 | * @return string Content for template subpart |
261 | 256 | */ |
262 | - protected function getCalendarYear($calendarIssuesByMonth, $year, $firstMonth = 1, $lastMonth = 12) |
|
263 | - { |
|
257 | + protected function getCalendarYear($calendarIssuesByMonth, $year, $firstMonth = 1, $lastMonth = 12) { |
|
264 | 258 | $calendarData = []; |
265 | 259 | for ($i = $firstMonth; $i <= $lastMonth; $i++) { |
266 | 260 | $calendarData[$i] = [ |
@@ -63,7 +63,7 @@ discard block |
||
63 | 63 | |
64 | 64 | // Load current document. |
65 | 65 | $this->loadDocument($this->requestData); |
66 | - if ($this->document === null) { |
|
66 | + if ($this->document === NULL) { |
|
67 | 67 | // Quit without doing anything if required variables are not set. |
68 | 68 | return; |
69 | 69 | } |
@@ -78,10 +78,10 @@ discard block |
||
78 | 78 | switch ($type) { |
79 | 79 | case 'newspaper': |
80 | 80 | case 'ephemera': |
81 | - $this->forward('years', null, null, $this->requestData); |
|
81 | + $this->forward('years', NULL, NULL, $this->requestData); |
|
82 | 82 | break; |
83 | 83 | case 'year': |
84 | - $this->forward('calendar', null, null, $this->requestData); |
|
84 | + $this->forward('calendar', NULL, NULL, $this->requestData); |
|
85 | 85 | break; |
86 | 86 | case 'issue': |
87 | 87 | default: |
@@ -110,7 +110,7 @@ discard block |
||
110 | 110 | |
111 | 111 | // Load current document. |
112 | 112 | $this->loadDocument($this->requestData); |
113 | - if ($this->document === null) { |
|
113 | + if ($this->document === NULL) { |
|
114 | 114 | // Quit without doing anything if required variables are not set. |
115 | 115 | return; |
116 | 116 | } |
@@ -127,7 +127,7 @@ discard block |
||
127 | 127 | $title = $document->getTitle(); |
128 | 128 | } else { |
129 | 129 | $title = !empty($document->getMetsLabel()) ? $document->getMetsLabel() : $document->getMetsOrderlabel(); |
130 | - if (strtotime($title) !== false) { |
|
130 | + if (strtotime($title) !== FALSE) { |
|
131 | 131 | $title = strftime('%x', strtotime($title)); |
132 | 132 | } |
133 | 133 | } |
@@ -142,7 +142,7 @@ discard block |
||
142 | 142 | $calendarIssuesByYear = []; |
143 | 143 | foreach ($issues as $issue) { |
144 | 144 | $dateTimestamp = strtotime($issue['year']); |
145 | - if ($dateTimestamp !== false) { |
|
145 | + if ($dateTimestamp !== FALSE) { |
|
146 | 146 | $_year = date('Y', $dateTimestamp); |
147 | 147 | $_month = date('n', $dateTimestamp); |
148 | 148 | $_day = date('j', $dateTimestamp); |
@@ -214,7 +214,7 @@ discard block |
||
214 | 214 | |
215 | 215 | // Load current document. |
216 | 216 | $this->loadDocument($this->requestData); |
217 | - if ($this->document === null) { |
|
217 | + if ($this->document === NULL) { |
|
218 | 218 | // Quit without doing anything if required variables are not set. |
219 | 219 | return; |
220 | 220 | } |