@@ -29,8 +29,7 @@ discard block |
||
| 29 | 29 | * @subpackage dlf |
| 30 | 30 | * @access public |
| 31 | 31 | */ |
| 32 | -class ListView extends \Kitodo\Dlf\Common\AbstractPlugin |
|
| 33 | -{ |
|
| 32 | +class ListView extends \Kitodo\Dlf\Common\AbstractPlugin { |
|
| 34 | 33 | public $scriptRelPath = 'Classes/Plugin/ListView.php'; |
| 35 | 34 | |
| 36 | 35 | /** |
@@ -72,8 +71,7 @@ discard block |
||
| 72 | 71 | * |
| 73 | 72 | * @return string The rendered page browser ready for output |
| 74 | 73 | */ |
| 75 | - protected function getPageBrowser() |
|
| 76 | - { |
|
| 74 | + protected function getPageBrowser() { |
|
| 77 | 75 | // Get overall number of pages. |
| 78 | 76 | $maxPages = intval(ceil($this->list->metadata['options']['numberOfToplevelHits'] / $this->conf['limit'])); |
| 79 | 77 | // Return empty pagebrowser if there is just one page. |
@@ -124,8 +122,7 @@ discard block |
||
| 124 | 122 | * |
| 125 | 123 | * @return string The rendered entry ready for output |
| 126 | 124 | */ |
| 127 | - protected function getEntry($number, $template) |
|
| 128 | - { |
|
| 125 | + protected function getEntry($number, $template) { |
|
| 129 | 126 | $markerArray['###NUMBER###'] = ($this->piVars['pointer'] * $this->conf['limit']) + $number + 1; |
| 130 | 127 | $markerArray['###METADATA###'] = ''; |
| 131 | 128 | $markerArray['###THUMBNAIL###'] = ''; |
@@ -227,8 +224,7 @@ discard block |
||
| 227 | 224 | * |
| 228 | 225 | * @return array The parsed fieldwrap |
| 229 | 226 | */ |
| 230 | - private function getFieldWrap($index_name, $wrap) |
|
| 231 | - { |
|
| 227 | + private function getFieldWrap($index_name, $wrap) { |
|
| 232 | 228 | if (isset($this->fieldwrap[$index_name])) { |
| 233 | 229 | return $this->fieldwrap[$index_name]; |
| 234 | 230 | } else { |
@@ -243,8 +239,7 @@ discard block |
||
| 243 | 239 | * |
| 244 | 240 | * @return string The rendered sorting dialog ready for output |
| 245 | 241 | */ |
| 246 | - protected function getSortingForm() |
|
| 247 | - { |
|
| 242 | + protected function getSortingForm() { |
|
| 248 | 243 | // Return nothing if there are no sortable metadata fields. |
| 249 | 244 | if (!count($this->sortables)) { |
| 250 | 245 | return ''; |
@@ -295,8 +290,7 @@ discard block |
||
| 295 | 290 | * |
| 296 | 291 | * @return string The rendered entries ready for output |
| 297 | 292 | */ |
| 298 | - protected function getSubEntries($number, $template) |
|
| 299 | - { |
|
| 293 | + protected function getSubEntries($number, $template) { |
|
| 300 | 294 | $content = ''; |
| 301 | 295 | $noTitle = $this->pi_getLL('noTitle'); |
| 302 | 296 | $highlight_word = preg_replace('/\s\s+/', ';', $this->list->metadata['searchString']); |
@@ -399,8 +393,7 @@ discard block |
||
| 399 | 393 | * |
| 400 | 394 | * @return void |
| 401 | 395 | */ |
| 402 | - protected function loadConfig() |
|
| 403 | - { |
|
| 396 | + protected function loadConfig() { |
|
| 404 | 397 | $queryBuilder = GeneralUtility::makeInstance(ConnectionPool::class) |
| 405 | 398 | ->getQueryBuilderForTable('tx_dlf_metadata'); |
| 406 | 399 | |
@@ -446,8 +439,7 @@ discard block |
||
| 446 | 439 | * |
| 447 | 440 | * @return string The content that is displayed on the website |
| 448 | 441 | */ |
| 449 | - public function main($content, $conf) |
|
| 450 | - { |
|
| 442 | + public function main($content, $conf) { |
|
| 451 | 443 | $this->init($conf); |
| 452 | 444 | // Don't cache the output. |
| 453 | 445 | $this->setCache(false); |
@@ -84,30 +84,30 @@ discard block |
||
| 84 | 84 | $separator = '<span class="separator">' . htmlspecialchars($this->pi_getLL('separator', ' - ')) . '</span>'; |
| 85 | 85 | // Add link to previous page. |
| 86 | 86 | if ($this->piVars['pointer'] > 0) { |
| 87 | - $output = $this->pi_linkTP_keepPIvars(htmlspecialchars($this->pi_getLL('prevPage', '<')), ['pointer' => $this->piVars['pointer'] - 1], true) . $separator; |
|
| 87 | + $output = $this->pi_linkTP_keepPIvars(htmlspecialchars($this->pi_getLL('prevPage', '<')), ['pointer' => $this->piVars['pointer'] - 1], TRUE) . $separator; |
|
| 88 | 88 | } else { |
| 89 | 89 | $output = '<span>' . htmlspecialchars($this->pi_getLL('prevPage', '<')) . '</span>' . $separator; |
| 90 | 90 | } |
| 91 | 91 | $i = 0; |
| 92 | - $skip = null; |
|
| 92 | + $skip = NULL; |
|
| 93 | 93 | // Add links to pages. |
| 94 | 94 | while ($i < $maxPages) { |
| 95 | 95 | if ($i < 3 || ($i > $this->piVars['pointer'] - 3 && $i < $this->piVars['pointer'] + 3) || $i > $maxPages - 4) { |
| 96 | 96 | if ($this->piVars['pointer'] != $i) { |
| 97 | - $output .= $this->pi_linkTP_keepPIvars(htmlspecialchars(sprintf($this->pi_getLL('page', '%d'), $i + 1)), ['pointer' => $i], true) . $separator; |
|
| 97 | + $output .= $this->pi_linkTP_keepPIvars(htmlspecialchars(sprintf($this->pi_getLL('page', '%d'), $i + 1)), ['pointer' => $i], TRUE) . $separator; |
|
| 98 | 98 | } else { |
| 99 | 99 | $output .= '<span class="active">' . htmlspecialchars(sprintf($this->pi_getLL('page', '%d'), $i + 1)) . '</span>' . $separator; |
| 100 | 100 | } |
| 101 | - $skip = true; |
|
| 102 | - } elseif ($skip === true) { |
|
| 101 | + $skip = TRUE; |
|
| 102 | + } elseif ($skip === TRUE) { |
|
| 103 | 103 | $output .= '<span class="skip">' . htmlspecialchars($this->pi_getLL('skip', '...')) . '</span>' . $separator; |
| 104 | - $skip = false; |
|
| 104 | + $skip = FALSE; |
|
| 105 | 105 | } |
| 106 | 106 | $i++; |
| 107 | 107 | } |
| 108 | 108 | // Add link to next page. |
| 109 | 109 | if ($this->piVars['pointer'] < $maxPages - 1) { |
| 110 | - $output .= $this->pi_linkTP_keepPIvars(htmlspecialchars($this->pi_getLL('nextPage', '>')), ['pointer' => $this->piVars['pointer'] + 1], true); |
|
| 110 | + $output .= $this->pi_linkTP_keepPIvars(htmlspecialchars($this->pi_getLL('nextPage', '>')), ['pointer' => $this->piVars['pointer'] + 1], TRUE); |
|
| 111 | 111 | } else { |
| 112 | 112 | $output .= '<span>' . htmlspecialchars($this->pi_getLL('nextPage', '>')) . '</span>'; |
| 113 | 113 | } |
@@ -144,7 +144,7 @@ discard block |
||
| 144 | 144 | if ($index_name == 'title') { |
| 145 | 145 | // Get title of parent document if needed. |
| 146 | 146 | if (empty($value) && $this->conf['getTitle']) { |
| 147 | - $superiorTitle = Document::getTitle($this->list[$number]['uid'], true); |
|
| 147 | + $superiorTitle = Document::getTitle($this->list[$number]['uid'], TRUE); |
|
| 148 | 148 | if (!empty($superiorTitle)) { |
| 149 | 149 | $value = '[' . $superiorTitle . ']'; |
| 150 | 150 | } |
@@ -166,7 +166,7 @@ discard block |
||
| 166 | 166 | 'parameter' => $this->conf['targetPid'], |
| 167 | 167 | 'forceAbsoluteUrl' => !empty($this->conf['forceAbsoluteUrl']) ? 1 : 0, |
| 168 | 168 | 'forceAbsoluteUrl.' => ['scheme' => !empty($this->conf['forceAbsoluteUrl']) && !empty($this->conf['forceAbsoluteUrlHttps']) ? 'https' : 'http'], |
| 169 | - 'additionalParams' => \TYPO3\CMS\Core\Utility\GeneralUtility::implodeArrayForUrl($this->prefixId, $additionalParams, '', true, false) |
|
| 169 | + 'additionalParams' => \TYPO3\CMS\Core\Utility\GeneralUtility::implodeArrayForUrl($this->prefixId, $additionalParams, '', TRUE, FALSE) |
|
| 170 | 170 | ]; |
| 171 | 171 | $value = $this->cObj->typoLink(htmlspecialchars($value), $conf); |
| 172 | 172 | } elseif ($index_name == 'owner' && !empty($value)) { |
@@ -213,12 +213,12 @@ discard block |
||
| 213 | 213 | 'parameter' => $this->conf['targetBasket'], |
| 214 | 214 | 'forceAbsoluteUrl' => !empty($this->conf['forceAbsoluteUrl']) ? 1 : 0, |
| 215 | 215 | 'forceAbsoluteUrl.' => ['scheme' => !empty($this->conf['forceAbsoluteUrl']) && !empty($this->conf['forceAbsoluteUrlHttps']) ? 'https' : 'http'], |
| 216 | - 'additionalParams' => \TYPO3\CMS\Core\Utility\GeneralUtility::implodeArrayForUrl($this->prefixId, $additionalParams, '', true, false) |
|
| 216 | + 'additionalParams' => \TYPO3\CMS\Core\Utility\GeneralUtility::implodeArrayForUrl($this->prefixId, $additionalParams, '', TRUE, FALSE) |
|
| 217 | 217 | ]; |
| 218 | 218 | $link = $this->cObj->typoLink(htmlspecialchars($this->pi_getLL('addBasket', '')), $conf); |
| 219 | 219 | $markerArray['###BASKETBUTTON###'] = $link; |
| 220 | 220 | } |
| 221 | - return $this->templateService->substituteMarkerArray($this->templateService->substituteSubpart($template['entry'], '###SUBTEMPLATE###', $subpart, true), $markerArray); |
|
| 221 | + return $this->templateService->substituteMarkerArray($this->templateService->substituteSubpart($template['entry'], '###SUBTEMPLATE###', $subpart, TRUE), $markerArray); |
|
| 222 | 222 | } |
| 223 | 223 | |
| 224 | 224 | /** |
@@ -262,7 +262,7 @@ discard block |
||
| 262 | 262 | 'forceAbsoluteUrl.' => ['scheme' => !empty($this->conf['forceAbsoluteUrl']) && !empty($this->conf['forceAbsoluteUrlHttps']) ? 'https' : 'http'] |
| 263 | 263 | ]; |
| 264 | 264 | if (!empty($this->piVars['logicalPage'])) { |
| 265 | - $linkConf['additionalParams'] = \TYPO3\CMS\Core\Utility\GeneralUtility::implodeArrayForUrl($this->prefixId, ['logicalPage' => $this->piVars['logicalPage']], '', true, false); |
|
| 265 | + $linkConf['additionalParams'] = \TYPO3\CMS\Core\Utility\GeneralUtility::implodeArrayForUrl($this->prefixId, ['logicalPage' => $this->piVars['logicalPage']], '', TRUE, FALSE); |
|
| 266 | 266 | } |
| 267 | 267 | // Build HTML form. |
| 268 | 268 | $sorting = '<form action="' . $this->cObj->typoLink_URL($linkConf) . '" method="get"><div><input type="hidden" name="id" value="' . $GLOBALS['TSFE']->id . '" />'; |
@@ -320,7 +320,7 @@ discard block |
||
| 320 | 320 | if ($index_name == 'title') { |
| 321 | 321 | // Get title of parent document if needed. |
| 322 | 322 | if (empty($value) && $this->conf['getTitle']) { |
| 323 | - $superiorTitle = Document::getTitle($subpart['uid'], true); |
|
| 323 | + $superiorTitle = Document::getTitle($subpart['uid'], TRUE); |
|
| 324 | 324 | if (!empty($superiorTitle)) { |
| 325 | 325 | $value = '[' . $superiorTitle . ']'; |
| 326 | 326 | } |
@@ -344,7 +344,7 @@ discard block |
||
| 344 | 344 | 'parameter' => $this->conf['targetPid'], |
| 345 | 345 | 'forceAbsoluteUrl' => !empty($this->conf['forceAbsoluteUrl']) ? 1 : 0, |
| 346 | 346 | 'forceAbsoluteUrl.' => ['scheme' => !empty($this->conf['forceAbsoluteUrl']) && !empty($this->conf['forceAbsoluteUrlHttps']) ? 'https' : 'http'], |
| 347 | - 'additionalParams' => \TYPO3\CMS\Core\Utility\GeneralUtility::implodeArrayForUrl($this->prefixId, $additionalParams, '', true, false) |
|
| 347 | + 'additionalParams' => \TYPO3\CMS\Core\Utility\GeneralUtility::implodeArrayForUrl($this->prefixId, $additionalParams, '', TRUE, FALSE) |
|
| 348 | 348 | ]; |
| 349 | 349 | $value = $this->cObj->typoLink(htmlspecialchars($value), $conf); |
| 350 | 350 | } elseif ($index_name == 'owner' && !empty($value)) { |
@@ -392,14 +392,14 @@ discard block |
||
| 392 | 392 | 'parameter' => $this->conf['targetBasket'], |
| 393 | 393 | 'forceAbsoluteUrl' => !empty($this->conf['forceAbsoluteUrl']) ? 1 : 0, |
| 394 | 394 | 'forceAbsoluteUrl.' => ['scheme' => !empty($this->conf['forceAbsoluteUrl']) && !empty($this->conf['forceAbsoluteUrlHttps']) ? 'https' : 'http'], |
| 395 | - 'additionalParams' => \TYPO3\CMS\Core\Utility\GeneralUtility::implodeArrayForUrl($this->prefixId, $additionalParams, '', true, false) |
|
| 395 | + 'additionalParams' => \TYPO3\CMS\Core\Utility\GeneralUtility::implodeArrayForUrl($this->prefixId, $additionalParams, '', TRUE, FALSE) |
|
| 396 | 396 | ]; |
| 397 | 397 | $link = $this->cObj->typoLink(htmlspecialchars($this->pi_getLL('addBasket', '')), $conf); |
| 398 | 398 | $markerArray['###SUBBASKETBUTTON###'] = $link; |
| 399 | 399 | } |
| 400 | 400 | $content .= $this->templateService->substituteMarkerArray($template['subentry'], $markerArray); |
| 401 | 401 | } |
| 402 | - return $this->templateService->substituteSubpart($this->templateService->getSubpart($this->template, '###SUBTEMPLATE###'), '###SUBENTRY###', $content, true); |
|
| 402 | + return $this->templateService->substituteSubpart($this->templateService->getSubpart($this->template, '###SUBTEMPLATE###'), '###SUBENTRY###', $content, TRUE); |
|
| 403 | 403 | } |
| 404 | 404 | |
| 405 | 405 | /** |
@@ -460,7 +460,7 @@ discard block |
||
| 460 | 460 | { |
| 461 | 461 | $this->init($conf); |
| 462 | 462 | // Don't cache the output. |
| 463 | - $this->setCache(false); |
|
| 463 | + $this->setCache(FALSE); |
|
| 464 | 464 | // Load the list. |
| 465 | 465 | $this->list = \TYPO3\CMS\Core\Utility\GeneralUtility::makeInstance(DocumentList::class); |
| 466 | 466 | $currentEntry = $this->piVars['pointer'] * $this->conf['limit']; |
@@ -557,7 +557,7 @@ discard block |
||
| 557 | 557 | } |
| 558 | 558 | $markerArray['###PAGEBROWSER###'] = $this->getPageBrowser(); |
| 559 | 559 | $markerArray['###SORTING###'] = $this->getSortingForm(); |
| 560 | - $content = $this->templateService->substituteMarkerArray($this->templateService->substituteSubpart($this->template, '###ENTRY###', $content, true), $markerArray); |
|
| 560 | + $content = $this->templateService->substituteMarkerArray($this->templateService->substituteSubpart($this->template, '###ENTRY###', $content, TRUE), $markerArray); |
|
| 561 | 561 | return $this->pi_wrapInBaseClass($content); |
| 562 | 562 | } |
| 563 | 563 | } |
@@ -81,12 +81,12 @@ discard block |
||
| 81 | 81 | return ''; |
| 82 | 82 | } |
| 83 | 83 | // Get separator. |
| 84 | - $separator = '<span class="separator">' . htmlspecialchars($this->pi_getLL('separator', ' - ')) . '</span>'; |
|
| 84 | + $separator = '<span class="separator">'.htmlspecialchars($this->pi_getLL('separator', ' - ')).'</span>'; |
|
| 85 | 85 | // Add link to previous page. |
| 86 | 86 | if ($this->piVars['pointer'] > 0) { |
| 87 | - $output = $this->pi_linkTP_keepPIvars(htmlspecialchars($this->pi_getLL('prevPage', '<')), ['pointer' => $this->piVars['pointer'] - 1], true) . $separator; |
|
| 87 | + $output = $this->pi_linkTP_keepPIvars(htmlspecialchars($this->pi_getLL('prevPage', '<')), ['pointer' => $this->piVars['pointer'] - 1], true).$separator; |
|
| 88 | 88 | } else { |
| 89 | - $output = '<span>' . htmlspecialchars($this->pi_getLL('prevPage', '<')) . '</span>' . $separator; |
|
| 89 | + $output = '<span>'.htmlspecialchars($this->pi_getLL('prevPage', '<')).'</span>'.$separator; |
|
| 90 | 90 | } |
| 91 | 91 | $i = 0; |
| 92 | 92 | $skip = null; |
@@ -94,13 +94,13 @@ discard block |
||
| 94 | 94 | while ($i < $maxPages) { |
| 95 | 95 | if ($i < 3 || ($i > $this->piVars['pointer'] - 3 && $i < $this->piVars['pointer'] + 3) || $i > $maxPages - 4) { |
| 96 | 96 | if ($this->piVars['pointer'] != $i) { |
| 97 | - $output .= $this->pi_linkTP_keepPIvars(htmlspecialchars(sprintf($this->pi_getLL('page', '%d'), $i + 1)), ['pointer' => $i], true) . $separator; |
|
| 97 | + $output .= $this->pi_linkTP_keepPIvars(htmlspecialchars(sprintf($this->pi_getLL('page', '%d'), $i + 1)), ['pointer' => $i], true).$separator; |
|
| 98 | 98 | } else { |
| 99 | - $output .= '<span class="active">' . htmlspecialchars(sprintf($this->pi_getLL('page', '%d'), $i + 1)) . '</span>' . $separator; |
|
| 99 | + $output .= '<span class="active">'.htmlspecialchars(sprintf($this->pi_getLL('page', '%d'), $i + 1)).'</span>'.$separator; |
|
| 100 | 100 | } |
| 101 | 101 | $skip = true; |
| 102 | 102 | } elseif ($skip === true) { |
| 103 | - $output .= '<span class="skip">' . htmlspecialchars($this->pi_getLL('skip', '...')) . '</span>' . $separator; |
|
| 103 | + $output .= '<span class="skip">'.htmlspecialchars($this->pi_getLL('skip', '...')).'</span>'.$separator; |
|
| 104 | 104 | $skip = false; |
| 105 | 105 | } |
| 106 | 106 | $i++; |
@@ -109,7 +109,7 @@ discard block |
||
| 109 | 109 | if ($this->piVars['pointer'] < $maxPages - 1) { |
| 110 | 110 | $output .= $this->pi_linkTP_keepPIvars(htmlspecialchars($this->pi_getLL('nextPage', '>')), ['pointer' => $this->piVars['pointer'] + 1], true); |
| 111 | 111 | } else { |
| 112 | - $output .= '<span>' . htmlspecialchars($this->pi_getLL('nextPage', '>')) . '</span>'; |
|
| 112 | + $output .= '<span>'.htmlspecialchars($this->pi_getLL('nextPage', '>')).'</span>'; |
|
| 113 | 113 | } |
| 114 | 114 | return $output; |
| 115 | 115 | } |
@@ -146,7 +146,7 @@ discard block |
||
| 146 | 146 | if (empty($value) && $this->conf['getTitle']) { |
| 147 | 147 | $superiorTitle = Document::getTitle($this->list[$number]['uid'], true); |
| 148 | 148 | if (!empty($superiorTitle)) { |
| 149 | - $value = '[' . $superiorTitle . ']'; |
|
| 149 | + $value = '['.$superiorTitle.']'; |
|
| 150 | 150 | } |
| 151 | 151 | } |
| 152 | 152 | // Set fake title if still not present. |
@@ -195,7 +195,7 @@ discard block |
||
| 195 | 195 | } |
| 196 | 196 | // Add thumbnail. |
| 197 | 197 | if (!empty($this->list[$number]['thumbnail'])) { |
| 198 | - $markerArray['###THUMBNAIL###'] = '<img alt="' . $imgAlt . '" src="' . $this->list[$number]['thumbnail'] . '" />'; |
|
| 198 | + $markerArray['###THUMBNAIL###'] = '<img alt="'.$imgAlt.'" src="'.$this->list[$number]['thumbnail'].'" />'; |
|
| 199 | 199 | } |
| 200 | 200 | // Add preview. |
| 201 | 201 | if (!empty($this->list[$number]['preview'])) { |
@@ -265,28 +265,28 @@ discard block |
||
| 265 | 265 | $linkConf['additionalParams'] = \TYPO3\CMS\Core\Utility\GeneralUtility::implodeArrayForUrl($this->prefixId, ['logicalPage' => $this->piVars['logicalPage']], '', true, false); |
| 266 | 266 | } |
| 267 | 267 | // Build HTML form. |
| 268 | - $sorting = '<form action="' . $this->cObj->typoLink_URL($linkConf) . '" method="get"><div><input type="hidden" name="id" value="' . $GLOBALS['TSFE']->id . '" />'; |
|
| 268 | + $sorting = '<form action="'.$this->cObj->typoLink_URL($linkConf).'" method="get"><div><input type="hidden" name="id" value="'.$GLOBALS['TSFE']->id.'" />'; |
|
| 269 | 269 | foreach ($this->piVars as $piVar => $value) { |
| 270 | 270 | if ($piVar != 'order' && $piVar != 'DATA' && !empty($value)) { |
| 271 | - $sorting .= '<input type="hidden" name="' . $this->prefixId . '[' . $piVar . ']" value="' . htmlspecialchars($value) . '" />'; |
|
| 271 | + $sorting .= '<input type="hidden" name="'.$this->prefixId.'['.$piVar.']" value="'.htmlspecialchars($value).'" />'; |
|
| 272 | 272 | } |
| 273 | 273 | } |
| 274 | 274 | // Select sort field. |
| 275 | - $uniqId = uniqid($prefix . '-'); |
|
| 276 | - $sorting .= '<label for="' . $uniqId . '">' . htmlspecialchars($this->pi_getLL('orderBy', '')) . '</label><select id="' . $uniqId . '" name="' . $this->prefixId . '[order]" onchange="javascript:this.form.submit();">'; |
|
| 275 | + $uniqId = uniqid($prefix.'-'); |
|
| 276 | + $sorting .= '<label for="'.$uniqId.'">'.htmlspecialchars($this->pi_getLL('orderBy', '')).'</label><select id="'.$uniqId.'" name="'.$this->prefixId.'[order]" onchange="javascript:this.form.submit();">'; |
|
| 277 | 277 | // Add relevance sorting if this is a search result list. |
| 278 | 278 | if ($this->list->metadata['options']['source'] == 'search') { |
| 279 | - $sorting .= '<option value="score"' . (($this->list->metadata['options']['order'] == 'score') ? ' selected="selected"' : '') . '>' . htmlspecialchars($this->pi_getLL('relevance', '')) . '</option>'; |
|
| 279 | + $sorting .= '<option value="score"'.(($this->list->metadata['options']['order'] == 'score') ? ' selected="selected"' : '').'>'.htmlspecialchars($this->pi_getLL('relevance', '')).'</option>'; |
|
| 280 | 280 | } |
| 281 | 281 | foreach ($this->sortables as $index_name => $label) { |
| 282 | - $sorting .= '<option value="' . htmlspecialchars($index_name) . '"' . (($this->list->metadata['options']['order'] == $index_name) ? ' selected="selected"' : '') . '>' . htmlspecialchars($label) . '</option>'; |
|
| 282 | + $sorting .= '<option value="'.htmlspecialchars($index_name).'"'.(($this->list->metadata['options']['order'] == $index_name) ? ' selected="selected"' : '').'>'.htmlspecialchars($label).'</option>'; |
|
| 283 | 283 | } |
| 284 | 284 | $sorting .= '</select>'; |
| 285 | 285 | // Select sort direction. |
| 286 | - $uniqId = uniqid($prefix . '-'); |
|
| 287 | - $sorting .= '<label for="' . $uniqId . '">' . htmlspecialchars($this->pi_getLL('direction', '')) . '</label><select id="' . $uniqId . '" name="' . $this->prefixId . '[asc]" onchange="javascript:this.form.submit();">'; |
|
| 288 | - $sorting .= '<option value="1" ' . ($this->list->metadata['options']['order.asc'] ? ' selected="selected"' : '') . '>' . htmlspecialchars($this->pi_getLL('direction.asc', '')) . '</option>'; |
|
| 289 | - $sorting .= '<option value="0" ' . (!$this->list->metadata['options']['order.asc'] ? ' selected="selected"' : '') . '>' . htmlspecialchars($this->pi_getLL('direction.desc', '')) . '</option>'; |
|
| 286 | + $uniqId = uniqid($prefix.'-'); |
|
| 287 | + $sorting .= '<label for="'.$uniqId.'">'.htmlspecialchars($this->pi_getLL('direction', '')).'</label><select id="'.$uniqId.'" name="'.$this->prefixId.'[asc]" onchange="javascript:this.form.submit();">'; |
|
| 288 | + $sorting .= '<option value="1" '.($this->list->metadata['options']['order.asc'] ? ' selected="selected"' : '').'>'.htmlspecialchars($this->pi_getLL('direction.asc', '')).'</option>'; |
|
| 289 | + $sorting .= '<option value="0" '.(!$this->list->metadata['options']['order.asc'] ? ' selected="selected"' : '').'>'.htmlspecialchars($this->pi_getLL('direction.desc', '')).'</option>'; |
|
| 290 | 290 | $sorting .= '</select></div></form>'; |
| 291 | 291 | return $sorting; |
| 292 | 292 | } |
@@ -322,7 +322,7 @@ discard block |
||
| 322 | 322 | if (empty($value) && $this->conf['getTitle']) { |
| 323 | 323 | $superiorTitle = Document::getTitle($subpart['uid'], true); |
| 324 | 324 | if (!empty($superiorTitle)) { |
| 325 | - $value = '[' . $superiorTitle . ']'; |
|
| 325 | + $value = '['.$superiorTitle.']'; |
|
| 326 | 326 | } |
| 327 | 327 | } |
| 328 | 328 | // Set fake title if still not present. |
@@ -356,7 +356,7 @@ discard block |
||
| 356 | 356 | $value = htmlspecialchars(Helper::translate($value, 'tx_dlf_structures', $this->conf['pages'])); |
| 357 | 357 | // Add page number for single pages. |
| 358 | 358 | if ($_value == 'page') { |
| 359 | - $value .= ' ' . intval($subpart['page']); |
|
| 359 | + $value .= ' '.intval($subpart['page']); |
|
| 360 | 360 | } |
| 361 | 361 | } elseif ($index_name == 'language' && !empty($value)) { |
| 362 | 362 | // Translate ISO 639 language code. |
@@ -377,7 +377,7 @@ discard block |
||
| 377 | 377 | } |
| 378 | 378 | // Add thumbnail. |
| 379 | 379 | if (!empty($subpart['thumbnail'])) { |
| 380 | - $markerArray['###SUBTHUMBNAIL###'] = '<img alt="' . $imgAlt . '" src="' . $subpart['thumbnail'] . '" />'; |
|
| 380 | + $markerArray['###SUBTHUMBNAIL###'] = '<img alt="'.$imgAlt.'" src="'.$subpart['thumbnail'].'" />'; |
|
| 381 | 381 | } |
| 382 | 382 | // Add preview. |
| 383 | 383 | if (!empty($subpart['preview'])) { |
@@ -491,7 +491,7 @@ discard block |
||
| 491 | 491 | || (isset($this->piVars['asc']) && $this->piVars['asc'] != $listMetadata['options']['order.asc']) |
| 492 | 492 | ) { |
| 493 | 493 | // Update list's metadata. |
| 494 | - $listMetadata['options']['params']['sort'] = [$this->piVars['order'] . "_sorting" => (bool) $this->piVars['asc'] ? 'asc' : 'desc']; |
|
| 494 | + $listMetadata['options']['params']['sort'] = [$this->piVars['order']."_sorting" => (bool) $this->piVars['asc'] ? 'asc' : 'desc']; |
|
| 495 | 495 | $listMetadata['options']['order'] = $this->piVars['order']; |
| 496 | 496 | $listMetadata['options']['order.asc'] = (bool) $this->piVars['asc']; |
| 497 | 497 | // Reset pointer. |
@@ -515,7 +515,7 @@ discard block |
||
| 515 | 515 | $this->list = $solr->search(); |
| 516 | 516 | } |
| 517 | 517 | // Add list description |
| 518 | - $listMetadata['description'] = '<p class="tx-dlf-search-numHits">' . htmlspecialchars(sprintf($this->pi_getLL('hits', ''), $this->list->metadata['options']['numberOfHits'], $this->list->metadata['options']['numberOfToplevelHits'])) . '</p>'; |
|
| 518 | + $listMetadata['description'] = '<p class="tx-dlf-search-numHits">'.htmlspecialchars(sprintf($this->pi_getLL('hits', ''), $this->list->metadata['options']['numberOfHits'], $this->list->metadata['options']['numberOfToplevelHits'])).'</p>'; |
|
| 519 | 519 | $this->list->metadata = $listMetadata; |
| 520 | 520 | // Save updated list. |
| 521 | 521 | $this->list->save(); |
@@ -544,7 +544,7 @@ discard block |
||
| 544 | 544 | $markerArray['###LISTTITLE###'] = $this->list->metadata['label']; |
| 545 | 545 | $markerArray['###LISTDESCRIPTION###'] = $this->list->metadata['description']; |
| 546 | 546 | if (!empty($this->list->metadata['thumbnail'])) { |
| 547 | - $markerArray['###LISTTHUMBNAIL###'] = '<img alt="" src="' . $this->list->metadata['thumbnail'] . '" />'; |
|
| 547 | + $markerArray['###LISTTHUMBNAIL###'] = '<img alt="" src="'.$this->list->metadata['thumbnail'].'" />'; |
|
| 548 | 548 | } else { |
| 549 | 549 | $markerArray['###LISTTHUMBNAIL###'] = ''; |
| 550 | 550 | } |
@@ -23,8 +23,7 @@ discard block |
||
| 23 | 23 | * @subpackage dlf |
| 24 | 24 | * @access public |
| 25 | 25 | */ |
| 26 | -class Navigation extends \Kitodo\Dlf\Common\AbstractPlugin |
|
| 27 | -{ |
|
| 26 | +class Navigation extends \Kitodo\Dlf\Common\AbstractPlugin { |
|
| 28 | 27 | public $scriptRelPath = 'Classes/Plugin/Navigation.php'; |
| 29 | 28 | |
| 30 | 29 | /** |
@@ -34,8 +33,7 @@ discard block |
||
| 34 | 33 | * |
| 35 | 34 | * @return string Link to the list view ready to output |
| 36 | 35 | */ |
| 37 | - protected function getLinkToListview() |
|
| 38 | - { |
|
| 36 | + protected function getLinkToListview() { |
|
| 39 | 37 | if (!empty($this->conf['targetPid'])) { |
| 40 | 38 | // Load the list. |
| 41 | 39 | $list = \TYPO3\CMS\Core\Utility\GeneralUtility::makeInstance(DocumentList::class); |
@@ -61,8 +59,7 @@ discard block |
||
| 61 | 59 | * |
| 62 | 60 | * @return string Page selector ready to output |
| 63 | 61 | */ |
| 64 | - protected function getPageSelector() |
|
| 65 | - { |
|
| 62 | + protected function getPageSelector() { |
|
| 66 | 63 | // Configure @action URL for form. |
| 67 | 64 | $linkConf = [ |
| 68 | 65 | 'parameter' => $GLOBALS['TSFE']->id, |
@@ -96,8 +93,7 @@ discard block |
||
| 96 | 93 | * |
| 97 | 94 | * @return string The content that is displayed on the website |
| 98 | 95 | */ |
| 99 | - public function main($content, $conf) |
|
| 100 | - { |
|
| 96 | + public function main($content, $conf) { |
|
| 101 | 97 | $this->init($conf); |
| 102 | 98 | // Turn cache on. |
| 103 | 99 | $this->setCache(true); |
@@ -212,8 +208,7 @@ discard block |
||
| 212 | 208 | * |
| 213 | 209 | * @return string Typolink ready to output |
| 214 | 210 | */ |
| 215 | - protected function makeLink($label, array $overrulePIvars = [], $aTagParams = '') |
|
| 216 | - { |
|
| 211 | + protected function makeLink($label, array $overrulePIvars = [], $aTagParams = '') { |
|
| 217 | 212 | // Merge plugin variables with new set of values. |
| 218 | 213 | if (is_array($this->piVars)) { |
| 219 | 214 | $piVars = $this->piVars; |
@@ -100,10 +100,10 @@ discard block |
||
| 100 | 100 | { |
| 101 | 101 | $this->init($conf); |
| 102 | 102 | // Turn cache on. |
| 103 | - $this->setCache(true); |
|
| 103 | + $this->setCache(TRUE); |
|
| 104 | 104 | // Load current document. |
| 105 | 105 | $this->loadDocument(); |
| 106 | - if ($this->doc === null) { |
|
| 106 | + if ($this->doc === NULL) { |
|
| 107 | 107 | // Quit without doing anything if required variables are not set. |
| 108 | 108 | return $content; |
| 109 | 109 | } else { |
@@ -227,7 +227,7 @@ discard block |
||
| 227 | 227 | 'forceAbsoluteUrl' => !empty($this->conf['forceAbsoluteUrl']) ? 1 : 0, |
| 228 | 228 | 'forceAbsoluteUrl.' => ['scheme' => !empty($this->conf['forceAbsoluteUrl']) && !empty($this->conf['forceAbsoluteUrlHttps']) ? 'https' : 'http'], |
| 229 | 229 | 'ATagParams' => $aTagParams, |
| 230 | - 'additionalParams' => \TYPO3\CMS\Core\Utility\GeneralUtility::implodeArrayForUrl($this->prefixId, $overrulePIvars, '', true, false), |
|
| 230 | + 'additionalParams' => \TYPO3\CMS\Core\Utility\GeneralUtility::implodeArrayForUrl($this->prefixId, $overrulePIvars, '', TRUE, FALSE), |
|
| 231 | 231 | 'title' => $label |
| 232 | 232 | ]; |
| 233 | 233 | return $this->cObj->typoLink($label, $conf); |
@@ -69,18 +69,18 @@ discard block |
||
| 69 | 69 | 'forceAbsoluteUrl' => !empty($this->conf['forceAbsoluteUrl']) ? 1 : 0, |
| 70 | 70 | 'forceAbsoluteUrl.' => ['scheme' => !empty($this->conf['forceAbsoluteUrl']) && !empty($this->conf['forceAbsoluteUrlHttps']) ? 'https' : 'http'] |
| 71 | 71 | ]; |
| 72 | - $output = '<form action="' . $this->cObj->typoLink_URL($linkConf) . '" method="get"><div><input type="hidden" name="id" value="' . $GLOBALS['TSFE']->id . '" />'; |
|
| 72 | + $output = '<form action="'.$this->cObj->typoLink_URL($linkConf).'" method="get"><div><input type="hidden" name="id" value="'.$GLOBALS['TSFE']->id.'" />'; |
|
| 73 | 73 | // Add plugin variables. |
| 74 | 74 | foreach ($this->piVars as $piVar => $value) { |
| 75 | 75 | if ($piVar != 'page' && $piVar != 'DATA' && !empty($value)) { |
| 76 | - $output .= '<input type="hidden" name="' . $this->prefixId . '[' . $piVar . ']" value="' . htmlspecialchars($value) . '" />'; |
|
| 76 | + $output .= '<input type="hidden" name="'.$this->prefixId.'['.$piVar.']" value="'.htmlspecialchars($value).'" />'; |
|
| 77 | 77 | } |
| 78 | 78 | } |
| 79 | 79 | // Add page selector. |
| 80 | - $uniqId = uniqid(Helper::getUnqualifiedClassName(get_class($this)) . '-'); |
|
| 81 | - $output .= '<label for="' . $uniqId . '">' . htmlspecialchars($this->pi_getLL('selectPage', '')) . '</label><select id="' . $uniqId . '" name="' . $this->prefixId . '[page]" onchange="javascript:this.form.submit();"' . ($this->doc->numPages < 1 ? ' disabled="disabled"' : '') . '>'; |
|
| 80 | + $uniqId = uniqid(Helper::getUnqualifiedClassName(get_class($this)).'-'); |
|
| 81 | + $output .= '<label for="'.$uniqId.'">'.htmlspecialchars($this->pi_getLL('selectPage', '')).'</label><select id="'.$uniqId.'" name="'.$this->prefixId.'[page]" onchange="javascript:this.form.submit();"'.($this->doc->numPages < 1 ? ' disabled="disabled"' : '').'>'; |
|
| 82 | 82 | for ($i = 1; $i <= $this->doc->numPages; $i++) { |
| 83 | - $output .= '<option value="' . $i . '"' . ($this->piVars['page'] == $i ? ' selected="selected"' : '') . '>[' . $i . ']' . ($this->doc->physicalStructureInfo[$this->doc->physicalStructure[$i]]['orderlabel'] ? ' - ' . htmlspecialchars($this->doc->physicalStructureInfo[$this->doc->physicalStructure[$i]]['orderlabel']) : '') . '</option>'; |
|
| 83 | + $output .= '<option value="'.$i.'"'.($this->piVars['page'] == $i ? ' selected="selected"' : '').'>['.$i.']'.($this->doc->physicalStructureInfo[$this->doc->physicalStructure[$i]]['orderlabel'] ? ' - '.htmlspecialchars($this->doc->physicalStructureInfo[$this->doc->physicalStructure[$i]]['orderlabel']) : '').'</option>'; |
|
| 84 | 84 | } |
| 85 | 85 | $output .= '</select></div></form>'; |
| 86 | 86 | return $output; |
@@ -138,53 +138,53 @@ discard block |
||
| 138 | 138 | if ($this->piVars['page'] > 1) { |
| 139 | 139 | $markerArray['###FIRST###'] = $this->makeLink(htmlspecialchars($this->pi_getLL('firstPage', '')), ['page' => 1]); |
| 140 | 140 | } else { |
| 141 | - $markerArray['###FIRST###'] = '<span title="' . htmlspecialchars($this->pi_getLL('firstPage', '')) . '">' . htmlspecialchars($this->pi_getLL('firstPage', '')) . '</span>'; |
|
| 141 | + $markerArray['###FIRST###'] = '<span title="'.htmlspecialchars($this->pi_getLL('firstPage', '')).'">'.htmlspecialchars($this->pi_getLL('firstPage', '')).'</span>'; |
|
| 142 | 142 | } |
| 143 | 143 | // Link back X pages. |
| 144 | 144 | if ($this->piVars['page'] > $pageSteps) { |
| 145 | 145 | $markerArray['###BACK###'] = $this->makeLink(htmlspecialchars(sprintf($this->pi_getLL('backXPages', ''), $pageSteps)), ['page' => $this->piVars['page'] - $pageSteps]); |
| 146 | 146 | } else { |
| 147 | - $markerArray['###BACK###'] = '<span title="' . htmlspecialchars(sprintf($this->pi_getLL('backXPages', ''), $pageSteps)) . '">' . htmlspecialchars(sprintf($this->pi_getLL('backXPages', ''), $pageSteps)) . '</span>'; |
|
| 147 | + $markerArray['###BACK###'] = '<span title="'.htmlspecialchars(sprintf($this->pi_getLL('backXPages', ''), $pageSteps)).'">'.htmlspecialchars(sprintf($this->pi_getLL('backXPages', ''), $pageSteps)).'</span>'; |
|
| 148 | 148 | } |
| 149 | 149 | // Link to previous page. |
| 150 | 150 | if ($this->piVars['page'] > (1 + $this->piVars['double'])) { |
| 151 | 151 | $markerArray['###PREVIOUS###'] = $this->makeLink(htmlspecialchars($this->pi_getLL('prevPage', '')), ['page' => $this->piVars['page'] - (1 + $this->piVars['double'])]); |
| 152 | 152 | } else { |
| 153 | - $markerArray['###PREVIOUS###'] = '<span title="' . htmlspecialchars($this->pi_getLL('prevPage', '')) . '">' . htmlspecialchars($this->pi_getLL('prevPage', '')) . '</span>'; |
|
| 153 | + $markerArray['###PREVIOUS###'] = '<span title="'.htmlspecialchars($this->pi_getLL('prevPage', '')).'">'.htmlspecialchars($this->pi_getLL('prevPage', '')).'</span>'; |
|
| 154 | 154 | } |
| 155 | 155 | // Link to next page. |
| 156 | 156 | if ($this->piVars['page'] < ($this->doc->numPages - $this->piVars['double'])) { |
| 157 | 157 | $markerArray['###NEXT###'] = $this->makeLink(htmlspecialchars($this->pi_getLL('nextPage', '')), ['page' => $this->piVars['page'] + (1 + $this->piVars['double'])]); |
| 158 | 158 | } else { |
| 159 | - $markerArray['###NEXT###'] = '<span title="' . htmlspecialchars($this->pi_getLL('nextPage', '')) . '">' . htmlspecialchars($this->pi_getLL('nextPage', '')) . '</span>'; |
|
| 159 | + $markerArray['###NEXT###'] = '<span title="'.htmlspecialchars($this->pi_getLL('nextPage', '')).'">'.htmlspecialchars($this->pi_getLL('nextPage', '')).'</span>'; |
|
| 160 | 160 | } |
| 161 | 161 | // Link forward X pages. |
| 162 | 162 | if ($this->piVars['page'] <= ($this->doc->numPages - $pageSteps)) { |
| 163 | 163 | $markerArray['###FORWARD###'] = $this->makeLink(htmlspecialchars(sprintf($this->pi_getLL('forwardXPages', ''), $pageSteps)), ['page' => $this->piVars['page'] + $pageSteps]); |
| 164 | 164 | } else { |
| 165 | - $markerArray['###FORWARD###'] = '<span title="' . htmlspecialchars(sprintf($this->pi_getLL('forwardXPages', ''), $pageSteps)) . '">' . htmlspecialchars(sprintf($this->pi_getLL('forwardXPages', ''), $pageSteps)) . '</span>'; |
|
| 165 | + $markerArray['###FORWARD###'] = '<span title="'.htmlspecialchars(sprintf($this->pi_getLL('forwardXPages', ''), $pageSteps)).'">'.htmlspecialchars(sprintf($this->pi_getLL('forwardXPages', ''), $pageSteps)).'</span>'; |
|
| 166 | 166 | } |
| 167 | 167 | // Link to last page. |
| 168 | 168 | if ($this->piVars['page'] < $this->doc->numPages) { |
| 169 | 169 | $markerArray['###LAST###'] = $this->makeLink(htmlspecialchars($this->pi_getLL('lastPage', '')), ['page' => $this->doc->numPages]); |
| 170 | 170 | } else { |
| 171 | - $markerArray['###LAST###'] = '<span title="' . htmlspecialchars($this->pi_getLL('lastPage', '')) . '">' . htmlspecialchars($this->pi_getLL('lastPage', '')) . '</span>'; |
|
| 171 | + $markerArray['###LAST###'] = '<span title="'.htmlspecialchars($this->pi_getLL('lastPage', '')).'">'.htmlspecialchars($this->pi_getLL('lastPage', '')).'</span>'; |
|
| 172 | 172 | } |
| 173 | 173 | // Add double page switcher. |
| 174 | 174 | if ($this->doc->numPages > 0) { |
| 175 | 175 | if (!$this->piVars['double']) { |
| 176 | - $markerArray['###DOUBLEPAGE###'] = $this->makeLink(htmlspecialchars($this->pi_getLL('doublePageOn', '')), ['double' => 1], 'class="tx-dlf-navigation-doubleOn" title="' . htmlspecialchars($this->pi_getLL('doublePageOn', '')) . '"'); |
|
| 176 | + $markerArray['###DOUBLEPAGE###'] = $this->makeLink(htmlspecialchars($this->pi_getLL('doublePageOn', '')), ['double' => 1], 'class="tx-dlf-navigation-doubleOn" title="'.htmlspecialchars($this->pi_getLL('doublePageOn', '')).'"'); |
|
| 177 | 177 | } else { |
| 178 | - $markerArray['###DOUBLEPAGE###'] = $this->makeLink(htmlspecialchars($this->pi_getLL('doublePageOff', '')), ['double' => 0], 'class="tx-dlf-navigation-doubleOff" title="' . htmlspecialchars($this->pi_getLL('doublePageOff', '')) . '"'); |
|
| 178 | + $markerArray['###DOUBLEPAGE###'] = $this->makeLink(htmlspecialchars($this->pi_getLL('doublePageOff', '')), ['double' => 0], 'class="tx-dlf-navigation-doubleOff" title="'.htmlspecialchars($this->pi_getLL('doublePageOff', '')).'"'); |
|
| 179 | 179 | } |
| 180 | 180 | if ($this->piVars['double'] && $this->piVars['page'] < $this->doc->numPages) { |
| 181 | - $markerArray['###DOUBLEPAGE+1###'] = $this->makeLink(htmlspecialchars($this->pi_getLL('doublePage+1', '')), ['page' => $this->piVars['page'] + 1], 'title="' . htmlspecialchars($this->pi_getLL('doublePage+1', '')) . '"'); |
|
| 181 | + $markerArray['###DOUBLEPAGE+1###'] = $this->makeLink(htmlspecialchars($this->pi_getLL('doublePage+1', '')), ['page' => $this->piVars['page'] + 1], 'title="'.htmlspecialchars($this->pi_getLL('doublePage+1', '')).'"'); |
|
| 182 | 182 | } else { |
| 183 | - $markerArray['###DOUBLEPAGE+1###'] = '<span title="' . htmlspecialchars($this->pi_getLL('doublePage+1', '')) . '">' . htmlspecialchars($this->pi_getLL('doublePage+1', '')) . '</span>'; |
|
| 183 | + $markerArray['###DOUBLEPAGE+1###'] = '<span title="'.htmlspecialchars($this->pi_getLL('doublePage+1', '')).'">'.htmlspecialchars($this->pi_getLL('doublePage+1', '')).'</span>'; |
|
| 184 | 184 | } |
| 185 | 185 | } else { |
| 186 | - $markerArray['###DOUBLEPAGE###'] = '<span title="' . htmlspecialchars($this->pi_getLL('doublePageOn', '')) . '">' . htmlspecialchars($this->pi_getLL('doublePageOn', '')) . '</span>'; |
|
| 187 | - $markerArray['###DOUBLEPAGE+1###'] = '<span title="' . htmlspecialchars($this->pi_getLL('doublePage+1', '')) . '">' . htmlspecialchars($this->pi_getLL('doublePage+1', '')) . '</span>'; |
|
| 186 | + $markerArray['###DOUBLEPAGE###'] = '<span title="'.htmlspecialchars($this->pi_getLL('doublePageOn', '')).'">'.htmlspecialchars($this->pi_getLL('doublePageOn', '')).'</span>'; |
|
| 187 | + $markerArray['###DOUBLEPAGE+1###'] = '<span title="'.htmlspecialchars($this->pi_getLL('doublePage+1', '')).'">'.htmlspecialchars($this->pi_getLL('doublePage+1', '')).'</span>'; |
|
| 188 | 188 | } |
| 189 | 189 | // Add page selector. |
| 190 | 190 | $markerArray['###PAGESELECT###'] = $this->getPageSelector(); |
@@ -25,8 +25,7 @@ discard block |
||
| 25 | 25 | * @subpackage dlf |
| 26 | 26 | * @access public |
| 27 | 27 | */ |
| 28 | -class PageView extends \Kitodo\Dlf\Common\AbstractPlugin |
|
| 29 | -{ |
|
| 28 | +class PageView extends \Kitodo\Dlf\Common\AbstractPlugin { |
|
| 30 | 29 | public $scriptRelPath = 'Classes/Plugin/PageView.php'; |
| 31 | 30 | |
| 32 | 31 | /** |
@@ -68,8 +67,7 @@ discard block |
||
| 68 | 67 | * |
| 69 | 68 | * @return string The output string for the ###JAVASCRIPT### template marker |
| 70 | 69 | */ |
| 71 | - protected function addViewerJS() |
|
| 72 | - { |
|
| 70 | + protected function addViewerJS() { |
|
| 73 | 71 | $markerArray = ''; |
| 74 | 72 | // CSS files. |
| 75 | 73 | $cssFiles = [ |
@@ -139,8 +137,7 @@ discard block |
||
| 139 | 137 | * |
| 140 | 138 | * @return array Marker array |
| 141 | 139 | */ |
| 142 | - protected function addInteraction() |
|
| 143 | - { |
|
| 140 | + protected function addInteraction() { |
|
| 144 | 141 | $markerArray = []; |
| 145 | 142 | if ($this->piVars['id']) { |
| 146 | 143 | if ($this->conf['crop']) { |
@@ -166,8 +163,7 @@ discard block |
||
| 166 | 163 | * |
| 167 | 164 | * @return array Marker array |
| 168 | 165 | */ |
| 169 | - protected function addBasketForm() |
|
| 170 | - { |
|
| 166 | + protected function addBasketForm() { |
|
| 171 | 167 | $markerArray = []; |
| 172 | 168 | // Add basket button |
| 173 | 169 | if ($this->conf['basketButton'] && $this->conf['targetBasket'] && $this->piVars['id']) { |
@@ -215,8 +211,7 @@ discard block |
||
| 215 | 211 | * |
| 216 | 212 | * @return array URL and MIME type of image file |
| 217 | 213 | */ |
| 218 | - protected function getImage($page) |
|
| 219 | - { |
|
| 214 | + protected function getImage($page) { |
|
| 220 | 215 | $image = []; |
| 221 | 216 | // Get @USE value of METS fileGrp. |
| 222 | 217 | $fileGrps = \TYPO3\CMS\Core\Utility\GeneralUtility::trimExplode(',', $this->conf['fileGrps']); |
@@ -252,8 +247,7 @@ discard block |
||
| 252 | 247 | * |
| 253 | 248 | * @return array URL and MIME type of fulltext file |
| 254 | 249 | */ |
| 255 | - protected function getFulltext($page) |
|
| 256 | - { |
|
| 250 | + protected function getFulltext($page) { |
|
| 257 | 251 | $fulltext = []; |
| 258 | 252 | // Get fulltext link. |
| 259 | 253 | if (!empty($this->doc->physicalStructureInfo[$this->doc->physicalStructure[$page]]['files'][$this->conf['fileGrpFulltext']])) { |
@@ -284,8 +278,7 @@ discard block |
||
| 284 | 278 | * @return array An array containing the IRIs of the AnnotationLists / AnnotationPages as well as |
| 285 | 279 | * some information about the canvas. |
| 286 | 280 | */ |
| 287 | - protected function getAnnotationContainers($page) |
|
| 288 | - { |
|
| 281 | + protected function getAnnotationContainers($page) { |
|
| 289 | 282 | if ($this->doc instanceof IiifManifest) { |
| 290 | 283 | $canvasId = $this->doc->physicalStructure[$page]; |
| 291 | 284 | $iiif = $this->doc->getIiif(); |
@@ -342,8 +335,7 @@ discard block |
||
| 342 | 335 | * |
| 343 | 336 | * @return string The content that is displayed on the website |
| 344 | 337 | */ |
| 345 | - public function main($content, $conf) |
|
| 346 | - { |
|
| 338 | + public function main($content, $conf) { |
|
| 347 | 339 | $this->init($conf); |
| 348 | 340 | // Load current document. |
| 349 | 341 | $this->loadDocument(); |
@@ -174,7 +174,7 @@ discard block |
||
| 174 | 174 | $label = htmlspecialchars($this->pi_getLL('addBasket', '')); |
| 175 | 175 | $params = [ |
| 176 | 176 | 'id' => $this->piVars['id'], |
| 177 | - 'addToBasket' => true |
|
| 177 | + 'addToBasket' => TRUE |
|
| 178 | 178 | ]; |
| 179 | 179 | if (empty($this->piVars['page'])) { |
| 180 | 180 | $params['page'] = 1; |
@@ -183,7 +183,7 @@ discard block |
||
| 183 | 183 | 'parameter' => $this->conf['targetBasket'], |
| 184 | 184 | 'forceAbsoluteUrl' => !empty($this->conf['forceAbsoluteUrl']) ? 1 : 0, |
| 185 | 185 | 'forceAbsoluteUrl.' => ['scheme' => !empty($this->conf['forceAbsoluteUrl']) && !empty($this->conf['forceAbsoluteUrlHttps']) ? 'https' : 'http'], |
| 186 | - 'additionalParams' => \TYPO3\CMS\Core\Utility\GeneralUtility::implodeArrayForUrl($this->prefixId, $params, '', true, false), |
|
| 186 | + 'additionalParams' => \TYPO3\CMS\Core\Utility\GeneralUtility::implodeArrayForUrl($this->prefixId, $params, '', TRUE, FALSE), |
|
| 187 | 187 | 'title' => $label |
| 188 | 188 | ]; |
| 189 | 189 | $output = '<form id="addToBasketForm" action="' . $this->cObj->typoLink_URL($basketConf) . '" method="post">'; |
@@ -292,7 +292,7 @@ discard block |
||
| 292 | 292 | if ($iiif instanceof ManifestInterface) { |
| 293 | 293 | $canvas = $iiif->getContainedResourceById($canvasId); |
| 294 | 294 | /* @var $canvas \Ubl\Iiif\Presentation\Common\Model\Resources\CanvasInterface */ |
| 295 | - if ($canvas != null && !empty($canvas->getPossibleTextAnnotationContainers(Motivation::PAINTING))) { |
|
| 295 | + if ($canvas != NULL && !empty($canvas->getPossibleTextAnnotationContainers(Motivation::PAINTING))) { |
|
| 296 | 296 | $annotationContainers = []; |
| 297 | 297 | /* |
| 298 | 298 | * TODO Analyzing the annotations on the server side requires loading the annotation lists / pages |
@@ -302,11 +302,11 @@ discard block |
||
| 302 | 302 | * On the other hand, server connections are potentially better than client connections. Downloading annotation lists |
| 303 | 303 | */ |
| 304 | 304 | foreach ($canvas->getPossibleTextAnnotationContainers(Motivation::PAINTING) as $annotationContainer) { |
| 305 | - if (($textAnnotations = $annotationContainer->getTextAnnotations(Motivation::PAINTING)) != null) { |
|
| 305 | + if (($textAnnotations = $annotationContainer->getTextAnnotations(Motivation::PAINTING)) != NULL) { |
|
| 306 | 306 | foreach ($textAnnotations as $annotation) { |
| 307 | 307 | if ( |
| 308 | 308 | $annotation->getBody()->getFormat() == 'text/plain' |
| 309 | - && $annotation->getBody()->getChars() != null |
|
| 309 | + && $annotation->getBody()->getChars() != NULL |
|
| 310 | 310 | ) { |
| 311 | 311 | $annotationListData = []; |
| 312 | 312 | $annotationListData['uri'] = $annotationContainer->getId(); |
@@ -348,7 +348,7 @@ discard block |
||
| 348 | 348 | // Load current document. |
| 349 | 349 | $this->loadDocument(); |
| 350 | 350 | if ( |
| 351 | - $this->doc === null |
|
| 351 | + $this->doc === NULL |
|
| 352 | 352 | || $this->doc->numPages < 1 |
| 353 | 353 | ) { |
| 354 | 354 | // Quit without doing anything if required variables are not set. |
@@ -97,12 +97,12 @@ discard block |
||
| 97 | 97 | $(document).ready(function() { |
| 98 | 98 | if (dlfUtils.exists(dlfViewer)) { |
| 99 | 99 | tx_dlf_viewer = new dlfViewer({ |
| 100 | - controls: ["' . implode('", "', $this->controls) . '"], |
|
| 101 | - div: "' . $this->conf['elementId'] . '", |
|
| 102 | - images: ' . json_encode($this->images) . ', |
|
| 103 | - fulltexts: ' . json_encode($this->fulltexts) . ', |
|
| 104 | - annotationContainers: ' . json_encode($this->annotationContainers) . ', |
|
| 105 | - useInternalProxy: ' . ($this->conf['useInternalProxy'] ? 1 : 0) . ' |
|
| 100 | + controls: ["' . implode('", "', $this->controls).'"], |
|
| 101 | + div: "' . $this->conf['elementId'].'", |
|
| 102 | + images: ' . json_encode($this->images).', |
|
| 103 | + fulltexts: ' . json_encode($this->fulltexts).', |
|
| 104 | + annotationContainers: ' . json_encode($this->annotationContainers).', |
|
| 105 | + useInternalProxy: ' . ($this->conf['useInternalProxy'] ? 1 : 0).' |
|
| 106 | 106 | }); |
| 107 | 107 | } |
| 108 | 108 | }); |
@@ -111,21 +111,21 @@ discard block |
||
| 111 | 111 | if (empty($this->conf['addJStoBody'])) { |
| 112 | 112 | $pageRenderer = \TYPO3\CMS\Core\Utility\GeneralUtility::makeInstance(\TYPO3\CMS\Core\Page\PageRenderer::class); |
| 113 | 113 | foreach ($cssFiles as $cssFile) { |
| 114 | - $pageRenderer->addCssFile(\TYPO3\CMS\Core\Utility\PathUtility::stripPathSitePrefix(\TYPO3\CMS\Core\Utility\ExtensionManagementUtility::extPath($this->extKey)) . $cssFile); |
|
| 114 | + $pageRenderer->addCssFile(\TYPO3\CMS\Core\Utility\PathUtility::stripPathSitePrefix(\TYPO3\CMS\Core\Utility\ExtensionManagementUtility::extPath($this->extKey)).$cssFile); |
|
| 115 | 115 | } |
| 116 | 116 | foreach ($jsFiles as $jsFile) { |
| 117 | - $pageRenderer->addJsFooterFile(\TYPO3\CMS\Core\Utility\PathUtility::stripPathSitePrefix(\TYPO3\CMS\Core\Utility\ExtensionManagementUtility::extPath($this->extKey)) . $jsFile); |
|
| 117 | + $pageRenderer->addJsFooterFile(\TYPO3\CMS\Core\Utility\PathUtility::stripPathSitePrefix(\TYPO3\CMS\Core\Utility\ExtensionManagementUtility::extPath($this->extKey)).$jsFile); |
|
| 118 | 118 | } |
| 119 | 119 | $pageRenderer->addJsFooterInlineCode('kitodo-pageview-configuration', $viewerConfiguration); |
| 120 | 120 | } else { |
| 121 | 121 | foreach ($jsFiles as $jsFile) { |
| 122 | - $markerArray .= '<script type="text/javascript" src="' . \TYPO3\CMS\Core\Utility\PathUtility::stripPathSitePrefix(\TYPO3\CMS\Core\Utility\ExtensionManagementUtility::extPath($this->extKey)) . $jsFile . '"></script>' . "\n"; |
|
| 122 | + $markerArray .= '<script type="text/javascript" src="'.\TYPO3\CMS\Core\Utility\PathUtility::stripPathSitePrefix(\TYPO3\CMS\Core\Utility\ExtensionManagementUtility::extPath($this->extKey)).$jsFile.'"></script>'."\n"; |
|
| 123 | 123 | } |
| 124 | 124 | $markerArray .= ' |
| 125 | 125 | <script type="text/javascript"> |
| 126 | 126 | /*<![CDATA[*/ |
| 127 | 127 | /*kitodo-pageview-configuration*/ |
| 128 | - ' . $viewerConfiguration . ' |
|
| 128 | + ' . $viewerConfiguration.' |
|
| 129 | 129 | /*]]>*/ |
| 130 | 130 | </script>'; |
| 131 | 131 | } |
@@ -144,14 +144,14 @@ discard block |
||
| 144 | 144 | $markerArray = []; |
| 145 | 145 | if ($this->piVars['id']) { |
| 146 | 146 | if ($this->conf['crop']) { |
| 147 | - $markerArray['###EDITBUTTON###'] = '<a href="javascript: tx_dlf_viewer.activateSelection();" title="' . htmlspecialchars($this->pi_getLL('editMode', '')) . '">' . htmlspecialchars($this->pi_getLL('editMode', '')) . '</a>'; |
|
| 148 | - $markerArray['###EDITREMOVE###'] = '<a href="javascript: tx_dlf_viewer.resetCropSelection();" title="' . htmlspecialchars($this->pi_getLL('editRemove', '')) . '">' . htmlspecialchars($this->pi_getLL('editRemove', '')) . '</a>'; |
|
| 147 | + $markerArray['###EDITBUTTON###'] = '<a href="javascript: tx_dlf_viewer.activateSelection();" title="'.htmlspecialchars($this->pi_getLL('editMode', '')).'">'.htmlspecialchars($this->pi_getLL('editMode', '')).'</a>'; |
|
| 148 | + $markerArray['###EDITREMOVE###'] = '<a href="javascript: tx_dlf_viewer.resetCropSelection();" title="'.htmlspecialchars($this->pi_getLL('editRemove', '')).'">'.htmlspecialchars($this->pi_getLL('editRemove', '')).'</a>'; |
|
| 149 | 149 | } else { |
| 150 | 150 | $markerArray['###EDITBUTTON###'] = ''; |
| 151 | 151 | $markerArray['###EDITREMOVE###'] = ''; |
| 152 | 152 | } |
| 153 | 153 | if ($this->conf['magnifier']) { |
| 154 | - $markerArray['###MAGNIFIER###'] = '<a href="javascript: tx_dlf_viewer.activateMagnifier();" title="' . htmlspecialchars($this->pi_getLL('magnifier', '')) . '">' . htmlspecialchars($this->pi_getLL('magnifier', '')) . '</a>'; |
|
| 154 | + $markerArray['###MAGNIFIER###'] = '<a href="javascript: tx_dlf_viewer.activateMagnifier();" title="'.htmlspecialchars($this->pi_getLL('magnifier', '')).'">'.htmlspecialchars($this->pi_getLL('magnifier', '')).'</a>'; |
|
| 155 | 155 | } else { |
| 156 | 156 | $markerArray['###MAGNIFIER###'] = ''; |
| 157 | 157 | } |
@@ -186,15 +186,15 @@ discard block |
||
| 186 | 186 | 'additionalParams' => \TYPO3\CMS\Core\Utility\GeneralUtility::implodeArrayForUrl($this->prefixId, $params, '', true, false), |
| 187 | 187 | 'title' => $label |
| 188 | 188 | ]; |
| 189 | - $output = '<form id="addToBasketForm" action="' . $this->cObj->typoLink_URL($basketConf) . '" method="post">'; |
|
| 190 | - $output .= '<input type="hidden" name="tx_dlf[startpage]" id="startpage" value="' . htmlspecialchars($this->piVars['page']) . '">'; |
|
| 191 | - $output .= '<input type="hidden" name="tx_dlf[endpage]" id="endpage" value="' . htmlspecialchars($this->piVars['page']) . '">'; |
|
| 189 | + $output = '<form id="addToBasketForm" action="'.$this->cObj->typoLink_URL($basketConf).'" method="post">'; |
|
| 190 | + $output .= '<input type="hidden" name="tx_dlf[startpage]" id="startpage" value="'.htmlspecialchars($this->piVars['page']).'">'; |
|
| 191 | + $output .= '<input type="hidden" name="tx_dlf[endpage]" id="endpage" value="'.htmlspecialchars($this->piVars['page']).'">'; |
|
| 192 | 192 | $output .= '<input type="hidden" name="tx_dlf[startX]" id="startX">'; |
| 193 | 193 | $output .= '<input type="hidden" name="tx_dlf[startY]" id="startY">'; |
| 194 | 194 | $output .= '<input type="hidden" name="tx_dlf[endX]" id="endX">'; |
| 195 | 195 | $output .= '<input type="hidden" name="tx_dlf[endY]" id="endY">'; |
| 196 | 196 | $output .= '<input type="hidden" name="tx_dlf[rotation]" id="rotation">'; |
| 197 | - $output .= '<button id="submitBasketForm" onclick="this.form.submit()">' . $label . '</button>'; |
|
| 197 | + $output .= '<button id="submitBasketForm" onclick="this.form.submit()">'.$label.'</button>'; |
|
| 198 | 198 | $output .= '</form>'; |
| 199 | 199 | $output .= '<script>'; |
| 200 | 200 | $output .= '$(document).ready(function() { $("#submitBasketForm").click(function() { $("#addToBasketForm").submit(); }); });'; |
@@ -230,14 +230,14 @@ discard block |
||
| 230 | 230 | 'parameter' => $GLOBALS['TSFE']->id, |
| 231 | 231 | 'forceAbsoluteUrl' => !empty($this->conf['forceAbsoluteUrl']) ? 1 : 0, |
| 232 | 232 | 'forceAbsoluteUrl.' => ['scheme' => !empty($this->conf['forceAbsoluteUrl']) && !empty($this->conf['forceAbsoluteUrlHttps']) ? 'https' : 'http'], |
| 233 | - 'additionalParams' => '&eID=tx_dlf_pageview_proxy&url=' . urlencode($image['url']), |
|
| 233 | + 'additionalParams' => '&eID=tx_dlf_pageview_proxy&url='.urlencode($image['url']), |
|
| 234 | 234 | ]; |
| 235 | 235 | $image['url'] = $this->cObj->typoLink_URL($linkConf); |
| 236 | 236 | } |
| 237 | 237 | $image['mimetype'] = $this->doc->getFileMimeType($this->doc->physicalStructureInfo[$this->doc->physicalStructure[$page]]['files'][$fileGrp]); |
| 238 | 238 | break; |
| 239 | 239 | } else { |
| 240 | - Helper::devLog('File not found in fileGrp "' . $fileGrp . '"', DEVLOG_SEVERITY_WARNING); |
|
| 240 | + Helper::devLog('File not found in fileGrp "'.$fileGrp.'"', DEVLOG_SEVERITY_WARNING); |
|
| 241 | 241 | } |
| 242 | 242 | } |
| 243 | 243 | return $image; |
@@ -264,13 +264,13 @@ discard block |
||
| 264 | 264 | 'parameter' => $GLOBALS['TSFE']->id, |
| 265 | 265 | 'forceAbsoluteUrl' => !empty($this->conf['forceAbsoluteUrl']) ? 1 : 0, |
| 266 | 266 | 'forceAbsoluteUrl.' => ['scheme' => !empty($this->conf['forceAbsoluteUrl']) && !empty($this->conf['forceAbsoluteUrlHttps']) ? 'https' : 'http'], |
| 267 | - 'additionalParams' => '&eID=tx_dlf_pageview_proxy&url=' . urlencode($fulltext['url']), |
|
| 267 | + 'additionalParams' => '&eID=tx_dlf_pageview_proxy&url='.urlencode($fulltext['url']), |
|
| 268 | 268 | ]; |
| 269 | 269 | $fulltext['url'] = $this->cObj->typoLink_URL($linkConf); |
| 270 | 270 | } |
| 271 | 271 | $fulltext['mimetype'] = $this->doc->getFileMimeType($this->doc->physicalStructureInfo[$this->doc->physicalStructure[$page]]['files'][$this->conf['fileGrpFulltext']]); |
| 272 | 272 | } else { |
| 273 | - Helper::devLog('File not found in fileGrp "' . $this->conf['fileGrpFulltext'] . '"', DEVLOG_SEVERITY_WARNING); |
|
| 273 | + Helper::devLog('File not found in fileGrp "'.$this->conf['fileGrpFulltext'].'"', DEVLOG_SEVERITY_WARNING); |
|
| 274 | 274 | } |
| 275 | 275 | return $fulltext; |
| 276 | 276 | } |
@@ -24,8 +24,8 @@ |
||
| 24 | 24 | 'suggests' => [] |
| 25 | 25 | ], |
| 26 | 26 | 'state' => 'stable', |
| 27 | - 'uploadfolder' => false, |
|
| 28 | - 'clearCacheOnLoad' => false, |
|
| 27 | + 'uploadfolder' => FALSE, |
|
| 28 | + 'clearCacheOnLoad' => FALSE, |
|
| 29 | 29 | 'author' => 'Sebastian Meyer (Maintainer)', |
| 30 | 30 | 'author_email' => '[email protected]', |
| 31 | 31 | 'author_company' => 'Kitodo. Key to digital objects e. V.', |