@@ -25,8 +25,7 @@ discard block |
||
25 | 25 | * @subpackage dlf |
26 | 26 | * @access public |
27 | 27 | */ |
28 | -class Basket extends \Kitodo\Dlf\Common\AbstractPlugin |
|
29 | -{ |
|
28 | +class Basket extends \Kitodo\Dlf\Common\AbstractPlugin { |
|
30 | 29 | public $scriptRelPath = 'Classes/Plugin/Basket.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 | // Don't cache the output. |
46 | 44 | $this->setCache(false); |
@@ -233,8 +231,7 @@ discard block |
||
233 | 231 | * |
234 | 232 | * @return string One basket entry |
235 | 233 | */ |
236 | - protected function getEntry($data, $template) |
|
237 | - { |
|
234 | + protected function getEntry($data, $template) { |
|
238 | 235 | if (is_object($data)) { |
239 | 236 | $data = get_object_vars($data); |
240 | 237 | } |
@@ -282,8 +279,7 @@ discard block |
||
282 | 279 | * |
283 | 280 | * @return array Basket data and Javascript output |
284 | 281 | */ |
285 | - protected function addToBasket($_piVars, $basketData) |
|
286 | - { |
|
282 | + protected function addToBasket($_piVars, $basketData) { |
|
287 | 283 | $output = ''; |
288 | 284 | if (!$_piVars['startpage']) { |
289 | 285 | $page = 0; |
@@ -375,8 +371,7 @@ discard block |
||
375 | 371 | * |
376 | 372 | * @return array basket data |
377 | 373 | */ |
378 | - protected function removeFromBasket($_piVars, $basketData) |
|
379 | - { |
|
374 | + protected function removeFromBasket($_piVars, $basketData) { |
|
380 | 375 | if (!empty($basketData['doc_ids'])) { |
381 | 376 | $items = $basketData['doc_ids']; |
382 | 377 | $items = get_object_vars($items); |
@@ -415,8 +410,7 @@ discard block |
||
415 | 410 | * |
416 | 411 | * @return array basket data |
417 | 412 | */ |
418 | - protected function openFromBasket($_piVars, $basketData) |
|
419 | - { |
|
413 | + protected function openFromBasket($_piVars, $basketData) { |
|
420 | 414 | $pdfUrl = $this->conf['pdfgenerate']; |
421 | 415 | foreach ($this->piVars['selected'] as $docValue) { |
422 | 416 | if ($docValue['id']) { |
@@ -438,8 +432,7 @@ discard block |
||
438 | 432 | * |
439 | 433 | * @return mixed download url or false |
440 | 434 | */ |
441 | - protected function getDocumentData($id, $data) |
|
442 | - { |
|
435 | + protected function getDocumentData($id, $data) { |
|
443 | 436 | // get document instance to load further information |
444 | 437 | $document = Document::getInstance($id, 0); |
445 | 438 | if ($document) { |
@@ -499,8 +492,7 @@ discard block |
||
499 | 492 | * |
500 | 493 | * @return void |
501 | 494 | */ |
502 | - protected function sendMail() |
|
503 | - { |
|
495 | + protected function sendMail() { |
|
504 | 496 | // send mail |
505 | 497 | $mailId = $this->piVars['mail_action']; |
506 | 498 | |
@@ -590,8 +582,7 @@ discard block |
||
590 | 582 | * |
591 | 583 | * @return void |
592 | 584 | */ |
593 | - protected function printDocument() |
|
594 | - { |
|
585 | + protected function printDocument() { |
|
595 | 586 | $pdfUrl = $this->conf['pdfprint']; |
596 | 587 | $numberOfPages = 0; |
597 | 588 | foreach ($this->piVars['selected'] as $docId => $docValue) { |
@@ -164,9 +164,9 @@ discard block |
||
164 | 164 | |
165 | 165 | if ($resultMail->rowCount() > 0) { |
166 | 166 | $mailForm = '<select name="tx_dlf[mail_action]">'; |
167 | - $mailForm .= '<option value="">' . htmlspecialchars($this->pi_getLL('chooseMail', '')) . '</option>'; |
|
167 | + $mailForm .= '<option value="">'.htmlspecialchars($this->pi_getLL('chooseMail', '')).'</option>'; |
|
168 | 168 | while ($row = $resultMail->fetch()) { |
169 | - $mailForm .= '<option value="' . $row['uid'] . '">' . htmlspecialchars($row['name']) . ' (' . htmlspecialchars($row['mail']) . ')</option>'; |
|
169 | + $mailForm .= '<option value="'.$row['uid'].'">'.htmlspecialchars($row['name']).' ('.htmlspecialchars($row['mail']).')</option>'; |
|
170 | 170 | } |
171 | 171 | $mailForm .= '</select><input type="submit">'; |
172 | 172 | } |
@@ -175,9 +175,9 @@ discard block |
||
175 | 175 | // remove action form |
176 | 176 | $markerArray['###REMOVEACTION###'] = ' |
177 | 177 | <select name="tx_dlf[basket_action]"> |
178 | - <option value="">' . htmlspecialchars($this->pi_getLL('chooseAction', '')) . '</option> |
|
179 | - <option value="open">' . htmlspecialchars($this->pi_getLL('download', '')) . '</option> |
|
180 | - <option value="remove">' . htmlspecialchars($this->pi_getLL('remove', '')) . '</option> |
|
178 | + <option value="">' . htmlspecialchars($this->pi_getLL('chooseAction', '')).'</option> |
|
179 | + <option value="open">' . htmlspecialchars($this->pi_getLL('download', '')).'</option> |
|
180 | + <option value="remove">' . htmlspecialchars($this->pi_getLL('remove', '')).'</option> |
|
181 | 181 | </select> |
182 | 182 | <input type="submit"> |
183 | 183 | '; |
@@ -198,9 +198,9 @@ discard block |
||
198 | 198 | $printForm = ''; |
199 | 199 | if ($resultPrinter->rowCount() > 0) { |
200 | 200 | $printForm = '<select name="tx_dlf[print_action]">'; |
201 | - $printForm .= '<option value="">' . htmlspecialchars($this->pi_getLL('choosePrinter', '')) . '</option>'; |
|
201 | + $printForm .= '<option value="">'.htmlspecialchars($this->pi_getLL('choosePrinter', '')).'</option>'; |
|
202 | 202 | while ($row = $resultPrinter->fetch()) { |
203 | - $printForm .= '<option value="' . $row['uid'] . '">' . htmlspecialchars($row['label']) . '</option>'; |
|
203 | + $printForm .= '<option value="'.$row['uid'].'">'.htmlspecialchars($row['label']).'</option>'; |
|
204 | 204 | } |
205 | 205 | $printForm .= '</select><input type="submit" />'; |
206 | 206 | } |
@@ -257,23 +257,23 @@ discard block |
||
257 | 257 | $rotation = $data['rotation']; |
258 | 258 | $docData = $this->getDocumentData($id, $data); |
259 | 259 | $markerArray['###BASKETDATA###'] = $docData['downloadLink']; |
260 | - $arrayKey = $id . '_' . $startpage; |
|
260 | + $arrayKey = $id.'_'.$startpage; |
|
261 | 261 | if (isset($startX)) { |
262 | - $arrayKey .= '_' . $startX; |
|
262 | + $arrayKey .= '_'.$startX; |
|
263 | 263 | } |
264 | 264 | if (isset($endX)) { |
265 | - $arrayKey .= '_' . $endX; |
|
265 | + $arrayKey .= '_'.$endX; |
|
266 | 266 | } |
267 | - $controlMark = '<input value="' . $id . '" name="tx_dlf[selected][' . $arrayKey . '][id]" type="checkbox">'; |
|
268 | - $controlMark .= '<input value="' . $startpage . '" name="tx_dlf[selected][' . $arrayKey . '][startpage]" type="hidden">'; |
|
269 | - $controlMark .= '<input value="' . $endpage . '" name="tx_dlf[selected][' . $arrayKey . '][endpage]" type="hidden">'; |
|
267 | + $controlMark = '<input value="'.$id.'" name="tx_dlf[selected]['.$arrayKey.'][id]" type="checkbox">'; |
|
268 | + $controlMark .= '<input value="'.$startpage.'" name="tx_dlf[selected]['.$arrayKey.'][startpage]" type="hidden">'; |
|
269 | + $controlMark .= '<input value="'.$endpage.'" name="tx_dlf[selected]['.$arrayKey.'][endpage]" type="hidden">'; |
|
270 | 270 | // add hidden fields for detail information |
271 | 271 | if ($startX) { |
272 | - $controlMark .= '<input type="hidden" name="tx_dlf[selected][' . $arrayKey . '][startX]" value="' . $startX . '">'; |
|
273 | - $controlMark .= '<input type="hidden" name="tx_dlf[selected][' . $arrayKey . '][startY]" value="' . $startY . '">'; |
|
274 | - $controlMark .= '<input type="hidden" name="tx_dlf[selected][' . $arrayKey . '][endX]" value="' . $endX . '">'; |
|
275 | - $controlMark .= '<input type="hidden" name="tx_dlf[selected][' . $arrayKey . '][endY]" value="' . $endY . '">'; |
|
276 | - $controlMark .= '<input type="hidden" name="tx_dlf[selected][' . $arrayKey . '][rotation]" value="' . $rotation . '">'; |
|
272 | + $controlMark .= '<input type="hidden" name="tx_dlf[selected]['.$arrayKey.'][startX]" value="'.$startX.'">'; |
|
273 | + $controlMark .= '<input type="hidden" name="tx_dlf[selected]['.$arrayKey.'][startY]" value="'.$startY.'">'; |
|
274 | + $controlMark .= '<input type="hidden" name="tx_dlf[selected]['.$arrayKey.'][endX]" value="'.$endX.'">'; |
|
275 | + $controlMark .= '<input type="hidden" name="tx_dlf[selected]['.$arrayKey.'][endY]" value="'.$endY.'">'; |
|
276 | + $controlMark .= '<input type="hidden" name="tx_dlf[selected]['.$arrayKey.'][rotation]" value="'.$rotation.'">'; |
|
277 | 277 | } |
278 | 278 | // return one entry |
279 | 279 | $markerArray['###CONTROLS###'] = $controlMark; |
@@ -329,12 +329,12 @@ discard block |
||
329 | 329 | if ($_piVars['addToBasket'] == 'list') { |
330 | 330 | $documentItem['endpage'] = $document->numPages; |
331 | 331 | } |
332 | - $arrayKey = $documentItem['id'] . '_' . $page; |
|
332 | + $arrayKey = $documentItem['id'].'_'.$page; |
|
333 | 333 | if (!empty($documentItem['startX'])) { |
334 | - $arrayKey .= '_' . $documentItem['startX']; |
|
334 | + $arrayKey .= '_'.$documentItem['startX']; |
|
335 | 335 | } |
336 | 336 | if (!empty($documentItem['endX'])) { |
337 | - $arrayKey .= '_' . $documentItem['endX']; |
|
337 | + $arrayKey .= '_'.$documentItem['endX']; |
|
338 | 338 | } |
339 | 339 | // do not add more than one identical object |
340 | 340 | if (!in_array($arrayKey, $items)) { |
@@ -353,14 +353,14 @@ discard block |
||
353 | 353 | // remove parameter endpage |
354 | 354 | $pdfParams = str_replace(",##endpage##", '', $pdfParams); |
355 | 355 | } |
356 | - $pdfGenerateUrl = $this->conf['pdfgenerate'] . $pdfParams; |
|
356 | + $pdfGenerateUrl = $this->conf['pdfgenerate'].$pdfParams; |
|
357 | 357 | if ($this->conf['pregeneration']) { |
358 | 358 | // send ajax request to webapp |
359 | 359 | $output .= ' |
360 | 360 | <script> |
361 | 361 | $(document).ready(function(){ |
362 | 362 | $.ajax({ |
363 | - url: "' . $pdfGenerateUrl . '", |
|
363 | + url: "' . $pdfGenerateUrl.'", |
|
364 | 364 | }).done(function() { |
365 | 365 | }); |
366 | 366 | }); |
@@ -398,12 +398,12 @@ discard block |
||
398 | 398 | } |
399 | 399 | foreach ($_piVars['selected'] as $value) { |
400 | 400 | if (isset($value['id'])) { |
401 | - $arrayKey = $value['id'] . '_' . $value['startpage']; |
|
401 | + $arrayKey = $value['id'].'_'.$value['startpage']; |
|
402 | 402 | if (isset($value['startX'])) { |
403 | - $arrayKey .= '_' . $value['startX']; |
|
403 | + $arrayKey .= '_'.$value['startX']; |
|
404 | 404 | } |
405 | 405 | if (isset($value['endX'])) { |
406 | - $arrayKey .= '_' . $value['endX']; |
|
406 | + $arrayKey .= '_'.$value['endX']; |
|
407 | 407 | } |
408 | 408 | if (isset($items[$arrayKey])) { |
409 | 409 | unset($items[$arrayKey]); |
@@ -442,10 +442,10 @@ discard block |
||
442 | 442 | foreach ($this->piVars['selected'] as $docValue) { |
443 | 443 | if ($docValue['id']) { |
444 | 444 | $docData = $this->getDocumentData($docValue['id'], $docValue); |
445 | - $pdfUrl .= $docData['urlParams'] . $this->conf['pdfparamseparator']; |
|
445 | + $pdfUrl .= $docData['urlParams'].$this->conf['pdfparamseparator']; |
|
446 | 446 | } |
447 | 447 | } |
448 | - header('Location: ' . $pdfUrl); |
|
448 | + header('Location: '.$pdfUrl); |
|
449 | 449 | ob_end_flush(); |
450 | 450 | exit; |
451 | 451 | } |
@@ -479,7 +479,7 @@ discard block |
||
479 | 479 | $urlParams = str_replace("##endx##", $data['endX'] === "" ? "" : intval($data['endX']), $urlParams); |
480 | 480 | $urlParams = str_replace("##endy##", $data['endY'] === "" ? "" : intval($data['endY']), $urlParams); |
481 | 481 | $urlParams = str_replace("##rotation##", $data['rotation'] === "" ? "" : intval($data['rotation']), $urlParams); |
482 | - $downloadUrl = $this->conf['pdfgenerate'] . $urlParams; |
|
482 | + $downloadUrl = $this->conf['pdfgenerate'].$urlParams; |
|
483 | 483 | $title = $document->getTitle($id, true); |
484 | 484 | if (empty($title)) { |
485 | 485 | $title = $this->pi_getLL('noTitle', ''); |
@@ -488,15 +488,15 @@ discard block |
||
488 | 488 | $info = ''; |
489 | 489 | if ($data['startX'] != '' && $data['endX'] != '') { |
490 | 490 | // cutout |
491 | - $info .= htmlspecialchars($this->pi_getLL('cutout', '')) . ' '; |
|
491 | + $info .= htmlspecialchars($this->pi_getLL('cutout', '')).' '; |
|
492 | 492 | } |
493 | 493 | if ($data['startpage'] == $data['endpage']) { |
494 | 494 | // One page |
495 | - $info .= htmlspecialchars($this->pi_getLL('page', '')) . ' ' . $data['startpage']; |
|
495 | + $info .= htmlspecialchars($this->pi_getLL('page', '')).' '.$data['startpage']; |
|
496 | 496 | } else { |
497 | - $info .= htmlspecialchars($this->pi_getLL('page', '')) . ' ' . $data['startpage'] . '-' . $data['endpage']; |
|
497 | + $info .= htmlspecialchars($this->pi_getLL('page', '')).' '.$data['startpage'].'-'.$data['endpage']; |
|
498 | 498 | } |
499 | - $downloadLink = '<a href="' . $downloadUrl . '" target="_blank">' . htmlspecialchars($title) . '</a> (' . $info . ')'; |
|
499 | + $downloadLink = '<a href="'.$downloadUrl.'" target="_blank">'.htmlspecialchars($title).'</a> ('.$info.')'; |
|
500 | 500 | if ($data['startpage'] == $data['endpage']) { |
501 | 501 | $pageNums = 1; |
502 | 502 | } else { |
@@ -541,7 +541,7 @@ discard block |
||
541 | 541 | |
542 | 542 | $allResults = $resultMail->fetchAll(); |
543 | 543 | $mailData = $allResults[0]; |
544 | - $mailText = htmlspecialchars($this->pi_getLL('mailBody', '')) . "\n"; |
|
544 | + $mailText = htmlspecialchars($this->pi_getLL('mailBody', ''))."\n"; |
|
545 | 545 | $numberOfPages = 0; |
546 | 546 | $pdfUrl = $this->conf['pdfdownload']; |
547 | 547 | // prepare links |
@@ -549,7 +549,7 @@ discard block |
||
549 | 549 | if ($docValue['id']) { |
550 | 550 | $explodeId = explode("_", $docValue['id']); |
551 | 551 | $docData = $this->getDocumentData($explodeId[0], $docValue); |
552 | - $pdfUrl .= $docData['urlParams'] . $this->conf['pdfparamseparator']; |
|
552 | + $pdfUrl .= $docData['urlParams'].$this->conf['pdfparamseparator']; |
|
553 | 553 | $pages = (abs(intval($docValue['startpage']) - intval($docValue['endpage']))); |
554 | 554 | if ($pages === 0) { |
555 | 555 | $numberOfPages = $numberOfPages + 1; |
@@ -560,7 +560,7 @@ discard block |
||
560 | 560 | } |
561 | 561 | // Remove leading/tailing pdfparamseperator |
562 | 562 | $pdfUrl = trim($pdfUrl, $this->conf['pdfparamseparator']); |
563 | - $mailBody = $mailText . $pdfUrl; |
|
563 | + $mailBody = $mailText.$pdfUrl; |
|
564 | 564 | // Get hook objects. |
565 | 565 | $hookObjects = Helper::getHookObjects($this->scriptRelPath); |
566 | 566 | // Hook for getting a customized mail body. |
@@ -593,12 +593,12 @@ discard block |
||
593 | 593 | // internal user |
594 | 594 | $insertArray['user_id'] = $GLOBALS["TSFE"]->fe_user->user['uid']; |
595 | 595 | $insertArray['name'] = $GLOBALS["TSFE"]->fe_user->user['username']; |
596 | - $insertArray['label'] = 'Mail: ' . $mailData['mail']; |
|
596 | + $insertArray['label'] = 'Mail: '.$mailData['mail']; |
|
597 | 597 | } else { |
598 | 598 | // external user |
599 | 599 | $insertArray['user_id'] = 0; |
600 | 600 | $insertArray['name'] = 'n/a'; |
601 | - $insertArray['label'] = 'Mail: ' . $mailData['mail']; |
|
601 | + $insertArray['label'] = 'Mail: '.$mailData['mail']; |
|
602 | 602 | } |
603 | 603 | // add action to protocol |
604 | 604 | GeneralUtility::makeInstance(ConnectionPool::class) |
@@ -623,7 +623,7 @@ discard block |
||
623 | 623 | foreach ($this->piVars['selected'] as $docId => $docValue) { |
624 | 624 | if ($docValue['id']) { |
625 | 625 | $docData = $this->getDocumentData($docValue['id'], $docValue); |
626 | - $pdfUrl .= $docData['urlParams'] . $this->conf['pdfparamseparator']; |
|
626 | + $pdfUrl .= $docData['urlParams'].$this->conf['pdfparamseparator']; |
|
627 | 627 | $numberOfPages += $docData['pageNums']; |
628 | 628 | } |
629 | 629 | } |
@@ -654,7 +654,7 @@ discard block |
||
654 | 654 | if ($docValue['id']) { |
655 | 655 | $explodeId = explode("_", $docId); |
656 | 656 | $docData = $this->getDocumentData($explodeId[0], $docValue); |
657 | - $pdfUrl .= $docData['urlParams'] . $this->conf['pdfparamseparator']; |
|
657 | + $pdfUrl .= $docData['urlParams'].$this->conf['pdfparamseparator']; |
|
658 | 658 | $numberOfPages += $docData['pageNums']; |
659 | 659 | } |
660 | 660 | } |
@@ -671,12 +671,12 @@ discard block |
||
671 | 671 | // internal user |
672 | 672 | $insertArray['user_id'] = $GLOBALS["TSFE"]->fe_user->user['uid']; |
673 | 673 | $insertArray['name'] = $GLOBALS["TSFE"]->fe_user->user['username']; |
674 | - $insertArray['label'] = 'Print: ' . $printerData['label']; |
|
674 | + $insertArray['label'] = 'Print: '.$printerData['label']; |
|
675 | 675 | } else { |
676 | 676 | // external user |
677 | 677 | $insertArray['user_id'] = 0; |
678 | 678 | $insertArray['name'] = 'n/a'; |
679 | - $insertArray['label'] = 'Print: ' . $printerData['label']; |
|
679 | + $insertArray['label'] = 'Print: '.$printerData['label']; |
|
680 | 680 | } |
681 | 681 | // add action to protocol |
682 | 682 | GeneralUtility::makeInstance(ConnectionPool::class) |
@@ -685,7 +685,7 @@ discard block |
||
685 | 685 | 'tx_dlf_actionlog', |
686 | 686 | $insertArray |
687 | 687 | ); |
688 | - header('Location: ' . $pdfUrl); |
|
688 | + header('Location: '.$pdfUrl); |
|
689 | 689 | ob_end_flush(); |
690 | 690 | exit; |
691 | 691 | } |
@@ -43,7 +43,7 @@ discard block |
||
43 | 43 | { |
44 | 44 | $this->init($conf); |
45 | 45 | // Don't cache the output. |
46 | - $this->setCache(false); |
|
46 | + $this->setCache(FALSE); |
|
47 | 47 | // Load template file. |
48 | 48 | $this->getTemplate(); |
49 | 49 | $subpartArray['entry'] = $this->templateService->getSubpart($this->template, '###ENTRY###'); |
@@ -65,7 +65,7 @@ discard block |
||
65 | 65 | ->execute(); |
66 | 66 | } else { |
67 | 67 | $GLOBALS['TSFE']->fe_user->setKey('ses', 'tx_dlf_basket', ''); |
68 | - $GLOBALS['TSFE']->fe_user->sesData_change = true; |
|
68 | + $GLOBALS['TSFE']->fe_user->sesData_change = TRUE; |
|
69 | 69 | $GLOBALS['TSFE']->fe_user->storeSessionData(); |
70 | 70 | $result = $queryBuilder |
71 | 71 | ->select('*') |
@@ -228,7 +228,7 @@ discard block |
||
228 | 228 | } else { |
229 | 229 | $markerArray['###BASKET###'] = ''; |
230 | 230 | } |
231 | - $content = $this->templateService->substituteMarkerArray($this->templateService->substituteSubpart($this->template, '###ENTRY###', $entries, true), $markerArray); |
|
231 | + $content = $this->templateService->substituteMarkerArray($this->templateService->substituteSubpart($this->template, '###ENTRY###', $entries, TRUE), $markerArray); |
|
232 | 232 | return $this->pi_wrapInBaseClass($content); |
233 | 233 | } |
234 | 234 | |
@@ -278,7 +278,7 @@ discard block |
||
278 | 278 | // return one entry |
279 | 279 | $markerArray['###CONTROLS###'] = $controlMark; |
280 | 280 | $markerArray['###NUMBER###'] = $docData['record_id']; |
281 | - return $this->templateService->substituteMarkerArray($this->templateService->substituteSubpart($template['entry'], '###ENTRY###', '', true), $markerArray); |
|
281 | + return $this->templateService->substituteMarkerArray($this->templateService->substituteSubpart($template['entry'], '###ENTRY###', '', TRUE), $markerArray); |
|
282 | 282 | } |
283 | 283 | |
284 | 284 | /** |
@@ -299,7 +299,7 @@ discard block |
||
299 | 299 | } else { |
300 | 300 | $page = intval($_piVars['startpage']); |
301 | 301 | } |
302 | - if ($page != null || $_piVars['addToBasket'] == 'list') { |
|
302 | + if ($page != NULL || $_piVars['addToBasket'] == 'list') { |
|
303 | 303 | $documentItem = [ |
304 | 304 | 'id' => intval($_piVars['id']), |
305 | 305 | 'startpage' => intval($_piVars['startpage']), |
@@ -480,7 +480,7 @@ discard block |
||
480 | 480 | $urlParams = str_replace("##endy##", $data['endY'] === "" ? "" : intval($data['endY']), $urlParams); |
481 | 481 | $urlParams = str_replace("##rotation##", $data['rotation'] === "" ? "" : intval($data['rotation']), $urlParams); |
482 | 482 | $downloadUrl = $this->conf['pdfgenerate'] . $urlParams; |
483 | - $title = $document->getTitle($id, true); |
|
483 | + $title = $document->getTitle($id, TRUE); |
|
484 | 484 | if (empty($title)) { |
485 | 485 | $title = $this->pi_getLL('noTitle', ''); |
486 | 486 | } |
@@ -510,7 +510,7 @@ discard block |
||
510 | 510 | 'record_id' => $document->recordId, |
511 | 511 | ]; |
512 | 512 | } |
513 | - return false; |
|
513 | + return FALSE; |
|
514 | 514 | } |
515 | 515 | |
516 | 516 | /** |
@@ -26,8 +26,7 @@ discard block |
||
26 | 26 | * @subpackage dlf |
27 | 27 | * @access public |
28 | 28 | */ |
29 | -class AnnotationTool extends AbstractPlugin |
|
30 | -{ |
|
29 | +class AnnotationTool extends AbstractPlugin { |
|
31 | 30 | /** |
32 | 31 | * @access public |
33 | 32 | * @var string |
@@ -44,8 +43,7 @@ discard block |
||
44 | 43 | * |
45 | 44 | * @return string The content that is displayed on the website |
46 | 45 | */ |
47 | - public function main($content, $conf) |
|
48 | - { |
|
46 | + public function main($content, $conf) { |
|
49 | 47 | $this->init($conf); |
50 | 48 | // Merge configuration with conf array of toolbox. |
51 | 49 | if (!empty($this->cObj->data['conf'])) { |
@@ -84,9 +84,9 @@ |
||
84 | 84 | $annotationContainers != null |
85 | 85 | && sizeof($annotationContainers) > 0 |
86 | 86 | ) { |
87 | - $markerArray['###ANNOTATION_SELECT###'] = '<a class="select switchoff" id="tx-dlf-tools-annotations" title="" data-dic="annotations-on:' . htmlspecialchars($this->pi_getLL('annotations-on', '')) . ';annotations-off:' . htmlspecialchars($this->pi_getLL('annotations-off', '')) . '"> </a>'; |
|
87 | + $markerArray['###ANNOTATION_SELECT###'] = '<a class="select switchoff" id="tx-dlf-tools-annotations" title="" data-dic="annotations-on:'.htmlspecialchars($this->pi_getLL('annotations-on', '')).';annotations-off:'.htmlspecialchars($this->pi_getLL('annotations-off', '')).'"> </a>'; |
|
88 | 88 | } else { |
89 | - $markerArray['###ANNOTATION_SELECT###'] = '<span class="no-annotations">' . htmlspecialchars($this->pi_getLL('annotations-not-available', '')) . '</span>'; |
|
89 | + $markerArray['###ANNOTATION_SELECT###'] = '<span class="no-annotations">'.htmlspecialchars($this->pi_getLL('annotations-not-available', '')).'</span>'; |
|
90 | 90 | } |
91 | 91 | $content .= $this->templateService->substituteMarkerArray($this->template, $markerArray); |
92 | 92 | return $this->pi_wrapInBaseClass($content); |
@@ -54,7 +54,7 @@ discard block |
||
54 | 54 | // Load current document. |
55 | 55 | $this->loadDocument(); |
56 | 56 | if ( |
57 | - $this->doc === null |
|
57 | + $this->doc === NULL |
|
58 | 58 | || $this->doc->numPages < 1 |
59 | 59 | ) { |
60 | 60 | // Quit without doing anything if required variables are not set. |
@@ -81,7 +81,7 @@ discard block |
||
81 | 81 | $this->getTemplate(); |
82 | 82 | $annotationContainers = $this->doc->physicalStructureInfo[$this->doc->physicalStructure[$this->piVars['page']]]['annotationContainers']; |
83 | 83 | if ( |
84 | - $annotationContainers != null |
|
84 | + $annotationContainers != NULL |
|
85 | 85 | && sizeof($annotationContainers) > 0 |
86 | 86 | ) { |
87 | 87 | $markerArray['###ANNOTATION_SELECT###'] = '<a class="select switchoff" id="tx-dlf-tools-annotations" title="" data-dic="annotations-on:' . htmlspecialchars($this->pi_getLL('annotations-on', '')) . ';annotations-off:' . htmlspecialchars($this->pi_getLL('annotations-off', '')) . '"> </a>'; |
@@ -53,7 +53,7 @@ |
||
53 | 53 | // Load current document. |
54 | 54 | $this->loadDocument(); |
55 | 55 | if ( |
56 | - $this->doc === null |
|
56 | + $this->doc === NULL |
|
57 | 57 | || $this->doc->numPages < 1 |
58 | 58 | || empty($this->conf['fileGrpFulltext']) |
59 | 59 | || empty($this->conf['solrcore']) |
@@ -26,8 +26,7 @@ discard block |
||
26 | 26 | * @subpackage dlf |
27 | 27 | * @access public |
28 | 28 | */ |
29 | -class SearchInDocumentTool extends \Kitodo\Dlf\Common\AbstractPlugin |
|
30 | -{ |
|
29 | +class SearchInDocumentTool extends \Kitodo\Dlf\Common\AbstractPlugin { |
|
31 | 30 | public $scriptRelPath = 'Classes/Plugin/Tools/SearchInDocumentTool.php'; |
32 | 31 | |
33 | 32 | /** |
@@ -40,8 +39,7 @@ discard block |
||
40 | 39 | * |
41 | 40 | * @return string The content that is displayed on the website |
42 | 41 | */ |
43 | - public function main($content, $conf) |
|
44 | - { |
|
42 | + public function main($content, $conf) { |
|
45 | 43 | |
46 | 44 | $this->init($conf); |
47 | 45 | |
@@ -126,8 +124,7 @@ discard block |
||
126 | 124 | * |
127 | 125 | * @return string with action url for search form |
128 | 126 | */ |
129 | - protected function getActionUrl() |
|
130 | - { |
|
127 | + protected function getActionUrl() { |
|
131 | 128 | // Configure @action URL for form. |
132 | 129 | $linkConf = [ |
133 | 130 | 'parameter' => $GLOBALS['TSFE']->id, |
@@ -152,8 +149,7 @@ discard block |
||
152 | 149 | * |
153 | 150 | * @return string with current document id |
154 | 151 | */ |
155 | - protected function getCurrentDocumentId() |
|
156 | - { |
|
152 | + protected function getCurrentDocumentId() { |
|
157 | 153 | $id = $this->doc->uid; |
158 | 154 | |
159 | 155 | // example: https://host.de/items/*id*/record |
@@ -177,8 +173,7 @@ discard block |
||
177 | 173 | * |
178 | 174 | * @return string with encrypted core name |
179 | 175 | */ |
180 | - protected function getEncryptedCoreName() |
|
181 | - { |
|
176 | + protected function getEncryptedCoreName() { |
|
182 | 177 | // Get core name. |
183 | 178 | $name = Helper::getIndexNameFromUid($this->conf['solrcore'], 'tx_dlf_solrcores'); |
184 | 179 | // Encrypt core name. |
@@ -22,8 +22,7 @@ discard block |
||
22 | 22 | * @subpackage dlf |
23 | 23 | * @access public |
24 | 24 | */ |
25 | -class ImageManipulationTool extends \Kitodo\Dlf\Common\AbstractPlugin |
|
26 | -{ |
|
25 | +class ImageManipulationTool extends \Kitodo\Dlf\Common\AbstractPlugin { |
|
27 | 26 | public $scriptRelPath = 'Classes/Plugin/Tools/ImageManipulationTool.php'; |
28 | 27 | |
29 | 28 | /** |
@@ -36,8 +35,7 @@ discard block |
||
36 | 35 | * |
37 | 36 | * @return string The content that is displayed on the website |
38 | 37 | */ |
39 | - public function main($content, $conf) |
|
40 | - { |
|
38 | + public function main($content, $conf) { |
|
41 | 39 | $this->init($conf); |
42 | 40 | // Merge configuration with conf array of toolbox. |
43 | 41 | if (!empty($this->cObj->data['conf'])) { |
@@ -47,7 +47,7 @@ |
||
47 | 47 | $parentContainer = !empty($this->conf['parentContainer']) ? $this->conf['parentContainer'] : '.tx-dlf-imagemanipulationtool'; |
48 | 48 | // Load template file. |
49 | 49 | $this->getTemplate(); |
50 | - $markerArray['###IMAGEMANIPULATION_SELECT###'] = '<span class="tx-dlf-tools-imagetools" id="tx-dlf-tools-imagetools" data-dic="imagemanipulation-on:' . htmlspecialchars($this->pi_getLL('imagemanipulation-on', '')) . ';imagemanipulation-off:' . htmlspecialchars($this->pi_getLL('imagemanipulation-off', '')) . ';reset:' . htmlspecialchars($this->pi_getLL('reset', '')) . ';saturation:' . htmlspecialchars($this->pi_getLL('saturation', '')) . ';hue:' . htmlspecialchars($this->pi_getLL('hue', '')) . ';contrast:' . htmlspecialchars($this->pi_getLL('contrast', '')) . ';brightness:' . htmlspecialchars($this->pi_getLL('brightness', '')) . ';invert:' . htmlspecialchars($this->pi_getLL('invert', '')) . ';parentContainer:' . $parentContainer . '" title="' . htmlspecialchars($this->pi_getLL('no-support', '')) . '"></span>'; |
|
50 | + $markerArray['###IMAGEMANIPULATION_SELECT###'] = '<span class="tx-dlf-tools-imagetools" id="tx-dlf-tools-imagetools" data-dic="imagemanipulation-on:'.htmlspecialchars($this->pi_getLL('imagemanipulation-on', '')).';imagemanipulation-off:'.htmlspecialchars($this->pi_getLL('imagemanipulation-off', '')).';reset:'.htmlspecialchars($this->pi_getLL('reset', '')).';saturation:'.htmlspecialchars($this->pi_getLL('saturation', '')).';hue:'.htmlspecialchars($this->pi_getLL('hue', '')).';contrast:'.htmlspecialchars($this->pi_getLL('contrast', '')).';brightness:'.htmlspecialchars($this->pi_getLL('brightness', '')).';invert:'.htmlspecialchars($this->pi_getLL('invert', '')).';parentContainer:'.$parentContainer.'" title="'.htmlspecialchars($this->pi_getLL('no-support', '')).'"></span>'; |
|
51 | 51 | $content .= $this->templateService->substituteMarkerArray($this->template, $markerArray); |
52 | 52 | return $this->pi_wrapInBaseClass($content); |
53 | 53 | } |
@@ -47,7 +47,7 @@ |
||
47 | 47 | // Load current document. |
48 | 48 | $this->loadDocument(); |
49 | 49 | if ( |
50 | - $this->doc === null |
|
50 | + $this->doc === NULL |
|
51 | 51 | || $this->doc->numPages < 1 |
52 | 52 | || empty($this->conf['fileGrpDownload']) |
53 | 53 | ) { |
@@ -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. |
@@ -115,7 +115,7 @@ discard block |
||
115 | 115 | empty($page1Link) |
116 | 116 | && empty($page2Link) |
117 | 117 | ) { |
118 | - $this->logger->warning('File not found in fileGrps "' . $this->conf['fileGrpDownload'] . '"'); |
|
118 | + $this->logger->warning('File not found in fileGrps "'.$this->conf['fileGrpDownload'].'"'); |
|
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 | - $this->logger->warning('File not found in fileGrp "' . $this->conf['fileGrpDownload'] . '"'); |
|
177 | + $this->logger->warning('File not found in fileGrp "'.$this->conf['fileGrpDownload'].'"'); |
|
178 | 178 | } |
179 | 179 | return $workLink; |
180 | 180 | } |
@@ -22,8 +22,7 @@ discard block |
||
22 | 22 | * @subpackage dlf |
23 | 23 | * @access public |
24 | 24 | */ |
25 | -class ImageDownloadTool extends \Kitodo\Dlf\Common\AbstractPlugin |
|
26 | -{ |
|
25 | +class ImageDownloadTool extends \Kitodo\Dlf\Common\AbstractPlugin { |
|
27 | 26 | public $scriptRelPath = 'Classes/Plugin/Tools/ImageDownloadTool.php'; |
28 | 27 | |
29 | 28 | /** |
@@ -36,8 +35,7 @@ discard block |
||
36 | 35 | * |
37 | 36 | * @return string The content that is displayed on the website |
38 | 37 | */ |
39 | - public function main($content, $conf) |
|
40 | - { |
|
38 | + public function main($content, $conf) { |
|
41 | 39 | $this->init($conf); |
42 | 40 | // Merge configuration with conf array of toolbox. |
43 | 41 | if (!empty($this->cObj->data['conf'])) { |
@@ -90,8 +88,7 @@ discard block |
||
90 | 88 | * |
91 | 89 | * @return string Link to image file with given label |
92 | 90 | */ |
93 | - protected function getImage($page, $label) |
|
94 | - { |
|
91 | + protected function getImage($page, $label) { |
|
95 | 92 | $image = []; |
96 | 93 | // Get @USE value of METS fileGrp. |
97 | 94 | $fileGrps = \TYPO3\CMS\Core\Utility\GeneralUtility::trimExplode(',', $this->conf['fileGrpsImageDownload']); |
@@ -46,7 +46,7 @@ |
||
46 | 46 | // Load current document. |
47 | 47 | $this->loadDocument(); |
48 | 48 | if ( |
49 | - $this->doc === null |
|
49 | + $this->doc === NULL |
|
50 | 50 | || $this->doc->numPages < 1 |
51 | 51 | || empty($this->conf['fileGrpsImageDownload']) |
52 | 52 | ) { |
@@ -114,14 +114,14 @@ |
||
114 | 114 | 'parameter' => $image['url'], |
115 | 115 | 'forceAbsoluteUrl' => !empty($this->conf['forceAbsoluteUrl']) ? 1 : 0, |
116 | 116 | 'forceAbsoluteUrl.' => ['scheme' => !empty($this->conf['forceAbsoluteUrl']) && !empty($this->conf['forceAbsoluteUrlHttps']) ? 'https' : 'http'], |
117 | - 'title' => $label . $mimetypeLabel, |
|
117 | + 'title' => $label.$mimetypeLabel, |
|
118 | 118 | 'extTarget' => '_blank', |
119 | 119 | 'additionalParams' => '', |
120 | 120 | ]; |
121 | - $imageLink = $this->cObj->typoLink($label . $mimetypeLabel, $linkConf); |
|
121 | + $imageLink = $this->cObj->typoLink($label.$mimetypeLabel, $linkConf); |
|
122 | 122 | break; |
123 | 123 | } else { |
124 | - $this->logger->warning('File not found in fileGrp "' . $fileGrp . '"'); |
|
124 | + $this->logger->warning('File not found in fileGrp "'.$fileGrp.'"'); |
|
125 | 125 | } |
126 | 126 | } |
127 | 127 | return $imageLink; |
@@ -23,8 +23,7 @@ discard block |
||
23 | 23 | * @subpackage dlf |
24 | 24 | * @access public |
25 | 25 | */ |
26 | -class FulltextTool extends \Kitodo\Dlf\Common\AbstractPlugin |
|
27 | -{ |
|
26 | +class FulltextTool extends \Kitodo\Dlf\Common\AbstractPlugin { |
|
28 | 27 | public $scriptRelPath = 'Classes/Plugin/Tools/FulltextTool.php'; |
29 | 28 | |
30 | 29 | /** |
@@ -37,8 +36,7 @@ discard block |
||
37 | 36 | * |
38 | 37 | * @return string The content that is displayed on the website |
39 | 38 | */ |
40 | - public function main($content, $conf) |
|
41 | - { |
|
39 | + public function main($content, $conf) { |
|
42 | 40 | $this->init($conf); |
43 | 41 | // Merge configuration with conf array of toolbox. |
44 | 42 | if (!empty($this->cObj->data['conf'])) { |
@@ -47,7 +47,7 @@ |
||
47 | 47 | // Load current document. |
48 | 48 | $this->loadDocument(); |
49 | 49 | if ( |
50 | - $this->doc === null |
|
50 | + $this->doc === NULL |
|
51 | 51 | || $this->doc->numPages < 1 |
52 | 52 | || empty($this->conf['fileGrpFulltext']) |
53 | 53 | ) { |
@@ -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'] |
|
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 | 92 | . '"> </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); |
@@ -24,8 +24,7 @@ discard block |
||
24 | 24 | * @subpackage dlf |
25 | 25 | * @access public |
26 | 26 | */ |
27 | -class TableOfContents extends \Kitodo\Dlf\Common\AbstractPlugin |
|
28 | -{ |
|
27 | +class TableOfContents extends \Kitodo\Dlf\Common\AbstractPlugin { |
|
29 | 28 | public $scriptRelPath = 'Classes/Plugin/TableOfContents.php'; |
30 | 29 | |
31 | 30 | /** |
@@ -46,8 +45,7 @@ discard block |
||
46 | 45 | * |
47 | 46 | * @return array HMENU array for menu entry |
48 | 47 | */ |
49 | - protected function getMenuEntry(array $entry, $recursive = false) |
|
50 | - { |
|
48 | + protected function getMenuEntry(array $entry, $recursive = false) { |
|
51 | 49 | $entryArray = []; |
52 | 50 | // Set "title", "volume", "type" and "pagination" from $entry array. |
53 | 51 | $entryArray['title'] = !empty($entry['label']) ? $entry['label'] : $entry['orderlabel']; |
@@ -129,8 +127,7 @@ discard block |
||
129 | 127 | * |
130 | 128 | * @return string The content that is displayed on the website |
131 | 129 | */ |
132 | - public function main($content, $conf) |
|
133 | - { |
|
130 | + public function main($content, $conf) { |
|
134 | 131 | $this->init($conf); |
135 | 132 | // Check for typoscript configuration to prevent fatal error. |
136 | 133 | if (empty($this->conf['menuConf.'])) { |
@@ -158,8 +155,7 @@ discard block |
||
158 | 155 | * |
159 | 156 | * @return array HMENU array |
160 | 157 | */ |
161 | - public function makeMenuArray($content, $conf) |
|
162 | - { |
|
158 | + public function makeMenuArray($content, $conf) { |
|
163 | 159 | $this->init($conf); |
164 | 160 | // Load current document. |
165 | 161 | $this->loadDocument(); |
@@ -66,7 +66,7 @@ discard block |
||
66 | 66 | $entryArray['_OVERRIDE_HREF'] = $this->pi_linkTP_keepPIvars_url(['page' => $entry['points']], true, false, $this->conf['targetPid']); |
67 | 67 | $entryArray['doNotLinkIt'] = 0; |
68 | 68 | if ($this->conf['basketButton']) { |
69 | - $entryArray['basketButtonHref'] = '<a href="' . $this->pi_linkTP_keepPIvars_url(['addToBasket' => 'toc', 'logId' => $entry['id'], 'startpage' => $entry['points']], true, false, $this->conf['targetBasket']) . '">' . htmlspecialchars($this->pi_getLL('basketButton', '')) . '</a>'; |
|
69 | + $entryArray['basketButtonHref'] = '<a href="'.$this->pi_linkTP_keepPIvars_url(['addToBasket' => 'toc', 'logId' => $entry['id'], 'startpage' => $entry['points']], true, false, $this->conf['targetBasket']).'">'.htmlspecialchars($this->pi_getLL('basketButton', '')).'</a>'; |
|
70 | 70 | } |
71 | 71 | } elseif ( |
72 | 72 | !empty($entry['points']) |
@@ -75,13 +75,13 @@ discard block |
||
75 | 75 | $entryArray['_OVERRIDE_HREF'] = $this->pi_linkTP_keepPIvars_url(['id' => $entry['points'], 'page' => 1], true, false, $this->conf['targetPid']); |
76 | 76 | $entryArray['doNotLinkIt'] = 0; |
77 | 77 | if ($this->conf['basketButton']) { |
78 | - $entryArray['basketButtonHref'] = '<a href="' . $this->pi_linkTP_keepPIvars_url(['addToBasket' => 'toc', 'logId' => $entry['id'], 'startpage' => $entry['points']], true, false, $this->conf['targetBasket']) . '">' . htmlspecialchars($this->pi_getLL('basketButton', '')) . '</a>'; |
|
78 | + $entryArray['basketButtonHref'] = '<a href="'.$this->pi_linkTP_keepPIvars_url(['addToBasket' => 'toc', 'logId' => $entry['id'], 'startpage' => $entry['points']], true, false, $this->conf['targetBasket']).'">'.htmlspecialchars($this->pi_getLL('basketButton', '')).'</a>'; |
|
79 | 79 | } |
80 | 80 | } elseif (!empty($entry['targetUid'])) { |
81 | 81 | $entryArray['_OVERRIDE_HREF'] = $this->pi_linkTP_keepPIvars_url(['id' => $entry['targetUid'], 'page' => 1], true, false, $this->conf['targetPid']); |
82 | 82 | $entryArray['doNotLinkIt'] = 0; |
83 | 83 | if ($this->conf['basketButton']) { |
84 | - $entryArray['basketButtonHref'] = '<a href="' . $this->pi_linkTP_keepPIvars_url(['addToBasket' => 'toc', 'logId' => $entry['id'], 'startpage' => $entry['targetUid']], true, false, $this->conf['targetBasket']) . '">' . htmlspecialchars($this->pi_getLL('basketButton', '')) . '</a>'; |
|
84 | + $entryArray['basketButtonHref'] = '<a href="'.$this->pi_linkTP_keepPIvars_url(['addToBasket' => 'toc', 'logId' => $entry['id'], 'startpage' => $entry['targetUid']], true, false, $this->conf['targetBasket']).'">'.htmlspecialchars($this->pi_getLL('basketButton', '')).'</a>'; |
|
85 | 85 | } |
86 | 86 | } |
87 | 87 | // Set "ITEM_STATE" to "CUR" if this entry points to current page. |
@@ -114,7 +114,7 @@ discard block |
||
114 | 114 | } |
115 | 115 | } |
116 | 116 | // Append "IFSUB" to "ITEM_STATE" if this entry has sub-entries. |
117 | - $entryArray['ITEM_STATE'] = ($entryArray['ITEM_STATE'] == 'NO' ? 'IFSUB' : $entryArray['ITEM_STATE'] . 'IFSUB'); |
|
117 | + $entryArray['ITEM_STATE'] = ($entryArray['ITEM_STATE'] == 'NO' ? 'IFSUB' : $entryArray['ITEM_STATE'].'IFSUB'); |
|
118 | 118 | } |
119 | 119 | return $entryArray; |
120 | 120 | } |
@@ -141,7 +141,7 @@ discard block |
||
141 | 141 | $this->getTemplate(); |
142 | 142 | $TSconfig = []; |
143 | 143 | $TSconfig['special'] = 'userfunction'; |
144 | - $TSconfig['special.']['userFunc'] = \Kitodo\Dlf\Plugin\TableOfContents::class . '->makeMenuArray'; |
|
144 | + $TSconfig['special.']['userFunc'] = \Kitodo\Dlf\Plugin\TableOfContents::class.'->makeMenuArray'; |
|
145 | 145 | $TSconfig = Helper::mergeRecursiveWithOverrule($this->conf['menuConf.'], $TSconfig); |
146 | 146 | $markerArray['###TOCMENU###'] = $this->cObj->cObjGetSingle('HMENU', $TSconfig); |
147 | 147 | $content .= $this->templateService->substituteMarkerArray($this->template, $markerArray); |
@@ -218,7 +218,7 @@ discard block |
||
218 | 218 | |
219 | 219 | $excludeOtherWhere = ''; |
220 | 220 | if ($this->conf['excludeOther']) { |
221 | - $excludeOtherWhere = 'tx_dlf_documents.pid=' . intval($this->conf['pages']); |
|
221 | + $excludeOtherWhere = 'tx_dlf_documents.pid='.intval($this->conf['pages']); |
|
222 | 222 | } |
223 | 223 | // Check if there are any metadata to suggest. |
224 | 224 | $result = $queryBuilder |
@@ -46,7 +46,7 @@ discard block |
||
46 | 46 | * |
47 | 47 | * @return array HMENU array for menu entry |
48 | 48 | */ |
49 | - protected function getMenuEntry(array $entry, $recursive = false) |
|
49 | + protected function getMenuEntry(array $entry, $recursive = FALSE) |
|
50 | 50 | { |
51 | 51 | $entryArray = []; |
52 | 52 | // Set "title", "volume", "type" and "pagination" from $entry array. |
@@ -63,25 +63,25 @@ discard block |
||
63 | 63 | !empty($entry['points']) |
64 | 64 | && \TYPO3\CMS\Core\Utility\MathUtility::canBeInterpretedAsInteger($entry['points']) |
65 | 65 | ) { |
66 | - $entryArray['_OVERRIDE_HREF'] = $this->pi_linkTP_keepPIvars_url(['page' => $entry['points']], true, false, $this->conf['targetPid']); |
|
66 | + $entryArray['_OVERRIDE_HREF'] = $this->pi_linkTP_keepPIvars_url(['page' => $entry['points']], TRUE, FALSE, $this->conf['targetPid']); |
|
67 | 67 | $entryArray['doNotLinkIt'] = 0; |
68 | 68 | if ($this->conf['basketButton']) { |
69 | - $entryArray['basketButtonHref'] = '<a href="' . $this->pi_linkTP_keepPIvars_url(['addToBasket' => 'toc', 'logId' => $entry['id'], 'startpage' => $entry['points']], true, false, $this->conf['targetBasket']) . '">' . htmlspecialchars($this->pi_getLL('basketButton', '')) . '</a>'; |
|
69 | + $entryArray['basketButtonHref'] = '<a href="' . $this->pi_linkTP_keepPIvars_url(['addToBasket' => 'toc', 'logId' => $entry['id'], 'startpage' => $entry['points']], TRUE, FALSE, $this->conf['targetBasket']) . '">' . htmlspecialchars($this->pi_getLL('basketButton', '')) . '</a>'; |
|
70 | 70 | } |
71 | 71 | } elseif ( |
72 | 72 | !empty($entry['points']) |
73 | 73 | && is_string($entry['points']) |
74 | 74 | ) { |
75 | - $entryArray['_OVERRIDE_HREF'] = $this->pi_linkTP_keepPIvars_url(['id' => $entry['points'], 'page' => 1], true, false, $this->conf['targetPid']); |
|
75 | + $entryArray['_OVERRIDE_HREF'] = $this->pi_linkTP_keepPIvars_url(['id' => $entry['points'], 'page' => 1], TRUE, FALSE, $this->conf['targetPid']); |
|
76 | 76 | $entryArray['doNotLinkIt'] = 0; |
77 | 77 | if ($this->conf['basketButton']) { |
78 | - $entryArray['basketButtonHref'] = '<a href="' . $this->pi_linkTP_keepPIvars_url(['addToBasket' => 'toc', 'logId' => $entry['id'], 'startpage' => $entry['points']], true, false, $this->conf['targetBasket']) . '">' . htmlspecialchars($this->pi_getLL('basketButton', '')) . '</a>'; |
|
78 | + $entryArray['basketButtonHref'] = '<a href="' . $this->pi_linkTP_keepPIvars_url(['addToBasket' => 'toc', 'logId' => $entry['id'], 'startpage' => $entry['points']], TRUE, FALSE, $this->conf['targetBasket']) . '">' . htmlspecialchars($this->pi_getLL('basketButton', '')) . '</a>'; |
|
79 | 79 | } |
80 | 80 | } elseif (!empty($entry['targetUid'])) { |
81 | - $entryArray['_OVERRIDE_HREF'] = $this->pi_linkTP_keepPIvars_url(['id' => $entry['targetUid'], 'page' => 1], true, false, $this->conf['targetPid']); |
|
81 | + $entryArray['_OVERRIDE_HREF'] = $this->pi_linkTP_keepPIvars_url(['id' => $entry['targetUid'], 'page' => 1], TRUE, FALSE, $this->conf['targetPid']); |
|
82 | 82 | $entryArray['doNotLinkIt'] = 0; |
83 | 83 | if ($this->conf['basketButton']) { |
84 | - $entryArray['basketButtonHref'] = '<a href="' . $this->pi_linkTP_keepPIvars_url(['addToBasket' => 'toc', 'logId' => $entry['id'], 'startpage' => $entry['targetUid']], true, false, $this->conf['targetBasket']) . '">' . htmlspecialchars($this->pi_getLL('basketButton', '')) . '</a>'; |
|
84 | + $entryArray['basketButtonHref'] = '<a href="' . $this->pi_linkTP_keepPIvars_url(['addToBasket' => 'toc', 'logId' => $entry['id'], 'startpage' => $entry['targetUid']], TRUE, FALSE, $this->conf['targetBasket']) . '">' . htmlspecialchars($this->pi_getLL('basketButton', '')) . '</a>'; |
|
85 | 85 | } |
86 | 86 | } |
87 | 87 | // Set "ITEM_STATE" to "CUR" if this entry points to current page. |
@@ -90,7 +90,7 @@ discard block |
||
90 | 90 | } |
91 | 91 | // Build sub-menu if available and called recursively. |
92 | 92 | if ( |
93 | - $recursive == true |
|
93 | + $recursive == TRUE |
|
94 | 94 | && !empty($entry['children']) |
95 | 95 | ) { |
96 | 96 | // Build sub-menu only if one of the following conditions apply: |
@@ -110,7 +110,7 @@ discard block |
||
110 | 110 | if (in_array($child['id'], $this->activeEntries)) { |
111 | 111 | $entryArray['ITEM_STATE'] = 'ACT'; |
112 | 112 | } |
113 | - $entryArray['_SUB_MENU'][] = $this->getMenuEntry($child, true); |
|
113 | + $entryArray['_SUB_MENU'][] = $this->getMenuEntry($child, TRUE); |
|
114 | 114 | } |
115 | 115 | } |
116 | 116 | // Append "IFSUB" to "ITEM_STATE" if this entry has sub-entries. |
@@ -163,7 +163,7 @@ discard block |
||
163 | 163 | $this->init($conf); |
164 | 164 | // Load current document. |
165 | 165 | $this->loadDocument(); |
166 | - if ($this->doc === null) { |
|
166 | + if ($this->doc === NULL) { |
|
167 | 167 | // Quit without doing anything if required variables are not set. |
168 | 168 | return []; |
169 | 169 | } else { |
@@ -205,12 +205,12 @@ discard block |
||
205 | 205 | } |
206 | 206 | // Go through table of contents and create all menu entries. |
207 | 207 | foreach ($this->doc->tableOfContents as $entry) { |
208 | - $menuArray[] = $this->getMenuEntry($entry, true); |
|
208 | + $menuArray[] = $this->getMenuEntry($entry, TRUE); |
|
209 | 209 | } |
210 | 210 | } else { |
211 | 211 | // Go through table of contents and create top-level menu entries. |
212 | 212 | foreach ($this->doc->tableOfContents as $entry) { |
213 | - $menuArray[] = $this->getMenuEntry($entry, false); |
|
213 | + $menuArray[] = $this->getMenuEntry($entry, FALSE); |
|
214 | 214 | } |
215 | 215 | // Build table of contents from database. |
216 | 216 | $queryBuilder = GeneralUtility::makeInstance(ConnectionPool::class) |
@@ -263,7 +263,7 @@ discard block |
||
263 | 263 | 'pagination' => '', |
264 | 264 | 'targetUid' => $resArray['uid'] |
265 | 265 | ]; |
266 | - $menuArray[0]['_SUB_MENU'][] = $this->getMenuEntry($entry, false); |
|
266 | + $menuArray[0]['_SUB_MENU'][] = $this->getMenuEntry($entry, FALSE); |
|
267 | 267 | } |
268 | 268 | } |
269 | 269 | } |
@@ -23,8 +23,7 @@ discard block |
||
23 | 23 | * @subpackage dlf |
24 | 24 | * @access public |
25 | 25 | */ |
26 | -class PageGrid extends \Kitodo\Dlf\Common\AbstractPlugin |
|
27 | -{ |
|
26 | +class PageGrid extends \Kitodo\Dlf\Common\AbstractPlugin { |
|
28 | 27 | public $scriptRelPath = 'Classes/Plugin/PageGrid.php'; |
29 | 28 | |
30 | 29 | /** |
@@ -37,8 +36,7 @@ discard block |
||
37 | 36 | * |
38 | 37 | * @return string The rendered entry ready for output |
39 | 38 | */ |
40 | - protected function getEntry($number, $template) |
|
41 | - { |
|
39 | + protected function getEntry($number, $template) { |
|
42 | 40 | // Set current page if applicable. |
43 | 41 | if (!empty($this->piVars['page']) && $this->piVars['page'] == $number) { |
44 | 42 | $markerArray['###STATE###'] = 'cur'; |
@@ -81,8 +79,7 @@ discard block |
||
81 | 79 | * |
82 | 80 | * @return string The rendered page browser ready for output |
83 | 81 | */ |
84 | - protected function getPageBrowser() |
|
85 | - { |
|
82 | + protected function getPageBrowser() { |
|
86 | 83 | // Get overall number of pages. |
87 | 84 | $maxPages = intval(ceil($this->doc->numPages / $this->conf['limit'])); |
88 | 85 | // Return empty pagebrowser if there is just one page. |
@@ -132,8 +129,7 @@ discard block |
||
132 | 129 | * |
133 | 130 | * @return string The content that is displayed on the website |
134 | 131 | */ |
135 | - public function main($content, $conf) |
|
136 | - { |
|
132 | + public function main($content, $conf) { |
|
137 | 133 | $this->init($conf); |
138 | 134 | $this->loadDocument(); |
139 | 135 | if ( |
@@ -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 | } |
@@ -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 | } |