@@ -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 | '; |
@@ -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) { |
@@ -16,67 +16,67 @@ |
||
| 16 | 16 | // Plugin "audioplayer". |
| 17 | 17 | $GLOBALS['TCA']['tt_content']['types']['list']['subtypes_excludelist']['dlf_audioplayer'] = 'layout,select_key,pages,recursive'; |
| 18 | 18 | $GLOBALS['TCA']['tt_content']['types']['list']['subtypes_addlist']['dlf_audioplayer'] = 'pi_flexform'; |
| 19 | -\TYPO3\CMS\Core\Utility\ExtensionManagementUtility::addPiFlexFormValue('dlf_audioplayer', 'FILE:EXT:' . 'dlf/Configuration/FlexForms/AudioPlayer.xml'); |
|
| 19 | +\TYPO3\CMS\Core\Utility\ExtensionManagementUtility::addPiFlexFormValue('dlf_audioplayer', 'FILE:EXT:'.'dlf/Configuration/FlexForms/AudioPlayer.xml'); |
|
| 20 | 20 | // Plugin "basket". |
| 21 | 21 | $GLOBALS['TCA']['tt_content']['types']['list']['subtypes_excludelist']['dlf_basket'] = 'layout,select_key,pages,recursive'; |
| 22 | 22 | $GLOBALS['TCA']['tt_content']['types']['list']['subtypes_addlist']['dlf_basket'] = 'pi_flexform'; |
| 23 | -\TYPO3\CMS\Core\Utility\ExtensionManagementUtility::addPiFlexFormValue('dlf_basket', 'FILE:EXT:' . 'dlf/Configuration/FlexForms/Basket.xml'); |
|
| 23 | +\TYPO3\CMS\Core\Utility\ExtensionManagementUtility::addPiFlexFormValue('dlf_basket', 'FILE:EXT:'.'dlf/Configuration/FlexForms/Basket.xml'); |
|
| 24 | 24 | // Plugin "calendar". |
| 25 | 25 | $GLOBALS['TCA']['tt_content']['types']['list']['subtypes_excludelist']['dlf_calendar'] = 'layout,select_key,pages,recursive'; |
| 26 | 26 | $GLOBALS['TCA']['tt_content']['types']['list']['subtypes_addlist']['dlf_calendar'] = 'pi_flexform'; |
| 27 | -\TYPO3\CMS\Core\Utility\ExtensionManagementUtility::addPiFlexFormValue('dlf_calendar', 'FILE:EXT:' . 'dlf/Configuration/FlexForms/Calendar.xml'); |
|
| 27 | +\TYPO3\CMS\Core\Utility\ExtensionManagementUtility::addPiFlexFormValue('dlf_calendar', 'FILE:EXT:'.'dlf/Configuration/FlexForms/Calendar.xml'); |
|
| 28 | 28 | // Plugin "collection". |
| 29 | 29 | $GLOBALS['TCA']['tt_content']['types']['list']['subtypes_excludelist']['dlf_collection'] = 'layout,select_key,pages,recursive'; |
| 30 | 30 | $GLOBALS['TCA']['tt_content']['types']['list']['subtypes_addlist']['dlf_collection'] = 'pi_flexform'; |
| 31 | -\TYPO3\CMS\Core\Utility\ExtensionManagementUtility::addPiFlexFormValue('dlf_collection', 'FILE:EXT:' . 'dlf/Configuration/FlexForms/Collection.xml'); |
|
| 31 | +\TYPO3\CMS\Core\Utility\ExtensionManagementUtility::addPiFlexFormValue('dlf_collection', 'FILE:EXT:'.'dlf/Configuration/FlexForms/Collection.xml'); |
|
| 32 | 32 | // Plugin "feeds". |
| 33 | 33 | $GLOBALS['TCA']['tt_content']['types']['list']['subtypes_excludelist']['dlf_feeds'] = 'layout,select_key,pages,recursive'; |
| 34 | 34 | $GLOBALS['TCA']['tt_content']['types']['list']['subtypes_addlist']['dlf_feeds'] = 'pi_flexform'; |
| 35 | -\TYPO3\CMS\Core\Utility\ExtensionManagementUtility::addPiFlexFormValue('dlf_feeds', 'FILE:EXT:' . 'dlf/Configuration/FlexForms/Feeds.xml'); |
|
| 35 | +\TYPO3\CMS\Core\Utility\ExtensionManagementUtility::addPiFlexFormValue('dlf_feeds', 'FILE:EXT:'.'dlf/Configuration/FlexForms/Feeds.xml'); |
|
| 36 | 36 | // Plugin "listview". |
| 37 | 37 | $GLOBALS['TCA']['tt_content']['types']['list']['subtypes_excludelist']['dlf_listview'] = 'layout,select_key,pages,recursive'; |
| 38 | 38 | $GLOBALS['TCA']['tt_content']['types']['list']['subtypes_addlist']['dlf_listview'] = 'pi_flexform'; |
| 39 | -\TYPO3\CMS\Core\Utility\ExtensionManagementUtility::addPiFlexFormValue('dlf_listview', 'FILE:EXT:' . 'dlf/Configuration/FlexForms/ListView.xml'); |
|
| 39 | +\TYPO3\CMS\Core\Utility\ExtensionManagementUtility::addPiFlexFormValue('dlf_listview', 'FILE:EXT:'.'dlf/Configuration/FlexForms/ListView.xml'); |
|
| 40 | 40 | // Plugin "metadata". |
| 41 | 41 | $GLOBALS['TCA']['tt_content']['types']['list']['subtypes_excludelist']['dlf_metadata'] = 'layout,select_key,pages,recursive'; |
| 42 | 42 | $GLOBALS['TCA']['tt_content']['types']['list']['subtypes_addlist']['dlf_metadata'] = 'pi_flexform'; |
| 43 | -\TYPO3\CMS\Core\Utility\ExtensionManagementUtility::addPiFlexFormValue('dlf_metadata', 'FILE:EXT:' . 'dlf/Configuration/FlexForms/Metadata.xml'); |
|
| 43 | +\TYPO3\CMS\Core\Utility\ExtensionManagementUtility::addPiFlexFormValue('dlf_metadata', 'FILE:EXT:'.'dlf/Configuration/FlexForms/Metadata.xml'); |
|
| 44 | 44 | // Plugin "navigation". |
| 45 | 45 | $GLOBALS['TCA']['tt_content']['types']['list']['subtypes_excludelist']['dlf_navigation'] = 'layout,select_key,pages,recursive'; |
| 46 | 46 | $GLOBALS['TCA']['tt_content']['types']['list']['subtypes_addlist']['dlf_navigation'] = 'pi_flexform'; |
| 47 | -\TYPO3\CMS\Core\Utility\ExtensionManagementUtility::addPiFlexFormValue('dlf_navigation', 'FILE:EXT:' . 'dlf/Configuration/FlexForms/Navigation.xml'); |
|
| 47 | +\TYPO3\CMS\Core\Utility\ExtensionManagementUtility::addPiFlexFormValue('dlf_navigation', 'FILE:EXT:'.'dlf/Configuration/FlexForms/Navigation.xml'); |
|
| 48 | 48 | // Plugin "oaipmh". |
| 49 | 49 | $GLOBALS['TCA']['tt_content']['types']['list']['subtypes_excludelist']['dlf_oaipmh'] = 'layout,select_key,pages,recursive'; |
| 50 | 50 | $GLOBALS['TCA']['tt_content']['types']['list']['subtypes_addlist']['dlf_oaipmh'] = 'pi_flexform'; |
| 51 | -\TYPO3\CMS\Core\Utility\ExtensionManagementUtility::addPiFlexFormValue('dlf_oaipmh', 'FILE:EXT:' . 'dlf/Configuration/FlexForms/OaiPmh.xml'); |
|
| 51 | +\TYPO3\CMS\Core\Utility\ExtensionManagementUtility::addPiFlexFormValue('dlf_oaipmh', 'FILE:EXT:'.'dlf/Configuration/FlexForms/OaiPmh.xml'); |
|
| 52 | 52 | // Plugin "pagegrid". |
| 53 | 53 | $GLOBALS['TCA']['tt_content']['types']['list']['subtypes_excludelist']['dlf_pagegrid'] = 'layout,select_key,pages,recursive'; |
| 54 | 54 | $GLOBALS['TCA']['tt_content']['types']['list']['subtypes_addlist']['dlf_pagegrid'] = 'pi_flexform'; |
| 55 | -\TYPO3\CMS\Core\Utility\ExtensionManagementUtility::addPiFlexFormValue('dlf_pagegrid', 'FILE:EXT:' . 'dlf/Configuration/FlexForms/PageGrid.xml'); |
|
| 55 | +\TYPO3\CMS\Core\Utility\ExtensionManagementUtility::addPiFlexFormValue('dlf_pagegrid', 'FILE:EXT:'.'dlf/Configuration/FlexForms/PageGrid.xml'); |
|
| 56 | 56 | // Plugin "pageview". |
| 57 | 57 | $GLOBALS['TCA']['tt_content']['types']['list']['subtypes_excludelist']['dlf_pageview'] = 'layout,select_key,pages,recursive'; |
| 58 | 58 | $GLOBALS['TCA']['tt_content']['types']['list']['subtypes_addlist']['dlf_pageview'] = 'pi_flexform'; |
| 59 | -\TYPO3\CMS\Core\Utility\ExtensionManagementUtility::addPiFlexFormValue('dlf_pageview', 'FILE:EXT:' . 'dlf/Configuration/FlexForms/PageView.xml'); |
|
| 59 | +\TYPO3\CMS\Core\Utility\ExtensionManagementUtility::addPiFlexFormValue('dlf_pageview', 'FILE:EXT:'.'dlf/Configuration/FlexForms/PageView.xml'); |
|
| 60 | 60 | // Plugin "search". |
| 61 | 61 | $GLOBALS['TCA']['tt_content']['types']['list']['subtypes_excludelist']['dlf_search'] = 'layout,select_key,pages,recursive'; |
| 62 | 62 | $GLOBALS['TCA']['tt_content']['types']['list']['subtypes_addlist']['dlf_search'] = 'pi_flexform'; |
| 63 | -\TYPO3\CMS\Core\Utility\ExtensionManagementUtility::addPiFlexFormValue('dlf_search', 'FILE:EXT:' . 'dlf/Configuration/FlexForms/Search.xml'); |
|
| 63 | +\TYPO3\CMS\Core\Utility\ExtensionManagementUtility::addPiFlexFormValue('dlf_search', 'FILE:EXT:'.'dlf/Configuration/FlexForms/Search.xml'); |
|
| 64 | 64 | // Plugin "statistics". |
| 65 | 65 | $GLOBALS['TCA']['tt_content']['types']['list']['subtypes_excludelist']['dlf_statistics'] = 'layout,select_key,pages,recursive'; |
| 66 | 66 | $GLOBALS['TCA']['tt_content']['types']['list']['subtypes_addlist']['dlf_statistics'] = 'pi_flexform'; |
| 67 | -\TYPO3\CMS\Core\Utility\ExtensionManagementUtility::addPiFlexFormValue('dlf_statistics', 'FILE:EXT:' . 'dlf/Configuration/FlexForms/Statistics.xml'); |
|
| 67 | +\TYPO3\CMS\Core\Utility\ExtensionManagementUtility::addPiFlexFormValue('dlf_statistics', 'FILE:EXT:'.'dlf/Configuration/FlexForms/Statistics.xml'); |
|
| 68 | 68 | // Plugin "tableofcontents". |
| 69 | 69 | $GLOBALS['TCA']['tt_content']['types']['list']['subtypes_excludelist']['dlf_tableofcontents'] = 'layout,select_key,pages,recursive'; |
| 70 | 70 | $GLOBALS['TCA']['tt_content']['types']['list']['subtypes_addlist']['dlf_tableofcontents'] = 'pi_flexform'; |
| 71 | -\TYPO3\CMS\Core\Utility\ExtensionManagementUtility::addPiFlexFormValue('dlf_tableofcontents', 'FILE:EXT:' . 'dlf/Configuration/FlexForms/TableOfContents.xml'); |
|
| 71 | +\TYPO3\CMS\Core\Utility\ExtensionManagementUtility::addPiFlexFormValue('dlf_tableofcontents', 'FILE:EXT:'.'dlf/Configuration/FlexForms/TableOfContents.xml'); |
|
| 72 | 72 | // Plugin "toolbox". |
| 73 | 73 | $GLOBALS['TCA']['tt_content']['types']['list']['subtypes_excludelist']['dlf_toolbox'] = 'layout,select_key,pages,recursive'; |
| 74 | 74 | $GLOBALS['TCA']['tt_content']['types']['list']['subtypes_addlist']['dlf_toolbox'] = 'pi_flexform'; |
| 75 | -\TYPO3\CMS\Core\Utility\ExtensionManagementUtility::addPiFlexFormValue('dlf_toolbox', 'FILE:EXT:' . 'dlf/Configuration/FlexForms/Toolbox.xml'); |
|
| 75 | +\TYPO3\CMS\Core\Utility\ExtensionManagementUtility::addPiFlexFormValue('dlf_toolbox', 'FILE:EXT:'.'dlf/Configuration/FlexForms/Toolbox.xml'); |
|
| 76 | 76 | // Plugin "view3d". |
| 77 | 77 | $GLOBALS['TCA']['tt_content']['types']['list']['subtypes_excludelist']['dlf_view3d'] = 'layout,select_key,pages,recursive'; |
| 78 | 78 | $GLOBALS['TCA']['tt_content']['types']['list']['subtypes_addlist']['dlf_view3d'] = 'pi_flexform'; |
| 79 | -\TYPO3\CMS\Core\Utility\ExtensionManagementUtility::addPiFlexFormValue('dlf_view3d', 'FILE:EXT:' . 'dlf/Configuration/FlexForms/View3D.xml'); |
|
| 79 | +\TYPO3\CMS\Core\Utility\ExtensionManagementUtility::addPiFlexFormValue('dlf_view3d', 'FILE:EXT:'.'dlf/Configuration/FlexForms/View3D.xml'); |
|
| 80 | 80 | |
| 81 | 81 | \TYPO3\CMS\Extbase\Utility\ExtensionUtility::registerPlugin( |
| 82 | 82 | 'Kitodo.Dlf', |
@@ -46,8 +46,7 @@ |
||
| 46 | 46 | * |
| 47 | 47 | * @return void |
| 48 | 48 | */ |
| 49 | - public function extractMetadata(\SimpleXMLElement $xml, array &$metadata) |
|
| 50 | - { |
|
| 49 | + public function extractMetadata(\SimpleXMLElement $xml, array &$metadata) { |
|
| 51 | 50 | $this->xml = $xml; |
| 52 | 51 | $this->metadata = $metadata; |
| 53 | 52 | |
@@ -99,7 +99,7 @@ discard block |
||
| 99 | 99 | if (!empty($name)) { |
| 100 | 100 | $this->metadata['author'][$i] = [ |
| 101 | 101 | 'name' => $name, |
| 102 | - 'url' => 'https://orcid.org/' . $orcidId |
|
| 102 | + 'url' => 'https://orcid.org/'.$orcidId |
|
| 103 | 103 | ]; |
| 104 | 104 | } else { |
| 105 | 105 | //fallback into display form |
@@ -146,7 +146,7 @@ discard block |
||
| 146 | 146 | } |
| 147 | 147 | // Append "valueURI" to name using Unicode unit separator. |
| 148 | 148 | if (isset($authors[$i]['valueURI'])) { |
| 149 | - $this->metadata['author'][$i] .= chr(31) . (string) $authors[$i]['valueURI']; |
|
| 149 | + $this->metadata['author'][$i] .= chr(31).(string) $authors[$i]['valueURI']; |
|
| 150 | 150 | } |
| 151 | 151 | } |
| 152 | 152 | |
@@ -187,7 +187,7 @@ discard block |
||
| 187 | 187 | if (!empty($name)) { |
| 188 | 188 | $this->metadata['holder'][$i] = [ |
| 189 | 189 | 'name' => $name, |
| 190 | - 'url' => 'http://viaf.org/viaf/' . $viafId |
|
| 190 | + 'url' => 'http://viaf.org/viaf/'.$viafId |
|
| 191 | 191 | ]; |
| 192 | 192 | } else { |
| 193 | 193 | //fallback into display form |
@@ -199,7 +199,7 @@ discard block |
||
| 199 | 199 | $this->getHolderFromXmlDisplayForm($holders, $i); |
| 200 | 200 | // Append "valueURI" to name using Unicode unit separator. |
| 201 | 201 | if (isset($holders[$i]['valueURI'])) { |
| 202 | - $this->metadata['holder'][$i] .= chr(31) . (string) $holders[$i]['valueURI']; |
|
| 202 | + $this->metadata['holder'][$i] .= chr(31).(string) $holders[$i]['valueURI']; |
|
| 203 | 203 | } |
| 204 | 204 | } |
| 205 | 205 | |
@@ -129,7 +129,7 @@ |
||
| 129 | 129 | $this->raw->registerXPathNamespace('personal-details', 'http://www.orcid.org/ns/personal-details'); |
| 130 | 130 | $givenNames = $this->raw->xpath('./personal-details:name/personal-details:given-names'); |
| 131 | 131 | $familyName = $this->raw->xpath('./personal-details:name/personal-details:family-name'); |
| 132 | - return (string) $givenNames[0] . ' ' . (string) $familyName[0]; |
|
| 132 | + return (string) $givenNames[0].' '.(string) $familyName[0]; |
|
| 133 | 133 | } else { |
| 134 | 134 | $this->logger->warning('No name found for given ORCID'); |
| 135 | 135 | return false; |
@@ -25,8 +25,7 @@ discard block |
||
| 25 | 25 | * @subpackage dlf |
| 26 | 26 | * @access public |
| 27 | 27 | **/ |
| 28 | -class Profile |
|
| 29 | -{ |
|
| 28 | +class Profile { |
|
| 30 | 29 | /** |
| 31 | 30 | * This holds the logger |
| 32 | 31 | * |
@@ -57,8 +56,7 @@ discard block |
||
| 57 | 56 | * |
| 58 | 57 | * @return void |
| 59 | 58 | **/ |
| 60 | - public function __construct($orcid) |
|
| 61 | - { |
|
| 59 | + public function __construct($orcid) { |
|
| 62 | 60 | $this->logger = GeneralUtility::makeInstance(LogManager::class)->getLogger(static::class); |
| 63 | 61 | $this->client = new Client($orcid, GeneralUtility::makeInstance(RequestFactory::class)); |
| 64 | 62 | } |
@@ -68,8 +66,7 @@ discard block |
||
| 68 | 66 | * |
| 69 | 67 | * @return array|false |
| 70 | 68 | **/ |
| 71 | - public function getData() |
|
| 72 | - { |
|
| 69 | + public function getData() { |
|
| 73 | 70 | $this->getRaw('person'); |
| 74 | 71 | if (!empty($this->raw)) { |
| 75 | 72 | $data = []; |
@@ -88,8 +85,7 @@ discard block |
||
| 88 | 85 | * |
| 89 | 86 | * @return string|false |
| 90 | 87 | **/ |
| 91 | - public function getAddress() |
|
| 92 | - { |
|
| 88 | + public function getAddress() { |
|
| 93 | 89 | $this->getRaw('address'); |
| 94 | 90 | if (!empty($this->raw)) { |
| 95 | 91 | $this->raw->registerXPathNamespace('address', 'http://www.orcid.org/ns/address'); |
@@ -105,8 +101,7 @@ discard block |
||
| 105 | 101 | * |
| 106 | 102 | * @return string|false |
| 107 | 103 | **/ |
| 108 | - public function getEmail() |
|
| 109 | - { |
|
| 104 | + public function getEmail() { |
|
| 110 | 105 | $this->getRaw('email'); |
| 111 | 106 | if (!empty($this->raw)) { |
| 112 | 107 | $this->raw->registerXPathNamespace('email', 'http://www.orcid.org/ns/email'); |
@@ -122,8 +117,7 @@ discard block |
||
| 122 | 117 | * |
| 123 | 118 | * @return string|false |
| 124 | 119 | **/ |
| 125 | - public function getFullName() |
|
| 126 | - { |
|
| 120 | + public function getFullName() { |
|
| 127 | 121 | $this->getRaw('personal-details'); |
| 128 | 122 | if (!empty($this->raw)) { |
| 129 | 123 | $this->raw->registerXPathNamespace('personal-details', 'http://www.orcid.org/ns/personal-details'); |
@@ -143,8 +137,7 @@ discard block |
||
| 143 | 137 | * |
| 144 | 138 | * @return void |
| 145 | 139 | **/ |
| 146 | - protected function getRaw($endpoint) |
|
| 147 | - { |
|
| 140 | + protected function getRaw($endpoint) { |
|
| 148 | 141 | $this->client->setEndpoint($endpoint); |
| 149 | 142 | $data = $this->client->getData(); |
| 150 | 143 | if (!isset($this->raw) && $data != false) { |
@@ -107,13 +107,13 @@ discard block |
||
| 107 | 107 | } |
| 108 | 108 | |
| 109 | 109 | // sanitize date search input |
| 110 | - if(empty($this->searchParams['dateFrom']) && !empty($this->searchParams['dateTo'])) { |
|
| 110 | + if (empty($this->searchParams['dateFrom']) && !empty($this->searchParams['dateTo'])) { |
|
| 111 | 111 | $this->searchParams['dateFrom'] = '*'; |
| 112 | 112 | } |
| 113 | - if(empty($this->searchParams['dateTo']) && !empty($this->searchParams['dateFrom'])) { |
|
| 113 | + if (empty($this->searchParams['dateTo']) && !empty($this->searchParams['dateFrom'])) { |
|
| 114 | 114 | $this->searchParams['dateTo'] = 'NOW'; |
| 115 | 115 | } |
| 116 | - if($this->searchParams['dateFrom'] > $this->searchParams['dateTo']) { |
|
| 116 | + if ($this->searchParams['dateFrom'] > $this->searchParams['dateTo']) { |
|
| 117 | 117 | $tmpDate = $this->searchParams['dateFrom']; |
| 118 | 118 | $this->searchParams['dateFrom'] = $this->searchParams['dateTo']; |
| 119 | 119 | $this->searchParams['dateTo'] = $tmpDate; |
@@ -174,7 +174,7 @@ discard block |
||
| 174 | 174 | |
| 175 | 175 | // Add uHash parameter to suggest parameter to make a basic protection of this form. |
| 176 | 176 | if ($this->settings['suggest']) { |
| 177 | - $this->view->assign('uHash', GeneralUtility::hmac((string) (new Typo3Version()) . Environment::getExtensionsPath(), 'SearchSuggest')); |
|
| 177 | + $this->view->assign('uHash', GeneralUtility::hmac((string) (new Typo3Version()).Environment::getExtensionsPath(), 'SearchSuggest')); |
|
| 178 | 178 | } |
| 179 | 179 | |
| 180 | 180 | $this->view->assign('viewData', $this->viewData); |
@@ -197,7 +197,7 @@ discard block |
||
| 197 | 197 | // Get facets from plugin configuration. |
| 198 | 198 | $facets = []; |
| 199 | 199 | foreach (GeneralUtility::trimExplode(',', $this->settings['facets'], true) as $facet) { |
| 200 | - $facets[$facet . '_faceting'] = Helper::translate($facet, 'tx_dlf_metadata', $this->settings['storagePid']); |
|
| 200 | + $facets[$facet.'_faceting'] = Helper::translate($facet, 'tx_dlf_metadata', $this->settings['storagePid']); |
|
| 201 | 201 | } |
| 202 | 202 | |
| 203 | 203 | $this->view->assign('facetsMenu', $this->makeFacetsMenuArray($facets)); |
@@ -239,13 +239,13 @@ discard block |
||
| 239 | 239 | $searchParams = $this->searchParams; |
| 240 | 240 | if ( |
| 241 | 241 | (!empty($searchParams['fulltext'])) |
| 242 | - || preg_match('/' . $fields['fulltext'] . ':\((.*)\)/', trim($searchParams['query']), $matches) |
|
| 242 | + || preg_match('/'.$fields['fulltext'].':\((.*)\)/', trim($searchParams['query']), $matches) |
|
| 243 | 243 | ) { |
| 244 | 244 | // If the query already is a fulltext query e.g using the facets |
| 245 | 245 | $searchParams['query'] = empty($matches[1]) ? $searchParams['query'] : $matches[1]; |
| 246 | 246 | // Search in fulltext field if applicable. Query must not be empty! |
| 247 | 247 | if (!empty($this->searchParams['query'])) { |
| 248 | - $search['query'] = $fields['fulltext'] . ':(' . Solr::escapeQuery(trim($searchParams['query'])) . ')'; |
|
| 248 | + $search['query'] = $fields['fulltext'].':('.Solr::escapeQuery(trim($searchParams['query'])).')'; |
|
| 249 | 249 | } |
| 250 | 250 | } else { |
| 251 | 251 | // Retain given search field if valid. |
@@ -257,7 +257,7 @@ discard block |
||
| 257 | 257 | // add filter query for date search |
| 258 | 258 | if (!empty($this->searchParams['dateFrom']) && !empty($this->searchParams['dateTo'])) { |
| 259 | 259 | // combine dateFrom and dateTo into filterquery as range search |
| 260 | - $search['params']['filterquery'][]['query'] = '{!join from=' . $fields['uid'] . ' to=' . $fields['uid'] . '}' . $fields['date'] . ':[' . $this->searchParams['dateFrom'] . ' TO ' . $this->searchParams['dateTo'] . ']'; |
|
| 260 | + $search['params']['filterquery'][]['query'] = '{!join from='.$fields['uid'].' to='.$fields['uid'].'}'.$fields['date'].':['.$this->searchParams['dateFrom'].' TO '.$this->searchParams['dateTo'].']'; |
|
| 261 | 261 | } |
| 262 | 262 | |
| 263 | 263 | // Add extended search query. |
@@ -275,9 +275,9 @@ discard block |
||
| 275 | 275 | in_array($searchParams['extOperator'][$i], $allowedOperators) |
| 276 | 276 | ) { |
| 277 | 277 | if (!empty($search['query'])) { |
| 278 | - $search['query'] .= ' ' . $searchParams['extOperator'][$i] . ' '; |
|
| 278 | + $search['query'] .= ' '.$searchParams['extOperator'][$i].' '; |
|
| 279 | 279 | } |
| 280 | - $search['query'] .= Indexer::getIndexFieldName($searchParams['extField'][$i], $this->settings['storagePid']) . ':(' . Solr::escapeQuery($searchParams['extQuery'][$i]) . ')'; |
|
| 280 | + $search['query'] .= Indexer::getIndexFieldName($searchParams['extField'][$i], $this->settings['storagePid']).':('.Solr::escapeQuery($searchParams['extQuery'][$i]).')'; |
|
| 281 | 281 | } |
| 282 | 282 | } |
| 283 | 283 | } |
@@ -403,7 +403,7 @@ discard block |
||
| 403 | 403 | $entryArray['doNotLinkIt'] = 0; |
| 404 | 404 | // Check if facet is already selected. |
| 405 | 405 | $queryColumn = array_column($search['params']['filterquery'], 'query'); |
| 406 | - $index = array_search($field . ':("' . Solr::escapeQuery($value) . '")', $queryColumn); |
|
| 406 | + $index = array_search($field.':("'.Solr::escapeQuery($value).'")', $queryColumn); |
|
| 407 | 407 | if ($index !== false) { |
| 408 | 408 | // Facet is selected, thus remove it from filter. |
| 409 | 409 | unset($queryColumn[$index]); |
@@ -417,7 +417,7 @@ discard block |
||
| 417 | 417 | } |
| 418 | 418 | } else { |
| 419 | 419 | // Facet is not selected, thus add it to filter. |
| 420 | - $queryColumn[] = $field . ':("' . Solr::escapeQuery($value) . '")'; |
|
| 420 | + $queryColumn[] = $field.':("'.Solr::escapeQuery($value).'")'; |
|
| 421 | 421 | $entryArray['ITEM_STATE'] = 'NO'; |
| 422 | 422 | } |
| 423 | 423 | $entryArray['queryColumn'] = $queryColumn; |
@@ -23,8 +23,7 @@ discard block |
||
| 23 | 23 | * @subpackage dlf |
| 24 | 24 | * @access public |
| 25 | 25 | */ |
| 26 | -class NavigationController extends AbstractController |
|
| 27 | -{ |
|
| 26 | +class NavigationController extends AbstractController { |
|
| 28 | 27 | /** |
| 29 | 28 | * Method to get the page select values and use them with chash |
| 30 | 29 | * @param \Kitodo\Dlf\Domain\Model\PageSelectForm|NULL $pageSelectForm |
@@ -53,8 +52,7 @@ discard block |
||
| 53 | 52 | * |
| 54 | 53 | * @return void |
| 55 | 54 | */ |
| 56 | - public function mainAction() |
|
| 57 | - { |
|
| 55 | + public function mainAction() { |
|
| 58 | 56 | // Load current document. |
| 59 | 57 | $this->loadDocument($this->requestData); |
| 60 | 58 | if ( |
@@ -143,7 +143,7 @@ discard block |
||
| 143 | 143 | if (!preg_match('/\d{8}-\d{1}/i', $id)) { |
| 144 | 144 | return false; |
| 145 | 145 | } elseif ($checksum == 10) { |
| 146 | - return self::checkIdentifier(($digits + 1) . substr($id, -2, 2), 'SWD'); |
|
| 146 | + return self::checkIdentifier(($digits + 1).substr($id, -2, 2), 'SWD'); |
|
| 147 | 147 | } elseif (substr($id, -1, 1) != $checksum) { |
| 148 | 148 | return false; |
| 149 | 149 | } |
@@ -315,7 +315,7 @@ discard block |
||
| 315 | 315 | $encrypted = openssl_encrypt($string, self::$cipherAlgorithm, $key, OPENSSL_RAW_DATA, $iv); |
| 316 | 316 | // Merge initialisation vector and encrypted data. |
| 317 | 317 | if ($encrypted !== false) { |
| 318 | - $encrypted = base64_encode($iv . $encrypted); |
|
| 318 | + $encrypted = base64_encode($iv.$encrypted); |
|
| 319 | 319 | } |
| 320 | 320 | return $encrypted; |
| 321 | 321 | } |
@@ -369,8 +369,8 @@ discard block |
||
| 369 | 369 | public static function getHookObjects($scriptRelPath) |
| 370 | 370 | { |
| 371 | 371 | $hookObjects = []; |
| 372 | - if (is_array($GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS'][self::$extKey . '/' . $scriptRelPath]['hookClass'])) { |
|
| 373 | - foreach ($GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS'][self::$extKey . '/' . $scriptRelPath]['hookClass'] as $classRef) { |
|
| 372 | + if (is_array($GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS'][self::$extKey.'/'.$scriptRelPath]['hookClass'])) { |
|
| 373 | + foreach ($GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS'][self::$extKey.'/'.$scriptRelPath]['hookClass'] as $classRef) { |
|
| 374 | 374 | $hookObjects[] = GeneralUtility::makeInstance($classRef); |
| 375 | 375 | } |
| 376 | 376 | } |
@@ -397,12 +397,12 @@ discard block |
||
| 397 | 397 | // NOTE: Only use tables that don't have too many entries! |
| 398 | 398 | || !in_array($table, ['tx_dlf_collections', 'tx_dlf_libraries', 'tx_dlf_metadata', 'tx_dlf_structures', 'tx_dlf_solrcores']) |
| 399 | 399 | ) { |
| 400 | - self::log('Invalid UID "' . $uid . '" or table "' . $table . '"', LOG_SEVERITY_ERROR); |
|
| 400 | + self::log('Invalid UID "'.$uid.'" or table "'.$table.'"', LOG_SEVERITY_ERROR); |
|
| 401 | 401 | return ''; |
| 402 | 402 | } |
| 403 | 403 | |
| 404 | - $makeCacheKey = function ($pid, $uid) { |
|
| 405 | - return $pid . '.' . $uid; |
|
| 404 | + $makeCacheKey = function($pid, $uid) { |
|
| 405 | + return $pid.'.'.$uid; |
|
| 406 | 406 | }; |
| 407 | 407 | |
| 408 | 408 | static $cache = []; |
@@ -412,9 +412,9 @@ discard block |
||
| 412 | 412 | |
| 413 | 413 | $result = $queryBuilder |
| 414 | 414 | ->select( |
| 415 | - $table . '.index_name AS index_name', |
|
| 416 | - $table . '.uid AS uid', |
|
| 417 | - $table . '.pid AS pid', |
|
| 415 | + $table.'.index_name AS index_name', |
|
| 416 | + $table.'.uid AS uid', |
|
| 417 | + $table.'.pid AS pid', |
|
| 418 | 418 | ) |
| 419 | 419 | ->from($table) |
| 420 | 420 | ->execute(); |
@@ -432,7 +432,7 @@ discard block |
||
| 432 | 432 | $result = $cache[$table][$cacheKey] ?? ''; |
| 433 | 433 | |
| 434 | 434 | if ($result === '') { |
| 435 | - self::log('No "index_name" with UID ' . $uid . ' and PID ' . $pid . ' found in table "' . $table . '"', LOG_SEVERITY_WARNING); |
|
| 435 | + self::log('No "index_name" with UID '.$uid.' and PID '.$pid.' found in table "'.$table.'"', LOG_SEVERITY_WARNING); |
|
| 436 | 436 | } |
| 437 | 437 | |
| 438 | 438 | return $result; |
@@ -459,11 +459,11 @@ discard block |
||
| 459 | 459 | // No ISO code, return unchanged. |
| 460 | 460 | return $code; |
| 461 | 461 | } |
| 462 | - $lang = LocalizationUtility::translate('LLL:' . $file . ':' . $code); |
|
| 462 | + $lang = LocalizationUtility::translate('LLL:'.$file.':'.$code); |
|
| 463 | 463 | if (!empty($lang)) { |
| 464 | 464 | return $lang; |
| 465 | 465 | } else { |
| 466 | - self::log('Language code "' . $code . '" not found in ISO-639 table', LOG_SEVERITY_NOTICE); |
|
| 466 | + self::log('Language code "'.$code.'" not found in ISO-639 table', LOG_SEVERITY_NOTICE); |
|
| 467 | 467 | return $code; |
| 468 | 468 | } |
| 469 | 469 | } |
@@ -560,7 +560,7 @@ discard block |
||
| 560 | 560 | '-' => 39, |
| 561 | 561 | ':' => 17, |
| 562 | 562 | ]; |
| 563 | - $urn = strtolower($base . $id); |
|
| 563 | + $urn = strtolower($base.$id); |
|
| 564 | 564 | if (preg_match('/[^a-z\d:-]/', $urn)) { |
| 565 | 565 | self::log('Invalid chars in given parameters', LOG_SEVERITY_WARNING); |
| 566 | 566 | return ''; |
@@ -574,7 +574,7 @@ discard block |
||
| 574 | 574 | $checksum += ($i + 1) * intval(substr($digits, $i, 1)); |
| 575 | 575 | } |
| 576 | 576 | $checksum = substr(intval($checksum / intval(substr($digits, -1, 1))), -1, 1); |
| 577 | - return $base . $id . $checksum; |
|
| 577 | + return $base.$id.$checksum; |
|
| 578 | 578 | } |
| 579 | 579 | |
| 580 | 580 | /** |
@@ -668,7 +668,7 @@ discard block |
||
| 668 | 668 | // Sanitize input. |
| 669 | 669 | $pid = max(intval($pid), 0); |
| 670 | 670 | if (!$pid) { |
| 671 | - self::log('Invalid PID ' . $pid . ' for translation', LOG_SEVERITY_WARNING); |
|
| 671 | + self::log('Invalid PID '.$pid.' for translation', LOG_SEVERITY_WARNING); |
|
| 672 | 672 | return $index_name; |
| 673 | 673 | } |
| 674 | 674 | /** @var \TYPO3\CMS\Frontend\Page\PageRepository $pageRepository */ |
@@ -690,13 +690,13 @@ discard block |
||
| 690 | 690 | // First fetch the uid of the received index_name |
| 691 | 691 | $result = $queryBuilder |
| 692 | 692 | ->select( |
| 693 | - $table . '.uid AS uid', |
|
| 694 | - $table . '.l18n_parent AS l18n_parent' |
|
| 693 | + $table.'.uid AS uid', |
|
| 694 | + $table.'.l18n_parent AS l18n_parent' |
|
| 695 | 695 | ) |
| 696 | 696 | ->from($table) |
| 697 | 697 | ->where( |
| 698 | - $queryBuilder->expr()->eq($table . '.pid', $pid), |
|
| 699 | - $queryBuilder->expr()->eq($table . '.index_name', $queryBuilder->expr()->literal($index_name)), |
|
| 698 | + $queryBuilder->expr()->eq($table.'.pid', $pid), |
|
| 699 | + $queryBuilder->expr()->eq($table.'.index_name', $queryBuilder->expr()->literal($index_name)), |
|
| 700 | 700 | self::whereExpression($table, true) |
| 701 | 701 | ) |
| 702 | 702 | ->setMaxResults(1) |
@@ -709,12 +709,12 @@ discard block |
||
| 709 | 709 | $resArray = $allResults[0]; |
| 710 | 710 | |
| 711 | 711 | $result = $queryBuilder |
| 712 | - ->select($table . '.index_name AS index_name') |
|
| 712 | + ->select($table.'.index_name AS index_name') |
|
| 713 | 713 | ->from($table) |
| 714 | 714 | ->where( |
| 715 | - $queryBuilder->expr()->eq($table . '.pid', $pid), |
|
| 716 | - $queryBuilder->expr()->eq($table . '.uid', $resArray['l18n_parent']), |
|
| 717 | - $queryBuilder->expr()->eq($table . '.sys_language_uid', intval($languageAspect->getContentId())), |
|
| 715 | + $queryBuilder->expr()->eq($table.'.pid', $pid), |
|
| 716 | + $queryBuilder->expr()->eq($table.'.uid', $resArray['l18n_parent']), |
|
| 717 | + $queryBuilder->expr()->eq($table.'.sys_language_uid', intval($languageAspect->getContentId())), |
|
| 718 | 718 | self::whereExpression($table, true) |
| 719 | 719 | ) |
| 720 | 720 | ->setMaxResults(1) |
@@ -732,14 +732,14 @@ discard block |
||
| 732 | 732 | if (empty($labels[$table][$pid][$languageAspect->getContentId()][$index_name])) { |
| 733 | 733 | // Check if this table is allowed for translation. |
| 734 | 734 | if (in_array($table, ['tx_dlf_collections', 'tx_dlf_libraries', 'tx_dlf_metadata', 'tx_dlf_structures'])) { |
| 735 | - $additionalWhere = $queryBuilder->expr()->in($table . '.sys_language_uid', [-1, 0]); |
|
| 735 | + $additionalWhere = $queryBuilder->expr()->in($table.'.sys_language_uid', [-1, 0]); |
|
| 736 | 736 | if ($languageAspect->getContentId() > 0) { |
| 737 | 737 | $additionalWhere = $queryBuilder->expr()->andX( |
| 738 | 738 | $queryBuilder->expr()->orX( |
| 739 | - $queryBuilder->expr()->in($table . '.sys_language_uid', [-1, 0]), |
|
| 740 | - $queryBuilder->expr()->eq($table . '.sys_language_uid', intval($languageAspect->getContentId())) |
|
| 739 | + $queryBuilder->expr()->in($table.'.sys_language_uid', [-1, 0]), |
|
| 740 | + $queryBuilder->expr()->eq($table.'.sys_language_uid', intval($languageAspect->getContentId())) |
|
| 741 | 741 | ), |
| 742 | - $queryBuilder->expr()->eq($table . '.l18n_parent', 0) |
|
| 742 | + $queryBuilder->expr()->eq($table.'.l18n_parent', 0) |
|
| 743 | 743 | ); |
| 744 | 744 | } |
| 745 | 745 | |
@@ -748,7 +748,7 @@ discard block |
||
| 748 | 748 | ->select('*') |
| 749 | 749 | ->from($table) |
| 750 | 750 | ->where( |
| 751 | - $queryBuilder->expr()->eq($table . '.pid', $pid), |
|
| 751 | + $queryBuilder->expr()->eq($table.'.pid', $pid), |
|
| 752 | 752 | $additionalWhere, |
| 753 | 753 | self::whereExpression($table, true) |
| 754 | 754 | ) |
@@ -766,10 +766,10 @@ discard block |
||
| 766 | 766 | } |
| 767 | 767 | } |
| 768 | 768 | } else { |
| 769 | - self::log('No translation with PID ' . $pid . ' available in table "' . $table . '" or translation not accessible', LOG_SEVERITY_NOTICE); |
|
| 769 | + self::log('No translation with PID '.$pid.' available in table "'.$table.'" or translation not accessible', LOG_SEVERITY_NOTICE); |
|
| 770 | 770 | } |
| 771 | 771 | } else { |
| 772 | - self::log('No translations available for table "' . $table . '"', LOG_SEVERITY_WARNING); |
|
| 772 | + self::log('No translations available for table "'.$table.'"', LOG_SEVERITY_WARNING); |
|
| 773 | 773 | } |
| 774 | 774 | } |
| 775 | 775 | |
@@ -811,9 +811,9 @@ discard block |
||
| 811 | 811 | return GeneralUtility::makeInstance(ConnectionPool::class) |
| 812 | 812 | ->getQueryBuilderForTable($table) |
| 813 | 813 | ->expr() |
| 814 | - ->eq($table . '.' . $GLOBALS['TCA'][$table]['ctrl']['delete'], 0); |
|
| 814 | + ->eq($table.'.'.$GLOBALS['TCA'][$table]['ctrl']['delete'], 0); |
|
| 815 | 815 | } else { |
| 816 | - self::log('Unexpected TYPO3_MODE "' . \TYPO3_MODE . '"', LOG_SEVERITY_ERROR); |
|
| 816 | + self::log('Unexpected TYPO3_MODE "'.\TYPO3_MODE.'"', LOG_SEVERITY_ERROR); |
|
| 817 | 817 | return '1=-1'; |
| 818 | 818 | } |
| 819 | 819 | } |
@@ -852,7 +852,7 @@ discard block |
||
| 852 | 852 | */ |
| 853 | 853 | public static function polyfillExtbaseClassesForTYPO3v9() |
| 854 | 854 | { |
| 855 | - $classes = require __DIR__ . '/../../Configuration/Extbase/Persistence/Classes.php'; |
|
| 855 | + $classes = require __DIR__.'/../../Configuration/Extbase/Persistence/Classes.php'; |
|
| 856 | 856 | |
| 857 | 857 | $objectManager = GeneralUtility::makeInstance(ObjectManager::class); |
| 858 | 858 | $configurationManager = $objectManager->get(ConfigurationManager::class); |
@@ -908,10 +908,10 @@ discard block |
||
| 908 | 908 | try { |
| 909 | 909 | $response = $requestFactory->request($url, 'GET', $configuration); |
| 910 | 910 | } catch (\Exception $e) { |
| 911 | - self::log('Could not fetch data from URL "' . $url . '". Error: ' . $e->getMessage() . '.', LOG_SEVERITY_WARNING); |
|
| 911 | + self::log('Could not fetch data from URL "'.$url.'". Error: '.$e->getMessage().'.', LOG_SEVERITY_WARNING); |
|
| 912 | 912 | return false; |
| 913 | 913 | } |
| 914 | - $content = $response->getBody()->getContents(); |
|
| 914 | + $content = $response->getBody()->getContents(); |
|
| 915 | 915 | |
| 916 | 916 | return $content; |
| 917 | 917 | } |
@@ -32,8 +32,7 @@ discard block |
||
| 32 | 32 | * @subpackage dlf |
| 33 | 33 | * @access public |
| 34 | 34 | */ |
| 35 | -class Indexer |
|
| 36 | -{ |
|
| 35 | +class Indexer { |
|
| 37 | 36 | /** |
| 38 | 37 | * The extension key |
| 39 | 38 | * |
@@ -93,8 +92,7 @@ discard block |
||
| 93 | 92 | * |
| 94 | 93 | * @return bool true on success or false on failure |
| 95 | 94 | */ |
| 96 | - public static function add(Document $document) |
|
| 97 | - { |
|
| 95 | + public static function add(Document $document) { |
|
| 98 | 96 | if (in_array($document->getUid(), self::$processedDocs)) { |
| 99 | 97 | return true; |
| 100 | 98 | } elseif (self::solrConnect($document->getSolrcore(), $document->getPid())) { |
@@ -209,8 +207,7 @@ discard block |
||
| 209 | 207 | * |
| 210 | 208 | * @return string The field's dynamic index name |
| 211 | 209 | */ |
| 212 | - public static function getIndexFieldName($index_name, $pid = 0) |
|
| 213 | - { |
|
| 210 | + public static function getIndexFieldName($index_name, $pid = 0) { |
|
| 214 | 211 | // Sanitize input. |
| 215 | 212 | $pid = max(intval($pid), 0); |
| 216 | 213 | if (!$pid) { |
@@ -236,8 +233,7 @@ discard block |
||
| 236 | 233 | * |
| 237 | 234 | * @return void |
| 238 | 235 | */ |
| 239 | - protected static function loadIndexConf($pid) |
|
| 240 | - { |
|
| 236 | + protected static function loadIndexConf($pid) { |
|
| 241 | 237 | if (!self::$fieldsLoaded) { |
| 242 | 238 | $queryBuilder = GeneralUtility::makeInstance(ConnectionPool::class) |
| 243 | 239 | ->getQueryBuilderForTable('tx_dlf_metadata'); |
@@ -307,8 +303,7 @@ discard block |
||
| 307 | 303 | * |
| 308 | 304 | * @return bool true on success or false on failure |
| 309 | 305 | */ |
| 310 | - protected static function processLogical(Document $document, array $logicalUnit) |
|
| 311 | - { |
|
| 306 | + protected static function processLogical(Document $document, array $logicalUnit) { |
|
| 312 | 307 | $success = true; |
| 313 | 308 | $doc = $document->getDoc(); |
| 314 | 309 | $doc->cPid = $document->getPid(); |
@@ -346,7 +341,7 @@ discard block |
||
| 346 | 341 | ) { |
| 347 | 342 | $solrDoc->setField('date', $metadata['date'][0]); |
| 348 | 343 | // change date YYYYMMDD to YYYY-MM-DD |
| 349 | - } elseif (preg_match("/^[\d]{8}$/", $metadata['date'][0])){ |
|
| 344 | + } elseif (preg_match("/^[\d]{8}$/", $metadata['date'][0])) { |
|
| 350 | 345 | $solrDoc->setField('date', date("Y-m-d", strtotime($metadata['date'][0]))); |
| 351 | 346 | // convert any datetime to proper ISO extended datetime format and timezone for SOLR |
| 352 | 347 | } else { |
@@ -439,8 +434,7 @@ discard block |
||
| 439 | 434 | * |
| 440 | 435 | * @return bool true on success or false on failure |
| 441 | 436 | */ |
| 442 | - protected static function processPhysical(Document $document, $page, array $physicalUnit) |
|
| 443 | - { |
|
| 437 | + protected static function processPhysical(Document $document, $page, array $physicalUnit) { |
|
| 444 | 438 | $doc = $document->getDoc(); |
| 445 | 439 | $doc->cPid = $document->getPid(); |
| 446 | 440 | if ($doc->hasFulltext && $fullText = $doc->getFullText($physicalUnit['id'])) { |
@@ -518,8 +512,7 @@ discard block |
||
| 518 | 512 | * |
| 519 | 513 | * @return bool true on success or false on failure |
| 520 | 514 | */ |
| 521 | - protected static function solrConnect($core, $pid = 0) |
|
| 522 | - { |
|
| 515 | + protected static function solrConnect($core, $pid = 0) { |
|
| 523 | 516 | // Get Solr instance. |
| 524 | 517 | if (!self::$solr) { |
| 525 | 518 | // Connect to Solr server. |
@@ -588,8 +581,7 @@ discard block |
||
| 588 | 581 | * |
| 589 | 582 | * @access private |
| 590 | 583 | */ |
| 591 | - private function __construct() |
|
| 592 | - { |
|
| 584 | + private function __construct() { |
|
| 593 | 585 | // This is a static class, thus no instances should be created. |
| 594 | 586 | } |
| 595 | 587 | } |
@@ -115,7 +115,7 @@ discard block |
||
| 115 | 115 | $parent->setDoc($doc); |
| 116 | 116 | $success = self::add($parent); |
| 117 | 117 | } else { |
| 118 | - Helper::log('Could not load parent document with UID ' . $document->getDoc()->parentId, LOG_SEVERITY_ERROR); |
|
| 118 | + Helper::log('Could not load parent document with UID '.$document->getDoc()->parentId, LOG_SEVERITY_ERROR); |
|
| 119 | 119 | return false; |
| 120 | 120 | } |
| 121 | 121 | } |
@@ -125,7 +125,7 @@ discard block |
||
| 125 | 125 | self::$processedDocs[] = $document->getUid(); |
| 126 | 126 | // Delete old Solr documents. |
| 127 | 127 | $updateQuery = self::$solr->service->createUpdate(); |
| 128 | - $updateQuery->addDeleteQuery('uid:' . $document->getUid()); |
|
| 128 | + $updateQuery->addDeleteQuery('uid:'.$document->getUid()); |
|
| 129 | 129 | self::$solr->service->update($updateQuery); |
| 130 | 130 | |
| 131 | 131 | // Index every logical unit as separate Solr document. |
@@ -174,14 +174,14 @@ discard block |
||
| 174 | 174 | } catch (\Exception $e) { |
| 175 | 175 | if (!(\TYPO3_REQUESTTYPE & \TYPO3_REQUESTTYPE_CLI)) { |
| 176 | 176 | Helper::addMessage( |
| 177 | - Helper::getLanguageService()->getLL('flash.solrException') . ' ' . htmlspecialchars($e->getMessage()), |
|
| 177 | + Helper::getLanguageService()->getLL('flash.solrException').' '.htmlspecialchars($e->getMessage()), |
|
| 178 | 178 | Helper::getLanguageService()->getLL('flash.error'), |
| 179 | 179 | FlashMessage::ERROR, |
| 180 | 180 | true, |
| 181 | 181 | 'core.template.flashMessages' |
| 182 | 182 | ); |
| 183 | 183 | } |
| 184 | - Helper::log('Apache Solr threw exception: "' . $e->getMessage() . '"', LOG_SEVERITY_ERROR); |
|
| 184 | + Helper::log('Apache Solr threw exception: "'.$e->getMessage().'"', LOG_SEVERITY_ERROR); |
|
| 185 | 185 | return false; |
| 186 | 186 | } |
| 187 | 187 | } else { |
@@ -214,7 +214,7 @@ discard block |
||
| 214 | 214 | // Sanitize input. |
| 215 | 215 | $pid = max(intval($pid), 0); |
| 216 | 216 | if (!$pid) { |
| 217 | - Helper::log('Invalid PID ' . $pid . ' for metadata configuration', LOG_SEVERITY_ERROR); |
|
| 217 | + Helper::log('Invalid PID '.$pid.' for metadata configuration', LOG_SEVERITY_ERROR); |
|
| 218 | 218 | return ''; |
| 219 | 219 | } |
| 220 | 220 | // Load metadata configuration. |
@@ -223,7 +223,7 @@ discard block |
||
| 223 | 223 | $suffix = (in_array($index_name, self::$fields['tokenized']) ? 't' : 'u'); |
| 224 | 224 | $suffix .= (in_array($index_name, self::$fields['stored']) ? 's' : 'u'); |
| 225 | 225 | $suffix .= (in_array($index_name, self::$fields['indexed']) ? 'i' : 'u'); |
| 226 | - $index_name .= '_' . $suffix; |
|
| 226 | + $index_name .= '_'.$suffix; |
|
| 227 | 227 | return $index_name; |
| 228 | 228 | } |
| 229 | 229 | |
@@ -337,7 +337,7 @@ discard block |
||
| 337 | 337 | $solrDoc->setField('title', $metadata['title'][0], self::$fields['fieldboost']['title']); |
| 338 | 338 | $solrDoc->setField('volume', $metadata['volume'][0], self::$fields['fieldboost']['volume']); |
| 339 | 339 | // verify date formatting |
| 340 | - if(strtotime($metadata['date'][0])) { |
|
| 340 | + if (strtotime($metadata['date'][0])) { |
|
| 341 | 341 | // do not alter dates YYYY or YYYY-MM or YYYY-MM-DD |
| 342 | 342 | if ( |
| 343 | 343 | preg_match("/^[\d]{4}$/", $metadata['date'][0]) |
@@ -346,7 +346,7 @@ discard block |
||
| 346 | 346 | ) { |
| 347 | 347 | $solrDoc->setField('date', $metadata['date'][0]); |
| 348 | 348 | // change date YYYYMMDD to YYYY-MM-DD |
| 349 | - } elseif (preg_match("/^[\d]{8}$/", $metadata['date'][0])){ |
|
| 349 | + } elseif (preg_match("/^[\d]{8}$/", $metadata['date'][0])) { |
|
| 350 | 350 | $solrDoc->setField('date', date("Y-m-d", strtotime($metadata['date'][0]))); |
| 351 | 351 | // convert any datetime to proper ISO extended datetime format and timezone for SOLR |
| 352 | 352 | } else { |
@@ -374,11 +374,11 @@ discard block |
||
| 374 | 374 | $solrDoc->setField(self::getIndexFieldName($index_name, $document->getPid()), $data, self::$fields['fieldboost'][$index_name]); |
| 375 | 375 | if (in_array($index_name, self::$fields['sortables'])) { |
| 376 | 376 | // Add sortable fields to index. |
| 377 | - $solrDoc->setField($index_name . '_sorting', $metadata[$index_name . '_sorting'][0]); |
|
| 377 | + $solrDoc->setField($index_name.'_sorting', $metadata[$index_name.'_sorting'][0]); |
|
| 378 | 378 | } |
| 379 | 379 | if (in_array($index_name, self::$fields['facets'])) { |
| 380 | 380 | // Add facets to index. |
| 381 | - $solrDoc->setField($index_name . '_faceting', $data); |
|
| 381 | + $solrDoc->setField($index_name.'_faceting', $data); |
|
| 382 | 382 | } |
| 383 | 383 | if (in_array($index_name, self::$fields['autocomplete'])) { |
| 384 | 384 | $autocomplete = array_merge($autocomplete, $data); |
@@ -403,14 +403,14 @@ discard block |
||
| 403 | 403 | } catch (\Exception $e) { |
| 404 | 404 | if (!(\TYPO3_REQUESTTYPE & \TYPO3_REQUESTTYPE_CLI)) { |
| 405 | 405 | Helper::addMessage( |
| 406 | - Helper::getLanguageService()->getLL('flash.solrException') . '<br />' . htmlspecialchars($e->getMessage()), |
|
| 406 | + Helper::getLanguageService()->getLL('flash.solrException').'<br />'.htmlspecialchars($e->getMessage()), |
|
| 407 | 407 | Helper::getLanguageService()->getLL('flash.error'), |
| 408 | 408 | FlashMessage::ERROR, |
| 409 | 409 | true, |
| 410 | 410 | 'core.template.flashMessages' |
| 411 | 411 | ); |
| 412 | 412 | } |
| 413 | - Helper::log('Apache Solr threw exception: "' . $e->getMessage() . '"', LOG_SEVERITY_ERROR); |
|
| 413 | + Helper::log('Apache Solr threw exception: "'.$e->getMessage().'"', LOG_SEVERITY_ERROR); |
|
| 414 | 414 | return false; |
| 415 | 415 | } |
| 416 | 416 | } |
@@ -476,7 +476,7 @@ discard block |
||
| 476 | 476 | $data = self::removeAppendsFromAuthor($data); |
| 477 | 477 | } |
| 478 | 478 | // Add facets to index. |
| 479 | - $solrDoc->setField($index_name . '_faceting', $data); |
|
| 479 | + $solrDoc->setField($index_name.'_faceting', $data); |
|
| 480 | 480 | } |
| 481 | 481 | } |
| 482 | 482 | // Add sorting information to physical sub-elements if applicable. |
@@ -484,7 +484,7 @@ discard block |
||
| 484 | 484 | !empty($data) |
| 485 | 485 | && substr($index_name, -8) == '_sorting' |
| 486 | 486 | ) { |
| 487 | - $solrDoc->setField($index_name , $doc->metadataArray[$doc->toplevelId][$index_name]); |
|
| 487 | + $solrDoc->setField($index_name, $doc->metadataArray[$doc->toplevelId][$index_name]); |
|
| 488 | 488 | } |
| 489 | 489 | } |
| 490 | 490 | } |
@@ -501,14 +501,14 @@ discard block |
||
| 501 | 501 | } catch (\Exception $e) { |
| 502 | 502 | if (!(\TYPO3_REQUESTTYPE & \TYPO3_REQUESTTYPE_CLI)) { |
| 503 | 503 | Helper::addMessage( |
| 504 | - Helper::getLanguageService()->getLL('flash.solrException') . '<br />' . htmlspecialchars($e->getMessage()), |
|
| 504 | + Helper::getLanguageService()->getLL('flash.solrException').'<br />'.htmlspecialchars($e->getMessage()), |
|
| 505 | 505 | Helper::getLanguageService()->getLL('flash.error'), |
| 506 | 506 | FlashMessage::ERROR, |
| 507 | 507 | true, |
| 508 | 508 | 'core.template.flashMessages' |
| 509 | 509 | ); |
| 510 | 510 | } |
| 511 | - Helper::log('Apache Solr threw exception: "' . $e->getMessage() . '"', LOG_SEVERITY_ERROR); |
|
| 511 | + Helper::log('Apache Solr threw exception: "'.$e->getMessage().'"', LOG_SEVERITY_ERROR); |
|
| 512 | 512 | return false; |
| 513 | 513 | } |
| 514 | 514 | } |
@@ -559,7 +559,7 @@ discard block |
||
| 559 | 559 | private static function getSolrDocument($updateQuery, $document, $unit, $fullText = '') { |
| 560 | 560 | $solrDoc = $updateQuery->createDocument(); |
| 561 | 561 | // Create unique identifier from document's UID and unit's XML ID. |
| 562 | - $solrDoc->setField('id', $document->getUid() . $unit['id']); |
|
| 562 | + $solrDoc->setField('id', $document->getUid().$unit['id']); |
|
| 563 | 563 | $solrDoc->setField('uid', $document->getUid()); |
| 564 | 564 | $solrDoc->setField('pid', $document->getPid()); |
| 565 | 565 | $solrDoc->setField('partof', $document->getPartof()); |