@@ -66,12 +66,12 @@ discard block |
||
| 66 | 66 | $(document).ready(function() { |
| 67 | 67 | AudioPlayer = new dlfAudioPlayer({ |
| 68 | 68 | audio: { |
| 69 | - mimeType: "' . $this->audio['mimetype'] . '", |
|
| 70 | - title: "' . $this->audio['label'] . '", |
|
| 71 | - url: "' . $this->audio['url'] . '" |
|
| 69 | + mimeType: "' . $this->audio['mimetype'].'", |
|
| 70 | + title: "' . $this->audio['label'].'", |
|
| 71 | + url: "' . $this->audio['url'].'" |
|
| 72 | 72 | }, |
| 73 | 73 | parentElId: "tx-dlf-audio", |
| 74 | - swfPath: "' . PathUtility::stripPathSitePrefix(ExtensionManagementUtility::extPath($this->extKey)) . 'Resources/Public/Javascript/jPlayer/jquery.jplayer.swf" |
|
| 74 | + swfPath: "' . PathUtility::stripPathSitePrefix(ExtensionManagementUtility::extPath($this->extKey)).'Resources/Public/Javascript/jPlayer/jquery.jplayer.swf" |
|
| 75 | 75 | }); |
| 76 | 76 | }); |
| 77 | 77 | '; |
@@ -79,22 +79,22 @@ discard block |
||
| 79 | 79 | if (empty($this->conf['addJStoBody'])) { |
| 80 | 80 | $pageRenderer = GeneralUtility::makeInstance(PageRenderer::class); |
| 81 | 81 | foreach ($cssFiles as $cssFile) { |
| 82 | - $pageRenderer->addCssFile(PathUtility::stripPathSitePrefix(ExtensionManagementUtility::extPath($this->extKey)) . $cssFile); |
|
| 82 | + $pageRenderer->addCssFile(PathUtility::stripPathSitePrefix(ExtensionManagementUtility::extPath($this->extKey)).$cssFile); |
|
| 83 | 83 | } |
| 84 | 84 | $pageRenderer->addCssInlineBlock('kitodo-audioplayer-configuration', $inlineCSS); |
| 85 | 85 | foreach ($jsFiles as $jsFile) { |
| 86 | - $pageRenderer->addJsFooterFile(PathUtility::stripPathSitePrefix(ExtensionManagementUtility::extPath($this->extKey)) . $jsFile); |
|
| 86 | + $pageRenderer->addJsFooterFile(PathUtility::stripPathSitePrefix(ExtensionManagementUtility::extPath($this->extKey)).$jsFile); |
|
| 87 | 87 | } |
| 88 | 88 | $pageRenderer->addJsFooterInlineCode('kitodo-audioplayer-configuration', $audioplayerConfiguration); |
| 89 | 89 | } else { |
| 90 | 90 | foreach ($jsFiles as $jsFile) { |
| 91 | - $markerArray .= '<script type="text/javascript" src="' . PathUtility::stripPathSitePrefix(ExtensionManagementUtility::extPath($this->extKey)) . $jsFile . '"></script>' . "\n"; |
|
| 91 | + $markerArray .= '<script type="text/javascript" src="'.PathUtility::stripPathSitePrefix(ExtensionManagementUtility::extPath($this->extKey)).$jsFile.'"></script>'."\n"; |
|
| 92 | 92 | } |
| 93 | 93 | $markerArray .= ' |
| 94 | 94 | <script type="text/javascript"> |
| 95 | 95 | /*<![CDATA[*/ |
| 96 | 96 | /*kitodo-audioplayer-configuration*/ |
| 97 | - ' . $audioplayerConfiguration . ' |
|
| 97 | + ' . $audioplayerConfiguration.' |
|
| 98 | 98 | /*]]>*/ |
| 99 | 99 | </script>'; |
| 100 | 100 | } |
@@ -55,7 +55,7 @@ discard block |
||
| 55 | 55 | $markerArray['###PAGINATION###'] = htmlspecialchars($this->doc->physicalStructureInfo[$this->doc->physicalStructure[$number]]['orderlabel']); |
| 56 | 56 | // Get thumbnail or placeholder. |
| 57 | 57 | $fileGrpsThumb = GeneralUtility::trimExplode(',', $this->conf['fileGrpThumbs']); |
| 58 | - if (array_intersect($fileGrpsThumb, array_keys($this->doc->physicalStructureInfo[$this->doc->physicalStructure[$number]]['files'])) !== [] ) { |
|
| 58 | + if (array_intersect($fileGrpsThumb, array_keys($this->doc->physicalStructureInfo[$this->doc->physicalStructure[$number]]['files'])) !== []) { |
|
| 59 | 59 | while ($fileGrpThumb = array_shift($fileGrpsThumb)) { |
| 60 | 60 | if (!empty($this->doc->physicalStructureInfo[$this->doc->physicalStructure[$number]]['files'][$fileGrpThumb])) { |
| 61 | 61 | $thumbnailFile = $this->doc->getFileLocation($this->doc->physicalStructureInfo[$this->doc->physicalStructure[$number]]['files'][$fileGrpThumb]); |
@@ -65,9 +65,9 @@ discard block |
||
| 65 | 65 | } elseif (!empty($this->conf['placeholder'])) { |
| 66 | 66 | $thumbnailFile = $GLOBALS['TSFE']->tmpl->getFileName($this->conf['placeholder']); |
| 67 | 67 | } else { |
| 68 | - $thumbnailFile = PathUtility::stripPathSitePrefix(ExtensionManagementUtility::extPath($this->extKey)) . 'Resources/Public/Images/PageGridPlaceholder.jpg'; |
|
| 68 | + $thumbnailFile = PathUtility::stripPathSitePrefix(ExtensionManagementUtility::extPath($this->extKey)).'Resources/Public/Images/PageGridPlaceholder.jpg'; |
|
| 69 | 69 | } |
| 70 | - $thumbnail = '<img alt="' . $markerArray['###PAGINATION###'] . '" src="' . $thumbnailFile . '" />'; |
|
| 70 | + $thumbnail = '<img alt="'.$markerArray['###PAGINATION###'].'" src="'.$thumbnailFile.'" />'; |
|
| 71 | 71 | // Get new plugin variables for typolink. |
| 72 | 72 | $piVars = $this->piVars; |
| 73 | 73 | // Unset no longer needed plugin variables. |
@@ -105,22 +105,22 @@ discard block |
||
| 105 | 105 | $separator = htmlspecialchars($this->pi_getLL('separator', ' - ')); |
| 106 | 106 | // Add link to previous page. |
| 107 | 107 | if ($this->piVars['pointer'] > 0) { |
| 108 | - $output = $this->pi_linkTP_keepPIvars(htmlspecialchars($this->pi_getLL('prevPage', '<')), ['pointer' => $this->piVars['pointer'] - 1, 'page' => (($this->piVars['pointer'] - 1) * $this->conf['limit']) + 1], true) . $separator; |
|
| 108 | + $output = $this->pi_linkTP_keepPIvars(htmlspecialchars($this->pi_getLL('prevPage', '<')), ['pointer' => $this->piVars['pointer'] - 1, 'page' => (($this->piVars['pointer'] - 1) * $this->conf['limit']) + 1], true).$separator; |
|
| 109 | 109 | } else { |
| 110 | - $output = '<span class="prev-page not-active">' . htmlspecialchars($this->pi_getLL('prevPage', '<')) . '</span>' . $separator; |
|
| 110 | + $output = '<span class="prev-page not-active">'.htmlspecialchars($this->pi_getLL('prevPage', '<')).'</span>'.$separator; |
|
| 111 | 111 | } |
| 112 | 112 | $i = 0; |
| 113 | 113 | // Add links to pages. |
| 114 | 114 | while ($i < $maxPages) { |
| 115 | 115 | if ($i < 3 || ($i > $this->piVars['pointer'] - 3 && $i < $this->piVars['pointer'] + 3) || $i > $maxPages - 4) { |
| 116 | 116 | if ($this->piVars['pointer'] != $i) { |
| 117 | - $output .= $this->pi_linkTP_keepPIvars(htmlspecialchars(sprintf($this->pi_getLL('page', '%d'), $i + 1)), ['pointer' => $i, 'page' => ($i * $this->conf['limit']) + 1], true) . $separator; |
|
| 117 | + $output .= $this->pi_linkTP_keepPIvars(htmlspecialchars(sprintf($this->pi_getLL('page', '%d'), $i + 1)), ['pointer' => $i, 'page' => ($i * $this->conf['limit']) + 1], true).$separator; |
|
| 118 | 118 | } else { |
| 119 | - $output .= '<span class="active">' . htmlspecialchars(sprintf($this->pi_getLL('page', '%d'), $i + 1)) . '</span>' . $separator; |
|
| 119 | + $output .= '<span class="active">'.htmlspecialchars(sprintf($this->pi_getLL('page', '%d'), $i + 1)).'</span>'.$separator; |
|
| 120 | 120 | } |
| 121 | 121 | $skip = true; |
| 122 | 122 | } elseif ($skip == true) { |
| 123 | - $output .= '<span class="skipped">' . htmlspecialchars($this->pi_getLL('skip', '...')) . '</span>' . $separator; |
|
| 123 | + $output .= '<span class="skipped">'.htmlspecialchars($this->pi_getLL('skip', '...')).'</span>'.$separator; |
|
| 124 | 124 | $skip = false; |
| 125 | 125 | } |
| 126 | 126 | $i++; |
@@ -129,7 +129,7 @@ discard block |
||
| 129 | 129 | if ($this->piVars['pointer'] < $maxPages - 1) { |
| 130 | 130 | $output .= $this->pi_linkTP_keepPIvars(htmlspecialchars($this->pi_getLL('nextPage', '>')), ['pointer' => $this->piVars['pointer'] + 1, 'page' => ($this->piVars['pointer'] + 1) * $this->conf['limit'] + 1], true); |
| 131 | 131 | } else { |
| 132 | - $output .= '<span class="next-page not-active">' . htmlspecialchars($this->pi_getLL('nextPage', '>')) . '</span>'; |
|
| 132 | + $output .= '<span class="next-page not-active">'.htmlspecialchars($this->pi_getLL('nextPage', '>')).'</span>'; |
|
| 133 | 133 | } |
| 134 | 134 | return $output; |
| 135 | 135 | } |
@@ -79,7 +79,7 @@ discard block |
||
| 79 | 79 | 'parameter' => $this->conf['targetPid'], |
| 80 | 80 | 'forceAbsoluteUrl' => !empty($this->conf['forceAbsoluteUrl']) ? 1 : 0, |
| 81 | 81 | 'forceAbsoluteUrl.' => ['scheme' => !empty($this->conf['forceAbsoluteUrl']) && !empty($this->conf['forceAbsoluteUrlHttps']) ? 'https' : 'http'], |
| 82 | - 'additionalParams' => GeneralUtility::implodeArrayForUrl($this->prefixId, $piVars, '', true, false), |
|
| 82 | + 'additionalParams' => GeneralUtility::implodeArrayForUrl($this->prefixId, $piVars, '', TRUE, FALSE), |
|
| 83 | 83 | 'title' => $markerArray['###PAGINATION###'] |
| 84 | 84 | ]; |
| 85 | 85 | $markerArray['###THUMBNAIL###'] = $this->cObj->typoLink($thumbnail, $linkConf); |
@@ -105,7 +105,7 @@ discard block |
||
| 105 | 105 | $separator = htmlspecialchars($this->pi_getLL('separator', ' - ')); |
| 106 | 106 | // Add link to previous page. |
| 107 | 107 | if ($this->piVars['pointer'] > 0) { |
| 108 | - $output = $this->pi_linkTP_keepPIvars(htmlspecialchars($this->pi_getLL('prevPage', '<')), ['pointer' => $this->piVars['pointer'] - 1, 'page' => (($this->piVars['pointer'] - 1) * $this->conf['limit']) + 1], true) . $separator; |
|
| 108 | + $output = $this->pi_linkTP_keepPIvars(htmlspecialchars($this->pi_getLL('prevPage', '<')), ['pointer' => $this->piVars['pointer'] - 1, 'page' => (($this->piVars['pointer'] - 1) * $this->conf['limit']) + 1], TRUE) . $separator; |
|
| 109 | 109 | } else { |
| 110 | 110 | $output = '<span class="prev-page not-active">' . htmlspecialchars($this->pi_getLL('prevPage', '<')) . '</span>' . $separator; |
| 111 | 111 | } |
@@ -114,20 +114,20 @@ discard block |
||
| 114 | 114 | while ($i < $maxPages) { |
| 115 | 115 | if ($i < 3 || ($i > $this->piVars['pointer'] - 3 && $i < $this->piVars['pointer'] + 3) || $i > $maxPages - 4) { |
| 116 | 116 | if ($this->piVars['pointer'] != $i) { |
| 117 | - $output .= $this->pi_linkTP_keepPIvars(htmlspecialchars(sprintf($this->pi_getLL('page', '%d'), $i + 1)), ['pointer' => $i, 'page' => ($i * $this->conf['limit']) + 1], true) . $separator; |
|
| 117 | + $output .= $this->pi_linkTP_keepPIvars(htmlspecialchars(sprintf($this->pi_getLL('page', '%d'), $i + 1)), ['pointer' => $i, 'page' => ($i * $this->conf['limit']) + 1], TRUE) . $separator; |
|
| 118 | 118 | } else { |
| 119 | 119 | $output .= '<span class="active">' . htmlspecialchars(sprintf($this->pi_getLL('page', '%d'), $i + 1)) . '</span>' . $separator; |
| 120 | 120 | } |
| 121 | - $skip = true; |
|
| 122 | - } elseif ($skip == true) { |
|
| 121 | + $skip = TRUE; |
|
| 122 | + } elseif ($skip == TRUE) { |
|
| 123 | 123 | $output .= '<span class="skipped">' . htmlspecialchars($this->pi_getLL('skip', '...')) . '</span>' . $separator; |
| 124 | - $skip = false; |
|
| 124 | + $skip = FALSE; |
|
| 125 | 125 | } |
| 126 | 126 | $i++; |
| 127 | 127 | } |
| 128 | 128 | // Add link to next page. |
| 129 | 129 | if ($this->piVars['pointer'] < $maxPages - 1) { |
| 130 | - $output .= $this->pi_linkTP_keepPIvars(htmlspecialchars($this->pi_getLL('nextPage', '>')), ['pointer' => $this->piVars['pointer'] + 1, 'page' => ($this->piVars['pointer'] + 1) * $this->conf['limit'] + 1], true); |
|
| 130 | + $output .= $this->pi_linkTP_keepPIvars(htmlspecialchars($this->pi_getLL('nextPage', '>')), ['pointer' => $this->piVars['pointer'] + 1, 'page' => ($this->piVars['pointer'] + 1) * $this->conf['limit'] + 1], TRUE); |
|
| 131 | 131 | } else { |
| 132 | 132 | $output .= '<span class="next-page not-active">' . htmlspecialchars($this->pi_getLL('nextPage', '>')) . '</span>'; |
| 133 | 133 | } |
@@ -149,7 +149,7 @@ discard block |
||
| 149 | 149 | $this->init($conf); |
| 150 | 150 | $this->loadDocument(); |
| 151 | 151 | if ( |
| 152 | - $this->doc === null |
|
| 152 | + $this->doc === NULL |
|
| 153 | 153 | || $this->doc->numPages < 1 |
| 154 | 154 | || empty($this->conf['fileGrpThumbs']) |
| 155 | 155 | ) { |
@@ -206,7 +206,7 @@ discard block |
||
| 206 | 206 | // Render page browser. |
| 207 | 207 | $markerArray['###PAGEBROWSER###'] = $this->getPageBrowser(); |
| 208 | 208 | // Merge everything with template. |
| 209 | - $content = $this->templateService->substituteMarkerArray($this->templateService->substituteSubpart($this->template, '###ENTRY###', $content, true), $markerArray); |
|
| 209 | + $content = $this->templateService->substituteMarkerArray($this->templateService->substituteSubpart($this->template, '###ENTRY###', $content, TRUE), $markerArray); |
|
| 210 | 210 | return $this->pi_wrapInBaseClass($content); |
| 211 | 211 | } |
| 212 | 212 | } |
@@ -83,9 +83,9 @@ |
||
| 83 | 83 | } |
| 84 | 84 | } |
| 85 | 85 | if (!empty($fullTextFile)) { |
| 86 | - $markerArray['###FULLTEXT_DOWNLOAD###'] = '<a href="#" id="tx-dlf-tools-fulltextdownload" title="' . htmlspecialchars($this->pi_getLL('download-current-page', '')) . '">' . htmlspecialchars($this->pi_getLL('download-current-page', '')) . '</a>'; |
|
| 86 | + $markerArray['###FULLTEXT_DOWNLOAD###'] = '<a href="#" id="tx-dlf-tools-fulltextdownload" title="'.htmlspecialchars($this->pi_getLL('download-current-page', '')).'">'.htmlspecialchars($this->pi_getLL('download-current-page', '')).'</a>'; |
|
| 87 | 87 | } else { |
| 88 | - $markerArray['###FULLTEXT_DOWNLOAD###'] = '<span class="no-fulltext">' . htmlspecialchars($this->pi_getLL('fulltext-not-available', '')) . '</span>'; |
|
| 88 | + $markerArray['###FULLTEXT_DOWNLOAD###'] = '<span class="no-fulltext">'.htmlspecialchars($this->pi_getLL('fulltext-not-available', '')).'</span>'; |
|
| 89 | 89 | } |
| 90 | 90 | $content .= $this->templateService->substituteMarkerArray($this->template, $markerArray); |
| 91 | 91 | return $this->pi_wrapInBaseClass($content); |
@@ -118,7 +118,7 @@ discard block |
||
| 118 | 118 | '###LABEL_PAGE###' => htmlspecialchars($this->pi_getLL('label.logicalPage')), |
| 119 | 119 | '###LABEL_NORESULT###' => htmlspecialchars($this->pi_getLL('label.noresult')), |
| 120 | 120 | '###CURRENT_DOCUMENT###' => $this->doc->uid, |
| 121 | - '###SOLR_ENCRYPTED###' => $encryptedSolr ?: '', |
|
| 121 | + '###SOLR_ENCRYPTED###' => $encryptedSolr ? : '', |
|
| 122 | 122 | ]; |
| 123 | 123 | |
| 124 | 124 | $content .= $this->templateService->substituteMarkerArray($this->template, $markerArray); |
@@ -135,7 +135,7 @@ discard block |
||
| 135 | 135 | protected function addSearchInDocumentJS() |
| 136 | 136 | { |
| 137 | 137 | $pageRenderer = GeneralUtility::makeInstance(PageRenderer::class); |
| 138 | - $pageRenderer->addJsFooterFile(PathUtility::stripPathSitePrefix(ExtensionManagementUtility::extPath($this->extKey)) . 'Resources/Public/Javascript/Search/SearchInDocument.js'); |
|
| 138 | + $pageRenderer->addJsFooterFile(PathUtility::stripPathSitePrefix(ExtensionManagementUtility::extPath($this->extKey)).'Resources/Public/Javascript/Search/SearchInDocument.js'); |
|
| 139 | 139 | } |
| 140 | 140 | |
| 141 | 141 | /** |
@@ -28,8 +28,7 @@ discard block |
||
| 28 | 28 | * @subpackage dlf |
| 29 | 29 | * @access public |
| 30 | 30 | */ |
| 31 | -class SearchInDocumentTool extends \Kitodo\Dlf\Common\AbstractPlugin |
|
| 32 | -{ |
|
| 31 | +class SearchInDocumentTool extends \Kitodo\Dlf\Common\AbstractPlugin { |
|
| 33 | 32 | public $scriptRelPath = 'Classes/Plugin/Tools/SearchInDocumentTool.php'; |
| 34 | 33 | |
| 35 | 34 | /** |
@@ -42,8 +41,7 @@ discard block |
||
| 42 | 41 | * |
| 43 | 42 | * @return string The content that is displayed on the website |
| 44 | 43 | */ |
| 45 | - public function main($content, $conf) |
|
| 46 | - { |
|
| 44 | + public function main($content, $conf) { |
|
| 47 | 45 | |
| 48 | 46 | $this->init($conf); |
| 49 | 47 | |
@@ -132,8 +130,7 @@ discard block |
||
| 132 | 130 | * |
| 133 | 131 | * @return void |
| 134 | 132 | */ |
| 135 | - protected function addSearchInDocumentJS() |
|
| 136 | - { |
|
| 133 | + protected function addSearchInDocumentJS() { |
|
| 137 | 134 | $pageRenderer = GeneralUtility::makeInstance(PageRenderer::class); |
| 138 | 135 | $pageRenderer->addJsFooterFile(PathUtility::stripPathSitePrefix(ExtensionManagementUtility::extPath($this->extKey)) . 'Resources/Public/Javascript/Search/SearchInDocument.js'); |
| 139 | 136 | } |
@@ -145,8 +142,7 @@ discard block |
||
| 145 | 142 | * |
| 146 | 143 | * @return string with encrypted core name |
| 147 | 144 | */ |
| 148 | - protected function getEncryptedCoreName() |
|
| 149 | - { |
|
| 145 | + protected function getEncryptedCoreName() { |
|
| 150 | 146 | // Get core name. |
| 151 | 147 | $name = Helper::getIndexNameFromUid($this->conf['solrcore'], 'tx_dlf_solrcores'); |
| 152 | 148 | // Encrypt core name. |
@@ -115,7 +115,7 @@ discard block |
||
| 115 | 115 | empty($page1Link) |
| 116 | 116 | && empty($page2Link) |
| 117 | 117 | ) { |
| 118 | - Helper::devLog('File not found in fileGrps "' . $this->conf['fileGrpDownload'] . '"', DEVLOG_SEVERITY_WARNING); |
|
| 118 | + Helper::devLog('File not found in fileGrps "'.$this->conf['fileGrpDownload'].'"', DEVLOG_SEVERITY_WARNING); |
|
| 119 | 119 | } |
| 120 | 120 | // Wrap URLs with HTML. |
| 121 | 121 | $linkConf = [ |
@@ -137,7 +137,7 @@ discard block |
||
| 137 | 137 | $linkConf['title'] = $this->pi_getLL('rightPage', ''); |
| 138 | 138 | $page2Link = $this->cObj->typoLink($this->pi_getLL('rightPage', ''), $linkConf); |
| 139 | 139 | } |
| 140 | - return $page1Link . $page2Link; |
|
| 140 | + return $page1Link.$page2Link; |
|
| 141 | 141 | } |
| 142 | 142 | |
| 143 | 143 | /** |
@@ -174,7 +174,7 @@ discard block |
||
| 174 | 174 | ]; |
| 175 | 175 | $workLink = $this->cObj->typoLink($this->pi_getLL('work', ''), $linkConf); |
| 176 | 176 | } else { |
| 177 | - Helper::devLog('File not found in fileGrp "' . $this->conf['fileGrpDownload'] . '"', DEVLOG_SEVERITY_WARNING); |
|
| 177 | + Helper::devLog('File not found in fileGrp "'.$this->conf['fileGrpDownload'].'"', DEVLOG_SEVERITY_WARNING); |
|
| 178 | 178 | } |
| 179 | 179 | return $workLink; |
| 180 | 180 | } |
@@ -25,8 +25,7 @@ discard block |
||
| 25 | 25 | * @subpackage dlf |
| 26 | 26 | * @access public |
| 27 | 27 | */ |
| 28 | -class PdfDownloadTool extends \Kitodo\Dlf\Common\AbstractPlugin |
|
| 29 | -{ |
|
| 28 | +class PdfDownloadTool extends \Kitodo\Dlf\Common\AbstractPlugin { |
|
| 30 | 29 | public $scriptRelPath = 'Classes/Plugin/Tools/PdfDownloadTool.php'; |
| 31 | 30 | |
| 32 | 31 | /** |
@@ -39,8 +38,7 @@ discard block |
||
| 39 | 38 | * |
| 40 | 39 | * @return string The content that is displayed on the website |
| 41 | 40 | */ |
| 42 | - public function main($content, $conf) |
|
| 43 | - { |
|
| 41 | + public function main($content, $conf) { |
|
| 44 | 42 | $this->init($conf); |
| 45 | 43 | // Merge configuration with conf array of toolbox. |
| 46 | 44 | if (!empty($this->cObj->data['conf'])) { |
@@ -90,8 +88,7 @@ discard block |
||
| 90 | 88 | * |
| 91 | 89 | * @return string Link to downloadable page |
| 92 | 90 | */ |
| 93 | - protected function getPageLink() |
|
| 94 | - { |
|
| 91 | + protected function getPageLink() { |
|
| 95 | 92 | $page1Link = ''; |
| 96 | 93 | $page2Link = ''; |
| 97 | 94 | $pageNumber = $this->piVars['page']; |
@@ -147,8 +144,7 @@ discard block |
||
| 147 | 144 | * |
| 148 | 145 | * @return string Link to downloadable work |
| 149 | 146 | */ |
| 150 | - protected function getWorkLink() |
|
| 151 | - { |
|
| 147 | + protected function getWorkLink() { |
|
| 152 | 148 | $workLink = ''; |
| 153 | 149 | $fileGrpsDownload = GeneralUtility::trimExplode(',', $this->conf['fileGrpDownload']); |
| 154 | 150 | // Get work link. |
@@ -84,14 +84,14 @@ |
||
| 84 | 84 | } |
| 85 | 85 | if (!empty($fullTextFile)) { |
| 86 | 86 | $markerArray['###FULLTEXT_SELECT###'] = '<a class="select switchoff" id="tx-dlf-tools-fulltext" title="" data-dic="' |
| 87 | - . 'fulltext:' . htmlspecialchars($this->pi_getLL('fulltext', '')) |
|
| 88 | - . ';fulltext-on:' . htmlspecialchars($this->pi_getLL('fulltext-on', '')) |
|
| 89 | - . ';fulltext-off:' . htmlspecialchars($this->pi_getLL('fulltext-off', '')) |
|
| 90 | - . ';activate-full-text-initially:' . MathUtility::forceIntegerInRange($this->conf['activateFullTextInitially'], 0, 1, 0) |
|
| 91 | - . ';full-text-scroll-element:' . $this->conf['fullTextScrollElement'] |
|
| 92 | - . ';search-hl-parameters:' . $this->conf['searchHlParameters'] . '"> </a>'; |
|
| 87 | + . 'fulltext:'.htmlspecialchars($this->pi_getLL('fulltext', '')) |
|
| 88 | + . ';fulltext-on:'.htmlspecialchars($this->pi_getLL('fulltext-on', '')) |
|
| 89 | + . ';fulltext-off:'.htmlspecialchars($this->pi_getLL('fulltext-off', '')) |
|
| 90 | + . ';activate-full-text-initially:'.MathUtility::forceIntegerInRange($this->conf['activateFullTextInitially'], 0, 1, 0) |
|
| 91 | + . ';full-text-scroll-element:'.$this->conf['fullTextScrollElement'] |
|
| 92 | + . ';search-hl-parameters:'.$this->conf['searchHlParameters'].'"> </a>'; |
|
| 93 | 93 | } else { |
| 94 | - $markerArray['###FULLTEXT_SELECT###'] = '<span class="no-fulltext">' . htmlspecialchars($this->pi_getLL('fulltext-not-available', '')) . '</span>'; |
|
| 94 | + $markerArray['###FULLTEXT_SELECT###'] = '<span class="no-fulltext">'.htmlspecialchars($this->pi_getLL('fulltext-not-available', '')).'</span>'; |
|
| 95 | 95 | } |
| 96 | 96 | $content .= $this->templateService->substituteMarkerArray($this->template, $markerArray); |
| 97 | 97 | return $this->pi_wrapInBaseClass($content); |
@@ -104,12 +104,12 @@ discard block |
||
| 104 | 104 | $(document).ready(function() { |
| 105 | 105 | if (dlfUtils.exists(dlfViewer)) { |
| 106 | 106 | tx_dlf_viewer = new dlfViewer({ |
| 107 | - controls: ["' . implode('", "', $this->controls) . '"], |
|
| 108 | - div: "' . $this->conf['elementId'] . '", |
|
| 109 | - images: ' . json_encode($this->images) . ', |
|
| 110 | - fulltexts: ' . json_encode($this->fulltexts) . ', |
|
| 111 | - annotationContainers: ' . json_encode($this->annotationContainers) . ', |
|
| 112 | - useInternalProxy: ' . ($this->conf['useInternalProxy'] ? 1 : 0) . ' |
|
| 107 | + controls: ["' . implode('", "', $this->controls).'"], |
|
| 108 | + div: "' . $this->conf['elementId'].'", |
|
| 109 | + images: ' . json_encode($this->images).', |
|
| 110 | + fulltexts: ' . json_encode($this->fulltexts).', |
|
| 111 | + annotationContainers: ' . json_encode($this->annotationContainers).', |
|
| 112 | + useInternalProxy: ' . ($this->conf['useInternalProxy'] ? 1 : 0).' |
|
| 113 | 113 | }); |
| 114 | 114 | } |
| 115 | 115 | }); |
@@ -118,21 +118,21 @@ discard block |
||
| 118 | 118 | if (empty($this->conf['addJStoBody'])) { |
| 119 | 119 | $pageRenderer = GeneralUtility::makeInstance(PageRenderer::class); |
| 120 | 120 | foreach ($cssFiles as $cssFile) { |
| 121 | - $pageRenderer->addCssFile(PathUtility::stripPathSitePrefix(ExtensionManagementUtility::extPath($this->extKey)) . $cssFile); |
|
| 121 | + $pageRenderer->addCssFile(PathUtility::stripPathSitePrefix(ExtensionManagementUtility::extPath($this->extKey)).$cssFile); |
|
| 122 | 122 | } |
| 123 | 123 | foreach ($jsFiles as $jsFile) { |
| 124 | - $pageRenderer->addJsFooterFile(PathUtility::stripPathSitePrefix(ExtensionManagementUtility::extPath($this->extKey)) . $jsFile); |
|
| 124 | + $pageRenderer->addJsFooterFile(PathUtility::stripPathSitePrefix(ExtensionManagementUtility::extPath($this->extKey)).$jsFile); |
|
| 125 | 125 | } |
| 126 | 126 | $pageRenderer->addJsFooterInlineCode('kitodo-pageview-configuration', $viewerConfiguration); |
| 127 | 127 | } else { |
| 128 | 128 | foreach ($jsFiles as $jsFile) { |
| 129 | - $markerArray .= '<script type="text/javascript" src="' . PathUtility::stripPathSitePrefix(ExtensionManagementUtility::extPath($this->extKey)) . $jsFile . '"></script>' . "\n"; |
|
| 129 | + $markerArray .= '<script type="text/javascript" src="'.PathUtility::stripPathSitePrefix(ExtensionManagementUtility::extPath($this->extKey)).$jsFile.'"></script>'."\n"; |
|
| 130 | 130 | } |
| 131 | 131 | $markerArray .= ' |
| 132 | 132 | <script type="text/javascript"> |
| 133 | 133 | /*<![CDATA[*/ |
| 134 | 134 | /*kitodo-pageview-configuration*/ |
| 135 | - ' . $viewerConfiguration . ' |
|
| 135 | + ' . $viewerConfiguration.' |
|
| 136 | 136 | /*]]>*/ |
| 137 | 137 | </script>'; |
| 138 | 138 | } |
@@ -151,14 +151,14 @@ discard block |
||
| 151 | 151 | $markerArray = []; |
| 152 | 152 | if ($this->piVars['id']) { |
| 153 | 153 | if ($this->conf['crop']) { |
| 154 | - $markerArray['###EDITBUTTON###'] = '<a href="javascript: tx_dlf_viewer.activateSelection();" title="' . htmlspecialchars($this->pi_getLL('editMode', '')) . '">' . htmlspecialchars($this->pi_getLL('editMode', '')) . '</a>'; |
|
| 155 | - $markerArray['###EDITREMOVE###'] = '<a href="javascript: tx_dlf_viewer.resetCropSelection();" title="' . htmlspecialchars($this->pi_getLL('editRemove', '')) . '">' . htmlspecialchars($this->pi_getLL('editRemove', '')) . '</a>'; |
|
| 154 | + $markerArray['###EDITBUTTON###'] = '<a href="javascript: tx_dlf_viewer.activateSelection();" title="'.htmlspecialchars($this->pi_getLL('editMode', '')).'">'.htmlspecialchars($this->pi_getLL('editMode', '')).'</a>'; |
|
| 155 | + $markerArray['###EDITREMOVE###'] = '<a href="javascript: tx_dlf_viewer.resetCropSelection();" title="'.htmlspecialchars($this->pi_getLL('editRemove', '')).'">'.htmlspecialchars($this->pi_getLL('editRemove', '')).'</a>'; |
|
| 156 | 156 | } else { |
| 157 | 157 | $markerArray['###EDITBUTTON###'] = ''; |
| 158 | 158 | $markerArray['###EDITREMOVE###'] = ''; |
| 159 | 159 | } |
| 160 | 160 | if ($this->conf['magnifier']) { |
| 161 | - $markerArray['###MAGNIFIER###'] = '<a href="javascript: tx_dlf_viewer.activateMagnifier();" title="' . htmlspecialchars($this->pi_getLL('magnifier', '')) . '">' . htmlspecialchars($this->pi_getLL('magnifier', '')) . '</a>'; |
|
| 161 | + $markerArray['###MAGNIFIER###'] = '<a href="javascript: tx_dlf_viewer.activateMagnifier();" title="'.htmlspecialchars($this->pi_getLL('magnifier', '')).'">'.htmlspecialchars($this->pi_getLL('magnifier', '')).'</a>'; |
|
| 162 | 162 | } else { |
| 163 | 163 | $markerArray['###MAGNIFIER###'] = ''; |
| 164 | 164 | } |
@@ -193,15 +193,15 @@ discard block |
||
| 193 | 193 | 'additionalParams' => GeneralUtility::implodeArrayForUrl($this->prefixId, $params, '', true, false), |
| 194 | 194 | 'title' => $label |
| 195 | 195 | ]; |
| 196 | - $output = '<form id="addToBasketForm" action="' . $this->cObj->typoLink_URL($basketConf) . '" method="post">'; |
|
| 197 | - $output .= '<input type="hidden" name="tx_dlf[startpage]" id="startpage" value="' . htmlspecialchars($this->piVars['page']) . '">'; |
|
| 198 | - $output .= '<input type="hidden" name="tx_dlf[endpage]" id="endpage" value="' . htmlspecialchars($this->piVars['page']) . '">'; |
|
| 196 | + $output = '<form id="addToBasketForm" action="'.$this->cObj->typoLink_URL($basketConf).'" method="post">'; |
|
| 197 | + $output .= '<input type="hidden" name="tx_dlf[startpage]" id="startpage" value="'.htmlspecialchars($this->piVars['page']).'">'; |
|
| 198 | + $output .= '<input type="hidden" name="tx_dlf[endpage]" id="endpage" value="'.htmlspecialchars($this->piVars['page']).'">'; |
|
| 199 | 199 | $output .= '<input type="hidden" name="tx_dlf[startX]" id="startX">'; |
| 200 | 200 | $output .= '<input type="hidden" name="tx_dlf[startY]" id="startY">'; |
| 201 | 201 | $output .= '<input type="hidden" name="tx_dlf[endX]" id="endX">'; |
| 202 | 202 | $output .= '<input type="hidden" name="tx_dlf[endY]" id="endY">'; |
| 203 | 203 | $output .= '<input type="hidden" name="tx_dlf[rotation]" id="rotation">'; |
| 204 | - $output .= '<button id="submitBasketForm" onclick="this.form.submit()">' . $label . '</button>'; |
|
| 204 | + $output .= '<button id="submitBasketForm" onclick="this.form.submit()">'.$label.'</button>'; |
|
| 205 | 205 | $output .= '</form>'; |
| 206 | 206 | $output .= '<script>'; |
| 207 | 207 | $output .= '$(document).ready(function() { $("#submitBasketForm").click(function() { $("#addToBasketForm").submit(); }); });'; |
@@ -237,14 +237,14 @@ discard block |
||
| 237 | 237 | 'parameter' => $GLOBALS['TSFE']->id, |
| 238 | 238 | 'forceAbsoluteUrl' => !empty($this->conf['forceAbsoluteUrl']) ? 1 : 0, |
| 239 | 239 | 'forceAbsoluteUrl.' => ['scheme' => !empty($this->conf['forceAbsoluteUrl']) && !empty($this->conf['forceAbsoluteUrlHttps']) ? 'https' : 'http'], |
| 240 | - 'additionalParams' => '&eID=tx_dlf_pageview_proxy&url=' . urlencode($image['url']), |
|
| 240 | + 'additionalParams' => '&eID=tx_dlf_pageview_proxy&url='.urlencode($image['url']), |
|
| 241 | 241 | ]; |
| 242 | 242 | $image['url'] = $this->cObj->typoLink_URL($linkConf); |
| 243 | 243 | } |
| 244 | 244 | $image['mimetype'] = $this->doc->getFileMimeType($this->doc->physicalStructureInfo[$this->doc->physicalStructure[$page]]['files'][$fileGrpImages]); |
| 245 | 245 | break; |
| 246 | 246 | } else { |
| 247 | - Helper::devLog('File not found in fileGrp "' . $fileGrpImages . '"', DEVLOG_SEVERITY_WARNING); |
|
| 247 | + Helper::devLog('File not found in fileGrp "'.$fileGrpImages.'"', DEVLOG_SEVERITY_WARNING); |
|
| 248 | 248 | } |
| 249 | 249 | } |
| 250 | 250 | return $image; |
@@ -273,7 +273,7 @@ discard block |
||
| 273 | 273 | 'parameter' => $GLOBALS['TSFE']->id, |
| 274 | 274 | 'forceAbsoluteUrl' => !empty($this->conf['forceAbsoluteUrl']) ? 1 : 0, |
| 275 | 275 | 'forceAbsoluteUrl.' => ['scheme' => !empty($this->conf['forceAbsoluteUrl']) && !empty($this->conf['forceAbsoluteUrlHttps']) ? 'https' : 'http'], |
| 276 | - 'additionalParams' => '&eID=tx_dlf_pageview_proxy&url=' . urlencode($fulltext['url']), |
|
| 276 | + 'additionalParams' => '&eID=tx_dlf_pageview_proxy&url='.urlencode($fulltext['url']), |
|
| 277 | 277 | ]; |
| 278 | 278 | $fulltext['url'] = $this->cObj->typoLink_URL($linkConf); |
| 279 | 279 | } |
@@ -282,7 +282,7 @@ discard block |
||
| 282 | 282 | } |
| 283 | 283 | } |
| 284 | 284 | if (empty($fulltext)) { |
| 285 | - Helper::devLog('File not found in fileGrp "' . $this->conf['fileGrpFulltext'] . '"', DEVLOG_SEVERITY_WARNING); |
|
| 285 | + Helper::devLog('File not found in fileGrp "'.$this->conf['fileGrpFulltext'].'"', DEVLOG_SEVERITY_WARNING); |
|
| 286 | 286 | } |
| 287 | 287 | return $fulltext; |
| 288 | 288 | } |
@@ -30,8 +30,7 @@ discard block |
||
| 30 | 30 | * @subpackage dlf |
| 31 | 31 | * @access public |
| 32 | 32 | */ |
| 33 | -class PageView extends \Kitodo\Dlf\Common\AbstractPlugin |
|
| 34 | -{ |
|
| 33 | +class PageView extends \Kitodo\Dlf\Common\AbstractPlugin { |
|
| 35 | 34 | public $scriptRelPath = 'Classes/Plugin/PageView.php'; |
| 36 | 35 | |
| 37 | 36 | /** |
@@ -73,8 +72,7 @@ discard block |
||
| 73 | 72 | * |
| 74 | 73 | * @return string The output string for the ###JAVASCRIPT### template marker |
| 75 | 74 | */ |
| 76 | - protected function addViewerJS() |
|
| 77 | - { |
|
| 75 | + protected function addViewerJS() { |
|
| 78 | 76 | $markerArray = ''; |
| 79 | 77 | // CSS files. |
| 80 | 78 | $cssFiles = [ |
@@ -146,8 +144,7 @@ discard block |
||
| 146 | 144 | * |
| 147 | 145 | * @return array Marker array |
| 148 | 146 | */ |
| 149 | - protected function addInteraction() |
|
| 150 | - { |
|
| 147 | + protected function addInteraction() { |
|
| 151 | 148 | $markerArray = []; |
| 152 | 149 | if ($this->piVars['id']) { |
| 153 | 150 | if ($this->conf['crop']) { |
@@ -173,8 +170,7 @@ discard block |
||
| 173 | 170 | * |
| 174 | 171 | * @return array Marker array |
| 175 | 172 | */ |
| 176 | - protected function addBasketForm() |
|
| 177 | - { |
|
| 173 | + protected function addBasketForm() { |
|
| 178 | 174 | $markerArray = []; |
| 179 | 175 | // Add basket button |
| 180 | 176 | if ($this->conf['basketButton'] && $this->conf['targetBasket'] && $this->piVars['id']) { |
@@ -222,8 +218,7 @@ discard block |
||
| 222 | 218 | * |
| 223 | 219 | * @return array URL and MIME type of image file |
| 224 | 220 | */ |
| 225 | - protected function getImage($page) |
|
| 226 | - { |
|
| 221 | + protected function getImage($page) { |
|
| 227 | 222 | $image = []; |
| 228 | 223 | // Get @USE value of METS fileGrp. |
| 229 | 224 | $fileGrpsImages = GeneralUtility::trimExplode(',', $this->conf['fileGrpImages']); |
@@ -259,8 +254,7 @@ discard block |
||
| 259 | 254 | * |
| 260 | 255 | * @return array URL and MIME type of fulltext file |
| 261 | 256 | */ |
| 262 | - protected function getFulltext($page) |
|
| 263 | - { |
|
| 257 | + protected function getFulltext($page) { |
|
| 264 | 258 | $fulltext = []; |
| 265 | 259 | // Get fulltext link. |
| 266 | 260 | $fileGrpsFulltext = GeneralUtility::trimExplode(',', $this->conf['fileGrpFulltext']); |
@@ -296,8 +290,7 @@ discard block |
||
| 296 | 290 | * @return array An array containing the IRIs of the AnnotationLists / AnnotationPages as well as |
| 297 | 291 | * some information about the canvas. |
| 298 | 292 | */ |
| 299 | - protected function getAnnotationContainers($page) |
|
| 300 | - { |
|
| 293 | + protected function getAnnotationContainers($page) { |
|
| 301 | 294 | if ($this->doc instanceof IiifManifest) { |
| 302 | 295 | $canvasId = $this->doc->physicalStructure[$page]; |
| 303 | 296 | $iiif = $this->doc->getIiif(); |
@@ -354,8 +347,7 @@ discard block |
||
| 354 | 347 | * |
| 355 | 348 | * @return string The content that is displayed on the website |
| 356 | 349 | */ |
| 357 | - public function main($content, $conf) |
|
| 358 | - { |
|
| 350 | + public function main($content, $conf) { |
|
| 359 | 351 | $this->init($conf); |
| 360 | 352 | // Load current document. |
| 361 | 353 | $this->loadDocument(); |
@@ -181,7 +181,7 @@ discard block |
||
| 181 | 181 | $label = htmlspecialchars($this->pi_getLL('addBasket', '')); |
| 182 | 182 | $params = [ |
| 183 | 183 | 'id' => $this->piVars['id'], |
| 184 | - 'addToBasket' => true |
|
| 184 | + 'addToBasket' => TRUE |
|
| 185 | 185 | ]; |
| 186 | 186 | if (empty($this->piVars['page'])) { |
| 187 | 187 | $params['page'] = 1; |
@@ -190,7 +190,7 @@ discard block |
||
| 190 | 190 | 'parameter' => $this->conf['targetBasket'], |
| 191 | 191 | 'forceAbsoluteUrl' => !empty($this->conf['forceAbsoluteUrl']) ? 1 : 0, |
| 192 | 192 | 'forceAbsoluteUrl.' => ['scheme' => !empty($this->conf['forceAbsoluteUrl']) && !empty($this->conf['forceAbsoluteUrlHttps']) ? 'https' : 'http'], |
| 193 | - 'additionalParams' => GeneralUtility::implodeArrayForUrl($this->prefixId, $params, '', true, false), |
|
| 193 | + 'additionalParams' => GeneralUtility::implodeArrayForUrl($this->prefixId, $params, '', TRUE, FALSE), |
|
| 194 | 194 | 'title' => $label |
| 195 | 195 | ]; |
| 196 | 196 | $output = '<form id="addToBasketForm" action="' . $this->cObj->typoLink_URL($basketConf) . '" method="post">'; |
@@ -304,7 +304,7 @@ discard block |
||
| 304 | 304 | if ($iiif instanceof ManifestInterface) { |
| 305 | 305 | $canvas = $iiif->getContainedResourceById($canvasId); |
| 306 | 306 | /* @var $canvas \Ubl\Iiif\Presentation\Common\Model\Resources\CanvasInterface */ |
| 307 | - if ($canvas != null && !empty($canvas->getPossibleTextAnnotationContainers(Motivation::PAINTING))) { |
|
| 307 | + if ($canvas != NULL && !empty($canvas->getPossibleTextAnnotationContainers(Motivation::PAINTING))) { |
|
| 308 | 308 | $annotationContainers = []; |
| 309 | 309 | /* |
| 310 | 310 | * TODO Analyzing the annotations on the server side requires loading the annotation lists / pages |
@@ -314,11 +314,11 @@ discard block |
||
| 314 | 314 | * On the other hand, server connections are potentially better than client connections. Downloading annotation lists |
| 315 | 315 | */ |
| 316 | 316 | foreach ($canvas->getPossibleTextAnnotationContainers(Motivation::PAINTING) as $annotationContainer) { |
| 317 | - if (($textAnnotations = $annotationContainer->getTextAnnotations(Motivation::PAINTING)) != null) { |
|
| 317 | + if (($textAnnotations = $annotationContainer->getTextAnnotations(Motivation::PAINTING)) != NULL) { |
|
| 318 | 318 | foreach ($textAnnotations as $annotation) { |
| 319 | 319 | if ( |
| 320 | 320 | $annotation->getBody()->getFormat() == 'text/plain' |
| 321 | - && $annotation->getBody()->getChars() != null |
|
| 321 | + && $annotation->getBody()->getChars() != NULL |
|
| 322 | 322 | ) { |
| 323 | 323 | $annotationListData = []; |
| 324 | 324 | $annotationListData['uri'] = $annotationContainer->getId(); |
@@ -360,7 +360,7 @@ discard block |
||
| 360 | 360 | // Load current document. |
| 361 | 361 | $this->loadDocument(); |
| 362 | 362 | if ( |
| 363 | - $this->doc === null |
|
| 363 | + $this->doc === NULL |
|
| 364 | 364 | || $this->doc->numPages < 1 |
| 365 | 365 | ) { |
| 366 | 366 | // Quit without doing anything if required variables are not set. |
@@ -682,14 +682,14 @@ discard block |
||
| 682 | 682 | // Get the root element's name as text format. |
| 683 | 683 | $textFormat = strtoupper($rawTextXml->getName()); |
| 684 | 684 | } else { |
| 685 | - Helper::devLog('Couln\'t load fulltext file for structure node @ID "' . $id . '"', DEVLOG_SEVERITY_WARNING); |
|
| 685 | + Helper::devLog('Couln\'t load fulltext file for structure node @ID "'.$id.'"', DEVLOG_SEVERITY_WARNING); |
|
| 686 | 686 | return $rawText; |
| 687 | 687 | } |
| 688 | 688 | break; |
| 689 | 689 | } |
| 690 | 690 | } |
| 691 | 691 | } else { |
| 692 | - Helper::devLog('Invalid structure node @ID "' . $id . '"', DEVLOG_SEVERITY_WARNING); |
|
| 692 | + Helper::devLog('Invalid structure node @ID "'.$id.'"', DEVLOG_SEVERITY_WARNING); |
|
| 693 | 693 | return $rawText; |
| 694 | 694 | } |
| 695 | 695 | // Is this text format supported? |
@@ -707,11 +707,11 @@ discard block |
||
| 707 | 707 | $rawText = $obj->getRawText($rawTextXml); |
| 708 | 708 | $this->rawTextArray[$id] = $rawText; |
| 709 | 709 | } else { |
| 710 | - Helper::devLog('Invalid class/method "' . $class . '->getRawText()" for text format "' . $textFormat . '"', DEVLOG_SEVERITY_WARNING); |
|
| 710 | + Helper::devLog('Invalid class/method "'.$class.'->getRawText()" for text format "'.$textFormat.'"', DEVLOG_SEVERITY_WARNING); |
|
| 711 | 711 | } |
| 712 | 712 | } |
| 713 | 713 | } else { |
| 714 | - Helper::devLog('Unsupported text format "' . $textFormat . '" in physical node with @ID "' . $id . '"', DEVLOG_SEVERITY_WARNING); |
|
| 714 | + Helper::devLog('Unsupported text format "'.$textFormat.'" in physical node with @ID "'.$id.'"', DEVLOG_SEVERITY_WARNING); |
|
| 715 | 715 | } |
| 716 | 716 | return $rawText; |
| 717 | 717 | } |
@@ -764,10 +764,10 @@ discard block |
||
| 764 | 764 | $title = self::getTitle($partof, true); |
| 765 | 765 | } |
| 766 | 766 | } else { |
| 767 | - Helper::devLog('No document with UID ' . $uid . ' found or document not accessible', DEVLOG_SEVERITY_WARNING); |
|
| 767 | + Helper::devLog('No document with UID '.$uid.' found or document not accessible', DEVLOG_SEVERITY_WARNING); |
|
| 768 | 768 | } |
| 769 | 769 | } else { |
| 770 | - Helper::devLog('Invalid UID ' . $uid . ' for document', DEVLOG_SEVERITY_ERROR); |
|
| 770 | + Helper::devLog('Invalid UID '.$uid.' for document', DEVLOG_SEVERITY_ERROR); |
|
| 771 | 771 | } |
| 772 | 772 | return $title; |
| 773 | 773 | } |
@@ -902,7 +902,7 @@ discard block |
||
| 902 | 902 | // the actual loading is format specific |
| 903 | 903 | return $this->loadLocation($location); |
| 904 | 904 | } else { |
| 905 | - Helper::devLog('Invalid file location "' . $location . '" for document loading', DEVLOG_SEVERITY_ERROR); |
|
| 905 | + Helper::devLog('Invalid file location "'.$location.'" for document loading', DEVLOG_SEVERITY_ERROR); |
|
| 906 | 906 | } |
| 907 | 907 | return false; |
| 908 | 908 | } |
@@ -1011,7 +1011,7 @@ discard block |
||
| 1011 | 1011 | // Retain current PID. |
| 1012 | 1012 | $pid = $this->pid; |
| 1013 | 1013 | } elseif (!$pid) { |
| 1014 | - Helper::devLog('Invalid PID ' . $pid . ' for document saving', DEVLOG_SEVERITY_ERROR); |
|
| 1014 | + Helper::devLog('Invalid PID '.$pid.' for document saving', DEVLOG_SEVERITY_ERROR); |
|
| 1015 | 1015 | return false; |
| 1016 | 1016 | } |
| 1017 | 1017 | // Set PID for metadata definitions. |
@@ -1048,7 +1048,7 @@ discard block |
||
| 1048 | 1048 | if ($resArray = $result->fetch()) { |
| 1049 | 1049 | $structure = $resArray['uid']; |
| 1050 | 1050 | } else { |
| 1051 | - Helper::devLog('Could not identify document/structure type "' . $queryBuilder->expr()->literal($metadata['type'][0]) . '"', DEVLOG_SEVERITY_ERROR); |
|
| 1051 | + Helper::devLog('Could not identify document/structure type "'.$queryBuilder->expr()->literal($metadata['type'][0]).'"', DEVLOG_SEVERITY_ERROR); |
|
| 1052 | 1052 | return false; |
| 1053 | 1053 | } |
| 1054 | 1054 | $metadata['type'][0] = $structure; |
@@ -1290,7 +1290,7 @@ discard block |
||
| 1290 | 1290 | if ($core) { |
| 1291 | 1291 | Indexer::add($this, $core); |
| 1292 | 1292 | } else { |
| 1293 | - Helper::devLog('Invalid UID "' . $core . '" for Solr core', DEVLOG_SEVERITY_NOTICE); |
|
| 1293 | + Helper::devLog('Invalid UID "'.$core.'" for Solr core', DEVLOG_SEVERITY_NOTICE); |
|
| 1294 | 1294 | } |
| 1295 | 1295 | return true; |
| 1296 | 1296 | } |
@@ -1356,7 +1356,7 @@ discard block |
||
| 1356 | 1356 | // Set metadata definitions' PID. |
| 1357 | 1357 | $cPid = ($this->cPid ? $this->cPid : $this->pid); |
| 1358 | 1358 | if (!$cPid) { |
| 1359 | - Helper::devLog('Invalid PID ' . $cPid . ' for metadata definitions', DEVLOG_SEVERITY_ERROR); |
|
| 1359 | + Helper::devLog('Invalid PID '.$cPid.' for metadata definitions', DEVLOG_SEVERITY_ERROR); |
|
| 1360 | 1360 | return []; |
| 1361 | 1361 | } |
| 1362 | 1362 | if ( |
@@ -1684,7 +1684,7 @@ discard block |
||
| 1684 | 1684 | // Document ready! |
| 1685 | 1685 | $this->ready = true; |
| 1686 | 1686 | } else { |
| 1687 | - Helper::devLog('No document with UID ' . $uid . ' found or document not accessible', DEVLOG_SEVERITY_ERROR); |
|
| 1687 | + Helper::devLog('No document with UID '.$uid.' found or document not accessible', DEVLOG_SEVERITY_ERROR); |
|
| 1688 | 1688 | } |
| 1689 | 1689 | } |
| 1690 | 1690 | |
@@ -1699,12 +1699,12 @@ discard block |
||
| 1699 | 1699 | */ |
| 1700 | 1700 | public function __get($var) |
| 1701 | 1701 | { |
| 1702 | - $method = '_get' . ucfirst($var); |
|
| 1702 | + $method = '_get'.ucfirst($var); |
|
| 1703 | 1703 | if ( |
| 1704 | 1704 | !property_exists($this, $var) |
| 1705 | 1705 | || !method_exists($this, $method) |
| 1706 | 1706 | ) { |
| 1707 | - Helper::devLog('There is no getter function for property "' . $var . '"', DEVLOG_SEVERITY_WARNING); |
|
| 1707 | + Helper::devLog('There is no getter function for property "'.$var.'"', DEVLOG_SEVERITY_WARNING); |
|
| 1708 | 1708 | return; |
| 1709 | 1709 | } else { |
| 1710 | 1710 | return $this->$method(); |
@@ -1737,12 +1737,12 @@ discard block |
||
| 1737 | 1737 | */ |
| 1738 | 1738 | public function __set($var, $value) |
| 1739 | 1739 | { |
| 1740 | - $method = '_set' . ucfirst($var); |
|
| 1740 | + $method = '_set'.ucfirst($var); |
|
| 1741 | 1741 | if ( |
| 1742 | 1742 | !property_exists($this, $var) |
| 1743 | 1743 | || !method_exists($this, $method) |
| 1744 | 1744 | ) { |
| 1745 | - Helper::devLog('There is no setter function for property "' . $var . '"', DEVLOG_SEVERITY_WARNING); |
|
| 1745 | + Helper::devLog('There is no setter function for property "'.$var.'"', DEVLOG_SEVERITY_WARNING); |
|
| 1746 | 1746 | } else { |
| 1747 | 1747 | $this->$method($value); |
| 1748 | 1748 | } |
@@ -92,7 +92,7 @@ discard block |
||
| 92 | 92 | * @var bool |
| 93 | 93 | * @access protected |
| 94 | 94 | */ |
| 95 | - protected $formatsLoaded = false; |
|
| 95 | + protected $formatsLoaded = FALSE; |
|
| 96 | 96 | |
| 97 | 97 | /** |
| 98 | 98 | * Are there any fulltext files available? This also includes IIIF text annotations |
@@ -102,7 +102,7 @@ discard block |
||
| 102 | 102 | * @var bool |
| 103 | 103 | * @access protected |
| 104 | 104 | */ |
| 105 | - protected $hasFulltext = false; |
|
| 105 | + protected $hasFulltext = FALSE; |
|
| 106 | 106 | |
| 107 | 107 | /** |
| 108 | 108 | * Last searched logical and physical page |
@@ -110,7 +110,7 @@ discard block |
||
| 110 | 110 | * @var array |
| 111 | 111 | * @access protected |
| 112 | 112 | */ |
| 113 | - protected $lastSearchedPhysicalPage = ['logicalPage' => null, 'physicalPage' => null]; |
|
| 113 | + protected $lastSearchedPhysicalPage = ['logicalPage' => NULL, 'physicalPage' => NULL]; |
|
| 114 | 114 | |
| 115 | 115 | /** |
| 116 | 116 | * This holds the documents location |
@@ -144,7 +144,7 @@ discard block |
||
| 144 | 144 | * @var bool |
| 145 | 145 | * @access protected |
| 146 | 146 | */ |
| 147 | - protected $metadataArrayLoaded = false; |
|
| 147 | + protected $metadataArrayLoaded = FALSE; |
|
| 148 | 148 | |
| 149 | 149 | /** |
| 150 | 150 | * The holds the total number of pages |
@@ -185,7 +185,7 @@ discard block |
||
| 185 | 185 | * @var bool |
| 186 | 186 | * @access protected |
| 187 | 187 | */ |
| 188 | - protected $physicalStructureLoaded = false; |
|
| 188 | + protected $physicalStructureLoaded = FALSE; |
|
| 189 | 189 | |
| 190 | 190 | /** |
| 191 | 191 | * This holds the PID of the document or zero if not in database |
@@ -210,7 +210,7 @@ discard block |
||
| 210 | 210 | * @var bool |
| 211 | 211 | * @access protected |
| 212 | 212 | */ |
| 213 | - protected $ready = false; |
|
| 213 | + protected $ready = FALSE; |
|
| 214 | 214 | |
| 215 | 215 | /** |
| 216 | 216 | * The METS file's / IIIF manifest's record identifier |
@@ -244,7 +244,7 @@ discard block |
||
| 244 | 244 | * @var bool |
| 245 | 245 | * @access protected |
| 246 | 246 | */ |
| 247 | - protected $rootIdLoaded = false; |
|
| 247 | + protected $rootIdLoaded = FALSE; |
|
| 248 | 248 | |
| 249 | 249 | /** |
| 250 | 250 | * This holds the smLinks between logical and physical structMap |
@@ -261,7 +261,7 @@ discard block |
||
| 261 | 261 | * @var bool |
| 262 | 262 | * @access protected |
| 263 | 263 | */ |
| 264 | - protected $smLinksLoaded = false; |
|
| 264 | + protected $smLinksLoaded = FALSE; |
|
| 265 | 265 | |
| 266 | 266 | /** |
| 267 | 267 | * This holds the logical structure |
@@ -278,7 +278,7 @@ discard block |
||
| 278 | 278 | * @var bool |
| 279 | 279 | * @access protected |
| 280 | 280 | */ |
| 281 | - protected $tableOfContentsLoaded = false; |
|
| 281 | + protected $tableOfContentsLoaded = FALSE; |
|
| 282 | 282 | |
| 283 | 283 | /** |
| 284 | 284 | * This holds the document's thumbnail location |
@@ -295,7 +295,7 @@ discard block |
||
| 295 | 295 | * @var bool |
| 296 | 296 | * @access protected |
| 297 | 297 | */ |
| 298 | - protected $thumbnailLoaded = false; |
|
| 298 | + protected $thumbnailLoaded = FALSE; |
|
| 299 | 299 | |
| 300 | 300 | /** |
| 301 | 301 | * This holds the toplevel structure's @ID (METS) or the manifest's @id (IIIF) |
@@ -412,7 +412,7 @@ discard block |
||
| 412 | 412 | * |
| 413 | 413 | * @return \Kitodo\Dlf\Common\Document Instance of this class, either MetsDocument or IiifManifest |
| 414 | 414 | */ |
| 415 | - public static function &getInstance($uid, $pid = 0, $forceReload = false) |
|
| 415 | + public static function &getInstance($uid, $pid = 0, $forceReload = FALSE) |
|
| 416 | 416 | { |
| 417 | 417 | // Sanitize input. |
| 418 | 418 | $pid = max(intval($pid), 0); |
@@ -452,10 +452,10 @@ discard block |
||
| 452 | 452 | } |
| 453 | 453 | } |
| 454 | 454 | // Create new instance depending on format (METS or IIIF) ... |
| 455 | - $instance = null; |
|
| 456 | - $documentFormat = null; |
|
| 457 | - $xml = null; |
|
| 458 | - $iiif = null; |
|
| 455 | + $instance = NULL; |
|
| 456 | + $documentFormat = NULL; |
|
| 457 | + $xml = NULL; |
|
| 458 | + $iiif = NULL; |
|
| 459 | 459 | // Try to get document format from database |
| 460 | 460 | if (MathUtility::canBeInterpretedAsInteger($uid)) { |
| 461 | 461 | $queryBuilder = GeneralUtility::makeInstance(ConnectionPool::class) |
@@ -504,27 +504,27 @@ discard block |
||
| 504 | 504 | @ini_set('user_agent', $extConf['useragent']); |
| 505 | 505 | } |
| 506 | 506 | $content = GeneralUtility::getUrl($location); |
| 507 | - if ($content !== false) { |
|
| 507 | + if ($content !== FALSE) { |
|
| 508 | 508 | // TODO use single place to load xml |
| 509 | 509 | // Turn off libxml's error logging. |
| 510 | - $libxmlErrors = libxml_use_internal_errors(true); |
|
| 510 | + $libxmlErrors = libxml_use_internal_errors(TRUE); |
|
| 511 | 511 | // Disables the functionality to allow external entities to be loaded when parsing the XML, must be kept |
| 512 | - $previousValueOfEntityLoader = libxml_disable_entity_loader(true); |
|
| 512 | + $previousValueOfEntityLoader = libxml_disable_entity_loader(TRUE); |
|
| 513 | 513 | // Try to load XML from file. |
| 514 | 514 | $xml = simplexml_load_string($content); |
| 515 | 515 | // reset entity loader setting |
| 516 | 516 | libxml_disable_entity_loader($previousValueOfEntityLoader); |
| 517 | 517 | // Reset libxml's error logging. |
| 518 | 518 | libxml_use_internal_errors($libxmlErrors); |
| 519 | - if ($xml !== false) { |
|
| 519 | + if ($xml !== FALSE) { |
|
| 520 | 520 | /* @var $xml \SimpleXMLElement */ |
| 521 | 521 | $xml->registerXPathNamespace('mets', 'http://www.loc.gov/METS/'); |
| 522 | 522 | $xpathResult = $xml->xpath('//mets:mets'); |
| 523 | - $documentFormat = !empty($xpathResult) ? 'METS' : null; |
|
| 523 | + $documentFormat = !empty($xpathResult) ? 'METS' : NULL; |
|
| 524 | 524 | } else { |
| 525 | 525 | // Try to load file as IIIF resource instead. |
| 526 | - $contentAsJsonArray = json_decode($content, true); |
|
| 527 | - if ($contentAsJsonArray !== null) { |
|
| 526 | + $contentAsJsonArray = json_decode($content, TRUE); |
|
| 527 | + if ($contentAsJsonArray !== NULL) { |
|
| 528 | 528 | // Load plugin configuration. |
| 529 | 529 | $conf = unserialize($GLOBALS['TYPO3_CONF_VARS']['EXT']['extConf'][self::$extKey]); |
| 530 | 530 | IiifHelper::setUrlReader(IiifUrlReader::getInstance()); |
@@ -578,7 +578,7 @@ discard block |
||
| 578 | 578 | * |
| 579 | 579 | * @return array Array of the element's id, label, type and physical page indexes/mptr link |
| 580 | 580 | */ |
| 581 | - public abstract function getLogicalStructure($id, $recursive = false); |
|
| 581 | + public abstract function getLogicalStructure($id, $recursive = FALSE); |
|
| 582 | 582 | |
| 583 | 583 | /** |
| 584 | 584 | * This extracts all the metadata for a logical structure node |
@@ -615,7 +615,7 @@ discard block |
||
| 615 | 615 | } else { |
| 616 | 616 | $physicalPage = 0; |
| 617 | 617 | foreach ($this->physicalStructureInfo as $page) { |
| 618 | - if (strpos($page['orderlabel'], $logicalPage) !== false) { |
|
| 618 | + if (strpos($page['orderlabel'], $logicalPage) !== FALSE) { |
|
| 619 | 619 | $this->lastSearchedPhysicalPage['logicalPage'] = $logicalPage; |
| 620 | 620 | $this->lastSearchedPhysicalPage['physicalPage'] = $physicalPage; |
| 621 | 621 | return $physicalPage; |
@@ -668,11 +668,11 @@ discard block |
||
| 668 | 668 | if (!empty($this->physicalStructureInfo[$id]['files'][$fileGrpFulltext])) { |
| 669 | 669 | // Get fulltext file. |
| 670 | 670 | $file = GeneralUtility::getUrl($this->getFileLocation($this->physicalStructureInfo[$id]['files'][$fileGrpFulltext])); |
| 671 | - if ($file !== false) { |
|
| 671 | + if ($file !== FALSE) { |
|
| 672 | 672 | // Turn off libxml's error logging. |
| 673 | - $libxmlErrors = libxml_use_internal_errors(true); |
|
| 673 | + $libxmlErrors = libxml_use_internal_errors(TRUE); |
|
| 674 | 674 | // Disables the functionality to allow external entities to be loaded when parsing the XML, must be kept. |
| 675 | - $previousValueOfEntityLoader = libxml_disable_entity_loader(true); |
|
| 675 | + $previousValueOfEntityLoader = libxml_disable_entity_loader(TRUE); |
|
| 676 | 676 | // Load XML from file. |
| 677 | 677 | $rawTextXml = simplexml_load_string($file); |
| 678 | 678 | // Reset entity loader setting. |
@@ -728,7 +728,7 @@ discard block |
||
| 728 | 728 | * |
| 729 | 729 | * @return string The title of the document itself or a parent document |
| 730 | 730 | */ |
| 731 | - public static function getTitle($uid, $recursive = false) |
|
| 731 | + public static function getTitle($uid, $recursive = FALSE) |
|
| 732 | 732 | { |
| 733 | 733 | $title = ''; |
| 734 | 734 | // Sanitize input. |
@@ -761,7 +761,7 @@ discard block |
||
| 761 | 761 | && intval($partof) |
| 762 | 762 | && $partof != $uid |
| 763 | 763 | ) { |
| 764 | - $title = self::getTitle($partof, true); |
|
| 764 | + $title = self::getTitle($partof, TRUE); |
|
| 765 | 765 | } |
| 766 | 766 | } else { |
| 767 | 767 | Helper::devLog('No document with UID ' . $uid . ' found or document not accessible', DEVLOG_SEVERITY_WARNING); |
@@ -822,12 +822,12 @@ discard block |
||
| 822 | 822 | return $depth; |
| 823 | 823 | } elseif (array_key_exists('children', $element)) { |
| 824 | 824 | $foundInChildren = $this->getTreeDepth($element['children'], $depth + 1, $logId); |
| 825 | - if ($foundInChildren !== false) { |
|
| 825 | + if ($foundInChildren !== FALSE) { |
|
| 826 | 826 | return $foundInChildren; |
| 827 | 827 | } |
| 828 | 828 | } |
| 829 | 829 | } |
| 830 | - return false; |
|
| 830 | + return FALSE; |
|
| 831 | 831 | } |
| 832 | 832 | |
| 833 | 833 | /** |
@@ -904,7 +904,7 @@ discard block |
||
| 904 | 904 | } else { |
| 905 | 905 | Helper::devLog('Invalid file location "' . $location . '" for document loading', DEVLOG_SEVERITY_ERROR); |
| 906 | 906 | } |
| 907 | - return false; |
|
| 907 | + return FALSE; |
|
| 908 | 908 | } |
| 909 | 909 | |
| 910 | 910 | /** |
@@ -951,7 +951,7 @@ discard block |
||
| 951 | 951 | 'class' => $resArray['class'] |
| 952 | 952 | ]; |
| 953 | 953 | } |
| 954 | - $this->formatsLoaded = true; |
|
| 954 | + $this->formatsLoaded = TRUE; |
|
| 955 | 955 | } |
| 956 | 956 | } |
| 957 | 957 | |
@@ -997,7 +997,7 @@ discard block |
||
| 997 | 997 | { |
| 998 | 998 | if (\TYPO3_MODE !== 'BE') { |
| 999 | 999 | Helper::devLog('Saving a document is only allowed in the backend', DEVLOG_SEVERITY_ERROR); |
| 1000 | - return false; |
|
| 1000 | + return FALSE; |
|
| 1001 | 1001 | } |
| 1002 | 1002 | // Make sure $pid is a non-negative integer. |
| 1003 | 1003 | $pid = max(intval($pid), 0); |
@@ -1012,7 +1012,7 @@ discard block |
||
| 1012 | 1012 | $pid = $this->pid; |
| 1013 | 1013 | } elseif (!$pid) { |
| 1014 | 1014 | Helper::devLog('Invalid PID ' . $pid . ' for document saving', DEVLOG_SEVERITY_ERROR); |
| 1015 | - return false; |
|
| 1015 | + return FALSE; |
|
| 1016 | 1016 | } |
| 1017 | 1017 | // Set PID for metadata definitions. |
| 1018 | 1018 | $this->cPid = $pid; |
@@ -1025,7 +1025,7 @@ discard block |
||
| 1025 | 1025 | // Check for record identifier. |
| 1026 | 1026 | if (empty($metadata['record_id'][0])) { |
| 1027 | 1027 | Helper::devLog('No record identifier found to avoid duplication', DEVLOG_SEVERITY_ERROR); |
| 1028 | - return false; |
|
| 1028 | + return FALSE; |
|
| 1029 | 1029 | } |
| 1030 | 1030 | // Load plugin configuration. |
| 1031 | 1031 | $conf = unserialize($GLOBALS['TYPO3_CONF_VARS']['EXT']['extConf'][self::$extKey]); |
@@ -1049,7 +1049,7 @@ discard block |
||
| 1049 | 1049 | $structure = $resArray['uid']; |
| 1050 | 1050 | } else { |
| 1051 | 1051 | Helper::devLog('Could not identify document/structure type "' . $queryBuilder->expr()->literal($metadata['type'][0]) . '"', DEVLOG_SEVERITY_ERROR); |
| 1052 | - return false; |
|
| 1052 | + return FALSE; |
|
| 1053 | 1053 | } |
| 1054 | 1054 | $metadata['type'][0] = $structure; |
| 1055 | 1055 | |
@@ -1106,9 +1106,9 @@ discard block |
||
| 1106 | 1106 | if (!(\TYPO3_REQUESTTYPE & \TYPO3_REQUESTTYPE_CLI)) { |
| 1107 | 1107 | Helper::addMessage( |
| 1108 | 1108 | htmlspecialchars(sprintf(Helper::getMessage('flash.newCollection'), $collection, $substUid[$collNewUid])), |
| 1109 | - Helper::getMessage('flash.attention', true), |
|
| 1109 | + Helper::getMessage('flash.attention', TRUE), |
|
| 1110 | 1110 | \TYPO3\CMS\Core\Messaging\FlashMessage::INFO, |
| 1111 | - true |
|
| 1111 | + TRUE |
|
| 1112 | 1112 | ); |
| 1113 | 1113 | } |
| 1114 | 1114 | } |
@@ -1157,9 +1157,9 @@ discard block |
||
| 1157 | 1157 | if (!(\TYPO3_REQUESTTYPE & \TYPO3_REQUESTTYPE_CLI)) { |
| 1158 | 1158 | Helper::addMessage( |
| 1159 | 1159 | htmlspecialchars(sprintf(Helper::getMessage('flash.newLibrary'), $owner, $ownerUid)), |
| 1160 | - Helper::getMessage('flash.attention', true), |
|
| 1160 | + Helper::getMessage('flash.attention', TRUE), |
|
| 1161 | 1161 | \TYPO3\CMS\Core\Messaging\FlashMessage::INFO, |
| 1162 | - true |
|
| 1162 | + TRUE |
|
| 1163 | 1163 | ); |
| 1164 | 1164 | } |
| 1165 | 1165 | } |
@@ -1245,7 +1245,7 @@ discard block |
||
| 1245 | 1245 | 'author' => implode('; ', $metadata['author']), |
| 1246 | 1246 | 'year' => implode('; ', $metadata['year']), |
| 1247 | 1247 | 'place' => implode('; ', $metadata['place']), |
| 1248 | - 'thumbnail' => $this->_getThumbnail(true), |
|
| 1248 | + 'thumbnail' => $this->_getThumbnail(TRUE), |
|
| 1249 | 1249 | 'metadata' => serialize($listed), |
| 1250 | 1250 | 'metadata_sorting' => serialize($sortable), |
| 1251 | 1251 | 'structure' => $metadata['type'][0], |
@@ -1281,9 +1281,9 @@ discard block |
||
| 1281 | 1281 | if (!(\TYPO3_REQUESTTYPE & \TYPO3_REQUESTTYPE_CLI)) { |
| 1282 | 1282 | Helper::addMessage( |
| 1283 | 1283 | htmlspecialchars(sprintf(Helper::getMessage('flash.documentSaved'), $metadata['title'][0], $this->uid)), |
| 1284 | - Helper::getMessage('flash.done', true), |
|
| 1284 | + Helper::getMessage('flash.done', TRUE), |
|
| 1285 | 1285 | \TYPO3\CMS\Core\Messaging\FlashMessage::OK, |
| 1286 | - true |
|
| 1286 | + TRUE |
|
| 1287 | 1287 | ); |
| 1288 | 1288 | } |
| 1289 | 1289 | // Add document to index. |
@@ -1292,7 +1292,7 @@ discard block |
||
| 1292 | 1292 | } else { |
| 1293 | 1293 | Helper::devLog('Invalid UID "' . $core . '" for Solr core', DEVLOG_SEVERITY_NOTICE); |
| 1294 | 1294 | } |
| 1295 | - return true; |
|
| 1295 | + return TRUE; |
|
| 1296 | 1296 | } |
| 1297 | 1297 | |
| 1298 | 1298 | /** |
@@ -1365,7 +1365,7 @@ discard block |
||
| 1365 | 1365 | ) { |
| 1366 | 1366 | $this->prepareMetadataArray($cPid); |
| 1367 | 1367 | $this->metadataArray[0] = $cPid; |
| 1368 | - $this->metadataArrayLoaded = true; |
|
| 1368 | + $this->metadataArrayLoaded = TRUE; |
|
| 1369 | 1369 | } |
| 1370 | 1370 | return $this->metadataArray; |
| 1371 | 1371 | } |
@@ -1474,7 +1474,7 @@ discard block |
||
| 1474 | 1474 | $parent = self::getInstance($this->parentId, $this->pid); |
| 1475 | 1475 | $this->rootId = $parent->rootId; |
| 1476 | 1476 | } |
| 1477 | - $this->rootIdLoaded = true; |
|
| 1477 | + $this->rootIdLoaded = TRUE; |
|
| 1478 | 1478 | } |
| 1479 | 1479 | return $this->rootId; |
| 1480 | 1480 | } |
@@ -1503,8 +1503,8 @@ discard block |
||
| 1503 | 1503 | // Is there no logical structure array yet? |
| 1504 | 1504 | if (!$this->tableOfContentsLoaded) { |
| 1505 | 1505 | // Get all logical structures. |
| 1506 | - $this->getLogicalStructure('', true); |
|
| 1507 | - $this->tableOfContentsLoaded = true; |
|
| 1506 | + $this->getLogicalStructure('', TRUE); |
|
| 1507 | + $this->tableOfContentsLoaded = TRUE; |
|
| 1508 | 1508 | } |
| 1509 | 1509 | return $this->tableOfContents; |
| 1510 | 1510 | } |
@@ -1520,7 +1520,7 @@ discard block |
||
| 1520 | 1520 | * |
| 1521 | 1521 | * @return string The document's thumbnail location |
| 1522 | 1522 | */ |
| 1523 | - protected abstract function _getThumbnail($forceReload = false); |
|
| 1523 | + protected abstract function _getThumbnail($forceReload = FALSE); |
|
| 1524 | 1524 | |
| 1525 | 1525 | /** |
| 1526 | 1526 | * This returns the ID of the toplevel logical structure node |
@@ -1601,7 +1601,7 @@ discard block |
||
| 1601 | 1601 | && $this->load($uid))) { |
| 1602 | 1602 | // Initialize core METS object. |
| 1603 | 1603 | $this->init(); |
| 1604 | - if ($this->getDocument() !== null) { |
|
| 1604 | + if ($this->getDocument() !== NULL) { |
|
| 1605 | 1605 | // Cast to string for safety reasons. |
| 1606 | 1606 | $location = (string) $uid; |
| 1607 | 1607 | $this->establishRecordId($pid); |
@@ -1659,30 +1659,30 @@ discard block |
||
| 1659 | 1659 | $this->parentId = $resArray['partof']; |
| 1660 | 1660 | $this->thumbnail = $resArray['thumbnail']; |
| 1661 | 1661 | $this->location = $resArray['location']; |
| 1662 | - $this->thumbnailLoaded = true; |
|
| 1662 | + $this->thumbnailLoaded = TRUE; |
|
| 1663 | 1663 | // Load XML file if necessary... |
| 1664 | 1664 | if ( |
| 1665 | - $this->getDocument() === null |
|
| 1665 | + $this->getDocument() === NULL |
|
| 1666 | 1666 | && $this->load($this->location) |
| 1667 | 1667 | ) { |
| 1668 | 1668 | // ...and set some basic properties. |
| 1669 | 1669 | $this->init(); |
| 1670 | 1670 | } |
| 1671 | 1671 | // Do we have a METS / IIIF object now? |
| 1672 | - if ($this->getDocument() !== null) { |
|
| 1672 | + if ($this->getDocument() !== NULL) { |
|
| 1673 | 1673 | // Set new location if necessary. |
| 1674 | 1674 | if (!empty($location)) { |
| 1675 | 1675 | $this->location = $location; |
| 1676 | 1676 | } |
| 1677 | 1677 | // Document ready! |
| 1678 | - $this->ready = true; |
|
| 1678 | + $this->ready = TRUE; |
|
| 1679 | 1679 | } |
| 1680 | - } elseif ($this->getDocument() !== null) { |
|
| 1680 | + } elseif ($this->getDocument() !== NULL) { |
|
| 1681 | 1681 | // Set location as UID for documents not in database. |
| 1682 | 1682 | $this->uid = $location; |
| 1683 | 1683 | $this->location = $location; |
| 1684 | 1684 | // Document ready! |
| 1685 | - $this->ready = true; |
|
| 1685 | + $this->ready = TRUE; |
|
| 1686 | 1686 | } else { |
| 1687 | 1687 | Helper::devLog('No document with UID ' . $uid . ' found or document not accessible', DEVLOG_SEVERITY_ERROR); |
| 1688 | 1688 | } |
@@ -86,7 +86,7 @@ discard block |
||
| 86 | 86 | * @var bool |
| 87 | 87 | * @access protected |
| 88 | 88 | */ |
| 89 | - protected $hasFulltextSet = false; |
|
| 89 | + protected $hasFulltextSet = FALSE; |
|
| 90 | 90 | |
| 91 | 91 | /** |
| 92 | 92 | * This holds the original manifest's parsed metadata array with their corresponding |
@@ -119,7 +119,7 @@ discard block |
||
| 119 | 119 | */ |
| 120 | 120 | protected function establishRecordId($pid) |
| 121 | 121 | { |
| 122 | - if ($this->iiif !== null) { |
|
| 122 | + if ($this->iiif !== NULL) { |
|
| 123 | 123 | /* |
| 124 | 124 | * FIXME This will not consistently work because we can not be sure to have the pid at hand. It may miss |
| 125 | 125 | * if the plugin that actually loads the manifest allows content from other pages. |
@@ -203,7 +203,7 @@ discard block |
||
| 203 | 203 | * @var bool |
| 204 | 204 | * @access protected |
| 205 | 205 | */ |
| 206 | - protected $useGrpsLoaded = false; |
|
| 206 | + protected $useGrpsLoaded = FALSE; |
|
| 207 | 207 | |
| 208 | 208 | /** |
| 209 | 209 | * Holds the configured useGrps as array. |
@@ -245,7 +245,7 @@ discard block |
||
| 245 | 245 | if (!empty($extConf['fileGrpAudio'])) { |
| 246 | 246 | $this->useGrps['fileGrpAudio'] = GeneralUtility::trimExplode(',', $extConf['fileGrpAudio']); |
| 247 | 247 | } |
| 248 | - $this->useGrpsLoaded = true; |
|
| 248 | + $this->useGrpsLoaded = TRUE; |
|
| 249 | 249 | } |
| 250 | 250 | return array_key_exists($use, $this->useGrps) ? $this->useGrps[$use] : []; |
| 251 | 251 | } |
@@ -258,8 +258,8 @@ discard block |
||
| 258 | 258 | { |
| 259 | 259 | // Is there no physical structure array yet? |
| 260 | 260 | if (!$this->physicalStructureLoaded) { |
| 261 | - if ($this->iiif == null || !($this->iiif instanceof ManifestInterface)) { |
|
| 262 | - return null; |
|
| 261 | + if ($this->iiif == NULL || !($this->iiif instanceof ManifestInterface)) { |
|
| 262 | + return NULL; |
|
| 263 | 263 | } |
| 264 | 264 | $extConf = unserialize($GLOBALS['TYPO3_CONF_VARS']['EXT']['extConf'][self::$extKey]); |
| 265 | 265 | $iiifId = $this->iiif->getId(); |
@@ -269,7 +269,7 @@ discard block |
||
| 269 | 269 | $this->physicalStructureInfo[$physSeq[0]]['label'] = $this->iiif->getLabelForDisplay(); |
| 270 | 270 | $this->physicalStructureInfo[$physSeq[0]]['orderlabel'] = $this->iiif->getLabelForDisplay(); |
| 271 | 271 | $this->physicalStructureInfo[$physSeq[0]]['type'] = 'physSequence'; |
| 272 | - $this->physicalStructureInfo[$physSeq[0]]['contentIds'] = null; |
|
| 272 | + $this->physicalStructureInfo[$physSeq[0]]['contentIds'] = NULL; |
|
| 273 | 273 | $fileUseDownload = $this->getUseGroups('fileGrpDownload'); |
| 274 | 274 | $fileUseFulltext = $this->getUseGroups('fileGrpFulltext'); |
| 275 | 275 | $fileUseThumbs = $this->getUseGroups('fileGrpThumbs'); |
@@ -283,13 +283,13 @@ discard block |
||
| 283 | 283 | if (!empty($fileUseFulltext)) { |
| 284 | 284 | $iiifAlto = $this->iiif->getSeeAlsoUrlsForFormat('application/alto+xml'); |
| 285 | 285 | if (empty($iiifAlto)) { |
| 286 | - $iiifAlto = $this->iiif->getSeeAlsoUrlsForProfile('http://www.loc.gov/standards/alto/', true); |
|
| 286 | + $iiifAlto = $this->iiif->getSeeAlsoUrlsForProfile('http://www.loc.gov/standards/alto/', TRUE); |
|
| 287 | 287 | } |
| 288 | 288 | if (!empty($iiifAlto)) { |
| 289 | 289 | $this->mimeTypes[$iiifAlto[0]] = 'application/alto+xml'; |
| 290 | 290 | $this->physicalStructureInfo[$physSeq[0]]['files'][$fileUseFulltext[0]] = $iiifAlto[0]; |
| 291 | - $this->hasFulltext = true; |
|
| 292 | - $this->hasFulltextSet = true; |
|
| 291 | + $this->hasFulltext = TRUE; |
|
| 292 | + $this->hasFulltextSet = TRUE; |
|
| 293 | 293 | } |
| 294 | 294 | } |
| 295 | 295 | if (!empty($this->iiif->getDefaultCanvases())) { |
@@ -308,39 +308,39 @@ discard block |
||
| 308 | 308 | // populate structural metadata info |
| 309 | 309 | $elements[$canvasOrder] = $canvas->getId(); |
| 310 | 310 | $this->physicalStructureInfo[$elements[$canvasOrder]]['id'] = $canvas->getId(); |
| 311 | - $this->physicalStructureInfo[$elements[$canvasOrder]]['dmdId'] = null; |
|
| 311 | + $this->physicalStructureInfo[$elements[$canvasOrder]]['dmdId'] = NULL; |
|
| 312 | 312 | $this->physicalStructureInfo[$elements[$canvasOrder]]['label'] = $canvas->getLabelForDisplay(); |
| 313 | 313 | $this->physicalStructureInfo[$elements[$canvasOrder]]['orderlabel'] = $canvas->getLabelForDisplay(); |
| 314 | 314 | // assume that a canvas always represents a page |
| 315 | 315 | $this->physicalStructureInfo[$elements[$canvasOrder]]['type'] = 'page'; |
| 316 | - $this->physicalStructureInfo[$elements[$canvasOrder]]['contentIds'] = null; |
|
| 317 | - $this->physicalStructureInfo[$elements[$canvasOrder]]['annotationContainers'] = null; |
|
| 316 | + $this->physicalStructureInfo[$elements[$canvasOrder]]['contentIds'] = NULL; |
|
| 317 | + $this->physicalStructureInfo[$elements[$canvasOrder]]['annotationContainers'] = NULL; |
|
| 318 | 318 | if (!empty($canvas->getPossibleTextAnnotationContainers(Motivation::PAINTING))) { |
| 319 | 319 | $this->physicalStructureInfo[$elements[$canvasOrder]]['annotationContainers'] = []; |
| 320 | 320 | foreach ($canvas->getPossibleTextAnnotationContainers(Motivation::PAINTING) as $annotationContainer) { |
| 321 | 321 | $this->physicalStructureInfo[$elements[$canvasOrder]]['annotationContainers'][] = $annotationContainer->getId(); |
| 322 | 322 | if ($extConf['indexAnnotations']) { |
| 323 | - $this->hasFulltext = true; |
|
| 324 | - $this->hasFulltextSet = true; |
|
| 323 | + $this->hasFulltext = TRUE; |
|
| 324 | + $this->hasFulltextSet = TRUE; |
|
| 325 | 325 | } |
| 326 | 326 | } |
| 327 | 327 | } |
| 328 | 328 | if (!empty($fileUseFulltext)) { |
| 329 | 329 | $alto = $canvas->getSeeAlsoUrlsForFormat('application/alto+xml'); |
| 330 | 330 | if (empty($alto)) { |
| 331 | - $alto = $canvas->getSeeAlsoUrlsForProfile('http://www.loc.gov/standards/alto/', true); |
|
| 331 | + $alto = $canvas->getSeeAlsoUrlsForProfile('http://www.loc.gov/standards/alto/', TRUE); |
|
| 332 | 332 | } |
| 333 | 333 | if (!empty($alto)) { |
| 334 | 334 | $this->mimeTypes[$alto[0]] = 'application/alto+xml'; |
| 335 | 335 | $this->physicalStructureInfo[$elements[$canvasOrder]]['files'][$fileUseFulltext[0]] = $alto[0]; |
| 336 | - $this->hasFulltext = true; |
|
| 337 | - $this->hasFulltextSet = true; |
|
| 336 | + $this->hasFulltext = TRUE; |
|
| 337 | + $this->hasFulltextSet = TRUE; |
|
| 338 | 338 | } |
| 339 | 339 | } |
| 340 | 340 | if (!empty($fileUses)) { |
| 341 | 341 | $image = $canvas->getImageAnnotations()[0]; |
| 342 | 342 | foreach ($fileUses as $fileUse) { |
| 343 | - if ($image->getBody() !== null && $image->getBody() instanceof ContentResourceInterface) { |
|
| 343 | + if ($image->getBody() !== NULL && $image->getBody() instanceof ContentResourceInterface) { |
|
| 344 | 344 | $this->physicalStructureInfo[$elements[$canvasOrder]]['files'][$fileUse] = $image->getBody()->getId(); |
| 345 | 345 | } |
| 346 | 346 | } |
@@ -359,7 +359,7 @@ discard block |
||
| 359 | 359 | // Merge and re-index the array to get nice numeric indexes. |
| 360 | 360 | $this->physicalStructure = array_merge($physSeq, $elements); |
| 361 | 361 | } |
| 362 | - $this->physicalStructureLoaded = true; |
|
| 362 | + $this->physicalStructureLoaded = TRUE; |
|
| 363 | 363 | } |
| 364 | 364 | return $this->physicalStructure; |
| 365 | 365 | } |
@@ -384,15 +384,15 @@ discard block |
||
| 384 | 384 | */ |
| 385 | 385 | public function getFileLocation($id) |
| 386 | 386 | { |
| 387 | - if ($id == null) { |
|
| 388 | - return null; |
|
| 387 | + if ($id == NULL) { |
|
| 388 | + return NULL; |
|
| 389 | 389 | } |
| 390 | 390 | $resource = $this->iiif->getContainedResourceById($id); |
| 391 | 391 | if (isset($resource)) { |
| 392 | 392 | if ($resource instanceof CanvasInterface) { |
| 393 | - return (!empty($resource->getImageAnnotations()) && $resource->getImageAnnotations()->getSingleService() != null) ? $resource->getImageAnnotations()[0]->getSingleService()->getId() : $id; |
|
| 393 | + return (!empty($resource->getImageAnnotations()) && $resource->getImageAnnotations()->getSingleService() != NULL) ? $resource->getImageAnnotations()[0]->getSingleService()->getId() : $id; |
|
| 394 | 394 | } elseif ($resource instanceof ContentResourceInterface) { |
| 395 | - return $resource->getSingleService() != null && $resource->getSingleService() instanceof Service ? $resource->getSingleService()->getId() : $id; |
|
| 395 | + return $resource->getSingleService() != NULL && $resource->getSingleService() instanceof Service ? $resource->getSingleService()->getId() : $id; |
|
| 396 | 396 | } elseif ($resource instanceof AbstractImageService) { |
| 397 | 397 | return $resource->getId(); |
| 398 | 398 | } elseif ($resource instanceof AnnotationContainerInterface) { |
@@ -415,7 +415,7 @@ discard block |
||
| 415 | 415 | } elseif ($fileResource instanceof AnnotationInterface) { |
| 416 | 416 | $format = "application/vnd.kitodo.iiif"; |
| 417 | 417 | } elseif ($fileResource instanceof ContentResourceInterface) { |
| 418 | - if ($fileResource->isText() || $fileResource->isImage() && ($fileResource->getSingleService() == null || !($fileResource->getSingleService() instanceof AbstractImageService))) { |
|
| 418 | + if ($fileResource->isText() || $fileResource->isImage() && ($fileResource->getSingleService() == NULL || !($fileResource->getSingleService() instanceof AbstractImageService))) { |
|
| 419 | 419 | // Support static images without an image service |
| 420 | 420 | return $fileResource->getFormat(); |
| 421 | 421 | } |
@@ -433,7 +433,7 @@ discard block |
||
| 433 | 433 | * {@inheritDoc} |
| 434 | 434 | * @see Document::getLogicalStructure() |
| 435 | 435 | */ |
| 436 | - public function getLogicalStructure($id, $recursive = false) |
|
| 436 | + public function getLogicalStructure($id, $recursive = FALSE) |
|
| 437 | 437 | { |
| 438 | 438 | $details = []; |
| 439 | 439 | if (!$recursive && !empty($this->logicalUnits[$id])) { |
@@ -450,8 +450,8 @@ discard block |
||
| 450 | 450 | // cache the ranges - they might occure multiple times in the structures "tree" - with full data as well as referenced as id |
| 451 | 451 | $processedStructures = []; |
| 452 | 452 | foreach ($logUnits as $logUnit) { |
| 453 | - if (array_search($logUnit->getId(), $processedStructures) == false) { |
|
| 454 | - $this->tableOfContents[] = $this->getLogicalStructureInfo($logUnit, true, $processedStructures); |
|
| 453 | + if (array_search($logUnit->getId(), $processedStructures) == FALSE) { |
|
| 454 | + $this->tableOfContents[] = $this->getLogicalStructureInfo($logUnit, TRUE, $processedStructures); |
|
| 455 | 455 | } |
| 456 | 456 | } |
| 457 | 457 | } |
@@ -469,13 +469,13 @@ discard block |
||
| 469 | 469 | * @param array $processedStructures: IIIF resources that already have been processed |
| 470 | 470 | * @return array Logical structure array |
| 471 | 471 | */ |
| 472 | - protected function getLogicalStructureInfo(IiifResourceInterface $resource, $recursive = false, &$processedStructures = []) |
|
| 472 | + protected function getLogicalStructureInfo(IiifResourceInterface $resource, $recursive = FALSE, &$processedStructures = []) |
|
| 473 | 473 | { |
| 474 | 474 | $details = []; |
| 475 | 475 | $details['id'] = $resource->getId(); |
| 476 | 476 | $details['dmdId'] = ''; |
| 477 | - $details['label'] = $resource->getLabelForDisplay() !== null ? $resource->getLabelForDisplay() : ''; |
|
| 478 | - $details['orderlabel'] = $resource->getLabelForDisplay() !== null ? $resource->getLabelForDisplay() : ''; |
|
| 477 | + $details['label'] = $resource->getLabelForDisplay() !== NULL ? $resource->getLabelForDisplay() : ''; |
|
| 478 | + $details['orderlabel'] = $resource->getLabelForDisplay() !== NULL ? $resource->getLabelForDisplay() : ''; |
|
| 479 | 479 | $details['contentIds'] = ''; |
| 480 | 480 | $details['volume'] = ''; |
| 481 | 481 | $details['pagination'] = ''; |
@@ -500,10 +500,10 @@ discard block |
||
| 500 | 500 | $startCanvas = $resource->getStartCanvasOrFirstCanvas(); |
| 501 | 501 | $canvases = $resource->getAllCanvases(); |
| 502 | 502 | } |
| 503 | - if ($startCanvas != null) { |
|
| 503 | + if ($startCanvas != NULL) { |
|
| 504 | 504 | $details['pagination'] = $startCanvas->getLabel(); |
| 505 | 505 | $startCanvasIndex = array_search($startCanvas, $this->iiif->getDefaultCanvases()); |
| 506 | - if ($startCanvasIndex !== false) { |
|
| 506 | + if ($startCanvasIndex !== FALSE) { |
|
| 507 | 507 | $details['points'] = $startCanvasIndex + 1; |
| 508 | 508 | } |
| 509 | 509 | } |
@@ -517,7 +517,7 @@ discard block |
||
| 517 | 517 | if ($recursive) { |
| 518 | 518 | $processedStructures[] = $resource->getId(); |
| 519 | 519 | $details['children'] = []; |
| 520 | - if ($resource instanceof ManifestInterface && $resource->getRootRanges() != null) { |
|
| 520 | + if ($resource instanceof ManifestInterface && $resource->getRootRanges() != NULL) { |
|
| 521 | 521 | $rangesToAdd = []; |
| 522 | 522 | $rootRanges = []; |
| 523 | 523 | if (sizeof($this->iiif->getRootRanges()) == 1 && $this->iiif->getRootRanges()[0]->isTopRange()) { |
@@ -529,15 +529,15 @@ discard block |
||
| 529 | 529 | $rootRanges[] = $range; |
| 530 | 530 | } |
| 531 | 531 | foreach ($rootRanges as $range) { |
| 532 | - if ((array_search($range->getId(), $processedStructures) == false)) { |
|
| 533 | - $details['children'][] = $this->getLogicalStructureInfo($range, true, $processedStructures); |
|
| 532 | + if ((array_search($range->getId(), $processedStructures) == FALSE)) { |
|
| 533 | + $details['children'][] = $this->getLogicalStructureInfo($range, TRUE, $processedStructures); |
|
| 534 | 534 | } |
| 535 | 535 | } |
| 536 | 536 | } elseif ($resource instanceof RangeInterface) { |
| 537 | 537 | if (!empty($resource->getAllRanges())) { |
| 538 | 538 | foreach ($resource->getAllRanges() as $range) { |
| 539 | - if ((array_search($range->getId(), $processedStructures) == false)) { |
|
| 540 | - $details['children'][] = $this->getLogicalStructureInfo($range, true, $processedStructures); |
|
| 539 | + if ((array_search($range->getId(), $processedStructures) == FALSE)) { |
|
| 540 | + $details['children'][] = $this->getLogicalStructureInfo($range, TRUE, $processedStructures); |
|
| 541 | 541 | } |
| 542 | 542 | } |
| 543 | 543 | } |
@@ -562,15 +562,15 @@ discard block |
||
| 562 | 562 | * |
| 563 | 563 | * @todo This method is still in experimental; the method signature may change. |
| 564 | 564 | */ |
| 565 | - public function getManifestMetadata($id, $cPid = 0, $withDescription = true, $withRights = true, $withRelated = true) |
|
| 565 | + public function getManifestMetadata($id, $cPid = 0, $withDescription = TRUE, $withRights = TRUE, $withRelated = TRUE) |
|
| 566 | 566 | { |
| 567 | 567 | if (!empty($this->originalMetadataArray[$id])) { |
| 568 | 568 | return $this->originalMetadataArray[$id]; |
| 569 | 569 | } |
| 570 | 570 | $iiifResource = $this->iiif->getContainedResourceById($id); |
| 571 | 571 | $result = []; |
| 572 | - if ($iiifResource != null) { |
|
| 573 | - if ($iiifResource->getLabel() != null && $iiifResource->getLabel() != "") { |
|
| 572 | + if ($iiifResource != NULL) { |
|
| 573 | + if ($iiifResource->getLabel() != NULL && $iiifResource->getLabel() != "") { |
|
| 574 | 574 | $result['label'] = $iiifResource->getLabel(); |
| 575 | 575 | } |
| 576 | 576 | if (!empty($iiifResource->getMetadata())) { |
@@ -672,7 +672,7 @@ discard block |
||
| 672 | 672 | $iiifResource = $this->iiif->getContainedResourceById($id); |
| 673 | 673 | while ($resArray = $result->fetch()) { |
| 674 | 674 | // Set metadata field's value(s). |
| 675 | - if ($resArray['format'] > 0 && !empty($resArray['xpath']) && ($values = $iiifResource->jsonPath($resArray['xpath'])) != null) { |
|
| 675 | + if ($resArray['format'] > 0 && !empty($resArray['xpath']) && ($values = $iiifResource->jsonPath($resArray['xpath'])) != NULL) { |
|
| 676 | 676 | if (is_string($values)) { |
| 677 | 677 | $metadata[$resArray['index_name']] = [trim((string) $values)]; |
| 678 | 678 | } elseif ($values instanceof JSONPath && is_array($values->data()) && count($values->data()) > 1) { |
@@ -690,7 +690,7 @@ discard block |
||
| 690 | 690 | if (!empty($metadata[$resArray['index_name']]) && $resArray['is_sortable']) { |
| 691 | 691 | if ( |
| 692 | 692 | $resArray['format'] > 0 && !empty($resArray['xpath_sorting']) |
| 693 | - && ($values = $iiifResource->jsonPath($resArray['xpath_sorting']) != null) |
|
| 693 | + && ($values = $iiifResource->jsonPath($resArray['xpath_sorting']) != NULL) |
|
| 694 | 694 | ) { |
| 695 | 695 | if (is_string($values)) { |
| 696 | 696 | $metadata[$resArray['index_name'] . '_sorting'][0] = [trim((string) $values)]; |
@@ -726,7 +726,7 @@ discard block |
||
| 726 | 726 | $this->smLinkRangeCanvasesRecursively($range); |
| 727 | 727 | } |
| 728 | 728 | } |
| 729 | - $this->smLinksLoaded = true; |
|
| 729 | + $this->smLinksLoaded = TRUE; |
|
| 730 | 730 | } |
| 731 | 731 | return $this->smLinks; |
| 732 | 732 | } |
@@ -820,7 +820,7 @@ discard block |
||
| 820 | 820 | foreach ($annotationContainer->getTextAnnotations(Motivation::PAINTING) as $annotation) { |
| 821 | 821 | if ( |
| 822 | 822 | $annotation->getTargetResourceId() == $iiifResource->getId() && |
| 823 | - $annotation->getBody() != null && $annotation->getBody()->getChars() != null |
|
| 823 | + $annotation->getBody() != NULL && $annotation->getBody()->getChars() != NULL |
|
| 824 | 824 | ) { |
| 825 | 825 | $annotationTexts[] = $annotation->getBody()->getChars(); |
| 826 | 826 | } |
@@ -866,21 +866,21 @@ discard block |
||
| 866 | 866 | protected function loadLocation($location) |
| 867 | 867 | { |
| 868 | 868 | $fileResource = GeneralUtility::getUrl($location); |
| 869 | - if ($fileResource !== false) { |
|
| 869 | + if ($fileResource !== FALSE) { |
|
| 870 | 870 | $conf = unserialize($GLOBALS['TYPO3_CONF_VARS']['EXT']['extConf'][self::$extKey]); |
| 871 | 871 | IiifHelper::setUrlReader(IiifUrlReader::getInstance()); |
| 872 | 872 | IiifHelper::setMaxThumbnailHeight($conf['iiifThumbnailHeight']); |
| 873 | 873 | IiifHelper::setMaxThumbnailWidth($conf['iiifThumbnailWidth']); |
| 874 | 874 | $resource = IiifHelper::loadIiifResource($fileResource); |
| 875 | - if ($resource != null) { |
|
| 875 | + if ($resource != NULL) { |
|
| 876 | 876 | if ($resource instanceof ManifestInterface) { |
| 877 | 877 | $this->iiif = $resource; |
| 878 | - return true; |
|
| 878 | + return TRUE; |
|
| 879 | 879 | } |
| 880 | 880 | } |
| 881 | 881 | } |
| 882 | 882 | Helper::devLog('Could not load IIIF manifest from "' . $location . '"', DEVLOG_SEVERITY_ERROR); |
| 883 | - return false; |
|
| 883 | + return FALSE; |
|
| 884 | 884 | } |
| 885 | 885 | |
| 886 | 886 | /** |
@@ -901,9 +901,9 @@ discard block |
||
| 901 | 901 | { |
| 902 | 902 | if ($preloadedDocument instanceof ManifestInterface) { |
| 903 | 903 | $this->iiif = $preloadedDocument; |
| 904 | - return true; |
|
| 904 | + return TRUE; |
|
| 905 | 905 | } |
| 906 | - return false; |
|
| 906 | + return FALSE; |
|
| 907 | 907 | } |
| 908 | 908 | |
| 909 | 909 | /** |
@@ -926,22 +926,22 @@ discard block |
||
| 926 | 926 | !empty($canvas->getSeeAlsoUrlsForFormat("application/alto+xml")) || |
| 927 | 927 | !empty($canvas->getSeeAlsoUrlsForProfile("http://www.loc.gov/standards/alto/")) |
| 928 | 928 | ) { |
| 929 | - $this->hasFulltextSet = true; |
|
| 930 | - $this->hasFulltext = true; |
|
| 929 | + $this->hasFulltextSet = TRUE; |
|
| 930 | + $this->hasFulltext = TRUE; |
|
| 931 | 931 | return; |
| 932 | 932 | } |
| 933 | 933 | $extConf = unserialize($GLOBALS['TYPO3_CONF_VARS']['EXT']['extConf'][self::$extKey]); |
| 934 | 934 | if ($extConf['indexAnnotations'] == 1 && !empty($canvas->getPossibleTextAnnotationContainers(Motivation::PAINTING))) { |
| 935 | 935 | foreach ($canvas->getPossibleTextAnnotationContainers(Motivation::PAINTING) as $annotationContainer) { |
| 936 | - if (($textAnnotations = $annotationContainer->getTextAnnotations(Motivation::PAINTING)) != null) { |
|
| 936 | + if (($textAnnotations = $annotationContainer->getTextAnnotations(Motivation::PAINTING)) != NULL) { |
|
| 937 | 937 | foreach ($textAnnotations as $annotation) { |
| 938 | 938 | if ( |
| 939 | - $annotation->getBody() != null && |
|
| 939 | + $annotation->getBody() != NULL && |
|
| 940 | 940 | $annotation->getBody()->getFormat() == "text/plain" && |
| 941 | - $annotation->getBody()->getChars() != null |
|
| 941 | + $annotation->getBody()->getChars() != NULL |
|
| 942 | 942 | ) { |
| 943 | - $this->hasFulltextSet = true; |
|
| 944 | - $this->hasFulltext = true; |
|
| 943 | + $this->hasFulltextSet = TRUE; |
|
| 944 | + $this->hasFulltext = TRUE; |
|
| 945 | 945 | return; |
| 946 | 946 | } |
| 947 | 947 | } |
@@ -949,7 +949,7 @@ discard block |
||
| 949 | 949 | } |
| 950 | 950 | } |
| 951 | 951 | } |
| 952 | - $this->hasFulltextSet = true; |
|
| 952 | + $this->hasFulltextSet = TRUE; |
|
| 953 | 953 | } |
| 954 | 954 | } |
| 955 | 955 | |
@@ -957,7 +957,7 @@ discard block |
||
| 957 | 957 | * {@inheritDoc} |
| 958 | 958 | * @see \Kitodo\Dlf\Common\Document::_getThumbnail() |
| 959 | 959 | */ |
| 960 | - protected function _getThumbnail($forceReload = false) |
|
| 960 | + protected function _getThumbnail($forceReload = FALSE) |
|
| 961 | 961 | { |
| 962 | 962 | return $this->iiif->getThumbnailUrl(); |
| 963 | 963 | } |
@@ -991,7 +991,7 @@ discard block |
||
| 991 | 991 | IiifHelper::setMaxThumbnailHeight($conf['iiifThumbnailHeight']); |
| 992 | 992 | IiifHelper::setMaxThumbnailWidth($conf['iiifThumbnailWidth']); |
| 993 | 993 | $resource = IiifHelper::loadIiifResource($this->asJson); |
| 994 | - if ($resource != null && $resource instanceof ManifestInterface) { |
|
| 994 | + if ($resource != NULL && $resource instanceof ManifestInterface) { |
|
| 995 | 995 | $this->asJson = ''; |
| 996 | 996 | $this->iiif = $resource; |
| 997 | 997 | $this->init(); |