We could not synchronize checks via GitHub's checks API since Scrutinizer's GitHub App is not installed for this repository.
@@ -161,11 +161,14 @@ discard block |
||
| 161 | 161 | 'additionalParams' => \TYPO3\CMS\Core\Utility\GeneralUtility::implodeArrayForUrl($this->prefixId, $additionalParams, '', TRUE, FALSE) |
| 162 | 162 | ]; |
| 163 | 163 | $value = $this->cObj->typoLink(htmlspecialchars($value), $conf); |
| 164 | - } elseif ($index_name == 'owner' && !empty($value)) { // Translate name of holding library. |
|
| 164 | + } elseif ($index_name == 'owner' && !empty($value)) { |
|
| 165 | +// Translate name of holding library. |
|
| 165 | 166 | $value = htmlspecialchars(Helper::translate($value, 'tx_dlf_libraries', $this->conf['pages'])); |
| 166 | - } elseif ($index_name == 'type' && !empty($value)) { // Translate document type. |
|
| 167 | + } elseif ($index_name == 'type' && !empty($value)) { |
|
| 168 | +// Translate document type. |
|
| 167 | 169 | $value = htmlspecialchars(Helper::translate($value, 'tx_dlf_structures', $this->conf['pages'])); |
| 168 | - } elseif ($index_name == 'language' && !empty($value)) { // Translate ISO 639 language code. |
|
| 170 | + } elseif ($index_name == 'language' && !empty($value)) { |
|
| 171 | +// Translate ISO 639 language code. |
|
| 169 | 172 | $value = htmlspecialchars(Helper::getLanguageName($value)); |
| 170 | 173 | } elseif (!empty($value)) { |
| 171 | 174 | $value = htmlspecialchars($value); |
@@ -328,16 +331,19 @@ discard block |
||
| 328 | 331 | 'additionalParams' => \TYPO3\CMS\Core\Utility\GeneralUtility::implodeArrayForUrl($this->prefixId, $additionalParams, '', TRUE, FALSE) |
| 329 | 332 | ]; |
| 330 | 333 | $value = $this->cObj->typoLink(htmlspecialchars($value), $conf); |
| 331 | - } elseif ($index_name == 'owner' && !empty($value)) { // Translate name of holding library. |
|
| 334 | + } elseif ($index_name == 'owner' && !empty($value)) { |
|
| 335 | +// Translate name of holding library. |
|
| 332 | 336 | $value = htmlspecialchars(Helper::translate($value, 'tx_dlf_libraries', $this->conf['pages'])); |
| 333 | - } elseif ($index_name == 'type' && !empty($value)) { // Translate document type. |
|
| 337 | + } elseif ($index_name == 'type' && !empty($value)) { |
|
| 338 | +// Translate document type. |
|
| 334 | 339 | $_value = $value; |
| 335 | 340 | $value = htmlspecialchars(Helper::translate($value, 'tx_dlf_structures', $this->conf['pages'])); |
| 336 | 341 | // Add page number for single pages. |
| 337 | 342 | if ($_value == 'page') { |
| 338 | 343 | $value .= ' '.intval($subpart['page']); |
| 339 | 344 | } |
| 340 | - } elseif ($index_name == 'language' && !empty($value)) { // Translate ISO 639 language code. |
|
| 345 | + } elseif ($index_name == 'language' && !empty($value)) { |
|
| 346 | +// Translate ISO 639 language code. |
|
| 341 | 347 | $value = htmlspecialchars(Helper::getLanguageName($value)); |
| 342 | 348 | } elseif (!empty($value)) { |
| 343 | 349 | $value = htmlspecialchars($value); |
@@ -23,8 +23,7 @@ discard block |
||
| 23 | 23 | * @subpackage tx_dlf |
| 24 | 24 | * @access public |
| 25 | 25 | */ |
| 26 | -final class MetsDocument extends Document |
|
| 27 | -{ |
|
| 26 | +final class MetsDocument extends Document { |
|
| 28 | 27 | /** |
| 29 | 28 | * This holds the whole XML file as string for serialization purposes |
| 30 | 29 | * @see __sleep() / __wakeup() |
@@ -259,14 +258,16 @@ discard block |
||
| 259 | 258 | // Yes. Get the file reference. |
| 260 | 259 | $details['points'] = (string) $structure->children('http://www.loc.gov/METS/')->mptr[0]->attributes('http://www.w3.org/1999/xlink')->href; |
| 261 | 260 | } elseif (!empty($this->physicalStructure) |
| 262 | - && array_key_exists($details['id'], $this->smLinks['l2p'])) { // Are there any physical elements and is this logical unit linked to at least one of them? |
|
| 261 | + && array_key_exists($details['id'], $this->smLinks['l2p'])) { |
|
| 262 | +// Are there any physical elements and is this logical unit linked to at least one of them? |
|
| 263 | 263 | $details['points'] = max(intval(array_search($this->smLinks['l2p'][$details['id']][0], $this->physicalStructure, TRUE)), 1); |
| 264 | 264 | if (!empty($this->physicalStructureInfo[$this->smLinks['l2p'][$details['id']][0]]['files'][$extConf['fileGrpThumbs']])) { |
| 265 | 265 | $details['thumbnailId'] = $this->physicalStructureInfo[$this->smLinks['l2p'][$details['id']][0]]['files'][$extConf['fileGrpThumbs']]; |
| 266 | 266 | } |
| 267 | 267 | // Get page/track number of the first page/track related to this structure element. |
| 268 | 268 | $details['pagination'] = $this->physicalStructureInfo[$this->smLinks['l2p'][$details['id']][0]]['orderlabel']; |
| 269 | - } elseif ($details['id'] == $this->_getToplevelId()) { // Is this the toplevel structure element? |
|
| 269 | + } elseif ($details['id'] == $this->_getToplevelId()) { |
|
| 270 | +// Is this the toplevel structure element? |
|
| 270 | 271 | // Yes. Point to itself. |
| 271 | 272 | $details['points'] = 1; |
| 272 | 273 | if (!empty($this->physicalStructure) |
@@ -491,8 +492,7 @@ discard block |
||
| 491 | 492 | * {@inheritDoc} |
| 492 | 493 | * @see Document::getStructureDepth() |
| 493 | 494 | */ |
| 494 | - public function getStructureDepth($logId) |
|
| 495 | - { |
|
| 495 | + public function getStructureDepth($logId) { |
|
| 496 | 496 | return count($this->mets->xpath('./mets:structMap[@TYPE="LOGICAL"]//mets:div[@ID="'.$logId.'"]/ancestor::*')); |
| 497 | 497 | } |
| 498 | 498 | |
@@ -551,8 +551,7 @@ discard block |
||
| 551 | 551 | * {@inheritDoc} |
| 552 | 552 | * @see Document::getParentDocumentUid() |
| 553 | 553 | */ |
| 554 | - protected function getParentDocumentUidForSaving($pid, $core) |
|
| 555 | - { |
|
| 554 | + protected function getParentDocumentUidForSaving($pid, $core) { |
|
| 556 | 555 | $partof = 0; |
| 557 | 556 | // Get the closest ancestor of the current document which has a MPTR child. |
| 558 | 557 | $parentMptr = $this->mets->xpath('./mets:structMap[@TYPE="LOGICAL"]//mets:div[@ID="'.$this->_getToplevelId().'"]/ancestor::mets:div[./mets:mptr][1]/mets:mptr'); |
@@ -242,8 +242,7 @@ |
||
| 242 | 242 | * @return array An array containing the IRIs of the AnnotationLists / AnnotationPages as well as |
| 243 | 243 | * some information about the canvas. |
| 244 | 244 | */ |
| 245 | - protected function getAnnotationContainers($page) |
|
| 246 | - { |
|
| 245 | + protected function getAnnotationContainers($page) { |
|
| 247 | 246 | if ($this->doc instanceof IiifManifest) { |
| 248 | 247 | $canvasId = $this->doc->physicalStructure[$page]; |
| 249 | 248 | $iiif = $this->doc->getIiif(); |
@@ -37,8 +37,7 @@ discard block |
||
| 37 | 37 | * @subpackage tx_dlf |
| 38 | 38 | * @access public |
| 39 | 39 | */ |
| 40 | -final class IiifManifest extends Document |
|
| 41 | -{ |
|
| 40 | +final class IiifManifest extends Document { |
|
| 42 | 41 | /** |
| 43 | 42 | * This holds the manifest file as string for serialization purposes |
| 44 | 43 | * @see __sleep() / __wakeup() |
@@ -99,8 +98,7 @@ discard block |
||
| 99 | 98 | * {@inheritDoc} |
| 100 | 99 | * @see Document::establishRecordId() |
| 101 | 100 | */ |
| 102 | - protected function establishRecordId($pid) |
|
| 103 | - { |
|
| 101 | + protected function establishRecordId($pid) { |
|
| 104 | 102 | if ($this->iiif !== null) { |
| 105 | 103 | /* |
| 106 | 104 | * 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 | |
@@ -196,8 +193,7 @@ discard block |
||
| 196 | 193 | * |
| 197 | 194 | * @return array|string |
| 198 | 195 | */ |
| 199 | - protected function getUseGroups($use) |
|
| 200 | - { |
|
| 196 | + protected function getUseGroups($use) { |
|
| 201 | 197 | if (!$this->useGrpsLoaded) { |
| 202 | 198 | // Get configured USE attributes. |
| 203 | 199 | $extConf = unserialize($GLOBALS['TYPO3_CONF_VARS']['EXT']['extConf'][self::$extKey]); |
@@ -224,8 +220,7 @@ discard block |
||
| 224 | 220 | * {@inheritDoc} |
| 225 | 221 | * @see Document::_getPhysicalStructure() |
| 226 | 222 | */ |
| 227 | - protected function _getPhysicalStructure() |
|
| 228 | - { |
|
| 223 | + protected function _getPhysicalStructure() { |
|
| 229 | 224 | // Is there no physical structure array yet? |
| 230 | 225 | if (!$this->physicalStructureLoaded) { |
| 231 | 226 | if ($this->iiif == null || !($this->iiif instanceof ManifestInterface)) { |
@@ -359,8 +354,7 @@ discard block |
||
| 359 | 354 | * {@inheritDoc} |
| 360 | 355 | * @see Document::getFileLocation() |
| 361 | 356 | */ |
| 362 | - public function getFileLocation($id) |
|
| 363 | - { |
|
| 357 | + public function getFileLocation($id) { |
|
| 364 | 358 | if ($id == null) { |
| 365 | 359 | return null; |
| 366 | 360 | } |
@@ -384,8 +378,7 @@ discard block |
||
| 384 | 378 | * {@inheritDoc} |
| 385 | 379 | * @see Document::getFileMimeType() |
| 386 | 380 | */ |
| 387 | - public function getFileMimeType($id) |
|
| 388 | - { |
|
| 381 | + public function getFileMimeType($id) { |
|
| 389 | 382 | $fileResource = $this->iiif->getContainedResourceById($id); |
| 390 | 383 | if ($fileResource instanceof CanvasInterface) { |
| 391 | 384 | $format = "application/vnd.kitodo.iiif"; |
@@ -410,8 +403,7 @@ discard block |
||
| 410 | 403 | * {@inheritDoc} |
| 411 | 404 | * @see Document::getLogicalStructure() |
| 412 | 405 | */ |
| 413 | - public function getLogicalStructure($id, $recursive = FALSE) |
|
| 414 | - { |
|
| 406 | + public function getLogicalStructure($id, $recursive = FALSE) { |
|
| 415 | 407 | $details = array (); |
| 416 | 408 | if (!$recursive && !empty($this->logicalUnits[$id])) { |
| 417 | 409 | return $this->logicalUnits[$id]; |
@@ -580,8 +572,7 @@ discard block |
||
| 580 | 572 | * {@inheritDoc} |
| 581 | 573 | * @see Document::getMetadata() |
| 582 | 574 | */ |
| 583 | - public function getMetadata($id, $cPid = 0) |
|
| 584 | - { |
|
| 575 | + public function getMetadata($id, $cPid = 0) { |
|
| 585 | 576 | if (!empty($this->metadataArray[$id]) && $this->metadataArray[0] == $cPid) { |
| 586 | 577 | return $this->metadataArray[$id]; |
| 587 | 578 | } |
@@ -704,8 +695,7 @@ discard block |
||
| 704 | 695 | * @param CanvasInterface $canvas |
| 705 | 696 | * @param IiifResourceInterface $resource |
| 706 | 697 | */ |
| 707 | - private function smLinkCanvasToResource(CanvasInterface $canvas, IiifResourceInterface $resource) |
|
| 708 | - { |
|
| 698 | + private function smLinkCanvasToResource(CanvasInterface $canvas, IiifResourceInterface $resource) { |
|
| 709 | 699 | $this->smLinks['l2p'][$resource->getId()][] = $canvas->getId(); |
| 710 | 700 | if (!is_array($this->smLinks['p2l'][$canvas->getId()]) || !in_array($resource->getId(), $this->smLinks['p2l'][$canvas->getId()])) { |
| 711 | 701 | $this->smLinks['p2l'][$canvas->getId()][] = $resource->getId(); |
@@ -720,8 +710,7 @@ discard block |
||
| 720 | 710 | * |
| 721 | 711 | * @see Document::getParentDocumentUidForSaving() |
| 722 | 712 | */ |
| 723 | - protected function getParentDocumentUidForSaving($pid, $core) |
|
| 724 | - { |
|
| 713 | + protected function getParentDocumentUidForSaving($pid, $core) { |
|
| 725 | 714 | // Do nothing. |
| 726 | 715 | } |
| 727 | 716 | |
@@ -780,8 +769,7 @@ discard block |
||
| 780 | 769 | * |
| 781 | 770 | * @return IiifResourceInterface |
| 782 | 771 | */ |
| 783 | - public function getIiif() |
|
| 784 | - { |
|
| 772 | + public function getIiif() { |
|
| 785 | 773 | return $this->iiif; |
| 786 | 774 | } |
| 787 | 775 | |
@@ -789,8 +777,7 @@ discard block |
||
| 789 | 777 | * {@inheritDoc} |
| 790 | 778 | * @see Document::init() |
| 791 | 779 | */ |
| 792 | - protected function init() |
|
| 793 | - { |
|
| 780 | + protected function init() { |
|
| 794 | 781 | // Nothing to do here, at the moment |
| 795 | 782 | } |
| 796 | 783 | |
@@ -798,8 +785,7 @@ discard block |
||
| 798 | 785 | * {@inheritDoc} |
| 799 | 786 | * @see Document::loadLocation() |
| 800 | 787 | */ |
| 801 | - protected function loadLocation($location) |
|
| 802 | - { |
|
| 788 | + protected function loadLocation($location) { |
|
| 803 | 789 | $content = GeneralUtility::getUrl($location); |
| 804 | 790 | $conf = unserialize($GLOBALS['TYPO3_CONF_VARS']['EXT']['extConf'][self::$extKey]); |
| 805 | 791 | IiifHelper::setUrlReader(IiifUrlReader::getInstance()); |
@@ -820,8 +806,7 @@ discard block |
||
| 820 | 806 | * {@inheritDoc} |
| 821 | 807 | * @see \Kitodo\Dlf\Common\Document::prepareMetadataArray() |
| 822 | 808 | */ |
| 823 | - protected function prepareMetadataArray($cPid) |
|
| 824 | - { |
|
| 809 | + protected function prepareMetadataArray($cPid) { |
|
| 825 | 810 | $id = $this->iiif->getId(); |
| 826 | 811 | $this->metadataArray[(string) $id] = $this->getMetadata((string) $id, $cPid); |
| 827 | 812 | } |
@@ -842,8 +827,7 @@ discard block |
||
| 842 | 827 | * {@inheritDoc} |
| 843 | 828 | * @see Document::ensureHasFulltextIsSet() |
| 844 | 829 | */ |
| 845 | - protected function ensureHasFulltextIsSet() |
|
| 846 | - { |
|
| 830 | + protected function ensureHasFulltextIsSet() { |
|
| 847 | 831 | /* |
| 848 | 832 | * TODO Check annotations and annotation lists of canvas for ALTO documents. |
| 849 | 833 | * Example: |
@@ -885,8 +869,7 @@ discard block |
||
| 885 | 869 | * {@inheritDoc} |
| 886 | 870 | * @see \Kitodo\Dlf\Common\Document::_getThumbnail() |
| 887 | 871 | */ |
| 888 | - protected function _getThumbnail($forceReload = FALSE) |
|
| 889 | - { |
|
| 872 | + protected function _getThumbnail($forceReload = FALSE) { |
|
| 890 | 873 | return $this->iiif->getThumbnailUrl(); |
| 891 | 874 | } |
| 892 | 875 | |
@@ -894,8 +877,7 @@ discard block |
||
| 894 | 877 | * {@inheritDoc} |
| 895 | 878 | * @see \Kitodo\Dlf\Common\Document::_getToplevelId() |
| 896 | 879 | */ |
| 897 | - protected function _getToplevelId() |
|
| 898 | - { |
|
| 880 | + protected function _getToplevelId() { |
|
| 899 | 881 | if (empty($this->toplevelId)) { |
| 900 | 882 | if (isset($this->iiif)) { |
| 901 | 883 | $this->toplevelId = $this->iiif->getId(); |