@@ -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 $metadata, $useOriginalIiifManifestMetadata = false) |
|
134 | - { |
|
128 | + protected function printMetadata(array $metadata, $useOriginalIiifManifestMetadata = false) { |
|
135 | 129 | if ($useOriginalIiifManifestMetadata) { |
136 | 130 | $iiifData = []; |
137 | 131 | foreach ($metadata as $row) { |
@@ -269,8 +263,7 @@ discard block |
||
269 | 263 | } |
270 | 264 | |
271 | 265 | if (is_array($metadata[$i][$name])) { |
272 | - $metadata[$i][$name] = array_values(array_filter($metadata[$i][$name], function($metadataValue) |
|
273 | - { |
|
266 | + $metadata[$i][$name] = array_values(array_filter($metadata[$i][$name], function($metadataValue) { |
|
274 | 267 | return !empty($metadataValue); |
275 | 268 | })); |
276 | 269 | } |
@@ -294,8 +287,7 @@ discard block |
||
294 | 287 | * |
295 | 288 | * @return array metadata |
296 | 289 | */ |
297 | - private function getMetadata() |
|
298 | - { |
|
290 | + private function getMetadata() { |
|
299 | 291 | $metadata = []; |
300 | 292 | if ($this->settings['rootline'] < 2) { |
301 | 293 | // Get current structure's @ID. |
@@ -333,8 +325,7 @@ discard block |
||
333 | 325 | * |
334 | 326 | * @return array metadata |
335 | 327 | */ |
336 | - private function getMetadataForIds($id, $metadata) |
|
337 | - { |
|
328 | + private function getMetadataForIds($id, $metadata) { |
|
338 | 329 | $useOriginalIiifManifestMetadata = $this->settings['originalIiifMetadata'] == 1 && $this->document->getDoc() instanceof IiifManifest; |
339 | 330 | foreach ($id as $sid) { |
340 | 331 | if ($useOriginalIiifManifestMetadata) { |
@@ -50,8 +50,7 @@ discard block |
||
50 | 50 | * @property-read string $toplevelId This holds the toplevel structure's @ID (METS) or the manifest's @id (IIIF) |
51 | 51 | * @property-read string $parentHref URL of the parent document (determined via mptr element), or empty string if none is available |
52 | 52 | */ |
53 | -final class MetsDocument extends Doc |
|
54 | -{ |
|
53 | +final class MetsDocument extends Doc { |
|
55 | 54 | /** |
56 | 55 | * Subsections / tags that may occur within `<mets:amdSec>`. |
57 | 56 | * |
@@ -176,8 +175,7 @@ discard block |
||
176 | 175 | * |
177 | 176 | * @return void |
178 | 177 | */ |
179 | - public function addMetadataFromMets(&$metadata, $id) |
|
180 | - { |
|
178 | + public function addMetadataFromMets(&$metadata, $id) { |
|
181 | 179 | $details = $this->getLogicalStructure($id); |
182 | 180 | if (!empty($details)) { |
183 | 181 | $metadata['mets_order'][0] = $details['order']; |
@@ -191,8 +189,7 @@ discard block |
||
191 | 189 | * {@inheritDoc} |
192 | 190 | * @see \Kitodo\Dlf\Common\Doc::establishRecordId() |
193 | 191 | */ |
194 | - protected function establishRecordId($pid) |
|
195 | - { |
|
192 | + protected function establishRecordId($pid) { |
|
196 | 193 | // Check for METS object @ID. |
197 | 194 | if (!empty($this->mets['OBJID'])) { |
198 | 195 | $this->recordId = (string) $this->mets['OBJID']; |
@@ -212,8 +209,7 @@ discard block |
||
212 | 209 | * {@inheritDoc} |
213 | 210 | * @see \Kitodo\Dlf\Common\Doc::getDownloadLocation() |
214 | 211 | */ |
215 | - public function getDownloadLocation($id) |
|
216 | - { |
|
212 | + public function getDownloadLocation($id) { |
|
217 | 213 | $fileMimeType = $this->getFileMimeType($id); |
218 | 214 | $fileLocation = $this->getFileLocation($id); |
219 | 215 | if ($fileMimeType === 'application/vnd.kitodo.iiif') { |
@@ -238,8 +234,7 @@ discard block |
||
238 | 234 | * {@inheritDoc} |
239 | 235 | * @see \Kitodo\Dlf\Common\Doc::getFileLocation() |
240 | 236 | */ |
241 | - public function getFileLocation($id) |
|
242 | - { |
|
237 | + public function getFileLocation($id) { |
|
243 | 238 | $location = $this->mets->xpath('./mets:fileSec/mets:fileGrp/mets:file[@ID="' . $id . '"]/mets:FLocat[@LOCTYPE="URL"]'); |
244 | 239 | if ( |
245 | 240 | !empty($id) |
@@ -256,8 +251,7 @@ discard block |
||
256 | 251 | * {@inheritDoc} |
257 | 252 | * @see \Kitodo\Dlf\Common\Doc::getFileMimeType() |
258 | 253 | */ |
259 | - public function getFileMimeType($id) |
|
260 | - { |
|
254 | + public function getFileMimeType($id) { |
|
261 | 255 | $mimetype = $this->mets->xpath('./mets:fileSec/mets:fileGrp/mets:file[@ID="' . $id . '"]/@MIMETYPE'); |
262 | 256 | if ( |
263 | 257 | !empty($id) |
@@ -274,8 +268,7 @@ discard block |
||
274 | 268 | * {@inheritDoc} |
275 | 269 | * @see \Kitodo\Dlf\Common\Doc::getLogicalStructure() |
276 | 270 | */ |
277 | - public function getLogicalStructure($id, $recursive = false) |
|
278 | - { |
|
271 | + public function getLogicalStructure($id, $recursive = false) { |
|
279 | 272 | $details = []; |
280 | 273 | // Is the requested logical unit already loaded? |
281 | 274 | if ( |
@@ -315,8 +308,7 @@ discard block |
||
315 | 308 | * |
316 | 309 | * @return array Array of the element's id, label, type and physical page indexes/mptr link |
317 | 310 | */ |
318 | - protected function getLogicalStructureInfo(\SimpleXMLElement $structure, $recursive = false) |
|
319 | - { |
|
311 | + protected function getLogicalStructureInfo(\SimpleXMLElement $structure, $recursive = false) { |
|
320 | 312 | // Get attributes. |
321 | 313 | foreach ($structure->attributes() as $attribute => $value) { |
322 | 314 | $attributes[$attribute] = (string) $value; |
@@ -420,8 +412,7 @@ discard block |
||
420 | 412 | * {@inheritDoc} |
421 | 413 | * @see \Kitodo\Dlf\Common\Doc::getMetadata() |
422 | 414 | */ |
423 | - public function getMetadata($id, $cPid = 0) |
|
424 | - { |
|
415 | + public function getMetadata($id, $cPid = 0) { |
|
425 | 416 | // Make sure $cPid is a non-negative integer. |
426 | 417 | $cPid = max(intval($cPid), 0); |
427 | 418 | // If $cPid is not given, try to get it elsewhere. |
@@ -675,8 +666,7 @@ discard block |
||
675 | 666 | * @param string $id: The "@ID" attribute of the file node |
676 | 667 | * @return void |
677 | 668 | */ |
678 | - protected function getMetadataIds($id) |
|
679 | - { |
|
669 | + protected function getMetadataIds($id) { |
|
680 | 670 | // Load amdSecChildIds concordance |
681 | 671 | $this->_getMdSec(); |
682 | 672 | $this->_getFileInfos(); |
@@ -723,8 +713,7 @@ discard block |
||
723 | 713 | * {@inheritDoc} |
724 | 714 | * @see \Kitodo\Dlf\Common\Doc::getFullText() |
725 | 715 | */ |
726 | - public function getFullText($id) |
|
727 | - { |
|
716 | + public function getFullText($id) { |
|
728 | 717 | $fullText = ''; |
729 | 718 | |
730 | 719 | // Load fileGrps and check for full text files. |
@@ -739,8 +728,7 @@ discard block |
||
739 | 728 | * {@inheritDoc} |
740 | 729 | * @see Doc::getStructureDepth() |
741 | 730 | */ |
742 | - public function getStructureDepth($logId) |
|
743 | - { |
|
731 | + public function getStructureDepth($logId) { |
|
744 | 732 | $ancestors = $this->mets->xpath('./mets:structMap[@TYPE="LOGICAL"]//mets:div[@ID="' . $logId . '"]/ancestor::*'); |
745 | 733 | if (!empty($ancestors)) { |
746 | 734 | return count($ancestors); |
@@ -753,8 +741,7 @@ discard block |
||
753 | 741 | * {@inheritDoc} |
754 | 742 | * @see \Kitodo\Dlf\Common\Doc::init() |
755 | 743 | */ |
756 | - protected function init($location) |
|
757 | - { |
|
744 | + protected function init($location) { |
|
758 | 745 | $this->logger = GeneralUtility::makeInstance(LogManager::class)->getLogger(get_class($this)); |
759 | 746 | // Get METS node from XML file. |
760 | 747 | $this->registerNamespaces($this->xml); |
@@ -778,8 +765,7 @@ discard block |
||
778 | 765 | * {@inheritDoc} |
779 | 766 | * @see \Kitodo\Dlf\Common\Doc::loadLocation() |
780 | 767 | */ |
781 | - protected function loadLocation($location) |
|
782 | - { |
|
768 | + protected function loadLocation($location) { |
|
783 | 769 | $fileResource = Helper::getUrl($location); |
784 | 770 | if ($fileResource !== false) { |
785 | 771 | $xml = Helper::getXmlFileAsString($fileResource); |
@@ -797,8 +783,7 @@ discard block |
||
797 | 783 | * {@inheritDoc} |
798 | 784 | * @see \Kitodo\Dlf\Common\Doc::ensureHasFulltextIsSet() |
799 | 785 | */ |
800 | - protected function ensureHasFulltextIsSet() |
|
801 | - { |
|
786 | + protected function ensureHasFulltextIsSet() { |
|
802 | 787 | // Are the fileGrps already loaded? |
803 | 788 | if (!$this->fileGrpsLoaded) { |
804 | 789 | $this->_getFileGrps(); |
@@ -809,8 +794,7 @@ discard block |
||
809 | 794 | * {@inheritDoc} |
810 | 795 | * @see Doc::setPreloadedDocument() |
811 | 796 | */ |
812 | - protected function setPreloadedDocument($preloadedDocument) |
|
813 | - { |
|
797 | + protected function setPreloadedDocument($preloadedDocument) { |
|
814 | 798 | |
815 | 799 | if ($preloadedDocument instanceof \SimpleXMLElement) { |
816 | 800 | $this->xml = $preloadedDocument; |
@@ -823,8 +807,7 @@ discard block |
||
823 | 807 | * {@inheritDoc} |
824 | 808 | * @see Doc::getDocument() |
825 | 809 | */ |
826 | - protected function getDocument() |
|
827 | - { |
|
810 | + protected function getDocument() { |
|
828 | 811 | return $this->mets; |
829 | 812 | } |
830 | 813 | |
@@ -835,8 +818,7 @@ discard block |
||
835 | 818 | * |
836 | 819 | * @return array Array of metadata sections with their IDs as array key |
837 | 820 | */ |
838 | - protected function _getMdSec() |
|
839 | - { |
|
821 | + protected function _getMdSec() { |
|
840 | 822 | if (!$this->mdSecLoaded) { |
841 | 823 | $this->loadFormats(); |
842 | 824 | |
@@ -878,8 +860,7 @@ discard block |
||
878 | 860 | return $this->mdSec; |
879 | 861 | } |
880 | 862 | |
881 | - protected function _getDmdSec() |
|
882 | - { |
|
863 | + protected function _getDmdSec() { |
|
883 | 864 | $this->_getMdSec(); |
884 | 865 | return $this->dmdSec; |
885 | 866 | } |
@@ -893,8 +874,7 @@ discard block |
||
893 | 874 | * |
894 | 875 | * @return array|null The processed metadata section |
895 | 876 | */ |
896 | - protected function processMdSec($element) |
|
897 | - { |
|
877 | + protected function processMdSec($element) { |
|
898 | 878 | $mdId = (string) $element->attributes()->ID; |
899 | 879 | if (empty($mdId)) { |
900 | 880 | return null; |
@@ -934,8 +914,7 @@ discard block |
||
934 | 914 | * |
935 | 915 | * @return array Array of file use groups with file IDs |
936 | 916 | */ |
937 | - protected function _getFileGrps() |
|
938 | - { |
|
917 | + protected function _getFileGrps() { |
|
939 | 918 | if (!$this->fileGrpsLoaded) { |
940 | 919 | // Get configured USE attributes. |
941 | 920 | $extConf = GeneralUtility::makeInstance(ExtensionConfiguration::class)->get(self::$extKey); |
@@ -987,8 +966,7 @@ discard block |
||
987 | 966 | * @access protected |
988 | 967 | * @return array |
989 | 968 | */ |
990 | - protected function _getFileInfos() |
|
991 | - { |
|
969 | + protected function _getFileInfos() { |
|
992 | 970 | $this->_getFileGrps(); |
993 | 971 | return $this->fileInfos; |
994 | 972 | } |
@@ -997,8 +975,7 @@ discard block |
||
997 | 975 | * {@inheritDoc} |
998 | 976 | * @see \Kitodo\Dlf\Common\Doc::prepareMetadataArray() |
999 | 977 | */ |
1000 | - protected function prepareMetadataArray($cPid) |
|
1001 | - { |
|
978 | + protected function prepareMetadataArray($cPid) { |
|
1002 | 979 | $ids = $this->mets->xpath('./mets:structMap[@TYPE="LOGICAL"]//mets:div[@DMDID]/@ID'); |
1003 | 980 | // Get all logical structure nodes with metadata. |
1004 | 981 | if (!empty($ids)) { |
@@ -1016,8 +993,7 @@ discard block |
||
1016 | 993 | * |
1017 | 994 | * @return \SimpleXMLElement The XML's METS part as \SimpleXMLElement object |
1018 | 995 | */ |
1019 | - protected function _getMets() |
|
1020 | - { |
|
996 | + protected function _getMets() { |
|
1021 | 997 | return $this->mets; |
1022 | 998 | } |
1023 | 999 | |
@@ -1025,8 +1001,7 @@ discard block |
||
1025 | 1001 | * {@inheritDoc} |
1026 | 1002 | * @see \Kitodo\Dlf\Common\Doc::_getPhysicalStructure() |
1027 | 1003 | */ |
1028 | - protected function _getPhysicalStructure() |
|
1029 | - { |
|
1004 | + protected function _getPhysicalStructure() { |
|
1030 | 1005 | // Is there no physical structure array yet? |
1031 | 1006 | if (!$this->physicalStructureLoaded) { |
1032 | 1007 | // Does the document have a structMap node of type "PHYSICAL"? |
@@ -1088,8 +1063,7 @@ discard block |
||
1088 | 1063 | * {@inheritDoc} |
1089 | 1064 | * @see \Kitodo\Dlf\Common\Doc::_getSmLinks() |
1090 | 1065 | */ |
1091 | - protected function _getSmLinks() |
|
1092 | - { |
|
1066 | + protected function _getSmLinks() { |
|
1093 | 1067 | if (!$this->smLinksLoaded) { |
1094 | 1068 | $smLinks = $this->mets->xpath('./mets:structLink/mets:smLink'); |
1095 | 1069 | if (!empty($smLinks)) { |
@@ -1107,8 +1081,7 @@ discard block |
||
1107 | 1081 | * {@inheritDoc} |
1108 | 1082 | * @see \Kitodo\Dlf\Common\Doc::_getThumbnail() |
1109 | 1083 | */ |
1110 | - protected function _getThumbnail($forceReload = false) |
|
1111 | - { |
|
1084 | + protected function _getThumbnail($forceReload = false) { |
|
1112 | 1085 | if ( |
1113 | 1086 | !$this->thumbnailLoaded |
1114 | 1087 | || $forceReload |
@@ -1187,8 +1160,7 @@ discard block |
||
1187 | 1160 | * {@inheritDoc} |
1188 | 1161 | * @see \Kitodo\Dlf\Common\Doc::_getToplevelId() |
1189 | 1162 | */ |
1190 | - protected function _getToplevelId() |
|
1191 | - { |
|
1163 | + protected function _getToplevelId() { |
|
1192 | 1164 | if (empty($this->toplevelId)) { |
1193 | 1165 | // Get all logical structure nodes with metadata, but without associated METS-Pointers. |
1194 | 1166 | $divs = $this->mets->xpath('./mets:structMap[@TYPE="LOGICAL"]//mets:div[@DMDID and not(./mets:mptr)]'); |
@@ -1217,8 +1189,7 @@ discard block |
||
1217 | 1189 | * |
1218 | 1190 | * @return string|null |
1219 | 1191 | */ |
1220 | - public function _getParentHref() |
|
1221 | - { |
|
1192 | + public function _getParentHref() { |
|
1222 | 1193 | if ($this->parentHref === null) { |
1223 | 1194 | $this->parentHref = ''; |
1224 | 1195 | |
@@ -1240,8 +1211,7 @@ discard block |
||
1240 | 1211 | * |
1241 | 1212 | * @return array Properties to be serialized |
1242 | 1213 | */ |
1243 | - public function __sleep() |
|
1244 | - { |
|
1214 | + public function __sleep() { |
|
1245 | 1215 | // \SimpleXMLElement objects can't be serialized, thus save the XML as string for serialization |
1246 | 1216 | $this->asXML = $this->xml->asXML(); |
1247 | 1217 | return ['uid', 'pid', 'recordId', 'parentId', 'asXML']; |
@@ -1254,8 +1224,7 @@ discard block |
||
1254 | 1224 | * |
1255 | 1225 | * @return string String representing the METS object |
1256 | 1226 | */ |
1257 | - public function __toString() |
|
1258 | - { |
|
1227 | + public function __toString() { |
|
1259 | 1228 | $xml = new \DOMDocument('1.0', 'utf-8'); |
1260 | 1229 | $xml->appendChild($xml->importNode(dom_import_simplexml($this->mets), true)); |
1261 | 1230 | $xml->formatOutput = true; |
@@ -1270,8 +1239,7 @@ discard block |
||
1270 | 1239 | * |
1271 | 1240 | * @return void |
1272 | 1241 | */ |
1273 | - public function __wakeup() |
|
1274 | - { |
|
1242 | + public function __wakeup() { |
|
1275 | 1243 | $xml = Helper::getXmlFileAsString($this->asXML); |
1276 | 1244 | if ($xml !== false) { |
1277 | 1245 | $this->asXML = ''; |
@@ -32,8 +32,7 @@ discard block |
||
32 | 32 | * @subpackage dlf |
33 | 33 | * @access public |
34 | 34 | */ |
35 | -class SearchController extends AbstractController |
|
36 | -{ |
|
35 | +class SearchController extends AbstractController { |
|
37 | 36 | /** |
38 | 37 | * @var CollectionRepository |
39 | 38 | */ |
@@ -42,8 +41,7 @@ discard block |
||
42 | 41 | /** |
43 | 42 | * @param CollectionRepository $collectionRepository |
44 | 43 | */ |
45 | - public function injectCollectionRepository(CollectionRepository $collectionRepository) |
|
46 | - { |
|
44 | + public function injectCollectionRepository(CollectionRepository $collectionRepository) { |
|
47 | 45 | $this->collectionRepository = $collectionRepository; |
48 | 46 | } |
49 | 47 | |
@@ -55,8 +53,7 @@ discard block |
||
55 | 53 | /** |
56 | 54 | * @param MetadataRepository $metadataRepository |
57 | 55 | */ |
58 | - public function injectMetadataRepository(MetadataRepository $metadataRepository) |
|
59 | - { |
|
56 | + public function injectMetadataRepository(MetadataRepository $metadataRepository) { |
|
60 | 57 | $this->metadataRepository = $metadataRepository; |
61 | 58 | } |
62 | 59 | |
@@ -71,8 +68,7 @@ discard block |
||
71 | 68 | * |
72 | 69 | * @return void |
73 | 70 | */ |
74 | - public function searchAction() |
|
75 | - { |
|
71 | + public function searchAction() { |
|
76 | 72 | // if search was triggered, get search parameters from POST variables |
77 | 73 | $this->searchParams = $this->getParametersSafely('searchParameter'); |
78 | 74 | |
@@ -87,8 +83,7 @@ discard block |
||
87 | 83 | * |
88 | 84 | * @return void |
89 | 85 | */ |
90 | - public function mainAction() |
|
91 | - { |
|
86 | + public function mainAction() { |
|
92 | 87 | $listViewSearch = false; |
93 | 88 | // Quit without doing anything if required variables are not set. |
94 | 89 | if (empty($this->settings['solrcore'])) { |
@@ -188,8 +183,7 @@ discard block |
||
188 | 183 | * |
189 | 184 | * @return string HTML output of facets menu |
190 | 185 | */ |
191 | - protected function addFacetsMenu() |
|
192 | - { |
|
186 | + protected function addFacetsMenu() { |
|
193 | 187 | // Quit without doing anything if no facets are configured. |
194 | 188 | if (empty($this->settings['facets']) && empty($this->settings['facetCollections'])) { |
195 | 189 | return ''; |
@@ -214,8 +208,7 @@ discard block |
||
214 | 208 | * |
215 | 209 | * @return array HMENU array |
216 | 210 | */ |
217 | - public function makeFacetsMenuArray($facets) |
|
218 | - { |
|
211 | + public function makeFacetsMenuArray($facets) { |
|
219 | 212 | $menuArray = []; |
220 | 213 | // Set default value for facet search. |
221 | 214 | $search = [ |
@@ -271,8 +264,7 @@ discard block |
||
271 | 264 | // check for virtual collections query string |
272 | 265 | if($collectionEntry->getIndexSearch()) { |
273 | 266 | $virtualCollectionsQueryString .= empty($virtualCollectionsQueryString) ? '(' . $collectionEntry->getIndexSearch() . ')' : ' OR ('. $collectionEntry->getIndexSearch() . ')' ; |
274 | - } |
|
275 | - else { |
|
267 | + } else { |
|
276 | 268 | $collectionsQueryString .= empty($collectionsQueryString) ? '"' . $collectionEntry->getIndexName() . '"' : ' OR "' . $collectionEntry->getIndexName() . '"'; |
277 | 269 | } |
278 | 270 | } |
@@ -421,8 +413,7 @@ discard block |
||
421 | 413 | * |
422 | 414 | * @return array The array for the facet's menu entry |
423 | 415 | */ |
424 | - protected function getFacetsMenuEntry($field, $value, $count, $search, &$state) |
|
425 | - { |
|
416 | + protected function getFacetsMenuEntry($field, $value, $count, $search, &$state) { |
|
426 | 417 | $entryArray = []; |
427 | 418 | // Translate value. |
428 | 419 | if ($field == 'owner_faceting') { |
@@ -473,8 +464,7 @@ discard block |
||
473 | 464 | * |
474 | 465 | * @return string The extended search form or an empty string |
475 | 466 | */ |
476 | - protected function addExtendedSearch() |
|
477 | - { |
|
467 | + protected function addExtendedSearch() { |
|
478 | 468 | // Quit without doing anything if no fields for extended search are selected. |
479 | 469 | if ( |
480 | 470 | empty($this->settings['extendedSlotCount']) |
@@ -29,8 +29,7 @@ discard block |
||
29 | 29 | * @subpackage dlf |
30 | 30 | * @access public |
31 | 31 | */ |
32 | -class ListViewController extends AbstractController |
|
33 | -{ |
|
32 | +class ListViewController 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 | |
@@ -68,8 +65,7 @@ discard block |
||
68 | 65 | * |
69 | 66 | * @return void |
70 | 67 | */ |
71 | - public function mainAction() |
|
72 | - { |
|
68 | + public function mainAction() { |
|
73 | 69 | $this->searchParams = $this->getParametersSafely('searchParameter'); |
74 | 70 | |
75 | 71 | // extract collection(s) from collection parameter |
@@ -23,8 +23,7 @@ discard block |
||
23 | 23 | * @subpackage dlf |
24 | 24 | * @access public |
25 | 25 | */ |
26 | -class NavigationController extends AbstractController |
|
27 | -{ |
|
26 | +class NavigationController extends AbstractController { |
|
28 | 27 | /** |
29 | 28 | * Method to get the page select values and use them with chash |
30 | 29 | * @param \Kitodo\Dlf\Domain\Model\PageSelectForm|NULL $pageSelectForm |
@@ -53,8 +52,7 @@ discard block |
||
53 | 52 | * |
54 | 53 | * @return void |
55 | 54 | */ |
56 | - public function mainAction() |
|
57 | - { |
|
55 | + public function mainAction() { |
|
58 | 56 | // Load current document. |
59 | 57 | $this->loadDocument($this->requestData); |
60 | 58 | if ($this->isDocMissing()) { |
@@ -23,15 +23,13 @@ discard block |
||
23 | 23 | * @subpackage dlf |
24 | 24 | * @access public |
25 | 25 | */ |
26 | -class ToolboxController extends AbstractController |
|
27 | -{ |
|
26 | +class ToolboxController extends AbstractController { |
|
28 | 27 | /** |
29 | 28 | * The main method of the plugin |
30 | 29 | * |
31 | 30 | * @return void |
32 | 31 | */ |
33 | - public function mainAction() |
|
34 | - { |
|
32 | + public function mainAction() { |
|
35 | 33 | // Load current document. |
36 | 34 | $this->loadDocument($this->requestData); |
37 | 35 | |
@@ -52,8 +50,7 @@ discard block |
||
52 | 50 | * |
53 | 51 | * @return void |
54 | 52 | */ |
55 | - public function annotationtool() |
|
56 | - { |
|
53 | + public function annotationtool() { |
|
57 | 54 | if ($this->isDocMissingOrEmpty()) { |
58 | 55 | // Quit without doing anything if required variables are not set. |
59 | 56 | return ''; |
@@ -91,8 +88,7 @@ discard block |
||
91 | 88 | * |
92 | 89 | * @return void |
93 | 90 | */ |
94 | - public function fulltextdownloadtool() |
|
95 | - { |
|
91 | + public function fulltextdownloadtool() { |
|
96 | 92 | if ( |
97 | 93 | $this->isDocMissingOrEmpty() |
98 | 94 | || empty($this->extConf['fileGrpFulltext']) |
@@ -136,8 +132,7 @@ discard block |
||
136 | 132 | * |
137 | 133 | * @return void |
138 | 134 | */ |
139 | - public function fulltexttool() |
|
140 | - { |
|
135 | + public function fulltexttool() { |
|
141 | 136 | if ( |
142 | 137 | $this->isDocMissingOrEmpty() |
143 | 138 | || empty($this->extConf['fileGrpFulltext']) |
@@ -181,8 +176,7 @@ discard block |
||
181 | 176 | * |
182 | 177 | * @return void |
183 | 178 | */ |
184 | - public function imagedownloadtool() |
|
185 | - { |
|
179 | + public function imagedownloadtool() { |
|
186 | 180 | if ( |
187 | 181 | $this->isDocMissingOrEmpty() |
188 | 182 | || empty($this->settings['fileGrpsImageDownload']) |
@@ -224,8 +218,7 @@ discard block |
||
224 | 218 | * |
225 | 219 | * @return array Array of image links and image format information |
226 | 220 | */ |
227 | - protected function getImage($page) |
|
228 | - { |
|
221 | + protected function getImage($page) { |
|
229 | 222 | $image = []; |
230 | 223 | // Get @USE value of METS fileGrp. |
231 | 224 | $fileGrps = \TYPO3\CMS\Core\Utility\GeneralUtility::trimExplode(',', $this->settings['fileGrpsImageDownload']); |
@@ -258,8 +251,7 @@ discard block |
||
258 | 251 | * |
259 | 252 | * @return void |
260 | 253 | */ |
261 | - public function imagemanipulationtool() |
|
262 | - { |
|
254 | + public function imagemanipulationtool() { |
|
263 | 255 | // Set parent element for initialization. |
264 | 256 | $parentContainer = !empty($this->settings['parentContainer']) ? $this->settings['parentContainer'] : '.tx-dlf-imagemanipulationtool'; |
265 | 257 | |
@@ -272,8 +264,7 @@ discard block |
||
272 | 264 | * |
273 | 265 | * @return void |
274 | 266 | */ |
275 | - public function pdfdownloadtool() |
|
276 | - { |
|
267 | + public function pdfdownloadtool() { |
|
277 | 268 | if ( |
278 | 269 | $this->isDocMissingOrEmpty() |
279 | 270 | || empty($this->extConf['fileGrpDownload']) |
@@ -310,8 +301,7 @@ discard block |
||
310 | 301 | * |
311 | 302 | * @return array Link to downloadable page |
312 | 303 | */ |
313 | - protected function getPageLink() |
|
314 | - { |
|
304 | + protected function getPageLink() { |
|
315 | 305 | $page1Link = ''; |
316 | 306 | $page2Link = ''; |
317 | 307 | $pageLinkArray = []; |
@@ -355,8 +345,7 @@ discard block |
||
355 | 345 | * |
356 | 346 | * @return string Link to downloadable work |
357 | 347 | */ |
358 | - protected function getWorkLink() |
|
359 | - { |
|
348 | + protected function getWorkLink() { |
|
360 | 349 | $workLink = ''; |
361 | 350 | $fileGrpsDownload = GeneralUtility::trimExplode(',', $this->extConf['fileGrpDownload']); |
362 | 351 | // Get work link. |
@@ -385,8 +374,7 @@ discard block |
||
385 | 374 | * |
386 | 375 | * @return void |
387 | 376 | */ |
388 | - public function searchindocumenttool() |
|
389 | - { |
|
377 | + public function searchindocumenttool() { |
|
390 | 378 | if ( |
391 | 379 | $this->isDocMissingOrEmpty() |
392 | 380 | || empty($this->extConf['fileGrpFulltext']) |
@@ -448,8 +436,7 @@ discard block |
||
448 | 436 | * |
449 | 437 | * @return string with current document id |
450 | 438 | */ |
451 | - protected function getCurrentDocumentId() |
|
452 | - { |
|
439 | + protected function getCurrentDocumentId() { |
|
453 | 440 | $id = $this->document->getUid(); |
454 | 441 | |
455 | 442 | if ($id !== null && $id > 0) { |
@@ -484,8 +471,7 @@ discard block |
||
484 | 471 | * |
485 | 472 | * @return string with encrypted core name |
486 | 473 | */ |
487 | - protected function getEncryptedCoreName() |
|
488 | - { |
|
474 | + protected function getEncryptedCoreName() { |
|
489 | 475 | // Get core name. |
490 | 476 | $name = Helper::getIndexNameFromUid($this->settings['solrcore'], 'tx_dlf_solrcores'); |
491 | 477 | // Encrypt core name. |
@@ -25,8 +25,7 @@ discard block |
||
25 | 25 | * @subpackage dlf |
26 | 26 | * @access public |
27 | 27 | */ |
28 | -class AudioplayerController extends AbstractController |
|
29 | -{ |
|
28 | +class AudioplayerController extends AbstractController { |
|
30 | 29 | /** |
31 | 30 | * Holds the current audio file's URL, MIME type and optional label |
32 | 31 | * |
@@ -42,8 +41,7 @@ discard block |
||
42 | 41 | * |
43 | 42 | * @return void |
44 | 43 | */ |
45 | - protected function addPlayerJS() |
|
46 | - { |
|
44 | + protected function addPlayerJS() { |
|
47 | 45 | // Inline CSS. |
48 | 46 | $inlineCSS = '#tx-dlf-audio { width: 100px; height: 100px; }'; |
49 | 47 | |
@@ -72,8 +70,7 @@ discard block |
||
72 | 70 | * |
73 | 71 | * @return void |
74 | 72 | */ |
75 | - public function mainAction() |
|
76 | - { |
|
73 | + public function mainAction() { |
|
77 | 74 | // Load current document. |
78 | 75 | $this->loadDocument($this->requestData); |
79 | 76 | if ($this->isDocMissingOrEmpty()) { |
@@ -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 | |
@@ -178,8 +175,7 @@ discard block |
||
178 | 175 | * |
179 | 176 | * @return boolean |
180 | 177 | */ |
181 | - protected function isDocMissingOrEmpty() |
|
182 | - { |
|
178 | + protected function isDocMissingOrEmpty() { |
|
183 | 179 | return $this->isDocMissing() || $this->document->getDoc()->numPages < 1; |
184 | 180 | } |
185 | 181 | |
@@ -188,8 +184,7 @@ discard block |
||
188 | 184 | * |
189 | 185 | * @return boolean |
190 | 186 | */ |
191 | - protected function isDocMissing() |
|
192 | - { |
|
187 | + protected function isDocMissing() { |
|
193 | 188 | return $this->document === null || $this->document->getDoc() === null; |
194 | 189 | } |
195 | 190 | |
@@ -211,8 +206,7 @@ discard block |
||
211 | 206 | * |
212 | 207 | * @return null|string|array |
213 | 208 | */ |
214 | - protected function getParametersSafely($parameterName) |
|
215 | - { |
|
209 | + protected function getParametersSafely($parameterName) { |
|
216 | 210 | if ($this->request->hasArgument($parameterName)) { |
217 | 211 | return $this->request->getArgument($parameterName); |
218 | 212 | } |
@@ -226,8 +220,7 @@ discard block |
||
226 | 220 | * |
227 | 221 | * @return void |
228 | 222 | */ |
229 | - public function __construct() |
|
230 | - { |
|
223 | + public function __construct() { |
|
231 | 224 | $this->initialize(); |
232 | 225 | } |
233 | 226 | } |
@@ -24,8 +24,7 @@ discard block |
||
24 | 24 | * @subpackage dlf |
25 | 25 | * @access public |
26 | 26 | */ |
27 | -class TableOfContentsController extends AbstractController |
|
28 | -{ |
|
27 | +class TableOfContentsController extends AbstractController { |
|
29 | 28 | /** |
30 | 29 | * This holds the active entries according to the currently selected page |
31 | 30 | * |
@@ -39,8 +38,7 @@ discard block |
||
39 | 38 | * |
40 | 39 | * @return void |
41 | 40 | */ |
42 | - public function mainAction() |
|
43 | - { |
|
41 | + public function mainAction() { |
|
44 | 42 | // Load current document. |
45 | 43 | $this->loadDocument($this->requestData); |
46 | 44 | if ($this->isDocMissing()) { |
@@ -63,8 +61,7 @@ discard block |
||
63 | 61 | * @access protected |
64 | 62 | * @return array HMENU array |
65 | 63 | */ |
66 | - protected function makeMenuArray() |
|
67 | - { |
|
64 | + protected function makeMenuArray() { |
|
68 | 65 | // Set default values for page if not set. |
69 | 66 | // $this->requestData['page'] may be integer or string (physical structure @ID) |
70 | 67 | if ( |
@@ -140,8 +137,7 @@ discard block |
||
140 | 137 | * |
141 | 138 | * @return array HMENU array for menu entry |
142 | 139 | */ |
143 | - protected function getMenuEntry(array $entry, $recursive = false) |
|
144 | - { |
|
140 | + protected function getMenuEntry(array $entry, $recursive = false) { |
|
145 | 141 | $entry = $this->resolveMenuEntry($entry); |
146 | 142 | |
147 | 143 | $entryArray = []; |
@@ -235,8 +231,7 @@ discard block |
||
235 | 231 | * @param array $entry |
236 | 232 | * @return array |
237 | 233 | */ |
238 | - protected function resolveMenuEntry($entry) |
|
239 | - { |
|
234 | + protected function resolveMenuEntry($entry) { |
|
240 | 235 | // If the menu entry points to the parent document, |
241 | 236 | // resolve to the parent UID set on indexation. |
242 | 237 | $doc = $this->document->getDoc(); |