@@ -192,14 +192,12 @@ discard block |
||
| 192 | 192 | /** |
| 193 | 193 | * constructor |
| 194 | 194 | */ |
| 195 | - public function __construct() |
|
| 196 | - { |
|
| 195 | + public function __construct() { |
|
| 197 | 196 | // Do not remove the next line: It would break the functionality |
| 198 | 197 | $this->initStorageObjects(); |
| 199 | 198 | } |
| 200 | 199 | |
| 201 | - protected function initStorageObjects() |
|
| 202 | - { |
|
| 200 | + protected function initStorageObjects() { |
|
| 203 | 201 | $this->collections = new ObjectStorage(); |
| 204 | 202 | } |
| 205 | 203 | |
@@ -577,8 +575,7 @@ discard block |
||
| 577 | 575 | * |
| 578 | 576 | * @return \TYPO3\CMS\Extbase\Persistence\ObjectStorage<\Kitodo\Dlf\Domain\Model\Collection> $collections |
| 579 | 577 | */ |
| 580 | - public function getCollections() |
|
| 581 | - { |
|
| 578 | + public function getCollections() { |
|
| 582 | 579 | return $this->collections; |
| 583 | 580 | } |
| 584 | 581 | |
@@ -607,8 +604,7 @@ discard block |
||
| 607 | 604 | * |
| 608 | 605 | * @return \TYPO3\CMS\Extbase\Persistence\ObjectStorage<\Kitodo\Dlf\Domain\Model\Collection> collections |
| 609 | 606 | */ |
| 610 | - public function removeCollection(Collection $collection) |
|
| 611 | - { |
|
| 607 | + public function removeCollection(Collection $collection) { |
|
| 612 | 608 | $this->collections->detach($collection); |
| 613 | 609 | } |
| 614 | 610 | |
@@ -29,8 +29,7 @@ discard block |
||
| 29 | 29 | * @subpackage dlf |
| 30 | 30 | * @access public |
| 31 | 31 | */ |
| 32 | -class MetadataController extends AbstractController |
|
| 33 | -{ |
|
| 32 | +class MetadataController extends AbstractController { |
|
| 34 | 33 | /** |
| 35 | 34 | * @var CollectionRepository |
| 36 | 35 | */ |
@@ -39,8 +38,7 @@ discard block |
||
| 39 | 38 | /** |
| 40 | 39 | * @param CollectionRepository $collectionRepository |
| 41 | 40 | */ |
| 42 | - public function injectCollectionRepository(CollectionRepository $collectionRepository) |
|
| 43 | - { |
|
| 41 | + public function injectCollectionRepository(CollectionRepository $collectionRepository) { |
|
| 44 | 42 | $this->collectionRepository = $collectionRepository; |
| 45 | 43 | } |
| 46 | 44 | |
@@ -52,8 +50,7 @@ discard block |
||
| 52 | 50 | /** |
| 53 | 51 | * @param MetadataRepository $metadataRepository |
| 54 | 52 | */ |
| 55 | - public function injectMetadataRepository(MetadataRepository $metadataRepository) |
|
| 56 | - { |
|
| 53 | + public function injectMetadataRepository(MetadataRepository $metadataRepository) { |
|
| 57 | 54 | $this->metadataRepository = $metadataRepository; |
| 58 | 55 | } |
| 59 | 56 | |
@@ -65,16 +62,14 @@ discard block |
||
| 65 | 62 | /** |
| 66 | 63 | * @param StructureRepository $structureRepository |
| 67 | 64 | */ |
| 68 | - public function injectStructureRepository(StructureRepository $structureRepository) |
|
| 69 | - { |
|
| 65 | + public function injectStructureRepository(StructureRepository $structureRepository) { |
|
| 70 | 66 | $this->structureRepository = $structureRepository; |
| 71 | 67 | } |
| 72 | 68 | |
| 73 | 69 | /** |
| 74 | 70 | * @return string|void |
| 75 | 71 | */ |
| 76 | - public function mainAction() |
|
| 77 | - { |
|
| 72 | + public function mainAction() { |
|
| 78 | 73 | $this->cObj = $this->configurationManager->getContentObject(); |
| 79 | 74 | |
| 80 | 75 | // Load current document. |
@@ -130,8 +125,7 @@ discard block |
||
| 130 | 125 | * |
| 131 | 126 | * @return string The metadata array ready for output |
| 132 | 127 | */ |
| 133 | - protected function printMetadata(array $metadataArray, $useOriginalIiifManifestMetadata = false) |
|
| 134 | - { |
|
| 128 | + protected function printMetadata(array $metadataArray, $useOriginalIiifManifestMetadata = false) { |
|
| 135 | 129 | if ($useOriginalIiifManifestMetadata) { |
| 136 | 130 | $iiifData = []; |
| 137 | 131 | foreach ($metadataArray as $metadata) { |
@@ -250,8 +244,7 @@ discard block |
||
| 250 | 244 | } |
| 251 | 245 | |
| 252 | 246 | if (is_array($metadataArray[$i][$metadataName])) { |
| 253 | - $metadataArray[$i][$metadataName] = array_values(array_filter($metadataArray[$i][$metadataName], function($value) |
|
| 254 | - { |
|
| 247 | + $metadataArray[$i][$metadataName] = array_values(array_filter($metadataArray[$i][$metadataName], function($value) { |
|
| 255 | 248 | return !empty($value); |
| 256 | 249 | })); |
| 257 | 250 | } |
@@ -273,8 +266,7 @@ discard block |
||
| 273 | 266 | * |
| 274 | 267 | * @return array metadata |
| 275 | 268 | */ |
| 276 | - private function getMetadata() |
|
| 277 | - { |
|
| 269 | + private function getMetadata() { |
|
| 278 | 270 | $metadata = []; |
| 279 | 271 | if ($this->settings['rootline'] < 2) { |
| 280 | 272 | // Get current structure's @ID. |
@@ -312,8 +304,7 @@ discard block |
||
| 312 | 304 | * |
| 313 | 305 | * @return array metadata |
| 314 | 306 | */ |
| 315 | - private function getMetadataForIds($id, $metadata) |
|
| 316 | - { |
|
| 307 | + private function getMetadataForIds($id, $metadata) { |
|
| 317 | 308 | $useOriginalIiifManifestMetadata = $this->settings['originalIiifMetadata'] == 1 && $this->document->getDoc() instanceof IiifManifest; |
| 318 | 309 | foreach ($id as $sid) { |
| 319 | 310 | if ($useOriginalIiifManifestMetadata) { |
@@ -23,8 +23,7 @@ discard block |
||
| 23 | 23 | * @subpackage dlf |
| 24 | 24 | * @access public |
| 25 | 25 | */ |
| 26 | -class TableOfContentsController extends AbstractController |
|
| 27 | -{ |
|
| 26 | +class TableOfContentsController extends AbstractController { |
|
| 28 | 27 | /** |
| 29 | 28 | * This holds the active entries according to the currently selected page |
| 30 | 29 | * |
@@ -43,8 +42,7 @@ discard block |
||
| 43 | 42 | * |
| 44 | 43 | * @return array HMENU array for menu entry |
| 45 | 44 | */ |
| 46 | - protected function getMenuEntry(array $entry, $recursive = false) |
|
| 47 | - { |
|
| 45 | + protected function getMenuEntry(array $entry, $recursive = false) { |
|
| 48 | 46 | $entryArray = []; |
| 49 | 47 | // Set "title", "volume", "type" and "pagination" from $entry array. |
| 50 | 48 | $entryArray['title'] = !empty($entry['label']) ? $entry['label'] : $entry['orderlabel']; |
@@ -131,8 +129,7 @@ discard block |
||
| 131 | 129 | * |
| 132 | 130 | * @return void |
| 133 | 131 | */ |
| 134 | - public function mainAction() |
|
| 135 | - { |
|
| 132 | + public function mainAction() { |
|
| 136 | 133 | $this->view->assign('toc', $this->makeMenuArray()); |
| 137 | 134 | } |
| 138 | 135 | |
@@ -142,8 +139,7 @@ discard block |
||
| 142 | 139 | * @access public |
| 143 | 140 | * @return array HMENU array |
| 144 | 141 | */ |
| 145 | - public function makeMenuArray() |
|
| 146 | - { |
|
| 142 | + public function makeMenuArray() { |
|
| 147 | 143 | // Load current document. |
| 148 | 144 | $this->loadDocument($this->requestData); |
| 149 | 145 | if ( |
@@ -44,8 +44,7 @@ discard block |
||
| 44 | 44 | /** |
| 45 | 45 | * @param DocumentRepository $documentRepository |
| 46 | 46 | */ |
| 47 | - public function injectDocumentRepository(DocumentRepository $documentRepository) |
|
| 48 | - { |
|
| 47 | + public function injectDocumentRepository(DocumentRepository $documentRepository) { |
|
| 49 | 48 | $this->documentRepository = $documentRepository; |
| 50 | 49 | } |
| 51 | 50 | |
@@ -85,8 +84,7 @@ discard block |
||
| 85 | 84 | * @access protected |
| 86 | 85 | * @return void |
| 87 | 86 | */ |
| 88 | - protected function initialize() |
|
| 89 | - { |
|
| 87 | + protected function initialize() { |
|
| 90 | 88 | $this->requestData = GeneralUtility::_GPmerged('tx_dlf'); |
| 91 | 89 | if (empty($this->requestData['page'])) { |
| 92 | 90 | $this->requestData['page'] = 1; |
@@ -112,8 +110,7 @@ discard block |
||
| 112 | 110 | * |
| 113 | 111 | * @return void |
| 114 | 112 | */ |
| 115 | - protected function loadDocument($requestData) |
|
| 116 | - { |
|
| 113 | + protected function loadDocument($requestData) { |
|
| 117 | 114 | // Try to get document format from database |
| 118 | 115 | if (!empty($requestData['id'])) { |
| 119 | 116 | |
@@ -186,8 +183,7 @@ discard block |
||
| 186 | 183 | * |
| 187 | 184 | * @return null|string|array |
| 188 | 185 | */ |
| 189 | - protected function getParametersSafely($parameterName) |
|
| 190 | - { |
|
| 186 | + protected function getParametersSafely($parameterName) { |
|
| 191 | 187 | if ($this->request->hasArgument($parameterName)) { |
| 192 | 188 | return $this->request->getArgument($parameterName); |
| 193 | 189 | } |
@@ -201,8 +197,7 @@ discard block |
||
| 201 | 197 | * |
| 202 | 198 | * @return void |
| 203 | 199 | */ |
| 204 | - public function __construct() |
|
| 205 | - { |
|
| 200 | + public function __construct() { |
|
| 206 | 201 | $this->initialize(); |
| 207 | 202 | } |
| 208 | 203 | } |
@@ -32,8 +32,7 @@ |
||
| 32 | 32 | * |
| 33 | 33 | * @return void |
| 34 | 34 | */ |
| 35 | - public function extractMetadata(\SimpleXMLElement $xml, array &$metadata) |
|
| 36 | - { |
|
| 35 | + public function extractMetadata(\SimpleXMLElement $xml, array &$metadata) { |
|
| 37 | 36 | $xml->registerXPathNamespace('teihdr', 'http://www.tei-c.org/ns/1.0'); |
| 38 | 37 | } |
| 39 | 38 | } |
@@ -33,8 +33,7 @@ discard block |
||
| 33 | 33 | * |
| 34 | 34 | * @return string The raw unformatted fulltext |
| 35 | 35 | */ |
| 36 | - public function getRawText(\SimpleXMLElement $xml) |
|
| 37 | - { |
|
| 36 | + public function getRawText(\SimpleXMLElement $xml) { |
|
| 38 | 37 | $rawText = ''; |
| 39 | 38 | $xml->registerXPathNamespace('alto', 'http://www.loc.gov/standards/alto/ns-v2#'); |
| 40 | 39 | // Get all (presumed) words of the text. |
@@ -54,8 +53,7 @@ discard block |
||
| 54 | 53 | * |
| 55 | 54 | * @return string The unformatted fulltext in MiniOCR format |
| 56 | 55 | */ |
| 57 | - public function getTextAsMiniOcr(\SimpleXMLElement $xml) |
|
| 58 | - { |
|
| 56 | + public function getTextAsMiniOcr(\SimpleXMLElement $xml) { |
|
| 59 | 57 | $xml->registerXPathNamespace('alto', 'http://www.loc.gov/standards/alto/ns-v2#'); |
| 60 | 58 | |
| 61 | 59 | // get all text blocks |
@@ -99,8 +97,7 @@ discard block |
||
| 99 | 97 | * |
| 100 | 98 | * @return string The parsed word extracted from attribute |
| 101 | 99 | */ |
| 102 | - private function getWord($attributes) |
|
| 103 | - { |
|
| 100 | + private function getWord($attributes) { |
|
| 104 | 101 | return htmlspecialchars((string) $attributes['CONTENT']) . ' '; |
| 105 | 102 | } |
| 106 | 103 | |
@@ -113,8 +110,7 @@ discard block |
||
| 113 | 110 | * |
| 114 | 111 | * @return string The parsed word coordinates extracted from attribute |
| 115 | 112 | */ |
| 116 | - private function getCoordinates($attributes) |
|
| 117 | - { |
|
| 113 | + private function getCoordinates($attributes) { |
|
| 118 | 114 | return (string) $attributes['HPOS'] . ' ' . (string) $attributes['VPOS'] . ' ' . (string) $attributes['WIDTH'] . ' ' . (string) $attributes['HEIGHT']; |
| 119 | 115 | } |
| 120 | 116 | } |
@@ -32,8 +32,7 @@ |
||
| 32 | 32 | * |
| 33 | 33 | * @return void |
| 34 | 34 | */ |
| 35 | - public function extractMetadata(\SimpleXMLElement $xml, array &$metadata) |
|
| 36 | - { |
|
| 35 | + public function extractMetadata(\SimpleXMLElement $xml, array &$metadata) { |
|
| 37 | 36 | $xml->registerXPathNamespace('mods', 'http://www.loc.gov/mods/v3'); |
| 38 | 37 | // Get "author" and "author_sorting". |
| 39 | 38 | $authors = $xml->xpath('./mods:name[./mods:role/mods:roleTerm[@type="code" and @authority="marcrelator"]="aut"]'); |
@@ -44,8 +44,7 @@ discard block |
||
| 44 | 44 | * @subpackage dlf |
| 45 | 45 | * @access public |
| 46 | 46 | */ |
| 47 | -class NewTenantController extends AbstractController |
|
| 48 | -{ |
|
| 47 | +class NewTenantController extends AbstractController { |
|
| 49 | 48 | /** |
| 50 | 49 | * @var int |
| 51 | 50 | */ |
@@ -85,8 +84,7 @@ discard block |
||
| 85 | 84 | /** |
| 86 | 85 | * @param FormatRepository $formatRepository |
| 87 | 86 | */ |
| 88 | - public function injectFormatRepository(FormatRepository $formatRepository) |
|
| 89 | - { |
|
| 87 | + public function injectFormatRepository(FormatRepository $formatRepository) { |
|
| 90 | 88 | $this->formatRepository = $formatRepository; |
| 91 | 89 | } |
| 92 | 90 | |
@@ -98,8 +96,7 @@ discard block |
||
| 98 | 96 | /** |
| 99 | 97 | * @param MetadataRepository $metadataRepository |
| 100 | 98 | */ |
| 101 | - public function injectMetadataRepository(MetadataRepository $metadataRepository) |
|
| 102 | - { |
|
| 99 | + public function injectMetadataRepository(MetadataRepository $metadataRepository) { |
|
| 103 | 100 | $this->metadataRepository = $metadataRepository; |
| 104 | 101 | } |
| 105 | 102 | |
@@ -111,8 +108,7 @@ discard block |
||
| 111 | 108 | /** |
| 112 | 109 | * @param StructureRepository $structureRepository |
| 113 | 110 | */ |
| 114 | - public function injectStructureRepository(StructureRepository $structureRepository) |
|
| 115 | - { |
|
| 111 | + public function injectStructureRepository(StructureRepository $structureRepository) { |
|
| 116 | 112 | $this->structureRepository = $structureRepository; |
| 117 | 113 | } |
| 118 | 114 | |
@@ -124,8 +120,7 @@ discard block |
||
| 124 | 120 | /** |
| 125 | 121 | * @param SolrCoreRepository $solrCoreRepository |
| 126 | 122 | */ |
| 127 | - public function injectSolrCoreRepository(SolrCoreRepository $solrCoreRepository) |
|
| 128 | - { |
|
| 123 | + public function injectSolrCoreRepository(SolrCoreRepository $solrCoreRepository) { |
|
| 129 | 124 | $this->solrCoreRepository = $solrCoreRepository; |
| 130 | 125 | } |
| 131 | 126 | |
@@ -133,8 +128,7 @@ discard block |
||
| 133 | 128 | * Initialization for all actions |
| 134 | 129 | * |
| 135 | 130 | */ |
| 136 | - protected function initializeAction() |
|
| 137 | - { |
|
| 131 | + protected function initializeAction() { |
|
| 138 | 132 | $this->pid = (int) GeneralUtility::_GP('id'); |
| 139 | 133 | |
| 140 | 134 | $frameworkConfiguration = $this->configurationManager->getConfiguration($this->configurationManager::CONFIGURATION_TYPE_FRAMEWORK); |
@@ -155,8 +149,7 @@ discard block |
||
| 155 | 149 | /** |
| 156 | 150 | * Action adding formats records |
| 157 | 151 | */ |
| 158 | - public function addFormatAction() |
|
| 159 | - { |
|
| 152 | + public function addFormatAction() { |
|
| 160 | 153 | // Include formats definition file. |
| 161 | 154 | $formatsDefaults = include(ExtensionManagementUtility::extPath('dlf') . 'Resources/Private/Data/FormatDefaults.php'); |
| 162 | 155 | |
@@ -193,8 +186,7 @@ discard block |
||
| 193 | 186 | /** |
| 194 | 187 | * Action adding metadata records |
| 195 | 188 | */ |
| 196 | - public function addMetadataAction() |
|
| 197 | - { |
|
| 189 | + public function addMetadataAction() { |
|
| 198 | 190 | // Include metadata definition file. |
| 199 | 191 | $metadataDefaults = include(ExtensionManagementUtility::extPath('dlf') . 'Resources/Private/Data/MetadataDefaults.php'); |
| 200 | 192 | |
@@ -268,8 +260,7 @@ discard block |
||
| 268 | 260 | /** |
| 269 | 261 | * Action adding Solr core records |
| 270 | 262 | */ |
| 271 | - public function addSolrCoreAction() |
|
| 272 | - { |
|
| 263 | + public function addSolrCoreAction() { |
|
| 273 | 264 | $doPersist = false; |
| 274 | 265 | |
| 275 | 266 | // load language file in own array |
@@ -298,8 +289,7 @@ discard block |
||
| 298 | 289 | /** |
| 299 | 290 | * Action adding structure records |
| 300 | 291 | */ |
| 301 | - public function addStructureAction() |
|
| 302 | - { |
|
| 292 | + public function addStructureAction() { |
|
| 303 | 293 | // Include structure definition file. |
| 304 | 294 | $structureDefaults = include(ExtensionManagementUtility::extPath('dlf') . 'Resources/Private/Data/StructureDefaults.php'); |
| 305 | 295 | |
@@ -351,8 +341,7 @@ discard block |
||
| 351 | 341 | * @param ViewInterface $view |
| 352 | 342 | * @return void |
| 353 | 343 | */ |
| 354 | - protected function initializeView(ViewInterface $view) |
|
| 355 | - { |
|
| 344 | + protected function initializeView(ViewInterface $view) { |
|
| 356 | 345 | /** @var BackendTemplateView $view */ |
| 357 | 346 | parent::initializeView($view); |
| 358 | 347 | if ($this->actionMethodName == 'indexAction') { |
@@ -370,8 +359,7 @@ discard block |
||
| 370 | 359 | * @access public |
| 371 | 360 | * |
| 372 | 361 | */ |
| 373 | - public function indexAction() |
|
| 374 | - { |
|
| 362 | + public function indexAction() { |
|
| 375 | 363 | $recordInfos = []; |
| 376 | 364 | |
| 377 | 365 | if ($this->pageInfo['doktype'] != 254) { |
@@ -401,8 +389,7 @@ discard block |
||
| 401 | 389 | * @access public |
| 402 | 390 | * |
| 403 | 391 | */ |
| 404 | - public function errorAction() |
|
| 405 | - { |
|
| 392 | + public function errorAction() { |
|
| 406 | 393 | } |
| 407 | 394 | |
| 408 | 395 | /** |
@@ -414,8 +401,7 @@ discard block |
||
| 414 | 401 | * |
| 415 | 402 | * @access public |
| 416 | 403 | */ |
| 417 | - protected function getLLL($index, $lang, $langArray) |
|
| 418 | - { |
|
| 404 | + protected function getLLL($index, $lang, $langArray) { |
|
| 419 | 405 | if (isset($langArray[$lang][$index][0]['target'])) { |
| 420 | 406 | return $langArray[$lang][$index][0]['target']; |
| 421 | 407 | } else { |
@@ -28,16 +28,14 @@ discard block |
||
| 28 | 28 | * @subpackage dlf |
| 29 | 29 | * @access public |
| 30 | 30 | */ |
| 31 | -class SearchInDocument |
|
| 32 | -{ |
|
| 31 | +class SearchInDocument { |
|
| 33 | 32 | /** |
| 34 | 33 | * The main method of the eID script |
| 35 | 34 | * |
| 36 | 35 | * @param ServerRequestInterface $request |
| 37 | 36 | * @return ResponseInterface JSON response of search suggestions |
| 38 | 37 | */ |
| 39 | - public function main(ServerRequestInterface $request) |
|
| 40 | - { |
|
| 38 | + public function main(ServerRequestInterface $request) { |
|
| 41 | 39 | $output = [ |
| 42 | 40 | 'documents' => [], |
| 43 | 41 | 'numFound' => 0 |
@@ -118,8 +116,7 @@ discard block |
||
| 118 | 116 | * |
| 119 | 117 | * @return string SOLR query |
| 120 | 118 | */ |
| 121 | - private function getQuery($fields, $parameters) |
|
| 122 | - { |
|
| 119 | + private function getQuery($fields, $parameters) { |
|
| 123 | 120 | return $fields['fulltext'] . ':(' . Solr::escapeQuery((string) $parameters['q']) . ') AND ' . $fields['uid'] . ':' . $this->getUid($parameters['uid']); |
| 124 | 121 | } |
| 125 | 122 | |
@@ -133,8 +130,7 @@ discard block |
||
| 133 | 130 | * |
| 134 | 131 | * @return int|string uid of the document |
| 135 | 132 | */ |
| 136 | - private function getUid($uid) |
|
| 137 | - { |
|
| 133 | + private function getUid($uid) { |
|
| 138 | 134 | return is_numeric($uid) ? intval($uid) : $uid; |
| 139 | 135 | } |
| 140 | 136 | } |