@@ -20,8 +20,7 @@ discard block |
||
| 20 | 20 | * @subpackage dlf |
| 21 | 21 | * @access public |
| 22 | 22 | */ |
| 23 | -class Toolbox extends \Kitodo\Dlf\Common\AbstractPlugin |
|
| 24 | -{ |
|
| 23 | +class Toolbox extends \Kitodo\Dlf\Common\AbstractPlugin { |
|
| 25 | 24 | public $scriptRelPath = 'Classes/Plugin/Toolbox.php'; |
| 26 | 25 | |
| 27 | 26 | /** |
@@ -34,8 +33,7 @@ discard block |
||
| 34 | 33 | * |
| 35 | 34 | * @return string The content that is displayed on the website |
| 36 | 35 | */ |
| 37 | - public function main($content, $conf) |
|
| 38 | - { |
|
| 36 | + public function main($content, $conf) { |
|
| 39 | 37 | $this->init($conf); |
| 40 | 38 | // Quit without doing anything if required variable is not set. |
| 41 | 39 | if (empty($this->piVars['id'])) { |
@@ -26,8 +26,7 @@ discard block |
||
| 26 | 26 | * @subpackage dlf |
| 27 | 27 | * @access public |
| 28 | 28 | */ |
| 29 | -class OaiPmh extends \Kitodo\Dlf\Common\AbstractPlugin |
|
| 30 | -{ |
|
| 29 | +class OaiPmh extends \Kitodo\Dlf\Common\AbstractPlugin { |
|
| 31 | 30 | public $scriptRelPath = 'Classes/Plugin/OaiPmh.php'; |
| 32 | 31 | |
| 33 | 32 | /** |
@@ -77,8 +76,7 @@ discard block |
||
| 77 | 76 | * |
| 78 | 77 | * @return void |
| 79 | 78 | */ |
| 80 | - protected function deleteExpiredTokens() |
|
| 81 | - { |
|
| 79 | + protected function deleteExpiredTokens() { |
|
| 82 | 80 | // Delete expired resumption tokens. |
| 83 | 81 | $GLOBALS['TYPO3_DB']->exec_DELETEquery( |
| 84 | 82 | 'tx_dlf_tokens', |
@@ -99,8 +97,7 @@ discard block |
||
| 99 | 97 | * |
| 100 | 98 | * @return \DOMElement XML node to add to the OAI response |
| 101 | 99 | */ |
| 102 | - protected function error($type) |
|
| 103 | - { |
|
| 100 | + protected function error($type) { |
|
| 104 | 101 | $this->error = true; |
| 105 | 102 | $error = $this->oai->createElementNS('http://www.openarchives.org/OAI/2.0/', 'error', htmlspecialchars($this->pi_getLL($type, $type, false), ENT_NOQUOTES, 'UTF-8')); |
| 106 | 103 | $error->setAttribute('code', $type); |
@@ -114,8 +111,7 @@ discard block |
||
| 114 | 111 | * |
| 115 | 112 | * @return void |
| 116 | 113 | */ |
| 117 | - protected function getUrlParams() |
|
| 118 | - { |
|
| 114 | + protected function getUrlParams() { |
|
| 119 | 115 | $allowedParams = [ |
| 120 | 116 | 'verb', |
| 121 | 117 | 'identifier', |
@@ -145,8 +141,7 @@ discard block |
||
| 145 | 141 | * |
| 146 | 142 | * @return \DOMElement XML node to add to the OAI response |
| 147 | 143 | */ |
| 148 | - protected function getDcData(array $metadata) |
|
| 149 | - { |
|
| 144 | + protected function getDcData(array $metadata) { |
|
| 150 | 145 | $oai_dc = $this->oai->createElementNS($this->formats['oai_dc']['namespace'], 'oai_dc:dc'); |
| 151 | 146 | $oai_dc->setAttributeNS('http://www.w3.org/2000/xmlns/', 'xmlns:dc', 'http://purl.org/dc/elements/1.1/'); |
| 152 | 147 | $oai_dc->setAttributeNS('http://www.w3.org/2000/xmlns/', 'xmlns:xsi', 'http://www.w3.org/2001/XMLSchema-instance'); |
@@ -224,8 +219,7 @@ discard block |
||
| 224 | 219 | * |
| 225 | 220 | * @return \DOMElement XML node to add to the OAI response |
| 226 | 221 | */ |
| 227 | - protected function getEpicurData(array $metadata) |
|
| 228 | - { |
|
| 222 | + protected function getEpicurData(array $metadata) { |
|
| 229 | 223 | // Define all XML elements with or without qualified namespace. |
| 230 | 224 | if (empty($this->conf['unqualified_epicur'])) { |
| 231 | 225 | $epicur = $this->oai->createElementNS($this->formats['epicur']['namespace'], 'epicur:epicur'); |
@@ -288,8 +282,7 @@ discard block |
||
| 288 | 282 | * |
| 289 | 283 | * @return \DOMElement XML node to add to the OAI response |
| 290 | 284 | */ |
| 291 | - protected function getMetsData(array $metadata) |
|
| 292 | - { |
|
| 285 | + protected function getMetsData(array $metadata) { |
|
| 293 | 286 | $mets = null; |
| 294 | 287 | // Load METS file. |
| 295 | 288 | $xml = new \DOMDocument(); |
@@ -321,8 +314,7 @@ discard block |
||
| 321 | 314 | * |
| 322 | 315 | * @return void |
| 323 | 316 | */ |
| 324 | - public function main($content, $conf) |
|
| 325 | - { |
|
| 317 | + public function main($content, $conf) { |
|
| 326 | 318 | // Initialize plugin. |
| 327 | 319 | $this->init($conf); |
| 328 | 320 | // Turn cache off. |
@@ -412,8 +404,7 @@ discard block |
||
| 412 | 404 | * |
| 413 | 405 | * @return \DOMElement XML node to add to the OAI response |
| 414 | 406 | */ |
| 415 | - protected function resume() |
|
| 416 | - { |
|
| 407 | + protected function resume() { |
|
| 417 | 408 | $queryBuilder = GeneralUtility::makeInstance(ConnectionPool::class) |
| 418 | 409 | ->getQueryBuilderForTable('tx_dlf_tokens'); |
| 419 | 410 | |
@@ -447,8 +438,7 @@ discard block |
||
| 447 | 438 | * |
| 448 | 439 | * @return \DOMElement XML node to add to the OAI response |
| 449 | 440 | */ |
| 450 | - protected function verbGetRecord() |
|
| 451 | - { |
|
| 441 | + protected function verbGetRecord() { |
|
| 452 | 442 | if (count($this->piVars) != 3 || empty($this->piVars['metadataPrefix']) || empty($this->piVars['identifier'])) { |
| 453 | 443 | return $this->error('badArgument'); |
| 454 | 444 | } |
@@ -527,8 +517,7 @@ discard block |
||
| 527 | 517 | * |
| 528 | 518 | * @return \DOMElement XML node to add to the OAI response |
| 529 | 519 | */ |
| 530 | - protected function verbIdentify() |
|
| 531 | - { |
|
| 520 | + protected function verbIdentify() { |
|
| 532 | 521 | // Check for invalid arguments. |
| 533 | 522 | if (count($this->piVars) > 1) { |
| 534 | 523 | return $this->error('badArgument'); |
@@ -610,8 +599,7 @@ discard block |
||
| 610 | 599 | * |
| 611 | 600 | * @return \DOMElement XML node to add to the OAI response |
| 612 | 601 | */ |
| 613 | - protected function verbListIdentifiers() |
|
| 614 | - { |
|
| 602 | + protected function verbListIdentifiers() { |
|
| 615 | 603 | // If we have a resumption token we can continue our work |
| 616 | 604 | if (!empty($this->piVars['resumptionToken'])) { |
| 617 | 605 | // "resumptionToken" is an exclusive argument. |
@@ -650,8 +638,7 @@ discard block |
||
| 650 | 638 | * |
| 651 | 639 | * @return \DOMElement XML node to add to the OAI response |
| 652 | 640 | */ |
| 653 | - protected function verbListMetadataFormats() |
|
| 654 | - { |
|
| 641 | + protected function verbListMetadataFormats() { |
|
| 655 | 642 | $resArray = []; |
| 656 | 643 | // Check for invalid arguments. |
| 657 | 644 | if (count($this->piVars) > 1) { |
@@ -709,8 +696,7 @@ discard block |
||
| 709 | 696 | * |
| 710 | 697 | * @return \DOMElement XML node to add to the OAI response |
| 711 | 698 | */ |
| 712 | - protected function verbListRecords() |
|
| 713 | - { |
|
| 699 | + protected function verbListRecords() { |
|
| 714 | 700 | // Check for invalid arguments. |
| 715 | 701 | if (!empty($this->piVars['resumptionToken'])) { |
| 716 | 702 | // "resumptionToken" is an exclusive argument. |
@@ -750,8 +736,7 @@ discard block |
||
| 750 | 736 | * |
| 751 | 737 | * @return \DOMElement XML node to add to the OAI response |
| 752 | 738 | */ |
| 753 | - protected function verbListSets() |
|
| 754 | - { |
|
| 739 | + protected function verbListSets() { |
|
| 755 | 740 | $queryBuilder = GeneralUtility::makeInstance(ConnectionPool::class) |
| 756 | 741 | ->getQueryBuilderForTable('tx_dlf_collections'); |
| 757 | 742 | |
@@ -807,8 +792,7 @@ discard block |
||
| 807 | 792 | * @return array Array of matching records |
| 808 | 793 | * @throws \Exception |
| 809 | 794 | */ |
| 810 | - protected function fetchDocumentUIDs() |
|
| 811 | - { |
|
| 795 | + protected function fetchDocumentUIDs() { |
|
| 812 | 796 | $queryBuilder = GeneralUtility::makeInstance(ConnectionPool::class) |
| 813 | 797 | ->getQueryBuilderForTable('tx_dlf_collections'); |
| 814 | 798 | |
@@ -929,8 +913,7 @@ discard block |
||
| 929 | 913 | * |
| 930 | 914 | * @return \DOMElement XML of enriched records |
| 931 | 915 | */ |
| 932 | - protected function generateOutputForDocumentList(DocumentList $documentListSet) |
|
| 933 | - { |
|
| 916 | + protected function generateOutputForDocumentList(DocumentList $documentListSet) { |
|
| 934 | 917 | $documentsToProcess = $documentListSet->removeRange(0, intval($this->conf['limit'])); |
| 935 | 918 | $verb = $this->piVars['verb']; |
| 936 | 919 | $documents = $GLOBALS['TYPO3_DB']->exec_SELECT_mm_query( |
@@ -1016,8 +999,7 @@ discard block |
||
| 1016 | 999 | * |
| 1017 | 1000 | * @return \DOMElement XML for resumption token |
| 1018 | 1001 | */ |
| 1019 | - protected function generateResumptionTokenForDocumentListSet(DocumentList $documentListSet) |
|
| 1020 | - { |
|
| 1002 | + protected function generateResumptionTokenForDocumentListSet(DocumentList $documentListSet) { |
|
| 1021 | 1003 | if ($documentListSet->count() != 0) { |
| 1022 | 1004 | $token = uniqid(); |
| 1023 | 1005 | $GLOBALS['TYPO3_DB']->exec_INSERTquery( |
@@ -28,8 +28,7 @@ discard block |
||
| 28 | 28 | * @subpackage dlf |
| 29 | 29 | * @access public |
| 30 | 30 | */ |
| 31 | -class Metadata extends \Kitodo\Dlf\Common\AbstractPlugin |
|
| 32 | -{ |
|
| 31 | +class Metadata extends \Kitodo\Dlf\Common\AbstractPlugin { |
|
| 33 | 32 | public $scriptRelPath = 'Classes/Plugin/Metadata.php'; |
| 34 | 33 | |
| 35 | 34 | /** |
@@ -50,8 +49,7 @@ discard block |
||
| 50 | 49 | * |
| 51 | 50 | * @return string The content that is displayed on the website |
| 52 | 51 | */ |
| 53 | - public function main($content, $conf) |
|
| 54 | - { |
|
| 52 | + public function main($content, $conf) { |
|
| 55 | 53 | $this->init($conf); |
| 56 | 54 | // Turn cache on. |
| 57 | 55 | $this->setCache(true); |
@@ -156,8 +154,7 @@ discard block |
||
| 156 | 154 | * |
| 157 | 155 | * @return string The metadata array ready for output |
| 158 | 156 | */ |
| 159 | - protected function printMetadata(array $metadataArray, $useOriginalIiifManifestMetadata = false) |
|
| 160 | - { |
|
| 157 | + protected function printMetadata(array $metadataArray, $useOriginalIiifManifestMetadata = false) { |
|
| 161 | 158 | // Load template file. |
| 162 | 159 | $this->getTemplate(); |
| 163 | 160 | $output = ''; |
@@ -28,16 +28,14 @@ |
||
| 28 | 28 | * @subpackage dlf |
| 29 | 29 | * @access public |
| 30 | 30 | */ |
| 31 | -class SearchInDocument |
|
| 32 | -{ |
|
| 31 | +class SearchInDocument { |
|
| 33 | 32 | /** |
| 34 | 33 | * The main method of the eID script |
| 35 | 34 | * |
| 36 | 35 | * @param ServerRequestInterface $request |
| 37 | 36 | * @return ResponseInterface JSON response of search suggestions |
| 38 | 37 | */ |
| 39 | - public function main(ServerRequestInterface $request) |
|
| 40 | - { |
|
| 38 | + public function main(ServerRequestInterface $request) { |
|
| 41 | 39 | $parameters = $request->getParsedBody(); |
| 42 | 40 | $encrypted = (string)$parameters['encrypted']; |
| 43 | 41 | $hashed = (string)$parameters['hashed']; |
@@ -29,16 +29,14 @@ |
||
| 29 | 29 | * @subpackage dlf |
| 30 | 30 | * @access public |
| 31 | 31 | */ |
| 32 | -class SearchSuggest |
|
| 33 | -{ |
|
| 32 | +class SearchSuggest { |
|
| 34 | 33 | /** |
| 35 | 34 | * The main method of the eID script |
| 36 | 35 | * |
| 37 | 36 | * @param ServerRequestInterface $request |
| 38 | 37 | * @return ResponseInterface XML response of search suggestions |
| 39 | 38 | */ |
| 40 | - public function main(ServerRequestInterface $request) |
|
| 41 | - { |
|
| 39 | + public function main(ServerRequestInterface $request) { |
|
| 42 | 40 | $parameters = $request->getParsedBody(); |
| 43 | 41 | $encrypted = (string)$parameters['encrypted']; |
| 44 | 42 | $hashed = (string)$parameters['hashed']; |
@@ -24,8 +24,7 @@ discard block |
||
| 24 | 24 | * @subpackage dlf |
| 25 | 25 | * @access public |
| 26 | 26 | */ |
| 27 | -class PageViewProxy |
|
| 28 | -{ |
|
| 27 | +class PageViewProxy { |
|
| 29 | 28 | |
| 30 | 29 | /** |
| 31 | 30 | * The main method of the eID script |
@@ -35,8 +34,7 @@ discard block |
||
| 35 | 34 | * @param ServerRequestInterface $request |
| 36 | 35 | * @return ResponseInterface |
| 37 | 36 | */ |
| 38 | - public function main(ServerRequestInterface $request) |
|
| 39 | - { |
|
| 37 | + public function main(ServerRequestInterface $request) { |
|
| 40 | 38 | // header parameter for getUrl(); allowed values 0,1,2; default 0 |
| 41 | 39 | $header = (int)$request->getQueryParams()['header']; |
| 42 | 40 | $header = \TYPO3\CMS\Core\Utility\MathUtility::forceIntegerInRange($header, 0, 2, 0); |
@@ -25,8 +25,7 @@ discard block |
||
| 25 | 25 | * @subpackage dlf |
| 26 | 26 | * @access public |
| 27 | 27 | */ |
| 28 | -class Calendar extends \Kitodo\Dlf\Common\AbstractPlugin |
|
| 29 | -{ |
|
| 28 | +class Calendar extends \Kitodo\Dlf\Common\AbstractPlugin { |
|
| 30 | 29 | public $scriptRelPath = 'Classes/Plugin/Calendar.php'; |
| 31 | 30 | |
| 32 | 31 | /** |
@@ -47,8 +46,7 @@ discard block |
||
| 47 | 46 | * |
| 48 | 47 | * @return string The content that is displayed on the website |
| 49 | 48 | */ |
| 50 | - public function main($content, $conf) |
|
| 51 | - { |
|
| 49 | + public function main($content, $conf) { |
|
| 52 | 50 | $this->init($conf); |
| 53 | 51 | |
| 54 | 52 | // Set initial document (anchor or year file) if configured. |
@@ -95,8 +93,7 @@ discard block |
||
| 95 | 93 | * |
| 96 | 94 | * @return string The content that is displayed on the website |
| 97 | 95 | */ |
| 98 | - public function calendar($content, $conf) |
|
| 99 | - { |
|
| 96 | + public function calendar($content, $conf) { |
|
| 100 | 97 | $this->init($conf); |
| 101 | 98 | // Load current document. |
| 102 | 99 | $this->loadDocument(); |
@@ -241,8 +238,7 @@ discard block |
||
| 241 | 238 | * |
| 242 | 239 | * @return string Content for template subpart |
| 243 | 240 | */ |
| 244 | - protected function getCalendarYear($calendarIssuesByMonth, $year, $firstMonth = 1, $lastMonth = 12) |
|
| 245 | - { |
|
| 241 | + protected function getCalendarYear($calendarIssuesByMonth, $year, $firstMonth = 1, $lastMonth = 12) { |
|
| 246 | 242 | // Get subpart templates. |
| 247 | 243 | $subPartContent = ''; |
| 248 | 244 | $subParts['month'] = $this->templateService->getSubpart($this->template, '###CALMONTH###'); |
@@ -360,8 +356,7 @@ discard block |
||
| 360 | 356 | * |
| 361 | 357 | * @return string The content that is displayed on the website |
| 362 | 358 | */ |
| 363 | - public function years($content, $conf) |
|
| 364 | - { |
|
| 359 | + public function years($content, $conf) { |
|
| 365 | 360 | $this->init($conf); |
| 366 | 361 | // Load current document. |
| 367 | 362 | $this->loadDocument(); |
@@ -20,8 +20,7 @@ discard block |
||
| 20 | 20 | * @subpackage dlf |
| 21 | 21 | * @access public |
| 22 | 22 | */ |
| 23 | -class Validator extends \Kitodo\Dlf\Common\AbstractPlugin |
|
| 24 | -{ |
|
| 23 | +class Validator extends \Kitodo\Dlf\Common\AbstractPlugin { |
|
| 25 | 24 | public $scriptRelPath = 'Classes/Plugin/Validator.php'; |
| 26 | 25 | |
| 27 | 26 | /** |
@@ -34,8 +33,7 @@ discard block |
||
| 34 | 33 | * |
| 35 | 34 | * @return string The content that is displayed on the website |
| 36 | 35 | */ |
| 37 | - public function main($content, $conf) |
|
| 38 | - { |
|
| 36 | + public function main($content, $conf) { |
|
| 39 | 37 | $this->init($conf); |
| 40 | 38 | // Disable caching for this plugin. |
| 41 | 39 | $this->setCache(false); |
@@ -25,8 +25,7 @@ discard block |
||
| 25 | 25 | * @subpackage dlf |
| 26 | 26 | * @access public |
| 27 | 27 | */ |
| 28 | -class Basket extends \Kitodo\Dlf\Common\AbstractPlugin |
|
| 29 | -{ |
|
| 28 | +class Basket extends \Kitodo\Dlf\Common\AbstractPlugin { |
|
| 30 | 29 | public $scriptRelPath = 'Classes/Plugin/Basket.php'; |
| 31 | 30 | |
| 32 | 31 | /** |
@@ -39,8 +38,7 @@ discard block |
||
| 39 | 38 | * |
| 40 | 39 | * @return string The content that is displayed on the website |
| 41 | 40 | */ |
| 42 | - public function main($content, $conf) |
|
| 43 | - { |
|
| 41 | + public function main($content, $conf) { |
|
| 44 | 42 | $this->init($conf); |
| 45 | 43 | // Don't cache the output. |
| 46 | 44 | $this->setCache(false); |
@@ -233,8 +231,7 @@ discard block |
||
| 233 | 231 | * |
| 234 | 232 | * @return string One basket entry |
| 235 | 233 | */ |
| 236 | - protected function getEntry($data, $template) |
|
| 237 | - { |
|
| 234 | + protected function getEntry($data, $template) { |
|
| 238 | 235 | if (is_object($data)) { |
| 239 | 236 | $data = get_object_vars($data); |
| 240 | 237 | } |
@@ -282,8 +279,7 @@ discard block |
||
| 282 | 279 | * |
| 283 | 280 | * @return array Basket data and Javascript output |
| 284 | 281 | */ |
| 285 | - protected function addToBasket($_piVars, $basketData) |
|
| 286 | - { |
|
| 282 | + protected function addToBasket($_piVars, $basketData) { |
|
| 287 | 283 | $output = ''; |
| 288 | 284 | if (!$_piVars['startpage']) { |
| 289 | 285 | $page = 0; |
@@ -375,8 +371,7 @@ discard block |
||
| 375 | 371 | * |
| 376 | 372 | * @return array basket data |
| 377 | 373 | */ |
| 378 | - protected function removeFromBasket($_piVars, $basketData) |
|
| 379 | - { |
|
| 374 | + protected function removeFromBasket($_piVars, $basketData) { |
|
| 380 | 375 | if (!empty($basketData['doc_ids'])) { |
| 381 | 376 | $items = $basketData['doc_ids']; |
| 382 | 377 | $items = get_object_vars($items); |
@@ -415,8 +410,7 @@ discard block |
||
| 415 | 410 | * |
| 416 | 411 | * @return array basket data |
| 417 | 412 | */ |
| 418 | - protected function openFromBasket($_piVars, $basketData) |
|
| 419 | - { |
|
| 413 | + protected function openFromBasket($_piVars, $basketData) { |
|
| 420 | 414 | $pdfUrl = $this->conf['pdfgenerate']; |
| 421 | 415 | foreach ($this->piVars['selected'] as $docValue) { |
| 422 | 416 | if ($docValue['id']) { |
@@ -438,8 +432,7 @@ discard block |
||
| 438 | 432 | * |
| 439 | 433 | * @return mixed download url or false |
| 440 | 434 | */ |
| 441 | - protected function getDocumentData($id, $data) |
|
| 442 | - { |
|
| 435 | + protected function getDocumentData($id, $data) { |
|
| 443 | 436 | // get document instance to load further information |
| 444 | 437 | $document = Document::getInstance($id, 0); |
| 445 | 438 | if ($document) { |
@@ -499,8 +492,7 @@ discard block |
||
| 499 | 492 | * |
| 500 | 493 | * @return void |
| 501 | 494 | */ |
| 502 | - protected function sendMail() |
|
| 503 | - { |
|
| 495 | + protected function sendMail() { |
|
| 504 | 496 | // send mail |
| 505 | 497 | $mailId = $this->piVars['mail_action']; |
| 506 | 498 | |
@@ -590,8 +582,7 @@ discard block |
||
| 590 | 582 | * |
| 591 | 583 | * @return void |
| 592 | 584 | */ |
| 593 | - protected function printDocument() |
|
| 594 | - { |
|
| 585 | + protected function printDocument() { |
|
| 595 | 586 | $pdfUrl = $this->conf['pdfprint']; |
| 596 | 587 | $numberOfPages = 0; |
| 597 | 588 | foreach ($this->piVars['selected'] as $docId => $docValue) { |