We could not synchronize checks via GitHub's checks API since Scrutinizer's GitHub App is not installed for this repository.
@@ -226,7 +226,7 @@ |
||
226 | 226 | 'label' => 'LLL:EXT:dlf/Resources/Private/Language/Labels.xml:tx_dlf_documents.thumbnail', |
227 | 227 | 'config' => [ |
228 | 228 | 'type' => 'user', |
229 | - 'userFunc' => \Kitodo\Dlf\Hooks\FormEngine::class . '->displayThumbnail', |
|
229 | + 'userFunc' => \Kitodo\Dlf\Hooks\FormEngine::class.'->displayThumbnail', |
|
230 | 230 | ], |
231 | 231 | ], |
232 | 232 | 'metadata' => [ |
@@ -17,79 +17,79 @@ |
||
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 | 19 | \TYPO3\CMS\Core\Utility\ExtensionManagementUtility::addPlugin(['LLL:EXT:dlf/Resources/Private/Language/Labels.xml:tt_content.dlf_audioplayer', 'dlf_audioplayer'], 'list_type', 'dlf'); |
20 | -\TYPO3\CMS\Core\Utility\ExtensionManagementUtility::addPiFlexFormValue('dlf_audioplayer', 'FILE:EXT:' . 'dlf/Configuration/Flexforms/AudioPlayer.xml'); |
|
20 | +\TYPO3\CMS\Core\Utility\ExtensionManagementUtility::addPiFlexFormValue('dlf_audioplayer', 'FILE:EXT:'.'dlf/Configuration/Flexforms/AudioPlayer.xml'); |
|
21 | 21 | // Plugin "basket". |
22 | 22 | $GLOBALS['TCA']['tt_content']['types']['list']['subtypes_excludelist']['dlf_basket'] = 'layout,select_key,pages,recursive'; |
23 | 23 | $GLOBALS['TCA']['tt_content']['types']['list']['subtypes_addlist']['dlf_basket'] = 'pi_flexform'; |
24 | 24 | \TYPO3\CMS\Core\Utility\ExtensionManagementUtility::addPlugin(['LLL:EXT:dlf/Resources/Private/Language/Labels.xml:tt_content.dlf_basket', 'dlf_basket'], 'list_type', 'dlf'); |
25 | -\TYPO3\CMS\Core\Utility\ExtensionManagementUtility::addPiFlexFormValue('dlf_basket', 'FILE:EXT:' . 'dlf/Configuration/Flexforms/Basket.xml'); |
|
25 | +\TYPO3\CMS\Core\Utility\ExtensionManagementUtility::addPiFlexFormValue('dlf_basket', 'FILE:EXT:'.'dlf/Configuration/Flexforms/Basket.xml'); |
|
26 | 26 | // Plugin "calendar". |
27 | 27 | $GLOBALS['TCA']['tt_content']['types']['list']['subtypes_excludelist']['dlf_calendar'] = 'layout,select_key,pages,recursive'; |
28 | 28 | $GLOBALS['TCA']['tt_content']['types']['list']['subtypes_addlist']['dlf_calendar'] = 'pi_flexform'; |
29 | 29 | \TYPO3\CMS\Core\Utility\ExtensionManagementUtility::addPlugin(['LLL:EXT:dlf/Resources/Private/Language/Labels.xml:tt_content.dlf_calendar', 'dlf_calendar'], 'list_type', 'dlf'); |
30 | -\TYPO3\CMS\Core\Utility\ExtensionManagementUtility::addPiFlexFormValue('dlf_calendar', 'FILE:EXT:' . 'dlf/Configuration/Flexforms/Calendar.xml'); |
|
30 | +\TYPO3\CMS\Core\Utility\ExtensionManagementUtility::addPiFlexFormValue('dlf_calendar', 'FILE:EXT:'.'dlf/Configuration/Flexforms/Calendar.xml'); |
|
31 | 31 | // Plugin "collection". |
32 | 32 | $GLOBALS['TCA']['tt_content']['types']['list']['subtypes_excludelist']['dlf_collection'] = 'layout,select_key,pages,recursive'; |
33 | 33 | $GLOBALS['TCA']['tt_content']['types']['list']['subtypes_addlist']['dlf_collection'] = 'pi_flexform'; |
34 | 34 | \TYPO3\CMS\Core\Utility\ExtensionManagementUtility::addPlugin(['LLL:EXT:dlf/Resources/Private/Language/Labels.xml:tt_content.dlf_collection', 'dlf_collection'], 'list_type', 'dlf'); |
35 | -\TYPO3\CMS\Core\Utility\ExtensionManagementUtility::addPiFlexFormValue('dlf_collection', 'FILE:EXT:' . 'dlf/Configuration/Flexforms/Collection.xml'); |
|
35 | +\TYPO3\CMS\Core\Utility\ExtensionManagementUtility::addPiFlexFormValue('dlf_collection', 'FILE:EXT:'.'dlf/Configuration/Flexforms/Collection.xml'); |
|
36 | 36 | // Plugin "feeds". |
37 | 37 | $GLOBALS['TCA']['tt_content']['types']['list']['subtypes_excludelist']['dlf_feeds'] = 'layout,select_key,pages,recursive'; |
38 | 38 | $GLOBALS['TCA']['tt_content']['types']['list']['subtypes_addlist']['dlf_feeds'] = 'pi_flexform'; |
39 | 39 | \TYPO3\CMS\Core\Utility\ExtensionManagementUtility::addPlugin(['LLL:EXT:dlf/Resources/Private/Language/Labels.xml:tt_content.dlf_feeds', 'dlf_feeds'], 'list_type', 'dlf'); |
40 | -\TYPO3\CMS\Core\Utility\ExtensionManagementUtility::addPiFlexFormValue('dlf_feeds', 'FILE:EXT:' . 'dlf/Configuration/Flexforms/Feeds.xml'); |
|
40 | +\TYPO3\CMS\Core\Utility\ExtensionManagementUtility::addPiFlexFormValue('dlf_feeds', 'FILE:EXT:'.'dlf/Configuration/Flexforms/Feeds.xml'); |
|
41 | 41 | // Plugin "listview". |
42 | 42 | $GLOBALS['TCA']['tt_content']['types']['list']['subtypes_excludelist']['dlf_listview'] = 'layout,select_key,pages,recursive'; |
43 | 43 | $GLOBALS['TCA']['tt_content']['types']['list']['subtypes_addlist']['dlf_listview'] = 'pi_flexform'; |
44 | 44 | \TYPO3\CMS\Core\Utility\ExtensionManagementUtility::addPlugin(['LLL:EXT:dlf/Resources/Private/Language/Labels.xml:tt_content.dlf_listview', 'dlf_listview'], 'list_type', 'dlf'); |
45 | -\TYPO3\CMS\Core\Utility\ExtensionManagementUtility::addPiFlexFormValue('dlf_listview', 'FILE:EXT:' . 'dlf/Configuration/Flexforms/ListView.xml'); |
|
45 | +\TYPO3\CMS\Core\Utility\ExtensionManagementUtility::addPiFlexFormValue('dlf_listview', 'FILE:EXT:'.'dlf/Configuration/Flexforms/ListView.xml'); |
|
46 | 46 | // Plugin "metadata". |
47 | 47 | $GLOBALS['TCA']['tt_content']['types']['list']['subtypes_excludelist']['dlf_metadata'] = 'layout,select_key,pages,recursive'; |
48 | 48 | $GLOBALS['TCA']['tt_content']['types']['list']['subtypes_addlist']['dlf_metadata'] = 'pi_flexform'; |
49 | 49 | \TYPO3\CMS\Core\Utility\ExtensionManagementUtility::addPlugin(['LLL:EXT:dlf/Resources/Private/Language/Labels.xml:tt_content.dlf_metadata', 'dlf_metadata'], 'list_type', 'dlf'); |
50 | -\TYPO3\CMS\Core\Utility\ExtensionManagementUtility::addPiFlexFormValue('dlf_metadata', 'FILE:EXT:' . 'dlf/Configuration/Flexforms/Metadata.xml'); |
|
50 | +\TYPO3\CMS\Core\Utility\ExtensionManagementUtility::addPiFlexFormValue('dlf_metadata', 'FILE:EXT:'.'dlf/Configuration/Flexforms/Metadata.xml'); |
|
51 | 51 | // Plugin "navigation". |
52 | 52 | $GLOBALS['TCA']['tt_content']['types']['list']['subtypes_excludelist']['dlf_navigation'] = 'layout,select_key,pages,recursive'; |
53 | 53 | $GLOBALS['TCA']['tt_content']['types']['list']['subtypes_addlist']['dlf_navigation'] = 'pi_flexform'; |
54 | 54 | \TYPO3\CMS\Core\Utility\ExtensionManagementUtility::addPlugin(['LLL:EXT:dlf/Resources/Private/Language/Labels.xml:tt_content.dlf_navigation', 'dlf_navigation'], 'list_type', 'dlf'); |
55 | -\TYPO3\CMS\Core\Utility\ExtensionManagementUtility::addPiFlexFormValue('dlf_navigation', 'FILE:EXT:' . 'dlf/Configuration/Flexforms/Navigation.xml'); |
|
55 | +\TYPO3\CMS\Core\Utility\ExtensionManagementUtility::addPiFlexFormValue('dlf_navigation', 'FILE:EXT:'.'dlf/Configuration/Flexforms/Navigation.xml'); |
|
56 | 56 | // Plugin "oaipmh". |
57 | 57 | $GLOBALS['TCA']['tt_content']['types']['list']['subtypes_excludelist']['dlf_oaipmh'] = 'layout,select_key,pages,recursive'; |
58 | 58 | $GLOBALS['TCA']['tt_content']['types']['list']['subtypes_addlist']['dlf_oaipmh'] = 'pi_flexform'; |
59 | 59 | \TYPO3\CMS\Core\Utility\ExtensionManagementUtility::addPlugin(['LLL:EXT:dlf/Resources/Private/Language/Labels.xml:tt_content.dlf_oaipmh', 'dlf_oaipmh'], 'list_type', 'dlf'); |
60 | -\TYPO3\CMS\Core\Utility\ExtensionManagementUtility::addPiFlexFormValue('dlf_oaipmh', 'FILE:EXT:' . 'dlf/Configuration/Flexforms/OaiPmh.xml'); |
|
60 | +\TYPO3\CMS\Core\Utility\ExtensionManagementUtility::addPiFlexFormValue('dlf_oaipmh', 'FILE:EXT:'.'dlf/Configuration/Flexforms/OaiPmh.xml'); |
|
61 | 61 | // Plugin "pagegrid". |
62 | 62 | $GLOBALS['TCA']['tt_content']['types']['list']['subtypes_excludelist']['dlf_pagegrid'] = 'layout,select_key,pages,recursive'; |
63 | 63 | $GLOBALS['TCA']['tt_content']['types']['list']['subtypes_addlist']['dlf_pagegrid'] = 'pi_flexform'; |
64 | 64 | \TYPO3\CMS\Core\Utility\ExtensionManagementUtility::addPlugin(['LLL:EXT:dlf/Resources/Private/Language/Labels.xml:tt_content.dlf_pagegrid', 'dlf_pagegrid'], 'list_type', 'dlf'); |
65 | -\TYPO3\CMS\Core\Utility\ExtensionManagementUtility::addPiFlexFormValue('dlf_pagegrid', 'FILE:EXT:' . 'dlf/Configuration/Flexforms/PageGrid.xml'); |
|
65 | +\TYPO3\CMS\Core\Utility\ExtensionManagementUtility::addPiFlexFormValue('dlf_pagegrid', 'FILE:EXT:'.'dlf/Configuration/Flexforms/PageGrid.xml'); |
|
66 | 66 | // Plugin "pageview". |
67 | 67 | $GLOBALS['TCA']['tt_content']['types']['list']['subtypes_excludelist']['dlf_pageview'] = 'layout,select_key,pages,recursive'; |
68 | 68 | $GLOBALS['TCA']['tt_content']['types']['list']['subtypes_addlist']['dlf_pageview'] = 'pi_flexform'; |
69 | 69 | \TYPO3\CMS\Core\Utility\ExtensionManagementUtility::addPlugin(['LLL:EXT:dlf/Resources/Private/Language/Labels.xml:tt_content.dlf_pageview', 'dlf_pageview'], 'list_type', 'dlf'); |
70 | -\TYPO3\CMS\Core\Utility\ExtensionManagementUtility::addPiFlexFormValue('dlf_pageview', 'FILE:EXT:' . 'dlf/Configuration/Flexforms/PageView.xml'); |
|
70 | +\TYPO3\CMS\Core\Utility\ExtensionManagementUtility::addPiFlexFormValue('dlf_pageview', 'FILE:EXT:'.'dlf/Configuration/Flexforms/PageView.xml'); |
|
71 | 71 | // Plugin "search". |
72 | 72 | $GLOBALS['TCA']['tt_content']['types']['list']['subtypes_excludelist']['dlf_search'] = 'layout,select_key,pages,recursive'; |
73 | 73 | $GLOBALS['TCA']['tt_content']['types']['list']['subtypes_addlist']['dlf_search'] = 'pi_flexform'; |
74 | 74 | \TYPO3\CMS\Core\Utility\ExtensionManagementUtility::addPlugin(['LLL:EXT:dlf/Resources/Private/Language/Labels.xml:tt_content.dlf_search', 'dlf_search'], 'list_type', 'dlf'); |
75 | -\TYPO3\CMS\Core\Utility\ExtensionManagementUtility::addPiFlexFormValue('dlf_search', 'FILE:EXT:' . 'dlf/Configuration/Flexforms/Search.xml'); |
|
75 | +\TYPO3\CMS\Core\Utility\ExtensionManagementUtility::addPiFlexFormValue('dlf_search', 'FILE:EXT:'.'dlf/Configuration/Flexforms/Search.xml'); |
|
76 | 76 | // Plugin "statistics". |
77 | 77 | $GLOBALS['TCA']['tt_content']['types']['list']['subtypes_excludelist']['dlf_statistics'] = 'layout,select_key,pages,recursive'; |
78 | 78 | $GLOBALS['TCA']['tt_content']['types']['list']['subtypes_addlist']['dlf_statistics'] = 'pi_flexform'; |
79 | 79 | \TYPO3\CMS\Core\Utility\ExtensionManagementUtility::addPlugin(['LLL:EXT:dlf/Resources/Private/Language/Labels.xml:tt_content.dlf_statistics', 'dlf_statistics'], 'list_type', 'dlf'); |
80 | -\TYPO3\CMS\Core\Utility\ExtensionManagementUtility::addPiFlexFormValue('dlf_statistics', 'FILE:EXT:' . 'dlf/Configuration/Flexforms/Statistics.xml'); |
|
80 | +\TYPO3\CMS\Core\Utility\ExtensionManagementUtility::addPiFlexFormValue('dlf_statistics', 'FILE:EXT:'.'dlf/Configuration/Flexforms/Statistics.xml'); |
|
81 | 81 | // Plugin "tableofcontents". |
82 | 82 | $GLOBALS['TCA']['tt_content']['types']['list']['subtypes_excludelist']['dlf_tableofcontents'] = 'layout,select_key,pages,recursive'; |
83 | 83 | $GLOBALS['TCA']['tt_content']['types']['list']['subtypes_addlist']['dlf_tableofcontents'] = 'pi_flexform'; |
84 | 84 | \TYPO3\CMS\Core\Utility\ExtensionManagementUtility::addPlugin(['LLL:EXT:dlf/Resources/Private/Language/Labels.xml:tt_content.dlf_tableofcontents', 'dlf_tableofcontents'], 'list_type', 'dlf'); |
85 | -\TYPO3\CMS\Core\Utility\ExtensionManagementUtility::addPiFlexFormValue('dlf_tableofcontents', 'FILE:EXT:' . 'dlf/Configuration/Flexforms/TableOfContents.xml'); |
|
85 | +\TYPO3\CMS\Core\Utility\ExtensionManagementUtility::addPiFlexFormValue('dlf_tableofcontents', 'FILE:EXT:'.'dlf/Configuration/Flexforms/TableOfContents.xml'); |
|
86 | 86 | // Plugin "toolbox". |
87 | 87 | $GLOBALS['TCA']['tt_content']['types']['list']['subtypes_excludelist']['dlf_toolbox'] = 'layout,select_key,pages,recursive'; |
88 | 88 | $GLOBALS['TCA']['tt_content']['types']['list']['subtypes_addlist']['dlf_toolbox'] = 'pi_flexform'; |
89 | 89 | \TYPO3\CMS\Core\Utility\ExtensionManagementUtility::addPlugin(['LLL:EXT:dlf/Resources/Private/Language/Labels.xml:tt_content.dlf_toolbox', 'dlf_toolbox'], 'list_type', 'dlf'); |
90 | -\TYPO3\CMS\Core\Utility\ExtensionManagementUtility::addPiFlexFormValue('dlf_toolbox', 'FILE:EXT:' . 'dlf/Configuration/Flexforms/Toolbox.xml'); |
|
90 | +\TYPO3\CMS\Core\Utility\ExtensionManagementUtility::addPiFlexFormValue('dlf_toolbox', 'FILE:EXT:'.'dlf/Configuration/Flexforms/Toolbox.xml'); |
|
91 | 91 | // Plugin "validator". |
92 | 92 | $GLOBALS['TCA']['tt_content']['types']['list']['subtypes_excludelist']['dlf_validator'] = 'layout,select_key,pages,recursive'; |
93 | 93 | $GLOBALS['TCA']['tt_content']['types']['list']['subtypes_addlist']['dlf_validator'] = 'pi_flexform'; |
94 | 94 | \TYPO3\CMS\Core\Utility\ExtensionManagementUtility::addPlugin(['LLL:EXT:dlf/Resources/Private/Language/Labels.xml:tt_content.dlf_validator', 'dlf_validator'], 'list_type', 'dlf'); |
95 | -\TYPO3\CMS\Core\Utility\ExtensionManagementUtility::addPiFlexFormValue('dlf_validator', 'FILE:EXT:' . 'dlf/Configuration/Flexforms/Validator.xml'); |
|
95 | +\TYPO3\CMS\Core\Utility\ExtensionManagementUtility::addPiFlexFormValue('dlf_validator', 'FILE:EXT:'.'dlf/Configuration/Flexforms/Validator.xml'); |
@@ -49,25 +49,25 @@ |
||
49 | 49 | // Register tools for toolbox plugin. |
50 | 50 | $GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['dlf/Classes/Plugin/Toolbox.php']['tools'] = []; |
51 | 51 | \Kitodo\Dlf\Hooks\ExtensionManagementUtility::addPItoST43($_EXTKEY, \Kitodo\Dlf\Plugin\Tools\FulltextTool::class, '_fulltexttool', '', TRUE); |
52 | -$GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['dlf/Classes/Plugin/Toolbox.php']['tools'][\TYPO3\CMS\Core\Utility\ExtensionManagementUtility::getCN($_EXTKEY) . '_fulltexttool'] = 'LLL:EXT:dlf/Resources/Private/Language/Labels.xml:tx_dlf_toolbox.fulltexttool'; |
|
52 | +$GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['dlf/Classes/Plugin/Toolbox.php']['tools'][\TYPO3\CMS\Core\Utility\ExtensionManagementUtility::getCN($_EXTKEY).'_fulltexttool'] = 'LLL:EXT:dlf/Resources/Private/Language/Labels.xml:tx_dlf_toolbox.fulltexttool'; |
|
53 | 53 | \Kitodo\Dlf\Hooks\ExtensionManagementUtility::addPItoST43($_EXTKEY, \Kitodo\Dlf\Plugin\Tools\AnnotationTool::class, '_annotationtool', '', TRUE); |
54 | -$GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['dlf/Classes/Plugin/Toolbox.php']['tools'][\TYPO3\CMS\Core\Utility\ExtensionManagementUtility::getCN($_EXTKEY) . '_annotationtool'] = 'LLL:EXT:dlf/Resources/Private/Language/Labels.xml:tx_dlf_toolbox.annotationtool'; |
|
54 | +$GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['dlf/Classes/Plugin/Toolbox.php']['tools'][\TYPO3\CMS\Core\Utility\ExtensionManagementUtility::getCN($_EXTKEY).'_annotationtool'] = 'LLL:EXT:dlf/Resources/Private/Language/Labels.xml:tx_dlf_toolbox.annotationtool'; |
|
55 | 55 | \Kitodo\Dlf\Hooks\ExtensionManagementUtility::addPItoST43($_EXTKEY, \Kitodo\Dlf\Plugin\Tools\ImageDownloadTool::class, '_imagedownloadtool', '', TRUE); |
56 | -$GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['dlf/Classes/Plugin/Toolbox.php']['tools'][\TYPO3\CMS\Core\Utility\ExtensionManagementUtility::getCN($_EXTKEY) . '_imagedownloadtool'] = 'LLL:EXT:dlf/Resources/Private/Language/Labels.xml:tx_dlf_toolbox.imagedownloadtool'; |
|
56 | +$GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['dlf/Classes/Plugin/Toolbox.php']['tools'][\TYPO3\CMS\Core\Utility\ExtensionManagementUtility::getCN($_EXTKEY).'_imagedownloadtool'] = 'LLL:EXT:dlf/Resources/Private/Language/Labels.xml:tx_dlf_toolbox.imagedownloadtool'; |
|
57 | 57 | \Kitodo\Dlf\Hooks\ExtensionManagementUtility::addPItoST43($_EXTKEY, \Kitodo\Dlf\Plugin\Tools\ImageManipulationTool::class, '_imagemanipulationtool', '', TRUE); |
58 | -$GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['dlf/Classes/Plugin/Toolbox.php']['tools'][\TYPO3\CMS\Core\Utility\ExtensionManagementUtility::getCN($_EXTKEY) . '_imagemanipulationtool'] = 'LLL:EXT:dlf/Resources/Private/Language/Labels.xml:tx_dlf_toolbox.imagemanipulationtool'; |
|
58 | +$GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['dlf/Classes/Plugin/Toolbox.php']['tools'][\TYPO3\CMS\Core\Utility\ExtensionManagementUtility::getCN($_EXTKEY).'_imagemanipulationtool'] = 'LLL:EXT:dlf/Resources/Private/Language/Labels.xml:tx_dlf_toolbox.imagemanipulationtool'; |
|
59 | 59 | \Kitodo\Dlf\Hooks\ExtensionManagementUtility::addPItoST43($_EXTKEY, \Kitodo\Dlf\Plugin\Tools\PdfDownloadTool::class, '_pdfdownloadtool', '', TRUE); |
60 | -$GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['dlf/Classes/Plugin/Toolbox.php']['tools'][\TYPO3\CMS\Core\Utility\ExtensionManagementUtility::getCN($_EXTKEY) . '_pdfdownloadtool'] = 'LLL:EXT:dlf/Resources/Private/Language/Labels.xml:tx_dlf_toolbox.pdfdownloadtool'; |
|
60 | +$GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['dlf/Classes/Plugin/Toolbox.php']['tools'][\TYPO3\CMS\Core\Utility\ExtensionManagementUtility::getCN($_EXTKEY).'_pdfdownloadtool'] = 'LLL:EXT:dlf/Resources/Private/Language/Labels.xml:tx_dlf_toolbox.pdfdownloadtool'; |
|
61 | 61 | \Kitodo\Dlf\Hooks\ExtensionManagementUtility::addPItoST43($_EXTKEY, \Kitodo\Dlf\Plugin\Tools\SearchInDocumentTool::class, '_searchindocumenttool', '', TRUE); |
62 | -$GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['dlf/Classes/Plugin/Toolbox.php']['tools'][\TYPO3\CMS\Core\Utility\ExtensionManagementUtility::getCN($_EXTKEY) . '_searchindocumenttool'] = 'LLL:EXT:dlf/Resources/Private/Language/Labels.xml:tx_dlf_toolbox.searchindocumenttool'; |
|
62 | +$GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['dlf/Classes/Plugin/Toolbox.php']['tools'][\TYPO3\CMS\Core\Utility\ExtensionManagementUtility::getCN($_EXTKEY).'_searchindocumenttool'] = 'LLL:EXT:dlf/Resources/Private/Language/Labels.xml:tx_dlf_toolbox.searchindocumenttool'; |
|
63 | 63 | // Register hooks. |
64 | 64 | $GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['t3lib/class.t3lib_tcemain.php']['processDatamapClass'][] = \Kitodo\Dlf\Hooks\DataHandler::class; |
65 | 65 | $GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['t3lib/class.t3lib_tcemain.php']['processCmdmapClass'][] = \Kitodo\Dlf\Hooks\DataHandler::class; |
66 | 66 | $GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['dlf/Classes/Common/MetsDocument.php']['hookClass'][] = \Kitodo\Dlf\Hooks\KitodoProductionHacks::class; |
67 | 67 | // Register AJAX eID handlers. |
68 | -$GLOBALS['TYPO3_CONF_VARS']['FE']['eID_include']['tx_dlf_search_suggest'] = \Kitodo\Dlf\Plugin\Eid\SearchSuggest::class . '::main'; |
|
69 | -$GLOBALS['TYPO3_CONF_VARS']['FE']['eID_include']['tx_dlf_search_in_document'] = \Kitodo\Dlf\Plugin\Eid\SearchInDocument::class . '::main'; |
|
70 | -$GLOBALS['TYPO3_CONF_VARS']['FE']['eID_include']['tx_dlf_pageview_proxy'] = \Kitodo\Dlf\Plugin\Eid\PageViewProxy::class . '::main'; |
|
68 | +$GLOBALS['TYPO3_CONF_VARS']['FE']['eID_include']['tx_dlf_search_suggest'] = \Kitodo\Dlf\Plugin\Eid\SearchSuggest::class.'::main'; |
|
69 | +$GLOBALS['TYPO3_CONF_VARS']['FE']['eID_include']['tx_dlf_search_in_document'] = \Kitodo\Dlf\Plugin\Eid\SearchInDocument::class.'::main'; |
|
70 | +$GLOBALS['TYPO3_CONF_VARS']['FE']['eID_include']['tx_dlf_pageview_proxy'] = \Kitodo\Dlf\Plugin\Eid\PageViewProxy::class.'::main'; |
|
71 | 71 | // Use Caching Framework for Solr queries |
72 | 72 | if (!is_array($GLOBALS['TYPO3_CONF_VARS']['SYS']['caching']['cacheConfigurations']['tx_dlf_solr'])) { |
73 | 73 | $GLOBALS['TYPO3_CONF_VARS']['SYS']['caching']['cacheConfigurations']['tx_dlf_solr'] = []; |
@@ -90,8 +90,7 @@ |
||
90 | 90 | * |
91 | 91 | * @return boolean TRUE if document type matches, FALSE if not |
92 | 92 | */ |
93 | - function user_dlf_docTypeCheck($type) |
|
94 | - { |
|
93 | + function user_dlf_docTypeCheck($type) { |
|
95 | 94 | $hook = \TYPO3\CMS\Core\Utility\GeneralUtility::makeInstance(\Kitodo\Dlf\Common\DocumentTypeCheck::class); |
96 | 95 | return ($hook->getDocType() === $type); |
97 | 96 | } |
@@ -18,7 +18,7 @@ |
||
18 | 18 | '', |
19 | 19 | '', |
20 | 20 | [ |
21 | - 'routeTarget' => \Kitodo\Dlf\Module\NewTenant::class . '::main', |
|
21 | + 'routeTarget' => \Kitodo\Dlf\Module\NewTenant::class.'::main', |
|
22 | 22 | 'access' => 'admin', |
23 | 23 | 'name' => 'tools_dlfNewTenantModule', |
24 | 24 | 'icon' => 'EXT:dlf/Resources/Public/Images/NewTenant.svg', |
@@ -100,7 +100,7 @@ discard block |
||
100 | 100 | if ($parent->ready) { |
101 | 101 | $errors = self::add($parent, $core); |
102 | 102 | } else { |
103 | - Helper::devLog('Could not load parent document with UID ' . $doc->parentId, DEVLOG_SEVERITY_ERROR); |
|
103 | + Helper::devLog('Could not load parent document with UID '.$doc->parentId, DEVLOG_SEVERITY_ERROR); |
|
104 | 104 | return 1; |
105 | 105 | } |
106 | 106 | } |
@@ -109,7 +109,7 @@ discard block |
||
109 | 109 | self::$processedDocs[] = $doc->uid; |
110 | 110 | // Delete old Solr documents. |
111 | 111 | $updateQuery = self::$solr->service->createUpdate(); |
112 | - $updateQuery->addDeleteQuery('uid:' . $doc->uid); |
|
112 | + $updateQuery->addDeleteQuery('uid:'.$doc->uid); |
|
113 | 113 | self::$solr->service->update($updateQuery); |
114 | 114 | // Index every logical unit as separate Solr document. |
115 | 115 | foreach ($doc->tableOfContents as $logicalUnit) { |
@@ -172,13 +172,13 @@ discard block |
||
172 | 172 | } catch (\Exception $e) { |
173 | 173 | if ((TYPO3_REQUESTTYPE & TYPO3_REQUESTTYPE_CLI) == FALSE) { |
174 | 174 | Helper::addMessage( |
175 | - Helper::getMessage('flash.solrException', TRUE) . '<br />' . htmlspecialchars($e->getMessage()), |
|
175 | + Helper::getMessage('flash.solrException', TRUE).'<br />'.htmlspecialchars($e->getMessage()), |
|
176 | 176 | Helper::getMessage('flash.error', TRUE), |
177 | 177 | \TYPO3\CMS\Core\Messaging\FlashMessage::ERROR, |
178 | 178 | TRUE |
179 | 179 | ); |
180 | 180 | } |
181 | - Helper::devLog('Apache Solr threw exception: "' . $e->getMessage() . '"', DEVLOG_SEVERITY_ERROR); |
|
181 | + Helper::devLog('Apache Solr threw exception: "'.$e->getMessage().'"', DEVLOG_SEVERITY_ERROR); |
|
182 | 182 | return 1; |
183 | 183 | } |
184 | 184 | } else { |
@@ -213,7 +213,7 @@ discard block |
||
213 | 213 | 'tx_dlf_solrcores.uid AS uid,tx_dlf_documents.title AS title', |
214 | 214 | 'tx_dlf_solrcores,tx_dlf_documents', |
215 | 215 | 'tx_dlf_solrcores.uid=tx_dlf_documents.solrcore' |
216 | - . ' AND tx_dlf_documents.uid=' . $uid |
|
216 | + . ' AND tx_dlf_documents.uid='.$uid |
|
217 | 217 | . Helper::whereClause('tx_dlf_solrcores'), |
218 | 218 | '', |
219 | 219 | '', |
@@ -226,19 +226,19 @@ discard block |
||
226 | 226 | try { |
227 | 227 | // Delete Solr document. |
228 | 228 | $updateQuery = self::$solr->service->createUpdate(); |
229 | - $updateQuery->addDeleteQuery('uid:' . $uid); |
|
229 | + $updateQuery->addDeleteQuery('uid:'.$uid); |
|
230 | 230 | $updateQuery->addCommit(); |
231 | 231 | self::$solr->service->update($updateQuery); |
232 | 232 | } catch (\Exception $e) { |
233 | 233 | if ((TYPO3_REQUESTTYPE & TYPO3_REQUESTTYPE_CLI) == FALSE) { |
234 | 234 | Helper::addMessage( |
235 | - Helper::getMessage('flash.solrException', TRUE) . '<br />' . htmlspecialchars($e->getMessage()), |
|
235 | + Helper::getMessage('flash.solrException', TRUE).'<br />'.htmlspecialchars($e->getMessage()), |
|
236 | 236 | Helper::getMessage('flash.error', TRUE), |
237 | 237 | \TYPO3\CMS\Core\Messaging\FlashMessage::ERROR, |
238 | 238 | TRUE |
239 | 239 | ); |
240 | 240 | } |
241 | - Helper::devLog('Apache Solr threw exception: "' . $e->getMessage() . '"', DEVLOG_SEVERITY_ERROR); |
|
241 | + Helper::devLog('Apache Solr threw exception: "'.$e->getMessage().'"', DEVLOG_SEVERITY_ERROR); |
|
242 | 242 | return 1; |
243 | 243 | } |
244 | 244 | } else { |
@@ -263,7 +263,7 @@ discard block |
||
263 | 263 | } |
264 | 264 | return 0; |
265 | 265 | } else { |
266 | - Helper::devLog('Invalid UID ' . $uid . ' for document deletion', DEVLOG_SEVERITY_ERROR); |
|
266 | + Helper::devLog('Invalid UID '.$uid.' for document deletion', DEVLOG_SEVERITY_ERROR); |
|
267 | 267 | return 1; |
268 | 268 | } |
269 | 269 | } |
@@ -283,7 +283,7 @@ discard block |
||
283 | 283 | // Sanitize input. |
284 | 284 | $pid = max(intval($pid), 0); |
285 | 285 | if (!$pid) { |
286 | - Helper::devLog('Invalid PID ' . $pid . ' for metadata configuration', DEVLOG_SEVERITY_ERROR); |
|
286 | + Helper::devLog('Invalid PID '.$pid.' for metadata configuration', DEVLOG_SEVERITY_ERROR); |
|
287 | 287 | return ''; |
288 | 288 | } |
289 | 289 | // Load metadata configuration. |
@@ -292,7 +292,7 @@ discard block |
||
292 | 292 | $suffix = (in_array($index_name, self::$fields['tokenized']) ? 't' : 'u'); |
293 | 293 | $suffix .= (in_array($index_name, self::$fields['stored']) ? 's' : 'u'); |
294 | 294 | $suffix .= (in_array($index_name, self::$fields['indexed']) ? 'i' : 'u'); |
295 | - $index_name .= '_' . $suffix; |
|
295 | + $index_name .= '_'.$suffix; |
|
296 | 296 | return $index_name; |
297 | 297 | } |
298 | 298 | |
@@ -392,7 +392,7 @@ discard block |
||
392 | 392 | $updateQuery = self::$solr->service->createUpdate(); |
393 | 393 | $solrDoc = $updateQuery->createDocument(); |
394 | 394 | // Create unique identifier from document's UID and unit's XML ID. |
395 | - $solrDoc->setField('id', $doc->uid . $logicalUnit['id']); |
|
395 | + $solrDoc->setField('id', $doc->uid.$logicalUnit['id']); |
|
396 | 396 | $solrDoc->setField('uid', $doc->uid); |
397 | 397 | $solrDoc->setField('pid', $doc->pid); |
398 | 398 | if (\TYPO3\CMS\Core\Utility\MathUtility::canBeInterpretedAsInteger($logicalUnit['points'])) { |
@@ -432,11 +432,11 @@ discard block |
||
432 | 432 | $solrDoc->setField(self::getIndexFieldName($index_name, $doc->pid), $data, self::$fields['fieldboost'][$index_name]); |
433 | 433 | if (in_array($index_name, self::$fields['sortables'])) { |
434 | 434 | // Add sortable fields to index. |
435 | - $solrDoc->setField($index_name . '_sorting', $metadata[$index_name . '_sorting'][0]); |
|
435 | + $solrDoc->setField($index_name.'_sorting', $metadata[$index_name.'_sorting'][0]); |
|
436 | 436 | } |
437 | 437 | if (in_array($index_name, self::$fields['facets'])) { |
438 | 438 | // Add facets to index. |
439 | - $solrDoc->setField($index_name . '_faceting', $data); |
|
439 | + $solrDoc->setField($index_name.'_faceting', $data); |
|
440 | 440 | } |
441 | 441 | if (in_array($index_name, self::$fields['autocomplete'])) { |
442 | 442 | $autocomplete = array_merge($autocomplete, $data); |
@@ -461,7 +461,7 @@ discard block |
||
461 | 461 | } catch (\Exception $e) { |
462 | 462 | if ((TYPO3_REQUESTTYPE & TYPO3_REQUESTTYPE_CLI) == FALSE) { |
463 | 463 | Helper::addMessage( |
464 | - Helper::getMessage('flash.solrException', TRUE) . '<br />' . htmlspecialchars($e->getMessage()), |
|
464 | + Helper::getMessage('flash.solrException', TRUE).'<br />'.htmlspecialchars($e->getMessage()), |
|
465 | 465 | Helper::getMessage('flash.error', TRUE), |
466 | 466 | \TYPO3\CMS\Core\Messaging\FlashMessage::ERROR, |
467 | 467 | TRUE |
@@ -544,7 +544,7 @@ discard block |
||
544 | 544 | $updateQuery = self::$solr->service->createUpdate(); |
545 | 545 | $solrDoc = $updateQuery->createDocument(); |
546 | 546 | // Create unique identifier from document's UID and unit's XML ID. |
547 | - $solrDoc->setField('id', $doc->uid . $physicalUnit['id']); |
|
547 | + $solrDoc->setField('id', $doc->uid.$physicalUnit['id']); |
|
548 | 548 | $solrDoc->setField('uid', $doc->uid); |
549 | 549 | $solrDoc->setField('pid', $doc->pid); |
550 | 550 | $solrDoc->setField('page', $page); |
@@ -566,7 +566,7 @@ discard block |
||
566 | 566 | ) { |
567 | 567 | if (in_array($index_name, self::$fields['facets'])) { |
568 | 568 | // Add facets to index. |
569 | - $solrDoc->setField($index_name . '_faceting', $data); |
|
569 | + $solrDoc->setField($index_name.'_faceting', $data); |
|
570 | 570 | } |
571 | 571 | } |
572 | 572 | } |
@@ -584,7 +584,7 @@ discard block |
||
584 | 584 | if ((TYPO3_REQUESTTYPE & TYPO3_REQUESTTYPE_CLI) == FALSE) { |
585 | 585 | Helper::addMessage( |
586 | 586 | \TYPO3\CMS\Core\Messaging\FlashMessage::class, |
587 | - Helper::getMessage('flash.solrException', TRUE) . '<br />' . htmlspecialchars($e->getMessage()), |
|
587 | + Helper::getMessage('flash.solrException', TRUE).'<br />'.htmlspecialchars($e->getMessage()), |
|
588 | 588 | Helper::getMessage('flash.error', TRUE), |
589 | 589 | \TYPO3\CMS\Core\Messaging\FlashMessage::ERROR, |
590 | 590 | TRUE |
@@ -26,8 +26,7 @@ discard block |
||
26 | 26 | * @subpackage dlf |
27 | 27 | * @access public |
28 | 28 | */ |
29 | -class Indexer |
|
30 | -{ |
|
29 | +class Indexer { |
|
31 | 30 | /** |
32 | 31 | * The extension key |
33 | 32 | * |
@@ -88,8 +87,7 @@ discard block |
||
88 | 87 | * |
89 | 88 | * @return integer 0 on success or 1 on failure |
90 | 89 | */ |
91 | - public static function add(Document &$doc, $core = 0) |
|
92 | - { |
|
90 | + public static function add(Document &$doc, $core = 0) { |
|
93 | 91 | if (in_array($doc->uid, self::$processedDocs)) { |
94 | 92 | return 0; |
95 | 93 | } elseif (self::solrConnect($core, $doc->pid)) { |
@@ -204,8 +202,7 @@ discard block |
||
204 | 202 | * |
205 | 203 | * @return integer 0 on success or 1 on failure |
206 | 204 | */ |
207 | - public static function delete($uid) |
|
208 | - { |
|
205 | + public static function delete($uid) { |
|
209 | 206 | // Sanitize input. |
210 | 207 | $uid = max(intval($uid), 0); |
211 | 208 | // Get Solr core for document. |
@@ -278,8 +275,7 @@ discard block |
||
278 | 275 | * |
279 | 276 | * @return string The field's dynamic index name |
280 | 277 | */ |
281 | - public static function getIndexFieldName($index_name, $pid = 0) |
|
282 | - { |
|
278 | + public static function getIndexFieldName($index_name, $pid = 0) { |
|
283 | 279 | // Sanitize input. |
284 | 280 | $pid = max(intval($pid), 0); |
285 | 281 | if (!$pid) { |
@@ -305,8 +301,7 @@ discard block |
||
305 | 301 | * |
306 | 302 | * @return void |
307 | 303 | */ |
308 | - protected static function loadIndexConf($pid) |
|
309 | - { |
|
304 | + protected static function loadIndexConf($pid) { |
|
310 | 305 | if (!self::$fieldsLoaded) { |
311 | 306 | /** @var QueryBuilder $queryBuilder */ |
312 | 307 | $queryBuilder = GeneralUtility::makeInstance(ConnectionPool::class) |
@@ -377,8 +372,7 @@ discard block |
||
377 | 372 | * |
378 | 373 | * @return integer 0 on success or 1 on failure |
379 | 374 | */ |
380 | - protected static function processLogical(Document &$doc, array $logicalUnit) |
|
381 | - { |
|
375 | + protected static function processLogical(Document &$doc, array $logicalUnit) { |
|
382 | 376 | $errors = 0; |
383 | 377 | // Get metadata for logical unit. |
384 | 378 | $metadata = $doc->metadataArray[$logicalUnit['id']]; |
@@ -495,8 +489,7 @@ discard block |
||
495 | 489 | * |
496 | 490 | * @return integer 0 on success or 1 on failure |
497 | 491 | */ |
498 | - protected static function processPhysical(Document &$doc, $page, array $physicalUnit) |
|
499 | - { |
|
492 | + protected static function processPhysical(Document &$doc, $page, array $physicalUnit) { |
|
500 | 493 | $errors = 0; |
501 | 494 | // Read extension configuration. |
502 | 495 | $extConf = unserialize($GLOBALS['TYPO3_CONF_VARS']['EXT']['extConf'][self::$extKey]); |
@@ -606,8 +599,7 @@ discard block |
||
606 | 599 | * |
607 | 600 | * @return boolean TRUE on success or FALSE on failure |
608 | 601 | */ |
609 | - protected static function solrConnect($core, $pid = 0) |
|
610 | - { |
|
602 | + protected static function solrConnect($core, $pid = 0) { |
|
611 | 603 | // Get Solr instance. |
612 | 604 | if (!self::$solr) { |
613 | 605 | // Connect to Solr server. |
@@ -158,13 +158,13 @@ discard block |
||
158 | 158 | ->execute(); |
159 | 159 | |
160 | 160 | while ($resArray = $result->fetch()) { |
161 | - $fields[] = $resArray['index_name'] . '_' . ($resArray['index_tokenized'] ? 't' : 'u') . ($resArray['index_stored'] ? 's' : 'u') . 'i'; |
|
161 | + $fields[] = $resArray['index_name'].'_'.($resArray['index_tokenized'] ? 't' : 'u').($resArray['index_stored'] ? 's' : 'u').'i'; |
|
162 | 162 | } |
163 | 163 | |
164 | 164 | // Check if queried field is valid. |
165 | 165 | $splitQuery = explode(':', $query, 2); |
166 | 166 | if (in_array($splitQuery[0], $fields)) { |
167 | - $query = $splitQuery[0] . ':(' . self::escapeQuery(trim($splitQuery[1], '()')) . ')'; |
|
167 | + $query = $splitQuery[0].':('.self::escapeQuery(trim($splitQuery[1], '()')).')'; |
|
168 | 168 | } else { |
169 | 169 | $query = self::escapeQuery($query); |
170 | 170 | } |
@@ -195,7 +195,7 @@ discard block |
||
195 | 195 | } |
196 | 196 | // Check if core is set. |
197 | 197 | if (empty($core)) { |
198 | - Helper::devLog('Invalid core name "' . $core . '" for Apache Solr', DEVLOG_SEVERITY_ERROR); |
|
198 | + Helper::devLog('Invalid core name "'.$core.'" for Apache Solr', DEVLOG_SEVERITY_ERROR); |
|
199 | 199 | return; |
200 | 200 | } |
201 | 201 | // Check if there is an instance in the registry already. |
@@ -264,12 +264,12 @@ discard block |
||
264 | 264 | $solrInfo['username'] |
265 | 265 | && $solrInfo['password'] |
266 | 266 | ) { |
267 | - $host = $solrInfo['username'] . ':' . $solrInfo['password'] . '@' . $solrInfo['host']; |
|
267 | + $host = $solrInfo['username'].':'.$solrInfo['password'].'@'.$solrInfo['host']; |
|
268 | 268 | } else { |
269 | 269 | $host = $solrInfo['host']; |
270 | 270 | } |
271 | 271 | // Return entire request URL. |
272 | - return $solrInfo['scheme'] . '://' . $host . ':' . $solrInfo['port'] . '/' . $solrInfo['path'] . '/' . $core; |
|
272 | + return $solrInfo['scheme'].'://'.$host.':'.$solrInfo['port'].'/'.$solrInfo['path'].'/'.$core; |
|
273 | 273 | } |
274 | 274 | |
275 | 275 | /** |
@@ -285,7 +285,7 @@ discard block |
||
285 | 285 | { |
286 | 286 | $start = max(intval($start), 0); |
287 | 287 | // Check if core already exists. |
288 | - if (self::getInstance('dlfCore' . $start) === NULL) { |
|
288 | + if (self::getInstance('dlfCore'.$start) === NULL) { |
|
289 | 289 | return $start; |
290 | 290 | } else { |
291 | 291 | return self::solrGetCoreNumber($start + 1); |
@@ -320,13 +320,13 @@ discard block |
||
320 | 320 | // Extend filter query to get all documents with the same uids. |
321 | 321 | foreach ($params['filterquery'] as $key => $value) { |
322 | 322 | if (isset($value['query'])) { |
323 | - $params['filterquery'][$key]['query'] = '{!join from=uid to=uid}' . $value['query']; |
|
323 | + $params['filterquery'][$key]['query'] = '{!join from=uid to=uid}'.$value['query']; |
|
324 | 324 | } |
325 | 325 | } |
326 | 326 | // Set filter query to just get toplevel documents. |
327 | 327 | $params['filterquery'][] = ['query' => 'toplevel:true']; |
328 | 328 | // Set join query to get all documents with the same uids. |
329 | - $params['query'] = '{!join from=uid to=uid}' . $params['query']; |
|
329 | + $params['query'] = '{!join from=uid to=uid}'.$params['query']; |
|
330 | 330 | // Perform search to determine the total number of toplevel hits and fetch the required rows. |
331 | 331 | $selectQuery = $this->service->createSelect($params); |
332 | 332 | $results = $this->service->select($selectQuery); |
@@ -504,12 +504,12 @@ discard block |
||
504 | 504 | */ |
505 | 505 | public function __get($var) |
506 | 506 | { |
507 | - $method = '_get' . ucfirst($var); |
|
507 | + $method = '_get'.ucfirst($var); |
|
508 | 508 | if ( |
509 | 509 | !property_exists($this, $var) |
510 | 510 | || !method_exists($this, $method) |
511 | 511 | ) { |
512 | - Helper::devLog('There is no getter function for property "' . $var . '"', DEVLOG_SEVERITY_WARNING); |
|
512 | + Helper::devLog('There is no getter function for property "'.$var.'"', DEVLOG_SEVERITY_WARNING); |
|
513 | 513 | return; |
514 | 514 | } else { |
515 | 515 | return $this->$method(); |
@@ -528,12 +528,12 @@ discard block |
||
528 | 528 | */ |
529 | 529 | public function __set($var, $value) |
530 | 530 | { |
531 | - $method = '_set' . ucfirst($var); |
|
531 | + $method = '_set'.ucfirst($var); |
|
532 | 532 | if ( |
533 | 533 | !property_exists($this, $var) |
534 | 534 | || !method_exists($this, $method) |
535 | 535 | ) { |
536 | - Helper::devLog('There is no setter function for property "' . $var . '"', DEVLOG_SEVERITY_WARNING); |
|
536 | + Helper::devLog('There is no setter function for property "'.$var.'"', DEVLOG_SEVERITY_WARNING); |
|
537 | 537 | } else { |
538 | 538 | $this->$method($value); |
539 | 539 | } |
@@ -557,7 +557,7 @@ discard block |
||
557 | 557 | 'scheme' => $solrInfo['scheme'], |
558 | 558 | 'host' => $solrInfo['host'], |
559 | 559 | 'port' => $solrInfo['port'], |
560 | - 'path' => '/' . $solrInfo['path'] . '/', |
|
560 | + 'path' => '/'.$solrInfo['path'].'/', |
|
561 | 561 | 'core' => $core, |
562 | 562 | 'username' => $solrInfo['username'], |
563 | 563 | 'password' => $solrInfo['password'], |
@@ -25,8 +25,7 @@ discard block |
||
25 | 25 | * @subpackage dlf |
26 | 26 | * @access public |
27 | 27 | */ |
28 | -class Solr |
|
29 | -{ |
|
28 | +class Solr { |
|
30 | 29 | /** |
31 | 30 | * This holds the core name |
32 | 31 | * |
@@ -108,8 +107,7 @@ discard block |
||
108 | 107 | * |
109 | 108 | * @return string The escaped query string |
110 | 109 | */ |
111 | - public static function escapeQuery($query) |
|
112 | - { |
|
110 | + public static function escapeQuery($query) { |
|
113 | 111 | $helper = \TYPO3\CMS\Core\Utility\GeneralUtility::makeInstance(\Solarium\Core\Query\Helper::class); |
114 | 112 | // Escape query phrase or term. |
115 | 113 | if (preg_match('/^".*"$/', $query)) { |
@@ -129,8 +127,7 @@ discard block |
||
129 | 127 | * |
130 | 128 | * @return string The escaped query string |
131 | 129 | */ |
132 | - public static function escapeQueryKeepField($query, $pid) |
|
133 | - { |
|
130 | + public static function escapeQueryKeepField($query, $pid) { |
|
134 | 131 | // Is there a field query? |
135 | 132 | if (preg_match('/^[[:alnum:]]+_[tu][su]i:\(?.*\)?$/', $query)) { |
136 | 133 | /** @var QueryBuilder $queryBuilder */ |
@@ -187,8 +184,7 @@ discard block |
||
187 | 184 | * |
188 | 185 | * @return \Kitodo\Dlf\Common\Solr Instance of this class |
189 | 186 | */ |
190 | - public static function getInstance($core) |
|
191 | - { |
|
187 | + public static function getInstance($core) { |
|
192 | 188 | // Get core name if UID is given. |
193 | 189 | if (\TYPO3\CMS\Core\Utility\MathUtility::canBeInterpretedAsInteger($core)) { |
194 | 190 | $core = Helper::getIndexNameFromUid($core, 'tx_dlf_solrcores'); |
@@ -226,8 +222,7 @@ discard block |
||
226 | 222 | * |
227 | 223 | * @return string The connection parameters for a specific Solr core |
228 | 224 | */ |
229 | - public static function getSolrConnectionInfo() |
|
230 | - { |
|
225 | + public static function getSolrConnectionInfo() { |
|
231 | 226 | $solrInfo = []; |
232 | 227 | // Extract extension configuration. |
233 | 228 | $conf = unserialize($GLOBALS['TYPO3_CONF_VARS']['EXT']['extConf'][self::$extKey]); |
@@ -256,8 +251,7 @@ discard block |
||
256 | 251 | * |
257 | 252 | * @return string The request URL for a specific Solr core |
258 | 253 | */ |
259 | - public static function getSolrUrl($core = '') |
|
260 | - { |
|
254 | + public static function getSolrUrl($core = '') { |
|
261 | 255 | // Get Solr connection information. |
262 | 256 | $solrInfo = self::getSolrConnectionInfo(); |
263 | 257 | if ( |
@@ -281,8 +275,7 @@ discard block |
||
281 | 275 | * |
282 | 276 | * @return integer First unused core number found |
283 | 277 | */ |
284 | - public static function solrGetCoreNumber($start = 0) |
|
285 | - { |
|
278 | + public static function solrGetCoreNumber($start = 0) { |
|
286 | 279 | $start = max(intval($start), 0); |
287 | 280 | // Check if core already exists. |
288 | 281 | if (self::getInstance('dlfCore' . $start) === NULL) { |
@@ -299,8 +292,7 @@ discard block |
||
299 | 292 | * |
300 | 293 | * @return \Kitodo\Dlf\Common\DocumentList The result list |
301 | 294 | */ |
302 | - public function search() |
|
303 | - { |
|
295 | + public function search() { |
|
304 | 296 | $toplevel = []; |
305 | 297 | // Take over query parameters. |
306 | 298 | $params = $this->params; |
@@ -375,8 +367,7 @@ discard block |
||
375 | 367 | * |
376 | 368 | * @return array The Apache Solr Documents that were fetched |
377 | 369 | */ |
378 | - public function search_raw($query = '', $parameters = []) |
|
379 | - { |
|
370 | + public function search_raw($query = '', $parameters = []) { |
|
380 | 371 | // Set additional query parameters. |
381 | 372 | $parameters['start'] = 0; |
382 | 373 | $parameters['rows'] = $this->limit; |
@@ -410,8 +401,7 @@ discard block |
||
410 | 401 | * |
411 | 402 | * @return integer The max number of results |
412 | 403 | */ |
413 | - protected function _getLimit() |
|
414 | - { |
|
404 | + protected function _getLimit() { |
|
415 | 405 | return $this->limit; |
416 | 406 | } |
417 | 407 | |
@@ -422,8 +412,7 @@ discard block |
||
422 | 412 | * |
423 | 413 | * @return integer Total number of hits for last search |
424 | 414 | */ |
425 | - protected function _getNumberOfHits() |
|
426 | - { |
|
415 | + protected function _getNumberOfHits() { |
|
427 | 416 | return $this->numberOfHits; |
428 | 417 | } |
429 | 418 | |
@@ -434,8 +423,7 @@ discard block |
||
434 | 423 | * |
435 | 424 | * @return boolean Is the search instantiated successfully? |
436 | 425 | */ |
437 | - protected function _getReady() |
|
438 | - { |
|
426 | + protected function _getReady() { |
|
439 | 427 | return $this->ready; |
440 | 428 | } |
441 | 429 | |
@@ -446,8 +434,7 @@ discard block |
||
446 | 434 | * |
447 | 435 | * @return \Solarium\Client Apache Solr service object |
448 | 436 | */ |
449 | - protected function _getService() |
|
450 | - { |
|
437 | + protected function _getService() { |
|
451 | 438 | return $this->service; |
452 | 439 | } |
453 | 440 | |
@@ -460,8 +447,7 @@ discard block |
||
460 | 447 | * |
461 | 448 | * @return void |
462 | 449 | */ |
463 | - protected function _setCPid($value) |
|
464 | - { |
|
450 | + protected function _setCPid($value) { |
|
465 | 451 | $this->cPid = max(intval($value), 0); |
466 | 452 | } |
467 | 453 | |
@@ -474,8 +460,7 @@ discard block |
||
474 | 460 | * |
475 | 461 | * @return void |
476 | 462 | */ |
477 | - protected function _setLimit($value) |
|
478 | - { |
|
463 | + protected function _setLimit($value) { |
|
479 | 464 | $this->limit = max(intval($value), 0); |
480 | 465 | } |
481 | 466 | |
@@ -488,8 +473,7 @@ discard block |
||
488 | 473 | * |
489 | 474 | * @return void |
490 | 475 | */ |
491 | - protected function _setParams(array $value) |
|
492 | - { |
|
476 | + protected function _setParams(array $value) { |
|
493 | 477 | $this->params = $value; |
494 | 478 | } |
495 | 479 | |
@@ -502,8 +486,7 @@ discard block |
||
502 | 486 | * |
503 | 487 | * @return mixed Value of $this->$var |
504 | 488 | */ |
505 | - public function __get($var) |
|
506 | - { |
|
489 | + public function __get($var) { |
|
507 | 490 | $method = '_get' . ucfirst($var); |
508 | 491 | if ( |
509 | 492 | !property_exists($this, $var) |
@@ -526,8 +509,7 @@ discard block |
||
526 | 509 | * |
527 | 510 | * @return void |
528 | 511 | */ |
529 | - public function __set($var, $value) |
|
530 | - { |
|
512 | + public function __set($var, $value) { |
|
531 | 513 | $method = '_set' . ucfirst($var); |
532 | 514 | if ( |
533 | 515 | !property_exists($this, $var) |
@@ -548,8 +530,7 @@ discard block |
||
548 | 530 | * |
549 | 531 | * @return void |
550 | 532 | */ |
551 | - protected function __construct($core) |
|
552 | - { |
|
533 | + protected function __construct($core) { |
|
553 | 534 | $solrInfo = self::getSolrConnectionInfo(); |
554 | 535 | $config = [ |
555 | 536 | 'endpoint' => [ |
@@ -23,8 +23,7 @@ discard block |
||
23 | 23 | * @author Lutz Helm <[email protected]> |
24 | 24 | * |
25 | 25 | */ |
26 | -class IiifUrlReader implements UrlReaderInterface |
|
27 | -{ |
|
26 | +class IiifUrlReader implements UrlReaderInterface { |
|
28 | 27 | /** |
29 | 28 | * Singleton instance of the class |
30 | 29 | * |
@@ -38,8 +37,7 @@ discard block |
||
38 | 37 | * {@inheritDoc} |
39 | 38 | * @see \Ubl\Iiif\Tools\UrlReaderInterface::getContent() |
40 | 39 | */ |
41 | - public function getContent($url) |
|
42 | - { |
|
40 | + public function getContent($url) { |
|
43 | 41 | return GeneralUtility::getUrl($url); |
44 | 42 | } |
45 | 43 | |
@@ -50,8 +48,7 @@ discard block |
||
50 | 48 | * |
51 | 49 | * @return IiifUrlReader |
52 | 50 | */ |
53 | - public static function getInstance() |
|
54 | - { |
|
51 | + public static function getInstance() { |
|
55 | 52 | if (!isset(self::$instance)) { |
56 | 53 | self::$instance = new IiifUrlReader(); |
57 | 54 | } |
@@ -155,7 +155,7 @@ discard block |
||
155 | 155 | $fileMimeType = $this->getFileMimeType($id); |
156 | 156 | $fileLocation = $this->getFileLocation($id); |
157 | 157 | if ($fileMimeType == "application/vnd.kitodo.iiif") { |
158 | - $fileLocation = strrpos($fileLocation, "info.json") == strlen($fileLocation) - 9 ? $fileLocation : strrpos($fileLocation, "/") == strlen($fileLocation) ? $fileLocation . "info.json" : $fileLocation . "/info.json"; |
|
158 | + $fileLocation = strrpos($fileLocation, "info.json") == strlen($fileLocation) - 9 ? $fileLocation : strrpos($fileLocation, "/") == strlen($fileLocation) ? $fileLocation."info.json" : $fileLocation."/info.json"; |
|
159 | 159 | $conf = unserialize($GLOBALS['TYPO3_CONF_VARS']['EXT']['extConf'][self::$extKey]); |
160 | 160 | IiifHelper::setUrlReader(IiifUrlReader::getInstance()); |
161 | 161 | IiifHelper::setMaxThumbnailHeight($conf['iiifThumbnailHeight']); |
@@ -165,9 +165,9 @@ discard block |
||
165 | 165 | return $service->getImageUrl(); |
166 | 166 | } |
167 | 167 | } elseif ($fileMimeType = "application/vnd.netfpx") { |
168 | - $baseURL = $fileLocation . (strpos($fileLocation, "?") === FALSE ? "?" : ""); |
|
168 | + $baseURL = $fileLocation.(strpos($fileLocation, "?") === FALSE ? "?" : ""); |
|
169 | 169 | // TODO CVT is an optional IIP server capability; in theory, capabilities should be determined in the object request with '&obj=IIP-server' |
170 | - return $baseURL . "&CVT=jpeg"; |
|
170 | + return $baseURL."&CVT=jpeg"; |
|
171 | 171 | } |
172 | 172 | return $fileLocation; |
173 | 173 | } |
@@ -180,11 +180,11 @@ discard block |
||
180 | 180 | { |
181 | 181 | if ( |
182 | 182 | !empty($id) |
183 | - && ($location = $this->mets->xpath('./mets:fileSec/mets:fileGrp/mets:file[@ID="' . $id . '"]/mets:FLocat[@LOCTYPE="URL"]')) |
|
183 | + && ($location = $this->mets->xpath('./mets:fileSec/mets:fileGrp/mets:file[@ID="'.$id.'"]/mets:FLocat[@LOCTYPE="URL"]')) |
|
184 | 184 | ) { |
185 | 185 | return (string) $location[0]->attributes('http://www.w3.org/1999/xlink')->href; |
186 | 186 | } else { |
187 | - Helper::devLog('There is no file node with @ID "' . $id . '"', DEVLOG_SEVERITY_WARNING); |
|
187 | + Helper::devLog('There is no file node with @ID "'.$id.'"', DEVLOG_SEVERITY_WARNING); |
|
188 | 188 | return ''; |
189 | 189 | } |
190 | 190 | } |
@@ -197,11 +197,11 @@ discard block |
||
197 | 197 | { |
198 | 198 | if ( |
199 | 199 | !empty($id) |
200 | - && ($mimetype = $this->mets->xpath('./mets:fileSec/mets:fileGrp/mets:file[@ID="' . $id . '"]/@MIMETYPE')) |
|
200 | + && ($mimetype = $this->mets->xpath('./mets:fileSec/mets:fileGrp/mets:file[@ID="'.$id.'"]/@MIMETYPE')) |
|
201 | 201 | ) { |
202 | 202 | return (string) $mimetype[0]; |
203 | 203 | } else { |
204 | - Helper::devLog('There is no file node with @ID "' . $id . '" or no MIME type specified', DEVLOG_SEVERITY_WARNING); |
|
204 | + Helper::devLog('There is no file node with @ID "'.$id.'" or no MIME type specified', DEVLOG_SEVERITY_WARNING); |
|
205 | 205 | return ''; |
206 | 206 | } |
207 | 207 | } |
@@ -222,7 +222,7 @@ discard block |
||
222 | 222 | return $this->logicalUnits[$id]; |
223 | 223 | } elseif (!empty($id)) { |
224 | 224 | // Get specified logical unit. |
225 | - $divs = $this->mets->xpath('./mets:structMap[@TYPE="LOGICAL"]//mets:div[@ID="' . $id . '"]'); |
|
225 | + $divs = $this->mets->xpath('./mets:structMap[@TYPE="LOGICAL"]//mets:div[@ID="'.$id.'"]'); |
|
226 | 226 | } else { |
227 | 227 | // Get all logical units at top level. |
228 | 228 | $divs = $this->mets->xpath('./mets:structMap[@TYPE="LOGICAL"]/mets:div'); |
@@ -353,7 +353,7 @@ discard block |
||
353 | 353 | // Retain current PID. |
354 | 354 | $cPid = ($this->cPid ? $this->cPid : $this->pid); |
355 | 355 | } elseif (!$cPid) { |
356 | - Helper::devLog('Invalid PID ' . $cPid . ' for metadata definitions', DEVLOG_SEVERITY_WARNING); |
|
356 | + Helper::devLog('Invalid PID '.$cPid.' for metadata definitions', DEVLOG_SEVERITY_WARNING); |
|
357 | 357 | return []; |
358 | 358 | } |
359 | 359 | // Get metadata from parsed metadata array if available. |
@@ -395,7 +395,7 @@ discard block |
||
395 | 395 | if (!empty($this->logicalUnits[$id])) { |
396 | 396 | $dmdId = $this->logicalUnits[$id]['dmdId']; |
397 | 397 | } else { |
398 | - $dmdId = $this->mets->xpath('./mets:structMap[@TYPE="LOGICAL"]//mets:div[@ID="' . $id . '"]/@DMDID'); |
|
398 | + $dmdId = $this->mets->xpath('./mets:structMap[@TYPE="LOGICAL"]//mets:div[@ID="'.$id.'"]/@DMDID'); |
|
399 | 399 | $dmdId = (string) $dmdId[0]; |
400 | 400 | } |
401 | 401 | if (!empty($dmdId)) { |
@@ -413,27 +413,27 @@ discard block |
||
413 | 413 | ) { |
414 | 414 | $obj->extractMetadata($this->dmdSec[$dmdId]['xml'], $metadata); |
415 | 415 | } else { |
416 | - Helper::devLog('Invalid class/method "' . $class . '->extractMetadata()" for metadata format "' . $this->dmdSec[$dmdId]['type'] . '"', DEVLOG_SEVERITY_WARNING); |
|
416 | + Helper::devLog('Invalid class/method "'.$class.'->extractMetadata()" for metadata format "'.$this->dmdSec[$dmdId]['type'].'"', DEVLOG_SEVERITY_WARNING); |
|
417 | 417 | } |
418 | 418 | } |
419 | 419 | } else { |
420 | - Helper::devLog('Unsupported metadata format "' . $this->dmdSec[$dmdId]['type'] . '" in dmdSec with @ID "' . $dmdId . '"', DEVLOG_SEVERITY_WARNING); |
|
420 | + Helper::devLog('Unsupported metadata format "'.$this->dmdSec[$dmdId]['type'].'" in dmdSec with @ID "'.$dmdId.'"', DEVLOG_SEVERITY_WARNING); |
|
421 | 421 | return []; |
422 | 422 | } |
423 | 423 | // Get the structure's type. |
424 | 424 | if (!empty($this->logicalUnits[$id])) { |
425 | 425 | $metadata['type'] = [$this->logicalUnits[$id]['type']]; |
426 | 426 | } else { |
427 | - $struct = $this->mets->xpath('./mets:structMap[@TYPE="LOGICAL"]//mets:div[@ID="' . $id . '"]/@TYPE'); |
|
427 | + $struct = $this->mets->xpath('./mets:structMap[@TYPE="LOGICAL"]//mets:div[@ID="'.$id.'"]/@TYPE'); |
|
428 | 428 | $metadata['type'] = [(string) $struct[0]]; |
429 | 429 | } |
430 | 430 | // Get the additional metadata from database. |
431 | 431 | $result = $GLOBALS['TYPO3_DB']->exec_SELECTquery( |
432 | 432 | 'tx_dlf_metadata.index_name AS index_name,tx_dlf_metadataformat.xpath AS xpath,tx_dlf_metadataformat.xpath_sorting AS xpath_sorting,tx_dlf_metadata.is_sortable AS is_sortable,tx_dlf_metadata.default_value AS default_value,tx_dlf_metadata.format AS format', |
433 | 433 | 'tx_dlf_metadata,tx_dlf_metadataformat,tx_dlf_formats', |
434 | - 'tx_dlf_metadata.pid=' . $cPid |
|
435 | - . ' AND tx_dlf_metadataformat.pid=' . $cPid |
|
436 | - . ' AND ((tx_dlf_metadata.uid=tx_dlf_metadataformat.parent_id AND tx_dlf_metadataformat.encoded=tx_dlf_formats.uid AND tx_dlf_formats.type=' . $GLOBALS['TYPO3_DB']->fullQuoteStr($this->dmdSec[$dmdId]['type'], 'tx_dlf_formats') . ') OR tx_dlf_metadata.format=0)' |
|
434 | + 'tx_dlf_metadata.pid='.$cPid |
|
435 | + . ' AND tx_dlf_metadataformat.pid='.$cPid |
|
436 | + . ' AND ((tx_dlf_metadata.uid=tx_dlf_metadataformat.parent_id AND tx_dlf_metadataformat.encoded=tx_dlf_formats.uid AND tx_dlf_formats.type='.$GLOBALS['TYPO3_DB']->fullQuoteStr($this->dmdSec[$dmdId]['type'], 'tx_dlf_formats').') OR tx_dlf_metadata.format=0)' |
|
437 | 437 | . Helper::whereClause('tx_dlf_metadata', TRUE) |
438 | 438 | . Helper::whereClause('tx_dlf_metadataformat') |
439 | 439 | . Helper::whereClause('tx_dlf_formats') |
@@ -483,13 +483,13 @@ discard block |
||
483 | 483 | $values instanceof \DOMNodeList |
484 | 484 | && $values->length > 0 |
485 | 485 | ) { |
486 | - $metadata[$resArray['index_name'] . '_sorting'][0] = trim((string) $values->item(0)->nodeValue); |
|
486 | + $metadata[$resArray['index_name'].'_sorting'][0] = trim((string) $values->item(0)->nodeValue); |
|
487 | 487 | } elseif (!($values instanceof \DOMNodeList)) { |
488 | - $metadata[$resArray['index_name'] . '_sorting'][0] = trim((string) $values); |
|
488 | + $metadata[$resArray['index_name'].'_sorting'][0] = trim((string) $values); |
|
489 | 489 | } |
490 | 490 | } |
491 | - if (empty($metadata[$resArray['index_name'] . '_sorting'][0])) { |
|
492 | - $metadata[$resArray['index_name'] . '_sorting'][0] = $metadata[$resArray['index_name']][0]; |
|
491 | + if (empty($metadata[$resArray['index_name'].'_sorting'][0])) { |
|
492 | + $metadata[$resArray['index_name'].'_sorting'][0] = $metadata[$resArray['index_name']][0]; |
|
493 | 493 | } |
494 | 494 | } |
495 | 495 | } |
@@ -508,9 +508,9 @@ discard block |
||
508 | 508 | 'tx_dlf_documents', |
509 | 509 | 'tx_dlf_relations', |
510 | 510 | 'tx_dlf_collections', |
511 | - 'AND tx_dlf_collections.pid=' . intval($cPid) |
|
512 | - . ' AND tx_dlf_documents.uid=' . intval($this->uid) |
|
513 | - . ' AND tx_dlf_relations.ident=' . $GLOBALS['TYPO3_DB']->fullQuoteStr('docs_colls', 'tx_dlf_relations') |
|
511 | + 'AND tx_dlf_collections.pid='.intval($cPid) |
|
512 | + . ' AND tx_dlf_documents.uid='.intval($this->uid) |
|
513 | + . ' AND tx_dlf_relations.ident='.$GLOBALS['TYPO3_DB']->fullQuoteStr('docs_colls', 'tx_dlf_relations') |
|
514 | 514 | . ' AND tx_dlf_collections.sys_language_uid IN (-1,0)' |
515 | 515 | . Helper::whereClause('tx_dlf_documents') |
516 | 516 | . Helper::whereClause('tx_dlf_collections'), |
@@ -554,7 +554,7 @@ discard block |
||
554 | 554 | */ |
555 | 555 | public function getStructureDepth($logId) |
556 | 556 | { |
557 | - return count($this->mets->xpath('./mets:structMap[@TYPE="LOGICAL"]//mets:div[@ID="' . $logId . '"]/ancestor::*')); |
|
557 | + return count($this->mets->xpath('./mets:structMap[@TYPE="LOGICAL"]//mets:div[@ID="'.$logId.'"]/ancestor::*')); |
|
558 | 558 | } |
559 | 559 | |
560 | 560 | /** |
@@ -571,7 +571,7 @@ discard block |
||
571 | 571 | // Register namespaces. |
572 | 572 | $this->registerNamespaces($this->mets); |
573 | 573 | } else { |
574 | - Helper::devLog('No METS part found in document with UID ' . $this->uid, DEVLOG_SEVERITY_ERROR); |
|
574 | + Helper::devLog('No METS part found in document with UID '.$this->uid, DEVLOG_SEVERITY_ERROR); |
|
575 | 575 | } |
576 | 576 | } |
577 | 577 | |
@@ -596,7 +596,7 @@ discard block |
||
596 | 596 | $this->xml = $xml; |
597 | 597 | return TRUE; |
598 | 598 | } else { |
599 | - Helper::devLog('Could not load XML file from "' . $location . '"', DEVLOG_SEVERITY_ERROR); |
|
599 | + Helper::devLog('Could not load XML file from "'.$location.'"', DEVLOG_SEVERITY_ERROR); |
|
600 | 600 | } |
601 | 601 | } |
602 | 602 | |
@@ -620,7 +620,7 @@ discard block |
||
620 | 620 | { |
621 | 621 | $partof = 0; |
622 | 622 | // Get the closest ancestor of the current document which has a MPTR child. |
623 | - $parentMptr = $this->mets->xpath('./mets:structMap[@TYPE="LOGICAL"]//mets:div[@ID="' . $this->_getToplevelId() . '"]/ancestor::mets:div[./mets:mptr][1]/mets:mptr'); |
|
623 | + $parentMptr = $this->mets->xpath('./mets:structMap[@TYPE="LOGICAL"]//mets:div[@ID="'.$this->_getToplevelId().'"]/ancestor::mets:div[./mets:mptr][1]/mets:mptr'); |
|
624 | 624 | if (!empty($parentMptr[0])) { |
625 | 625 | $parentLocation = (string) $parentMptr[0]->attributes('http://www.w3.org/1999/xlink')->href; |
626 | 626 | if ($parentLocation != $this->location) { |
@@ -686,15 +686,15 @@ discard block |
||
686 | 686 | // Get dmdSec nodes from METS. |
687 | 687 | $dmdIds = $this->mets->xpath('./mets:dmdSec/@ID'); |
688 | 688 | foreach ($dmdIds as $dmdId) { |
689 | - if ($type = $this->mets->xpath('./mets:dmdSec[@ID="' . (string) $dmdId . '"]/mets:mdWrap[not(@MDTYPE="OTHER")]/@MDTYPE')) { |
|
689 | + if ($type = $this->mets->xpath('./mets:dmdSec[@ID="'.(string) $dmdId.'"]/mets:mdWrap[not(@MDTYPE="OTHER")]/@MDTYPE')) { |
|
690 | 690 | if (!empty($this->formats[(string) $type[0]])) { |
691 | 691 | $type = (string) $type[0]; |
692 | - $xml = $this->mets->xpath('./mets:dmdSec[@ID="' . (string) $dmdId . '"]/mets:mdWrap[@MDTYPE="' . $type . '"]/mets:xmlData/' . strtolower($type) . ':' . $this->formats[$type]['rootElement']); |
|
692 | + $xml = $this->mets->xpath('./mets:dmdSec[@ID="'.(string) $dmdId.'"]/mets:mdWrap[@MDTYPE="'.$type.'"]/mets:xmlData/'.strtolower($type).':'.$this->formats[$type]['rootElement']); |
|
693 | 693 | } |
694 | - } elseif ($type = $this->mets->xpath('./mets:dmdSec[@ID="' . (string) $dmdId . '"]/mets:mdWrap[@MDTYPE="OTHER"]/@OTHERMDTYPE')) { |
|
694 | + } elseif ($type = $this->mets->xpath('./mets:dmdSec[@ID="'.(string) $dmdId.'"]/mets:mdWrap[@MDTYPE="OTHER"]/@OTHERMDTYPE')) { |
|
695 | 695 | if (!empty($this->formats[(string) $type[0]])) { |
696 | 696 | $type = (string) $type[0]; |
697 | - $xml = $this->mets->xpath('./mets:dmdSec[@ID="' . (string) $dmdId . '"]/mets:mdWrap[@MDTYPE="OTHER"][@OTHERMDTYPE="' . $type . '"]/mets:xmlData/' . strtolower($type) . ':' . $this->formats[$type]['rootElement']); |
|
697 | + $xml = $this->mets->xpath('./mets:dmdSec[@ID="'.(string) $dmdId.'"]/mets:mdWrap[@MDTYPE="OTHER"][@OTHERMDTYPE="'.$type.'"]/mets:xmlData/'.strtolower($type).':'.$this->formats[$type]['rootElement']); |
|
698 | 698 | } |
699 | 699 | } |
700 | 700 | if ($xml) { |
@@ -873,7 +873,7 @@ discard block |
||
873 | 873 | // Retain current PID. |
874 | 874 | $cPid = ($this->cPid ? $this->cPid : $this->pid); |
875 | 875 | if (!$cPid) { |
876 | - Helper::devLog('Invalid PID ' . $cPid . ' for structure definitions', DEVLOG_SEVERITY_ERROR); |
|
876 | + Helper::devLog('Invalid PID '.$cPid.' for structure definitions', DEVLOG_SEVERITY_ERROR); |
|
877 | 877 | $this->thumbnailLoaded = TRUE; |
878 | 878 | return $this->thumbnail; |
879 | 879 | } |
@@ -911,7 +911,7 @@ discard block |
||
911 | 911 | if (!empty($resArray['thumbnail'])) { |
912 | 912 | $strctType = Helper::getIndexNameFromUid($resArray['thumbnail'], 'tx_dlf_structures', $cPid); |
913 | 913 | // Check if this document has a structure element of the desired type. |
914 | - $strctIds = $this->mets->xpath('./mets:structMap[@TYPE="LOGICAL"]//mets:div[@TYPE="' . $strctType . '"]/@ID'); |
|
914 | + $strctIds = $this->mets->xpath('./mets:structMap[@TYPE="LOGICAL"]//mets:div[@TYPE="'.$strctType.'"]/@ID'); |
|
915 | 915 | if (!empty($strctIds)) { |
916 | 916 | $strctId = (string) $strctIds[0]; |
917 | 917 | } |
@@ -928,7 +928,7 @@ discard block |
||
928 | 928 | $this->thumbnail = $this->getFileLocation($this->physicalStructureInfo[$this->physicalStructure[1]]['files'][$extConf['fileGrpThumbs']]); |
929 | 929 | } |
930 | 930 | } else { |
931 | - Helper::devLog('No structure of type "' . $metadata['type'][0] . '" found in database', DEVLOG_SEVERITY_ERROR); |
|
931 | + Helper::devLog('No structure of type "'.$metadata['type'][0].'" found in database', DEVLOG_SEVERITY_ERROR); |
|
932 | 932 | } |
933 | 933 | $this->thumbnailLoaded = TRUE; |
934 | 934 | } |
@@ -27,8 +27,7 @@ discard block |
||
27 | 27 | * @subpackage tx_dlf |
28 | 28 | * @access public |
29 | 29 | */ |
30 | -final class MetsDocument extends Document |
|
31 | -{ |
|
30 | +final class MetsDocument extends Document { |
|
32 | 31 | /** |
33 | 32 | * This holds the whole XML file as string for serialization purposes |
34 | 33 | * @see __sleep() / __wakeup() |
@@ -129,8 +128,7 @@ discard block |
||
129 | 128 | * {@inheritDoc} |
130 | 129 | * @see \Kitodo\Dlf\Common\Document::establishRecordId() |
131 | 130 | */ |
132 | - protected function establishRecordId($pid) |
|
133 | - { |
|
131 | + protected function establishRecordId($pid) { |
|
134 | 132 | // Check for METS object @ID. |
135 | 133 | if (!empty($this->mets['OBJID'])) { |
136 | 134 | $this->recordId = (string) $this->mets['OBJID']; |
@@ -150,8 +148,7 @@ discard block |
||
150 | 148 | * {@inheritDoc} |
151 | 149 | * @see \Kitodo\Dlf\Common\Document::getDownloadLocation() |
152 | 150 | */ |
153 | - public function getDownloadLocation($id) |
|
154 | - { |
|
151 | + public function getDownloadLocation($id) { |
|
155 | 152 | $fileMimeType = $this->getFileMimeType($id); |
156 | 153 | $fileLocation = $this->getFileLocation($id); |
157 | 154 | if ($fileMimeType == "application/vnd.kitodo.iiif") { |
@@ -176,8 +173,7 @@ discard block |
||
176 | 173 | * {@inheritDoc} |
177 | 174 | * @see \Kitodo\Dlf\Common\Document::getFileLocation() |
178 | 175 | */ |
179 | - public function getFileLocation($id) |
|
180 | - { |
|
176 | + public function getFileLocation($id) { |
|
181 | 177 | if ( |
182 | 178 | !empty($id) |
183 | 179 | && ($location = $this->mets->xpath('./mets:fileSec/mets:fileGrp/mets:file[@ID="' . $id . '"]/mets:FLocat[@LOCTYPE="URL"]')) |
@@ -193,8 +189,7 @@ discard block |
||
193 | 189 | * {@inheritDoc} |
194 | 190 | * @see \Kitodo\Dlf\Common\Document::getFileMimeType() |
195 | 191 | */ |
196 | - public function getFileMimeType($id) |
|
197 | - { |
|
192 | + public function getFileMimeType($id) { |
|
198 | 193 | if ( |
199 | 194 | !empty($id) |
200 | 195 | && ($mimetype = $this->mets->xpath('./mets:fileSec/mets:fileGrp/mets:file[@ID="' . $id . '"]/@MIMETYPE')) |
@@ -210,8 +205,7 @@ discard block |
||
210 | 205 | * {@inheritDoc} |
211 | 206 | * @see \Kitodo\Dlf\Common\Document::getLogicalStructure() |
212 | 207 | */ |
213 | - public function getLogicalStructure($id, $recursive = FALSE) |
|
214 | - { |
|
208 | + public function getLogicalStructure($id, $recursive = FALSE) { |
|
215 | 209 | $details = []; |
216 | 210 | // Is the requested logical unit already loaded? |
217 | 211 | if ( |
@@ -251,8 +245,7 @@ discard block |
||
251 | 245 | * |
252 | 246 | * @return array Array of the element's id, label, type and physical page indexes/mptr link |
253 | 247 | */ |
254 | - protected function getLogicalStructureInfo(\SimpleXMLElement $structure, $recursive = FALSE) |
|
255 | - { |
|
248 | + protected function getLogicalStructureInfo(\SimpleXMLElement $structure, $recursive = FALSE) { |
|
256 | 249 | // Get attributes. |
257 | 250 | foreach ($structure->attributes() as $attribute => $value) { |
258 | 251 | $attributes[$attribute] = (string) $value; |
@@ -294,14 +287,16 @@ discard block |
||
294 | 287 | } elseif ( |
295 | 288 | !empty($this->physicalStructure) |
296 | 289 | && array_key_exists($details['id'], $this->smLinks['l2p']) |
297 | - ) { // Are there any physical elements and is this logical unit linked to at least one of them? |
|
290 | + ) { |
|
291 | +// Are there any physical elements and is this logical unit linked to at least one of them? |
|
298 | 292 | $details['points'] = max(intval(array_search($this->smLinks['l2p'][$details['id']][0], $this->physicalStructure, TRUE)), 1); |
299 | 293 | if (!empty($this->physicalStructureInfo[$this->smLinks['l2p'][$details['id']][0]]['files'][$extConf['fileGrpThumbs']])) { |
300 | 294 | $details['thumbnailId'] = $this->physicalStructureInfo[$this->smLinks['l2p'][$details['id']][0]]['files'][$extConf['fileGrpThumbs']]; |
301 | 295 | } |
302 | 296 | // Get page/track number of the first page/track related to this structure element. |
303 | 297 | $details['pagination'] = $this->physicalStructureInfo[$this->smLinks['l2p'][$details['id']][0]]['orderlabel']; |
304 | - } elseif ($details['id'] == $this->_getToplevelId()) { // Is this the toplevel structure element? |
|
298 | + } elseif ($details['id'] == $this->_getToplevelId()) { |
|
299 | +// Is this the toplevel structure element? |
|
305 | 300 | // Yes. Point to itself. |
306 | 301 | $details['points'] = 1; |
307 | 302 | if ( |
@@ -341,8 +336,7 @@ discard block |
||
341 | 336 | * {@inheritDoc} |
342 | 337 | * @see \Kitodo\Dlf\Common\Document::getMetadata() |
343 | 338 | */ |
344 | - public function getMetadata($id, $cPid = 0) |
|
345 | - { |
|
339 | + public function getMetadata($id, $cPid = 0) { |
|
346 | 340 | // Make sure $cPid is a non-negative integer. |
347 | 341 | $cPid = max(intval($cPid), 0); |
348 | 342 | // If $cPid is not given, try to get it elsewhere. |
@@ -533,8 +527,7 @@ discard block |
||
533 | 527 | * {@inheritDoc} |
534 | 528 | * @see \Kitodo\Dlf\Common\Document::getRawText() |
535 | 529 | */ |
536 | - public function getRawText($id) |
|
537 | - { |
|
530 | + public function getRawText($id) { |
|
538 | 531 | $rawText = ''; |
539 | 532 | // Get text from raw text array if available. |
540 | 533 | if (!empty($this->rawTextArray[$id])) { |
@@ -552,8 +545,7 @@ discard block |
||
552 | 545 | * {@inheritDoc} |
553 | 546 | * @see Document::getStructureDepth() |
554 | 547 | */ |
555 | - public function getStructureDepth($logId) |
|
556 | - { |
|
548 | + public function getStructureDepth($logId) { |
|
557 | 549 | return count($this->mets->xpath('./mets:structMap[@TYPE="LOGICAL"]//mets:div[@ID="' . $logId . '"]/ancestor::*')); |
558 | 550 | } |
559 | 551 | |
@@ -561,8 +553,7 @@ discard block |
||
561 | 553 | * {@inheritDoc} |
562 | 554 | * @see \Kitodo\Dlf\Common\Document::init() |
563 | 555 | */ |
564 | - protected function init() |
|
565 | - { |
|
556 | + protected function init() { |
|
566 | 557 | // Get METS node from XML file. |
567 | 558 | $this->registerNamespaces($this->xml); |
568 | 559 | $mets = $this->xml->xpath('//mets:mets'); |
@@ -579,8 +570,7 @@ discard block |
||
579 | 570 | * {@inheritDoc} |
580 | 571 | * @see \Kitodo\Dlf\Common\Document::loadLocation() |
581 | 572 | */ |
582 | - protected function loadLocation($location) |
|
583 | - { |
|
573 | + protected function loadLocation($location) { |
|
584 | 574 | // Turn off libxml's error logging. |
585 | 575 | $libxmlErrors = libxml_use_internal_errors(TRUE); |
586 | 576 | // Disables the functionality to allow external entities to be loaded when parsing the XML, must be kept |
@@ -604,8 +594,7 @@ discard block |
||
604 | 594 | * {@inheritDoc} |
605 | 595 | * @see \Kitodo\Dlf\Common\Document::ensureHasFulltextIsSet() |
606 | 596 | */ |
607 | - protected function ensureHasFulltextIsSet() |
|
608 | - { |
|
597 | + protected function ensureHasFulltextIsSet() { |
|
609 | 598 | // Are the fileGrps already loaded? |
610 | 599 | if (!$this->fileGrpsLoaded) { |
611 | 600 | $this->_getFileGrps(); |
@@ -616,8 +605,7 @@ discard block |
||
616 | 605 | * {@inheritDoc} |
617 | 606 | * @see Document::getParentDocumentUid() |
618 | 607 | */ |
619 | - protected function getParentDocumentUidForSaving($pid, $core) |
|
620 | - { |
|
608 | + protected function getParentDocumentUidForSaving($pid, $core) { |
|
621 | 609 | $partof = 0; |
622 | 610 | // Get the closest ancestor of the current document which has a MPTR child. |
623 | 611 | $parentMptr = $this->mets->xpath('./mets:structMap[@TYPE="LOGICAL"]//mets:div[@ID="' . $this->_getToplevelId() . '"]/ancestor::mets:div[./mets:mptr][1]/mets:mptr'); |
@@ -640,8 +628,7 @@ discard block |
||
640 | 628 | * {@inheritDoc} |
641 | 629 | * @see Document::setPreloadedDocument() |
642 | 630 | */ |
643 | - protected function setPreloadedDocument($preloadedDocument) |
|
644 | - { |
|
631 | + protected function setPreloadedDocument($preloadedDocument) { |
|
645 | 632 | |
646 | 633 | if ($preloadedDocument instanceof \SimpleXMLElement) { |
647 | 634 | $this->xml = $preloadedDocument; |
@@ -654,8 +641,7 @@ discard block |
||
654 | 641 | * {@inheritDoc} |
655 | 642 | * @see Document::getDocument() |
656 | 643 | */ |
657 | - protected function getDocument() |
|
658 | - { |
|
644 | + protected function getDocument() { |
|
659 | 645 | return $this->mets; |
660 | 646 | } |
661 | 647 | |
@@ -666,8 +652,7 @@ discard block |
||
666 | 652 | * |
667 | 653 | * @return integer The PID of the metadata definitions |
668 | 654 | */ |
669 | - protected function _getCPid() |
|
670 | - { |
|
655 | + protected function _getCPid() { |
|
671 | 656 | return $this->cPid; |
672 | 657 | } |
673 | 658 | |
@@ -678,8 +663,7 @@ discard block |
||
678 | 663 | * |
679 | 664 | * @return array Array of dmdSecs with their IDs as array key |
680 | 665 | */ |
681 | - protected function _getDmdSec() |
|
682 | - { |
|
666 | + protected function _getDmdSec() { |
|
683 | 667 | if (!$this->dmdSecLoaded) { |
684 | 668 | // Get available data formats. |
685 | 669 | $this->loadFormats(); |
@@ -715,8 +699,7 @@ discard block |
||
715 | 699 | * |
716 | 700 | * @return array Array of file use groups with file IDs |
717 | 701 | */ |
718 | - protected function _getFileGrps() |
|
719 | - { |
|
702 | + protected function _getFileGrps() { |
|
720 | 703 | if (!$this->fileGrpsLoaded) { |
721 | 704 | // Get configured USE attributes. |
722 | 705 | $extConf = unserialize($GLOBALS['TYPO3_CONF_VARS']['EXT']['extConf'][self::$extKey]); |
@@ -759,8 +742,7 @@ discard block |
||
759 | 742 | * {@inheritDoc} |
760 | 743 | * @see \Kitodo\Dlf\Common\Document::prepareMetadataArray() |
761 | 744 | */ |
762 | - protected function prepareMetadataArray($cPid) |
|
763 | - { |
|
745 | + protected function prepareMetadataArray($cPid) { |
|
764 | 746 | // Get all logical structure nodes with metadata. |
765 | 747 | if (($ids = $this->mets->xpath('./mets:structMap[@TYPE="LOGICAL"]//mets:div[@DMDID]/@ID'))) { |
766 | 748 | foreach ($ids as $id) { |
@@ -777,8 +759,7 @@ discard block |
||
777 | 759 | * |
778 | 760 | * @return \SimpleXMLElement The XML's METS part as \SimpleXMLElement object |
779 | 761 | */ |
780 | - protected function _getMets() |
|
781 | - { |
|
762 | + protected function _getMets() { |
|
782 | 763 | return $this->mets; |
783 | 764 | } |
784 | 765 | |
@@ -786,8 +767,7 @@ discard block |
||
786 | 767 | * {@inheritDoc} |
787 | 768 | * @see \Kitodo\Dlf\Common\Document::_getPhysicalStructure() |
788 | 769 | */ |
789 | - protected function _getPhysicalStructure() |
|
790 | - { |
|
770 | + protected function _getPhysicalStructure() { |
|
791 | 771 | // Is there no physical structure array yet? |
792 | 772 | if (!$this->physicalStructureLoaded) { |
793 | 773 | // Does the document have a structMap node of type "PHYSICAL"? |
@@ -847,8 +827,7 @@ discard block |
||
847 | 827 | * {@inheritDoc} |
848 | 828 | * @see \Kitodo\Dlf\Common\Document::_getSmLinks() |
849 | 829 | */ |
850 | - protected function _getSmLinks() |
|
851 | - { |
|
830 | + protected function _getSmLinks() { |
|
852 | 831 | if (!$this->smLinksLoaded) { |
853 | 832 | $smLinks = $this->mets->xpath('./mets:structLink/mets:smLink'); |
854 | 833 | foreach ($smLinks as $smLink) { |
@@ -864,8 +843,7 @@ discard block |
||
864 | 843 | * {@inheritDoc} |
865 | 844 | * @see \Kitodo\Dlf\Common\Document::_getThumbnail() |
866 | 845 | */ |
867 | - protected function _getThumbnail($forceReload = FALSE) |
|
868 | - { |
|
846 | + protected function _getThumbnail($forceReload = FALSE) { |
|
869 | 847 | if ( |
870 | 848 | !$this->thumbnailLoaded |
871 | 849 | || $forceReload |
@@ -939,8 +917,7 @@ discard block |
||
939 | 917 | * {@inheritDoc} |
940 | 918 | * @see \Kitodo\Dlf\Common\Document::_getToplevelId() |
941 | 919 | */ |
942 | - protected function _getToplevelId() |
|
943 | - { |
|
920 | + protected function _getToplevelId() { |
|
944 | 921 | if (empty($this->toplevelId)) { |
945 | 922 | // Get all logical structure nodes with metadata, but without associated METS-Pointers. |
946 | 923 | if (($divs = $this->mets->xpath('./mets:structMap[@TYPE="LOGICAL"]//mets:div[@DMDID and not(./mets:mptr)]'))) { |
@@ -971,8 +948,7 @@ discard block |
||
971 | 948 | * |
972 | 949 | * @return array Properties to be serialized |
973 | 950 | */ |
974 | - public function __sleep() |
|
975 | - { |
|
951 | + public function __sleep() { |
|
976 | 952 | // \SimpleXMLElement objects can't be serialized, thus save the XML as string for serialization |
977 | 953 | $this->asXML = $this->xml->asXML(); |
978 | 954 | return ['uid', 'pid', 'recordId', 'parentId', 'asXML']; |
@@ -985,8 +961,7 @@ discard block |
||
985 | 961 | * |
986 | 962 | * @return string String representing the METS object |
987 | 963 | */ |
988 | - public function __toString() |
|
989 | - { |
|
964 | + public function __toString() { |
|
990 | 965 | $xml = new \DOMDocument('1.0', 'utf-8'); |
991 | 966 | $xml->appendChild($xml->importNode(dom_import_simplexml($this->mets), TRUE)); |
992 | 967 | $xml->formatOutput = TRUE; |
@@ -1001,8 +976,7 @@ discard block |
||
1001 | 976 | * |
1002 | 977 | * @return void |
1003 | 978 | */ |
1004 | - public function __wakeup() |
|
1005 | - { |
|
979 | + public function __wakeup() { |
|
1006 | 980 | // Turn off libxml's error logging. |
1007 | 981 | $libxmlErrors = libxml_use_internal_errors(TRUE); |
1008 | 982 | // Reload XML from string. |
@@ -113,10 +113,10 @@ discard block |
||
113 | 113 | $result = $GLOBALS['TYPO3_DB']->exec_SELECTquery( |
114 | 114 | 'tx_dlf_metadataformat.xpath AS querypath', |
115 | 115 | 'tx_dlf_metadata,tx_dlf_metadataformat,tx_dlf_formats', |
116 | - 'tx_dlf_metadata.pid=' . intval($pid) |
|
117 | - . ' AND tx_dlf_metadataformat.pid=' . intval($pid) |
|
116 | + 'tx_dlf_metadata.pid='.intval($pid) |
|
117 | + . ' AND tx_dlf_metadataformat.pid='.intval($pid) |
|
118 | 118 | . ' AND ((tx_dlf_metadata.uid=tx_dlf_metadataformat.parent_id AND tx_dlf_metadataformat.encoded=tx_dlf_formats.uid' |
119 | - . ' AND tx_dlf_metadata.index_name="record_id" AND tx_dlf_formats.type=' . $GLOBALS['TYPO3_DB']->fullQuoteStr($this->getIiifVersion(), 'tx_dlf_formats') . ') OR tx_dlf_metadata.format=0)' |
|
119 | + . ' AND tx_dlf_metadata.index_name="record_id" AND tx_dlf_formats.type='.$GLOBALS['TYPO3_DB']->fullQuoteStr($this->getIiifVersion(), 'tx_dlf_formats').') OR tx_dlf_metadata.format=0)' |
|
120 | 120 | . Helper::whereClause('tx_dlf_metadata', TRUE) |
121 | 121 | . Helper::whereClause('tx_dlf_metadataformat') |
122 | 122 | . Helper::whereClause('tx_dlf_formats') |
@@ -620,10 +620,10 @@ discard block |
||
620 | 620 | $result = $GLOBALS['TYPO3_DB']->exec_SELECTquery( |
621 | 621 | 'tx_dlf_metadata.index_name AS index_name,tx_dlf_metadataformat.xpath AS xpath,tx_dlf_metadataformat.xpath_sorting AS xpath_sorting,tx_dlf_metadata.is_sortable AS is_sortable,tx_dlf_metadata.default_value AS default_value,tx_dlf_metadata.format AS format', |
622 | 622 | 'tx_dlf_metadata,tx_dlf_metadataformat,tx_dlf_formats', |
623 | - 'tx_dlf_metadata.pid=' . intval($cPid) |
|
624 | - . ' AND tx_dlf_metadataformat.pid=' . intval($cPid) |
|
625 | - . ' AND ((tx_dlf_metadata.uid=tx_dlf_metadataformat.parent_id AND tx_dlf_metadataformat.encoded=tx_dlf_formats.uid AND tx_dlf_formats.type=' . $GLOBALS['TYPO3_DB']->fullQuoteStr($this->getIiifVersion(), 'tx_dlf_formats') . ') OR tx_dlf_metadata.format=0)' |
|
626 | - . Helper::whereClause('tx_dlf_metadata', TRUE) . Helper::whereClause('tx_dlf_metadataformat') . Helper::whereClause('tx_dlf_formats') |
|
623 | + 'tx_dlf_metadata.pid='.intval($cPid) |
|
624 | + . ' AND tx_dlf_metadataformat.pid='.intval($cPid) |
|
625 | + . ' AND ((tx_dlf_metadata.uid=tx_dlf_metadataformat.parent_id AND tx_dlf_metadataformat.encoded=tx_dlf_formats.uid AND tx_dlf_formats.type='.$GLOBALS['TYPO3_DB']->fullQuoteStr($this->getIiifVersion(), 'tx_dlf_formats').') OR tx_dlf_metadata.format=0)' |
|
626 | + . Helper::whereClause('tx_dlf_metadata', TRUE).Helper::whereClause('tx_dlf_metadataformat').Helper::whereClause('tx_dlf_formats') |
|
627 | 627 | ); |
628 | 628 | $iiifResource = $this->iiif->getContainedResourceById($id); |
629 | 629 | while ($resArray = $GLOBALS['TYPO3_DB']->sql_fetch_assoc($result)) { |
@@ -649,16 +649,16 @@ discard block |
||
649 | 649 | && ($values = $iiifResource->jsonPath($resArray['xpath_sorting']) != NULL) |
650 | 650 | ) { |
651 | 651 | if ($values instanceof string) { |
652 | - $metadata[$resArray['index_name'] . '_sorting'][0] = [trim((string) $values)]; |
|
652 | + $metadata[$resArray['index_name'].'_sorting'][0] = [trim((string) $values)]; |
|
653 | 653 | } elseif ($values instanceof JSONPath && is_array($values->data()) && count($values->data() > 1)) { |
654 | 654 | $metadata[$resArray['index_name']] = []; |
655 | 655 | foreach ($values->data() as $value) { |
656 | - $metadata[$resArray['index_name'] . '_sorting'][0] = trim((string) $value); |
|
656 | + $metadata[$resArray['index_name'].'_sorting'][0] = trim((string) $value); |
|
657 | 657 | } |
658 | 658 | } |
659 | 659 | } |
660 | - if (empty($metadata[$resArray['index_name'] . '_sorting'][0])) { |
|
661 | - $metadata[$resArray['index_name'] . '_sorting'][0] = $metadata[$resArray['index_name']][0]; |
|
660 | + if (empty($metadata[$resArray['index_name'].'_sorting'][0])) { |
|
661 | + $metadata[$resArray['index_name'].'_sorting'][0] = $metadata[$resArray['index_name']][0]; |
|
662 | 662 | } |
663 | 663 | } |
664 | 664 | } |
@@ -782,7 +782,7 @@ discard block |
||
782 | 782 | } |
783 | 783 | } |
784 | 784 | } else { |
785 | - Helper::devLog('Invalid structure resource @id "' . $id . '"', DEVLOG_SEVERITY_WARNING); |
|
785 | + Helper::devLog('Invalid structure resource @id "'.$id.'"', DEVLOG_SEVERITY_WARNING); |
|
786 | 786 | return $rawText; |
787 | 787 | } |
788 | 788 | $this->rawTextArray[$id] = $rawText; |
@@ -829,7 +829,7 @@ discard block |
||
829 | 829 | return TRUE; |
830 | 830 | } |
831 | 831 | } else { |
832 | - Helper::devLog('Could not load IIIF manifest from "' . $location . '"', self::$extKey, SYSLOG_SEVERITY_ERROR); |
|
832 | + Helper::devLog('Could not load IIIF manifest from "'.$location.'"', self::$extKey, SYSLOG_SEVERITY_ERROR); |
|
833 | 833 | } |
834 | 834 | } |
835 | 835 |
@@ -38,8 +38,7 @@ discard block |
||
38 | 38 | * @subpackage tx_dlf |
39 | 39 | * @access public |
40 | 40 | */ |
41 | -final class IiifManifest extends Document |
|
42 | -{ |
|
41 | +final class IiifManifest extends Document { |
|
43 | 42 | /** |
44 | 43 | * This holds the manifest file as string for serialization purposes |
45 | 44 | * @see __sleep() / __wakeup() |
@@ -100,8 +99,7 @@ discard block |
||
100 | 99 | * {@inheritDoc} |
101 | 100 | * @see Document::establishRecordId() |
102 | 101 | */ |
103 | - protected function establishRecordId($pid) |
|
104 | - { |
|
102 | + protected function establishRecordId($pid) { |
|
105 | 103 | if ($this->iiif !== NULL) { |
106 | 104 | /* |
107 | 105 | * FIXME This will not consistently work because we can not be sure to have the pid at hand. It may miss |
@@ -141,8 +139,7 @@ discard block |
||
141 | 139 | * {@inheritDoc} |
142 | 140 | * @see Document::getDocument() |
143 | 141 | */ |
144 | - protected function getDocument() |
|
145 | - { |
|
142 | + protected function getDocument() { |
|
146 | 143 | return $this->iiif; |
147 | 144 | } |
148 | 145 | |
@@ -155,8 +152,7 @@ discard block |
||
155 | 152 | * @return string 'IIIF1' if the resource is a Metadata API 1 resource, 'IIIF2' / 'IIIF3' if |
156 | 153 | * the resource is a Presentation API 2 / 3 resource |
157 | 154 | */ |
158 | - public function getIiifVersion() |
|
159 | - { |
|
155 | + public function getIiifVersion() { |
|
160 | 156 | if (!isset($this->iiifVersion)) { |
161 | 157 | if ($this->iiif instanceof AbstractIiifResource1) { |
162 | 158 | $this->iiifVersion = 'IIIF1'; |
@@ -197,8 +193,7 @@ discard block |
||
197 | 193 | * |
198 | 194 | * @return array|string |
199 | 195 | */ |
200 | - protected function getUseGroups($use) |
|
201 | - { |
|
196 | + protected function getUseGroups($use) { |
|
202 | 197 | if (!$this->useGrpsLoaded) { |
203 | 198 | // Get configured USE attributes. |
204 | 199 | $extConf = unserialize($GLOBALS['TYPO3_CONF_VARS']['EXT']['extConf'][self::$extKey]); |
@@ -225,8 +220,7 @@ discard block |
||
225 | 220 | * {@inheritDoc} |
226 | 221 | * @see Document::_getPhysicalStructure() |
227 | 222 | */ |
228 | - protected function _getPhysicalStructure() |
|
229 | - { |
|
223 | + protected function _getPhysicalStructure() { |
|
230 | 224 | // Is there no physical structure array yet? |
231 | 225 | if (!$this->physicalStructureLoaded) { |
232 | 226 | if ($this->iiif == NULL || !($this->iiif instanceof ManifestInterface)) { |
@@ -347,8 +341,7 @@ discard block |
||
347 | 341 | * {@inheritDoc} |
348 | 342 | * @see Document::getDownloadLocation() |
349 | 343 | */ |
350 | - public function getDownloadLocation($id) |
|
351 | - { |
|
344 | + public function getDownloadLocation($id) { |
|
352 | 345 | $fileLocation = $this->getFileLocation($id); |
353 | 346 | $resource = $this->iiif->getContainedResourceById($fileLocation); |
354 | 347 | if ($resource instanceof AbstractImageService) { |
@@ -361,8 +354,7 @@ discard block |
||
361 | 354 | * {@inheritDoc} |
362 | 355 | * @see Document::getFileLocation() |
363 | 356 | */ |
364 | - public function getFileLocation($id) |
|
365 | - { |
|
357 | + public function getFileLocation($id) { |
|
366 | 358 | if ($id == NULL) { |
367 | 359 | return NULL; |
368 | 360 | } |
@@ -386,8 +378,7 @@ discard block |
||
386 | 378 | * {@inheritDoc} |
387 | 379 | * @see Document::getFileMimeType() |
388 | 380 | */ |
389 | - public function getFileMimeType($id) |
|
390 | - { |
|
381 | + public function getFileMimeType($id) { |
|
391 | 382 | $fileResource = $this->iiif->getContainedResourceById($id); |
392 | 383 | if ($fileResource instanceof CanvasInterface) { |
393 | 384 | $format = "application/vnd.kitodo.iiif"; |
@@ -412,8 +403,7 @@ discard block |
||
412 | 403 | * {@inheritDoc} |
413 | 404 | * @see Document::getLogicalStructure() |
414 | 405 | */ |
415 | - public function getLogicalStructure($id, $recursive = FALSE) |
|
416 | - { |
|
406 | + public function getLogicalStructure($id, $recursive = FALSE) { |
|
417 | 407 | $details = []; |
418 | 408 | if (!$recursive && !empty($this->logicalUnits[$id])) { |
419 | 409 | return $this->logicalUnits[$id]; |
@@ -448,8 +438,7 @@ discard block |
||
448 | 438 | * @param array $processedStructures: IIIF resources that already have been processed |
449 | 439 | * @return array Logical structure array |
450 | 440 | */ |
451 | - protected function getLogicalStructureInfo(IiifResourceInterface $resource, $recursive = FALSE, &$processedStructures = []) |
|
452 | - { |
|
441 | + protected function getLogicalStructureInfo(IiifResourceInterface $resource, $recursive = FALSE, &$processedStructures = []) { |
|
453 | 442 | $details = []; |
454 | 443 | $details['id'] = $resource->getId(); |
455 | 444 | $details['dmdId'] = ''; |
@@ -541,8 +530,7 @@ discard block |
||
541 | 530 | * |
542 | 531 | * @todo This method is still in experimental; the method signature may change. |
543 | 532 | */ |
544 | - public function getManifestMetadata($id, $cPid = 0, $withDescription = TRUE, $withRights = TRUE, $withRelated = TRUE) |
|
545 | - { |
|
533 | + public function getManifestMetadata($id, $cPid = 0, $withDescription = TRUE, $withRights = TRUE, $withRelated = TRUE) { |
|
546 | 534 | if (!empty($this->originalMetadataArray[$id])) { |
547 | 535 | return $this->originalMetadataArray[$id]; |
548 | 536 | } |
@@ -584,8 +572,7 @@ discard block |
||
584 | 572 | * {@inheritDoc} |
585 | 573 | * @see Document::getMetadata() |
586 | 574 | */ |
587 | - public function getMetadata($id, $cPid = 0) |
|
588 | - { |
|
575 | + public function getMetadata($id, $cPid = 0) { |
|
589 | 576 | if (!empty($this->metadataArray[$id]) && $this->metadataArray[0] == $cPid) { |
590 | 577 | return $this->metadataArray[$id]; |
591 | 578 | } |
@@ -669,8 +656,7 @@ discard block |
||
669 | 656 | * {@inheritDoc} |
670 | 657 | * @see Document::_getSmLinks() |
671 | 658 | */ |
672 | - protected function _getSmLinks() |
|
673 | - { |
|
659 | + protected function _getSmLinks() { |
|
674 | 660 | if (!$this->smLinksLoaded && isset($this->iiif) && $this->iiif instanceof ManifestInterface) { |
675 | 661 | if (!empty($this->iiif->getDefaultCanvases())) { |
676 | 662 | foreach ($this->iiif->getDefaultCanvases() as $canvas) { |
@@ -694,8 +680,7 @@ discard block |
||
694 | 680 | * |
695 | 681 | * @param RangeInterface $range: Current range whose canvases shall be linked |
696 | 682 | */ |
697 | - private function smLinkRangeCanvasesRecursively(RangeInterface $range) |
|
698 | - { |
|
683 | + private function smLinkRangeCanvasesRecursively(RangeInterface $range) { |
|
699 | 684 | // map range's canvases including all child ranges' canvases |
700 | 685 | if (!$range->isTopRange()) { |
701 | 686 | foreach ($range->getAllCanvasesRecursively() as $canvas) { |
@@ -718,8 +703,7 @@ discard block |
||
718 | 703 | * @param CanvasInterface $canvas |
719 | 704 | * @param IiifResourceInterface $resource |
720 | 705 | */ |
721 | - private function smLinkCanvasToResource(CanvasInterface $canvas, IiifResourceInterface $resource) |
|
722 | - { |
|
706 | + private function smLinkCanvasToResource(CanvasInterface $canvas, IiifResourceInterface $resource) { |
|
723 | 707 | $this->smLinks['l2p'][$resource->getId()][] = $canvas->getId(); |
724 | 708 | if (!is_array($this->smLinks['p2l'][$canvas->getId()]) || !in_array($resource->getId(), $this->smLinks['p2l'][$canvas->getId()])) { |
725 | 709 | $this->smLinks['p2l'][$canvas->getId()][] = $resource->getId(); |
@@ -734,8 +718,7 @@ discard block |
||
734 | 718 | * |
735 | 719 | * @see Document::getParentDocumentUidForSaving() |
736 | 720 | */ |
737 | - protected function getParentDocumentUidForSaving($pid, $core) |
|
738 | - { |
|
721 | + protected function getParentDocumentUidForSaving($pid, $core) { |
|
739 | 722 | // Do nothing. |
740 | 723 | } |
741 | 724 | |
@@ -743,8 +726,7 @@ discard block |
||
743 | 726 | * {@inheritDoc} |
744 | 727 | * @see Document::getRawText() |
745 | 728 | */ |
746 | - public function getRawText($id) |
|
747 | - { |
|
729 | + public function getRawText($id) { |
|
748 | 730 | $rawText = ''; |
749 | 731 | // Get text from raw text array if available. |
750 | 732 | if (!empty($this->rawTextArray[$id])) { |
@@ -797,8 +779,7 @@ discard block |
||
797 | 779 | * |
798 | 780 | * @return IiifResourceInterface |
799 | 781 | */ |
800 | - public function getIiif() |
|
801 | - { |
|
782 | + public function getIiif() { |
|
802 | 783 | return $this->iiif; |
803 | 784 | } |
804 | 785 | |
@@ -806,8 +787,7 @@ discard block |
||
806 | 787 | * {@inheritDoc} |
807 | 788 | * @see Document::init() |
808 | 789 | */ |
809 | - protected function init() |
|
810 | - { |
|
790 | + protected function init() { |
|
811 | 791 | // Nothing to do here, at the moment |
812 | 792 | } |
813 | 793 | |
@@ -815,8 +795,7 @@ discard block |
||
815 | 795 | * {@inheritDoc} |
816 | 796 | * @see Document::loadLocation() |
817 | 797 | */ |
818 | - protected function loadLocation($location) |
|
819 | - { |
|
798 | + protected function loadLocation($location) { |
|
820 | 799 | $content = GeneralUtility::getUrl($location); |
821 | 800 | $conf = unserialize($GLOBALS['TYPO3_CONF_VARS']['EXT']['extConf'][self::$extKey]); |
822 | 801 | IiifHelper::setUrlReader(IiifUrlReader::getInstance()); |
@@ -837,8 +816,7 @@ discard block |
||
837 | 816 | * {@inheritDoc} |
838 | 817 | * @see \Kitodo\Dlf\Common\Document::prepareMetadataArray() |
839 | 818 | */ |
840 | - protected function prepareMetadataArray($cPid) |
|
841 | - { |
|
819 | + protected function prepareMetadataArray($cPid) { |
|
842 | 820 | $id = $this->iiif->getId(); |
843 | 821 | $this->metadataArray[(string) $id] = $this->getMetadata((string) $id, $cPid); |
844 | 822 | } |
@@ -847,8 +825,7 @@ discard block |
||
847 | 825 | * {@inheritDoc} |
848 | 826 | * @see Document::setPreloadedDocument() |
849 | 827 | */ |
850 | - protected function setPreloadedDocument($preloadedDocument) |
|
851 | - { |
|
828 | + protected function setPreloadedDocument($preloadedDocument) { |
|
852 | 829 | if ($preloadedDocument instanceof ManifestInterface) { |
853 | 830 | $this->iiif = $preloadedDocument; |
854 | 831 | return TRUE; |
@@ -860,8 +837,7 @@ discard block |
||
860 | 837 | * {@inheritDoc} |
861 | 838 | * @see Document::ensureHasFulltextIsSet() |
862 | 839 | */ |
863 | - protected function ensureHasFulltextIsSet() |
|
864 | - { |
|
840 | + protected function ensureHasFulltextIsSet() { |
|
865 | 841 | /* |
866 | 842 | * TODO Check annotations and annotation lists of canvas for ALTO documents. |
867 | 843 | * Example: |
@@ -907,8 +883,7 @@ discard block |
||
907 | 883 | * {@inheritDoc} |
908 | 884 | * @see \Kitodo\Dlf\Common\Document::_getThumbnail() |
909 | 885 | */ |
910 | - protected function _getThumbnail($forceReload = FALSE) |
|
911 | - { |
|
886 | + protected function _getThumbnail($forceReload = FALSE) { |
|
912 | 887 | return $this->iiif->getThumbnailUrl(); |
913 | 888 | } |
914 | 889 | |
@@ -916,8 +891,7 @@ discard block |
||
916 | 891 | * {@inheritDoc} |
917 | 892 | * @see \Kitodo\Dlf\Common\Document::_getToplevelId() |
918 | 893 | */ |
919 | - protected function _getToplevelId() |
|
920 | - { |
|
894 | + protected function _getToplevelId() { |
|
921 | 895 | if (empty($this->toplevelId)) { |
922 | 896 | if (isset($this->iiif)) { |
923 | 897 | $this->toplevelId = $this->iiif->getId(); |
@@ -934,8 +908,7 @@ discard block |
||
934 | 908 | * |
935 | 909 | * @return void |
936 | 910 | */ |
937 | - public function __wakeup() |
|
938 | - { |
|
911 | + public function __wakeup() { |
|
939 | 912 | $conf = unserialize($GLOBALS['TYPO3_CONF_VARS']['EXT']['extConf'][self::$extKey]); |
940 | 913 | IiifHelper::setUrlReader(IiifUrlReader::getInstance()); |
941 | 914 | IiifHelper::setMaxThumbnailHeight($conf['iiifThumbnailHeight']); |
@@ -954,8 +927,7 @@ discard block |
||
954 | 927 | * |
955 | 928 | * @return string[] |
956 | 929 | */ |
957 | - public function __sleep() |
|
958 | - { |
|
930 | + public function __sleep() { |
|
959 | 931 | // TODO implement serializiation in IIIF library |
960 | 932 | $jsonArray = $this->iiif->getOriginalJsonArray(); |
961 | 933 | $this->asJson = json_encode($jsonArray); |