@@ -21,8 +21,7 @@ |
||
| 21 | 21 | * @access public |
| 22 | 22 | * @abstract |
| 23 | 23 | */ |
| 24 | -interface FulltextInterface |
|
| 25 | -{ |
|
| 24 | +interface FulltextInterface { |
|
| 26 | 25 | /** |
| 27 | 26 | * This extracts raw fulltext data from XML |
| 28 | 27 | * |
@@ -21,8 +21,7 @@ |
||
| 21 | 21 | * @access public |
| 22 | 22 | * @abstract |
| 23 | 23 | */ |
| 24 | -interface MetadataInterface |
|
| 25 | -{ |
|
| 24 | +interface MetadataInterface { |
|
| 26 | 25 | /** |
| 27 | 26 | * This extracts metadata from XML |
| 28 | 27 | * |
@@ -25,8 +25,7 @@ discard block |
||
| 25 | 25 | * @subpackage dlf |
| 26 | 26 | * @access public |
| 27 | 27 | */ |
| 28 | -class IiifUrlReader implements UrlReaderInterface |
|
| 29 | -{ |
|
| 28 | +class IiifUrlReader implements UrlReaderInterface { |
|
| 30 | 29 | /** |
| 31 | 30 | * Singleton instance of the class |
| 32 | 31 | * |
@@ -40,8 +39,7 @@ discard block |
||
| 40 | 39 | * {@inheritDoc} |
| 41 | 40 | * @see \Ubl\Iiif\Tools\UrlReaderInterface::getContent() |
| 42 | 41 | */ |
| 43 | - public function getContent($url) |
|
| 44 | - { |
|
| 42 | + public function getContent($url) { |
|
| 45 | 43 | $fileContents = GeneralUtility::getUrl($url); |
| 46 | 44 | if ($fileContents !== false) { |
| 47 | 45 | return $fileContents; |
@@ -57,8 +55,7 @@ discard block |
||
| 57 | 55 | * |
| 58 | 56 | * @return IiifUrlReader |
| 59 | 57 | */ |
| 60 | - public static function getInstance() |
|
| 61 | - { |
|
| 58 | + public static function getInstance() { |
|
| 62 | 59 | if (!isset(self::$instance)) { |
| 63 | 60 | self::$instance = new IiifUrlReader(); |
| 64 | 61 | } |
@@ -43,7 +43,7 @@ |
||
| 43 | 43 | public function getContent($url) |
| 44 | 44 | { |
| 45 | 45 | $fileContents = GeneralUtility::getUrl($url); |
| 46 | - if ($fileContents !== false) { |
|
| 46 | + if ($fileContents !== FALSE) { |
|
| 47 | 47 | return $fileContents; |
| 48 | 48 | } else { |
| 49 | 49 | return ''; |
@@ -97,8 +97,7 @@ discard block |
||
| 97 | 97 | * |
| 98 | 98 | * @return void |
| 99 | 99 | */ |
| 100 | - public function add(array $elements, $position = -1) |
|
| 101 | - { |
|
| 100 | + public function add(array $elements, $position = -1) { |
|
| 102 | 101 | $position = MathUtility::forceIntegerInRange($position, 0, $this->count, $this->count); |
| 103 | 102 | if (!empty($elements)) { |
| 104 | 103 | array_splice($this->elements, $position, 0, $elements); |
@@ -114,8 +113,7 @@ discard block |
||
| 114 | 113 | * |
| 115 | 114 | * @return int The number of elements in the list |
| 116 | 115 | */ |
| 117 | - public function count() |
|
| 118 | - { |
|
| 116 | + public function count() { |
|
| 119 | 117 | return $this->count; |
| 120 | 118 | } |
| 121 | 119 | |
@@ -127,8 +125,7 @@ discard block |
||
| 127 | 125 | * |
| 128 | 126 | * @return array The current element |
| 129 | 127 | */ |
| 130 | - public function current() |
|
| 131 | - { |
|
| 128 | + public function current() { |
|
| 132 | 129 | if ($this->valid()) { |
| 133 | 130 | return $this->getRecord($this->elements[$this->position]); |
| 134 | 131 | } else { |
@@ -146,8 +143,7 @@ discard block |
||
| 146 | 143 | * |
| 147 | 144 | * @return mixed The element's full record |
| 148 | 145 | */ |
| 149 | - protected function getRecord($element) |
|
| 150 | - { |
|
| 146 | + protected function getRecord($element) { |
|
| 151 | 147 | if ( |
| 152 | 148 | is_array($element) |
| 153 | 149 | && array_keys($element) == ['u', 'h', 's', 'p'] |
@@ -318,8 +314,7 @@ discard block |
||
| 318 | 314 | * |
| 319 | 315 | * @return int The current position |
| 320 | 316 | */ |
| 321 | - public function key() |
|
| 322 | - { |
|
| 317 | + public function key() { |
|
| 323 | 318 | return $this->position; |
| 324 | 319 | } |
| 325 | 320 | |
@@ -333,8 +328,7 @@ discard block |
||
| 333 | 328 | * |
| 334 | 329 | * @return void |
| 335 | 330 | */ |
| 336 | - public function move($position, $steps) |
|
| 337 | - { |
|
| 331 | + public function move($position, $steps) { |
|
| 338 | 332 | $position = intval($position); |
| 339 | 333 | // Check if list position is valid. |
| 340 | 334 | if ( |
@@ -365,8 +359,7 @@ discard block |
||
| 365 | 359 | * |
| 366 | 360 | * @return void |
| 367 | 361 | */ |
| 368 | - public function moveUp($position) |
|
| 369 | - { |
|
| 362 | + public function moveUp($position) { |
|
| 370 | 363 | $this->move($position, -1); |
| 371 | 364 | } |
| 372 | 365 | |
@@ -379,8 +372,7 @@ discard block |
||
| 379 | 372 | * |
| 380 | 373 | * @return void |
| 381 | 374 | */ |
| 382 | - public function moveDown($position) |
|
| 383 | - { |
|
| 375 | + public function moveDown($position) { |
|
| 384 | 376 | $this->move($position, 1); |
| 385 | 377 | } |
| 386 | 378 | |
@@ -392,8 +384,7 @@ discard block |
||
| 392 | 384 | * |
| 393 | 385 | * @return void |
| 394 | 386 | */ |
| 395 | - public function next() |
|
| 396 | - { |
|
| 387 | + public function next() { |
|
| 397 | 388 | $this->position++; |
| 398 | 389 | } |
| 399 | 390 | |
@@ -407,8 +398,7 @@ discard block |
||
| 407 | 398 | * |
| 408 | 399 | * @return bool Does the given offset exist? |
| 409 | 400 | */ |
| 410 | - public function offsetExists($offset) |
|
| 411 | - { |
|
| 401 | + public function offsetExists($offset) { |
|
| 412 | 402 | return isset($this->elements[$offset]); |
| 413 | 403 | } |
| 414 | 404 | |
@@ -422,8 +412,7 @@ discard block |
||
| 422 | 412 | * |
| 423 | 413 | * @return array The element at the given offset |
| 424 | 414 | */ |
| 425 | - public function offsetGet($offset) |
|
| 426 | - { |
|
| 415 | + public function offsetGet($offset) { |
|
| 427 | 416 | if ($this->offsetExists($offset)) { |
| 428 | 417 | return $this->getRecord($this->elements[$offset]); |
| 429 | 418 | } else { |
@@ -443,8 +432,7 @@ discard block |
||
| 443 | 432 | * |
| 444 | 433 | * @return void |
| 445 | 434 | */ |
| 446 | - public function offsetSet($offset, $value) |
|
| 447 | - { |
|
| 435 | + public function offsetSet($offset, $value) { |
|
| 448 | 436 | if (\TYPO3\CMS\Core\Utility\MathUtility::canBeInterpretedAsInteger($offset)) { |
| 449 | 437 | $this->elements[$offset] = $value; |
| 450 | 438 | } else { |
@@ -464,8 +452,7 @@ discard block |
||
| 464 | 452 | * |
| 465 | 453 | * @return array The removed element |
| 466 | 454 | */ |
| 467 | - public function remove($position) |
|
| 468 | - { |
|
| 455 | + public function remove($position) { |
|
| 469 | 456 | $position = intval($position); |
| 470 | 457 | if ( |
| 471 | 458 | $position < 0 |
@@ -489,8 +476,7 @@ discard block |
||
| 489 | 476 | * |
| 490 | 477 | * @return array The indizes of the removed elements |
| 491 | 478 | */ |
| 492 | - public function removeRange($position, $length) |
|
| 493 | - { |
|
| 479 | + public function removeRange($position, $length) { |
|
| 494 | 480 | $position = intval($position); |
| 495 | 481 | if ( |
| 496 | 482 | $position < 0 |
@@ -511,8 +497,7 @@ discard block |
||
| 511 | 497 | * |
| 512 | 498 | * @return void |
| 513 | 499 | */ |
| 514 | - public function reset() |
|
| 515 | - { |
|
| 500 | + public function reset() { |
|
| 516 | 501 | $this->elements = []; |
| 517 | 502 | $this->records = []; |
| 518 | 503 | $this->metadata = []; |
@@ -528,8 +513,7 @@ discard block |
||
| 528 | 513 | * |
| 529 | 514 | * @return void |
| 530 | 515 | */ |
| 531 | - public function rewind() |
|
| 532 | - { |
|
| 516 | + public function rewind() { |
|
| 533 | 517 | $this->position = 0; |
| 534 | 518 | } |
| 535 | 519 | |
@@ -542,8 +526,7 @@ discard block |
||
| 542 | 526 | * |
| 543 | 527 | * @return void |
| 544 | 528 | */ |
| 545 | - public function save($pid = 0) |
|
| 546 | - { |
|
| 529 | + public function save($pid = 0) { |
|
| 547 | 530 | $pid = max(intval($pid), 0); |
| 548 | 531 | // If no PID is given, save to the user's session instead |
| 549 | 532 | if ($pid > 0) { |
@@ -560,8 +543,7 @@ discard block |
||
| 560 | 543 | * |
| 561 | 544 | * @return bool true on success or false on failure |
| 562 | 545 | */ |
| 563 | - protected function solrConnect() |
|
| 564 | - { |
|
| 546 | + protected function solrConnect() { |
|
| 565 | 547 | // Get Solr instance. |
| 566 | 548 | if (!$this->solr) { |
| 567 | 549 | // Connect to Solr server. |
@@ -607,8 +589,7 @@ discard block |
||
| 607 | 589 | * |
| 608 | 590 | * @return void |
| 609 | 591 | */ |
| 610 | - public function sort($by, $asc = true) |
|
| 611 | - { |
|
| 592 | + public function sort($by, $asc = true) { |
|
| 612 | 593 | $newOrder = []; |
| 613 | 594 | $nonSortable = []; |
| 614 | 595 | foreach ($this->elements as $num => $element) { |
@@ -645,8 +626,7 @@ discard block |
||
| 645 | 626 | * |
| 646 | 627 | * @return void |
| 647 | 628 | */ |
| 648 | - public function offsetUnset($offset) |
|
| 649 | - { |
|
| 629 | + public function offsetUnset($offset) { |
|
| 650 | 630 | unset($this->elements[$offset]); |
| 651 | 631 | // Re-number the elements. |
| 652 | 632 | $this->elements = array_values($this->elements); |
@@ -661,8 +641,7 @@ discard block |
||
| 661 | 641 | * |
| 662 | 642 | * @return bool Is the current list position valid? |
| 663 | 643 | */ |
| 664 | - public function valid() |
|
| 665 | - { |
|
| 644 | + public function valid() { |
|
| 666 | 645 | return isset($this->elements[$this->position]); |
| 667 | 646 | } |
| 668 | 647 | |
@@ -673,8 +652,7 @@ discard block |
||
| 673 | 652 | * |
| 674 | 653 | * @return array The list's metadata |
| 675 | 654 | */ |
| 676 | - protected function _getMetadata() |
|
| 677 | - { |
|
| 655 | + protected function _getMetadata() { |
|
| 678 | 656 | return $this->metadata; |
| 679 | 657 | } |
| 680 | 658 | |
@@ -687,8 +665,7 @@ discard block |
||
| 687 | 665 | * |
| 688 | 666 | * @return void |
| 689 | 667 | */ |
| 690 | - protected function _setMetadata(array $metadata = []) |
|
| 691 | - { |
|
| 668 | + protected function _setMetadata(array $metadata = []) { |
|
| 692 | 669 | $this->metadata = $metadata; |
| 693 | 670 | } |
| 694 | 671 | |
@@ -702,8 +679,7 @@ discard block |
||
| 702 | 679 | * |
| 703 | 680 | * @return void |
| 704 | 681 | */ |
| 705 | - public function __construct(array $elements = [], array $metadata = []) |
|
| 706 | - { |
|
| 682 | + public function __construct(array $elements = [], array $metadata = []) { |
|
| 707 | 683 | if ( |
| 708 | 684 | empty($elements) |
| 709 | 685 | && empty($metadata) |
@@ -735,8 +711,7 @@ discard block |
||
| 735 | 711 | * |
| 736 | 712 | * @return void |
| 737 | 713 | */ |
| 738 | - protected function __clone() |
|
| 739 | - { |
|
| 714 | + protected function __clone() { |
|
| 740 | 715 | // This method is defined as protected because singleton objects should not be cloned. |
| 741 | 716 | } |
| 742 | 717 | |
@@ -749,8 +724,7 @@ discard block |
||
| 749 | 724 | * |
| 750 | 725 | * @return mixed Value of $this->$var |
| 751 | 726 | */ |
| 752 | - public function __get($var) |
|
| 753 | - { |
|
| 727 | + public function __get($var) { |
|
| 754 | 728 | $method = '_get' . ucfirst($var); |
| 755 | 729 | if ( |
| 756 | 730 | !property_exists($this, $var) |
@@ -772,8 +746,7 @@ discard block |
||
| 772 | 746 | * |
| 773 | 747 | * @return bool true if variable is set and not empty, false otherwise |
| 774 | 748 | */ |
| 775 | - public function __isset($var) |
|
| 776 | - { |
|
| 749 | + public function __isset($var) { |
|
| 777 | 750 | return !empty($this->__get($var)); |
| 778 | 751 | } |
| 779 | 752 | |
@@ -787,8 +760,7 @@ discard block |
||
| 787 | 760 | * |
| 788 | 761 | * @return void |
| 789 | 762 | */ |
| 790 | - public function __set($var, $value) |
|
| 791 | - { |
|
| 763 | + public function __set($var, $value) { |
|
| 792 | 764 | $method = '_set' . ucfirst($var); |
| 793 | 765 | if ( |
| 794 | 766 | !property_exists($this, $var) |
@@ -808,8 +780,7 @@ discard block |
||
| 808 | 780 | * |
| 809 | 781 | * @return array Properties to be serialized |
| 810 | 782 | */ |
| 811 | - public function __sleep() |
|
| 812 | - { |
|
| 783 | + public function __sleep() { |
|
| 813 | 784 | return ['elements', 'metadata']; |
| 814 | 785 | } |
| 815 | 786 | |
@@ -821,8 +792,7 @@ discard block |
||
| 821 | 792 | * |
| 822 | 793 | * @return void |
| 823 | 794 | */ |
| 824 | - public function __wakeup() |
|
| 825 | - { |
|
| 795 | + public function __wakeup() { |
|
| 826 | 796 | $this->count = count($this->elements); |
| 827 | 797 | } |
| 828 | 798 | } |
@@ -137,7 +137,7 @@ discard block |
||
| 137 | 137 | if ($this->valid()) { |
| 138 | 138 | return $this->getRecord($this->elements[$this->position]); |
| 139 | 139 | } else { |
| 140 | - $this->logger->notice('Invalid position "' . $this->position . '" for list element'); |
|
| 140 | + $this->logger->notice('Invalid position "'.$this->position.'" for list element'); |
|
| 141 | 141 | return; |
| 142 | 142 | } |
| 143 | 143 | } |
@@ -240,9 +240,9 @@ discard block |
||
| 240 | 240 | $fields = Solr::getFields(); |
| 241 | 241 | $params = []; |
| 242 | 242 | // Restrict the fields to the required ones |
| 243 | - $params['fields'] = $fields['uid'] . ',' . $fields['id'] . ',' . $fields['toplevel'] . ',' . $fields['thumbnail'] . ',' . $fields['page']; |
|
| 243 | + $params['fields'] = $fields['uid'].','.$fields['id'].','.$fields['toplevel'].','.$fields['thumbnail'].','.$fields['page']; |
|
| 244 | 244 | foreach ($this->solrConfig as $solr_name) { |
| 245 | - $params['fields'] .= ',' . $solr_name; |
|
| 245 | + $params['fields'] .= ','.$solr_name; |
|
| 246 | 246 | } |
| 247 | 247 | // If it is a fulltext search, enable highlighting. |
| 248 | 248 | if ($this->metadata['fulltextSearch']) { |
@@ -264,15 +264,15 @@ discard block |
||
| 264 | 264 | // Extend filter query to get all documents with the same UID. |
| 265 | 265 | foreach ($params['filterquery'] as $key => $value) { |
| 266 | 266 | if (isset($value['query'])) { |
| 267 | - $params['filterquery'][$key]['query'] = $value['query'] . ' OR ' . $fields['toplevel'] . ':true'; |
|
| 267 | + $params['filterquery'][$key]['query'] = $value['query'].' OR '.$fields['toplevel'].':true'; |
|
| 268 | 268 | } |
| 269 | 269 | } |
| 270 | 270 | // Add filter query to get all documents with the required uid. |
| 271 | - $params['filterquery'][] = ['query' => $fields['uid'] . ':' . Solr::escapeQuery($record['uid'])]; |
|
| 271 | + $params['filterquery'][] = ['query' => $fields['uid'].':'.Solr::escapeQuery($record['uid'])]; |
|
| 272 | 272 | // Add sorting. |
| 273 | 273 | $params['sort'] = $this->metadata['options']['params']['sort']; |
| 274 | 274 | // Set query. |
| 275 | - $params['query'] = $this->metadata['options']['select'] . ' OR ' . $fields['toplevel'] . ':true'; |
|
| 275 | + $params['query'] = $this->metadata['options']['select'].' OR '.$fields['toplevel'].':true'; |
|
| 276 | 276 | // Perform search for all documents with the same uid that either fit to the search or marked as toplevel. |
| 277 | 277 | $selectQuery = $this->solr->service->createSelect($params); |
| 278 | 278 | $result = $this->solr->service->select($selectQuery); |
@@ -347,7 +347,7 @@ discard block |
||
| 347 | 347 | $position < 0 |
| 348 | 348 | || $position >= $this->count |
| 349 | 349 | ) { |
| 350 | - $this->logger->warning('Invalid position "' . $position . '" for element moving'); |
|
| 350 | + $this->logger->warning('Invalid position "'.$position.'" for element moving'); |
|
| 351 | 351 | return; |
| 352 | 352 | } |
| 353 | 353 | $steps = intval($steps); |
@@ -355,7 +355,7 @@ discard block |
||
| 355 | 355 | if (($position + $steps) < 0 |
| 356 | 356 | || ($position + $steps) >= $this->count |
| 357 | 357 | ) { |
| 358 | - $this->logger->warning('Invalid steps "' . $steps . '" for moving element at position "' . $position . '"'); |
|
| 358 | + $this->logger->warning('Invalid steps "'.$steps.'" for moving element at position "'.$position.'"'); |
|
| 359 | 359 | return; |
| 360 | 360 | } |
| 361 | 361 | $element = $this->remove($position); |
@@ -433,7 +433,7 @@ discard block |
||
| 433 | 433 | if ($this->offsetExists($offset)) { |
| 434 | 434 | return $this->getRecord($this->elements[$offset]); |
| 435 | 435 | } else { |
| 436 | - $this->logger->notice('Invalid offset "' . $offset . '" for list element'); |
|
| 436 | + $this->logger->notice('Invalid offset "'.$offset.'" for list element'); |
|
| 437 | 437 | return; |
| 438 | 438 | } |
| 439 | 439 | } |
@@ -477,7 +477,7 @@ discard block |
||
| 477 | 477 | $position < 0 |
| 478 | 478 | || $position >= $this->count |
| 479 | 479 | ) { |
| 480 | - $this->logger->warning('Invalid position "' . $position . '" for element removing'); |
|
| 480 | + $this->logger->warning('Invalid position "'.$position.'" for element removing'); |
|
| 481 | 481 | return; |
| 482 | 482 | } |
| 483 | 483 | $removed = array_splice($this->elements, $position, 1); |
@@ -502,7 +502,7 @@ discard block |
||
| 502 | 502 | $position < 0 |
| 503 | 503 | || $position >= $this->count |
| 504 | 504 | ) { |
| 505 | - $this->logger->warning('Invalid position "' . $position . '" for element removing'); |
|
| 505 | + $this->logger->warning('Invalid position "'.$position.'" for element removing'); |
|
| 506 | 506 | return; |
| 507 | 507 | } |
| 508 | 508 | $removed = array_splice($this->elements, $position, $length); |
@@ -595,7 +595,7 @@ discard block |
||
| 595 | 595 | ->execute(); |
| 596 | 596 | |
| 597 | 597 | while ($resArray = $result->fetch()) { |
| 598 | - $this->solrConfig[$resArray['index_name']] = $resArray['index_name'] . '_' . ($resArray['index_tokenized'] ? 't' : 'u') . 's' . ($resArray['index_indexed'] ? 'i' : 'u'); |
|
| 598 | + $this->solrConfig[$resArray['index_name']] = $resArray['index_name'].'_'.($resArray['index_tokenized'] ? 't' : 'u').'s'.($resArray['index_indexed'] ? 'i' : 'u'); |
|
| 599 | 599 | } |
| 600 | 600 | // Add static fields. |
| 601 | 601 | $this->solrConfig['type'] = 'type'; |
@@ -623,7 +623,7 @@ discard block |
||
| 623 | 623 | foreach ($this->elements as $num => $element) { |
| 624 | 624 | // Is this element sortable? |
| 625 | 625 | if (!empty($element['s'][$by])) { |
| 626 | - $newOrder[$element['s'][$by] . str_pad($num, 6, '0', STR_PAD_LEFT)] = $element; |
|
| 626 | + $newOrder[$element['s'][$by].str_pad($num, 6, '0', STR_PAD_LEFT)] = $element; |
|
| 627 | 627 | } else { |
| 628 | 628 | $nonSortable[] = $element; |
| 629 | 629 | } |
@@ -761,12 +761,12 @@ discard block |
||
| 761 | 761 | */ |
| 762 | 762 | public function __get($var) |
| 763 | 763 | { |
| 764 | - $method = '_get' . ucfirst($var); |
|
| 764 | + $method = '_get'.ucfirst($var); |
|
| 765 | 765 | if ( |
| 766 | 766 | !property_exists($this, $var) |
| 767 | 767 | || !method_exists($this, $method) |
| 768 | 768 | ) { |
| 769 | - $this->logger->warning('There is no getter function for property "' . $var . '"'); |
|
| 769 | + $this->logger->warning('There is no getter function for property "'.$var.'"'); |
|
| 770 | 770 | return; |
| 771 | 771 | } else { |
| 772 | 772 | return $this->$method(); |
@@ -799,12 +799,12 @@ discard block |
||
| 799 | 799 | */ |
| 800 | 800 | public function __set($var, $value) |
| 801 | 801 | { |
| 802 | - $method = '_set' . ucfirst($var); |
|
| 802 | + $method = '_set'.ucfirst($var); |
|
| 803 | 803 | if ( |
| 804 | 804 | !property_exists($this, $var) |
| 805 | 805 | || !method_exists($this, $method) |
| 806 | 806 | ) { |
| 807 | - $this->logger->warning('There is no setter function for property "' . $var . '"'); |
|
| 807 | + $this->logger->warning('There is no setter function for property "'.$var.'"'); |
|
| 808 | 808 | } else { |
| 809 | 809 | $this->$method($value); |
| 810 | 810 | } |
@@ -222,7 +222,7 @@ discard block |
||
| 222 | 222 | if ($resArray['uid'] == $record['uid']) { |
| 223 | 223 | $record['thumbnail'] = $resArray['thumbnail']; |
| 224 | 224 | $record['metadata'] = $metadata; |
| 225 | - } elseif (($key = array_search(['u' => $resArray['uid']], $record['subparts'], true)) !== false) { |
|
| 225 | + } elseif (($key = array_search(['u' => $resArray['uid']], $record['subparts'], TRUE)) !== FALSE) { |
|
| 226 | 226 | $record['subparts'][$key] = [ |
| 227 | 227 | 'uid' => $resArray['uid'], |
| 228 | 228 | 'page' => 1, |
@@ -250,7 +250,7 @@ discard block |
||
| 250 | 250 | 'highlighting' => [ |
| 251 | 251 | 'query' => Solr::escapeQuery($this->metadata['searchString']), |
| 252 | 252 | 'field' => $fields['fulltext'], |
| 253 | - 'usefastvectorhighlighter' => true |
|
| 253 | + 'usefastvectorhighlighter' => TRUE |
|
| 254 | 254 | ] |
| 255 | 255 | ]; |
| 256 | 256 | } |
@@ -294,7 +294,7 @@ discard block |
||
| 294 | 294 | $record['thumbnail'] = $resArray->thumbnail; |
| 295 | 295 | $record['metadata'] = $metadata; |
| 296 | 296 | } else { |
| 297 | - $highlightedDoc = !empty($highlighting) ? $highlighting->getResult($resArray->id) : null; |
|
| 297 | + $highlightedDoc = !empty($highlighting) ? $highlighting->getResult($resArray->id) : NULL; |
|
| 298 | 298 | $highlight = !empty($highlightedDoc) ? $highlightedDoc->getField($fields['fulltext'])[0] : ''; |
| 299 | 299 | $record['subparts'][$resArray->id] = [ |
| 300 | 300 | 'uid' => $resArray->uid, |
@@ -600,10 +600,10 @@ discard block |
||
| 600 | 600 | // Add static fields. |
| 601 | 601 | $this->solrConfig['type'] = 'type'; |
| 602 | 602 | } else { |
| 603 | - return false; |
|
| 603 | + return FALSE; |
|
| 604 | 604 | } |
| 605 | 605 | } |
| 606 | - return true; |
|
| 606 | + return TRUE; |
|
| 607 | 607 | } |
| 608 | 608 | |
| 609 | 609 | /** |
@@ -616,7 +616,7 @@ discard block |
||
| 616 | 616 | * |
| 617 | 617 | * @return void |
| 618 | 618 | */ |
| 619 | - public function sort($by, $asc = true) |
|
| 619 | + public function sort($by, $asc = TRUE) |
|
| 620 | 620 | { |
| 621 | 621 | $newOrder = []; |
| 622 | 622 | $nonSortable = []; |
@@ -65,7 +65,7 @@ discard block |
||
| 65 | 65 | */ |
| 66 | 66 | protected function getClass(FlashMessage $flashMessage): string |
| 67 | 67 | { |
| 68 | - return 'alert-' . self::$classes[$flashMessage->getSeverity()]; |
|
| 68 | + return 'alert-'.self::$classes[$flashMessage->getSeverity()]; |
|
| 69 | 69 | } |
| 70 | 70 | |
| 71 | 71 | /** |
@@ -95,19 +95,19 @@ discard block |
||
| 95 | 95 | $markup[] = '<div class="typo3-messages">'; |
| 96 | 96 | foreach ($flashMessages as $flashMessage) { |
| 97 | 97 | $messageTitle = $flashMessage->getTitle(); |
| 98 | - $markup[] = '<div class="alert ' . htmlspecialchars($this->getClass($flashMessage)) . '">'; |
|
| 98 | + $markup[] = '<div class="alert '.htmlspecialchars($this->getClass($flashMessage)).'">'; |
|
| 99 | 99 | $markup[] = ' <div class="media">'; |
| 100 | 100 | $markup[] = ' <div class="media-left">'; |
| 101 | 101 | $markup[] = ' <span class="fa-stack fa-lg">'; |
| 102 | 102 | $markup[] = ' <i class="fa fa-circle fa-stack-2x"></i>'; |
| 103 | - $markup[] = ' <i class="fa fa-' . htmlspecialchars($this->getIconName($flashMessage)) . ' fa-stack-1x"></i>'; |
|
| 103 | + $markup[] = ' <i class="fa fa-'.htmlspecialchars($this->getIconName($flashMessage)).' fa-stack-1x"></i>'; |
|
| 104 | 104 | $markup[] = ' </span>'; |
| 105 | 105 | $markup[] = ' </div>'; |
| 106 | 106 | $markup[] = ' <div class="media-body">'; |
| 107 | 107 | if ($messageTitle !== '') { |
| 108 | - $markup[] = ' <h4 class="alert-title">' . htmlspecialchars($messageTitle) . '</h4>'; |
|
| 108 | + $markup[] = ' <h4 class="alert-title">'.htmlspecialchars($messageTitle).'</h4>'; |
|
| 109 | 109 | } |
| 110 | - $markup[] = ' <p class="alert-message">' . $flashMessage->getMessage() . '</p>'; |
|
| 110 | + $markup[] = ' <p class="alert-message">'.$flashMessage->getMessage().'</p>'; |
|
| 111 | 111 | $markup[] = ' </div>'; |
| 112 | 112 | $markup[] = ' </div>'; |
| 113 | 113 | $markup[] = '</div>'; |
@@ -21,8 +21,7 @@ |
||
| 21 | 21 | * The created output contains all classes which are required for |
| 22 | 22 | * the TYPO3 backend. Any kind of message contains also a nice icon. |
| 23 | 23 | */ |
| 24 | -class KitodoFlashMessageRenderer implements \TYPO3\CMS\Core\Messaging\Renderer\FlashMessageRendererInterface |
|
| 25 | -{ |
|
| 24 | +class KitodoFlashMessageRenderer implements \TYPO3\CMS\Core\Messaging\Renderer\FlashMessageRendererInterface { |
|
| 26 | 25 | /** |
| 27 | 26 | * @var string The message severity class names |
| 28 | 27 | */ |
@@ -23,8 +23,7 @@ |
||
| 23 | 23 | * @subpackage dlf |
| 24 | 24 | * @access public |
| 25 | 25 | */ |
| 26 | -class ext_update |
|
| 27 | -{ |
|
| 26 | +class ext_update { |
|
| 28 | 27 | /** |
| 29 | 28 | * This holds the output ready to return |
| 30 | 29 | * |
@@ -43,21 +43,21 @@ discard block |
||
| 43 | 43 | public function access(): bool |
| 44 | 44 | { |
| 45 | 45 | if (count($this->getMetadataConfig())) { |
| 46 | - return true; |
|
| 46 | + return TRUE; |
|
| 47 | 47 | } |
| 48 | 48 | if ($this->oldIndexRelatedTableNames()) { |
| 49 | - return true; |
|
| 49 | + return TRUE; |
|
| 50 | 50 | } |
| 51 | 51 | if ($this->solariumSolrUpdateRequired()) { |
| 52 | - return true; |
|
| 52 | + return TRUE; |
|
| 53 | 53 | } |
| 54 | 54 | if (count($this->oldFormatClasses())) { |
| 55 | - return true; |
|
| 55 | + return TRUE; |
|
| 56 | 56 | } |
| 57 | 57 | if ($this->hasNoFormatForDocument()) { |
| 58 | - return true; |
|
| 58 | + return TRUE; |
|
| 59 | 59 | } |
| 60 | - return false; |
|
| 60 | + return FALSE; |
|
| 61 | 61 | } |
| 62 | 62 | |
| 63 | 63 | /** |
@@ -142,10 +142,10 @@ discard block |
||
| 142 | 142 | // Instantiate search object. |
| 143 | 143 | $solr = Solr::getInstance($resArray['index_name']); |
| 144 | 144 | if (!$solr->ready) { |
| 145 | - return true; |
|
| 145 | + return TRUE; |
|
| 146 | 146 | } |
| 147 | 147 | } |
| 148 | - return false; |
|
| 148 | + return FALSE; |
|
| 149 | 149 | } |
| 150 | 150 | |
| 151 | 151 | /** |
@@ -201,10 +201,10 @@ discard block |
||
| 201 | 201 | || $resArray['column_name'] === 'boost' |
| 202 | 202 | || $resArray['column_name'] === 'autocomplete' |
| 203 | 203 | ) { |
| 204 | - return true; |
|
| 204 | + return TRUE; |
|
| 205 | 205 | } |
| 206 | 206 | } |
| 207 | - return false; |
|
| 207 | + return FALSE; |
|
| 208 | 208 | } |
| 209 | 209 | |
| 210 | 210 | /** |
@@ -214,7 +214,7 @@ discard block |
||
| 214 | 214 | * @param bool $checkStructureOnly |
| 215 | 215 | * @return bool |
| 216 | 216 | */ |
| 217 | - protected function hasNoFormatForDocument($checkStructureOnly = false): bool |
|
| 217 | + protected function hasNoFormatForDocument($checkStructureOnly = FALSE): bool |
|
| 218 | 218 | { |
| 219 | 219 | // Check if column "document_format" exists. |
| 220 | 220 | $database = $GLOBALS['TYPO3_CONF_VARS']['DB']['Connections']['Default']['dbname']; |
@@ -229,7 +229,7 @@ discard block |
||
| 229 | 229 | while ($resArray = $result->fetch()) { |
| 230 | 230 | if ($resArray['COLUMN_NAME'] === 'document_format') { |
| 231 | 231 | if ($checkStructureOnly) { |
| 232 | - return false; |
|
| 232 | + return FALSE; |
|
| 233 | 233 | } |
| 234 | 234 | // Check if column has empty fields. |
| 235 | 235 | $queryBuilder = GeneralUtility::makeInstance(ConnectionPool::class)->getQueryBuilderForTable('INFORMATION_SCHEMA.COLUMNS'); |
@@ -241,11 +241,11 @@ discard block |
||
| 241 | 241 | ->fetchColumn(0); |
| 242 | 242 | |
| 243 | 243 | if ($count === 0) { |
| 244 | - return false; |
|
| 244 | + return FALSE; |
|
| 245 | 245 | } |
| 246 | 246 | } |
| 247 | 247 | } |
| 248 | - return true; |
|
| 248 | + return TRUE; |
|
| 249 | 249 | } |
| 250 | 250 | |
| 251 | 251 | /** |
@@ -395,7 +395,7 @@ discard block |
||
| 395 | 395 | */ |
| 396 | 396 | protected function doSolariumSolrUpdate(): void |
| 397 | 397 | { |
| 398 | - $error = false; |
|
| 398 | + $error = FALSE; |
|
| 399 | 399 | // Get all Solr cores that were not deleted. |
| 400 | 400 | $queryBuilder = GeneralUtility::makeInstance(ConnectionPool::class)->getQueryBuilderForTable('tx_dlf_solrcores'); |
| 401 | 401 | $result = $queryBuilder |
@@ -412,7 +412,7 @@ discard block |
||
| 412 | 412 | \TYPO3\CMS\Core\Messaging\FlashMessage::ERROR |
| 413 | 413 | ); |
| 414 | 414 | $this->content .= Helper::renderFlashMessages(); |
| 415 | - $error = true; |
|
| 415 | + $error = TRUE; |
|
| 416 | 416 | } |
| 417 | 417 | } |
| 418 | 418 | if (!$error) { |
@@ -439,7 +439,7 @@ discard block |
||
| 439 | 439 | ->update('tx_dlf_documents') |
| 440 | 440 | ->where( |
| 441 | 441 | $queryBuilder->expr()->orX( |
| 442 | - $queryBuilder->expr()->eq('document_format', $queryBuilder->createNamedParameter(null)), |
|
| 442 | + $queryBuilder->expr()->eq('document_format', $queryBuilder->createNamedParameter(NULL)), |
|
| 443 | 443 | $queryBuilder->expr()->eq('document_format', $queryBuilder->createNamedParameter('')) |
| 444 | 444 | ) |
| 445 | 445 | ) |
@@ -224,7 +224,7 @@ |
||
| 224 | 224 | $result = $queryBuilder |
| 225 | 225 | ->select('COLUMN_NAME') |
| 226 | 226 | ->from('INFORMATION_SCHEMA.COLUMNS') |
| 227 | - ->where('TABLE_NAME="tx_dlf_documents" AND TABLE_SCHEMA="' . $database . '" AND COLUMN_NAME="document_format"') |
|
| 227 | + ->where('TABLE_NAME="tx_dlf_documents" AND TABLE_SCHEMA="'.$database.'" AND COLUMN_NAME="document_format"') |
|
| 228 | 228 | ->execute(); |
| 229 | 229 | while ($resArray = $result->fetch()) { |
| 230 | 230 | if ($resArray['COLUMN_NAME'] === 'document_format') { |
@@ -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.', |
@@ -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 . '[' . preg_replace('/[^A-Za-z0-9_-]/', '', $piVar) . ']" value="' . htmlspecialchars($value) . '" />'; |
|
| 76 | + $output .= '<input type="hidden" name="'.$this->prefixId.'['.preg_replace('/[^A-Za-z0-9_-]/', '', $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 Navigation extends \Kitodo\Dlf\Common\AbstractPlugin |
|
| 29 | -{ |
|
| 28 | +class Navigation extends \Kitodo\Dlf\Common\AbstractPlugin { |
|
| 30 | 29 | public $scriptRelPath = 'Classes/Plugin/Navigation.php'; |
| 31 | 30 | |
| 32 | 31 | /** |
@@ -36,8 +35,7 @@ discard block |
||
| 36 | 35 | * |
| 37 | 36 | * @return string Link to the list view ready to output |
| 38 | 37 | */ |
| 39 | - protected function getLinkToListview() |
|
| 40 | - { |
|
| 38 | + protected function getLinkToListview() { |
|
| 41 | 39 | if (!empty($this->conf['targetPid'])) { |
| 42 | 40 | // Load the list. |
| 43 | 41 | $list = GeneralUtility::makeInstance(DocumentList::class); |
@@ -63,8 +61,7 @@ discard block |
||
| 63 | 61 | * |
| 64 | 62 | * @return string Page selector ready to output |
| 65 | 63 | */ |
| 66 | - protected function getPageSelector() |
|
| 67 | - { |
|
| 64 | + protected function getPageSelector() { |
|
| 68 | 65 | // Configure @action URL for form. |
| 69 | 66 | $linkConf = [ |
| 70 | 67 | 'parameter' => $GLOBALS['TSFE']->id, |
@@ -98,8 +95,7 @@ discard block |
||
| 98 | 95 | * |
| 99 | 96 | * @return string The content that is displayed on the website |
| 100 | 97 | */ |
| 101 | - public function main($content, $conf) |
|
| 102 | - { |
|
| 98 | + public function main($content, $conf) { |
|
| 103 | 99 | $this->init($conf); |
| 104 | 100 | // Turn cache on. |
| 105 | 101 | $this->setCache(true); |
@@ -214,8 +210,7 @@ discard block |
||
| 214 | 210 | * |
| 215 | 211 | * @return string Typolink ready to output |
| 216 | 212 | */ |
| 217 | - protected function makeLink($label, array $overrulePIvars = [], $aTagParams = '') |
|
| 218 | - { |
|
| 213 | + protected function makeLink($label, array $overrulePIvars = [], $aTagParams = '') { |
|
| 219 | 214 | // Merge plugin variables with new set of values. |
| 220 | 215 | if (is_array($this->piVars)) { |
| 221 | 216 | $piVars = $this->piVars; |
@@ -102,10 +102,10 @@ discard block |
||
| 102 | 102 | { |
| 103 | 103 | $this->init($conf); |
| 104 | 104 | // Turn cache on. |
| 105 | - $this->setCache(true); |
|
| 105 | + $this->setCache(TRUE); |
|
| 106 | 106 | // Load current document. |
| 107 | 107 | $this->loadDocument(); |
| 108 | - if ($this->doc === null) { |
|
| 108 | + if ($this->doc === NULL) { |
|
| 109 | 109 | // Quit without doing anything if required variables are not set. |
| 110 | 110 | return $content; |
| 111 | 111 | } else { |
@@ -229,7 +229,7 @@ discard block |
||
| 229 | 229 | 'forceAbsoluteUrl' => !empty($this->conf['forceAbsoluteUrl']) ? 1 : 0, |
| 230 | 230 | 'forceAbsoluteUrl.' => ['scheme' => !empty($this->conf['forceAbsoluteUrl']) && !empty($this->conf['forceAbsoluteUrlHttps']) ? 'https' : 'http'], |
| 231 | 231 | 'ATagParams' => $aTagParams, |
| 232 | - 'additionalParams' => GeneralUtility::implodeArrayForUrl($this->prefixId, $overrulePIvars, '', true, false), |
|
| 232 | + 'additionalParams' => GeneralUtility::implodeArrayForUrl($this->prefixId, $overrulePIvars, '', TRUE, FALSE), |
|
| 233 | 233 | 'title' => $label |
| 234 | 234 | ]; |
| 235 | 235 | return $this->cObj->typoLink($label, $conf); |
@@ -23,10 +23,8 @@ |
||
| 23 | 23 | * @subpackage dlf |
| 24 | 24 | * @access public |
| 25 | 25 | */ |
| 26 | -class DocumentTypeProvider extends AbstractProvider |
|
| 27 | -{ |
|
| 28 | - public function __construct() |
|
| 29 | - { |
|
| 26 | +class DocumentTypeProvider extends AbstractProvider { |
|
| 27 | + public function __construct() { |
|
| 30 | 28 | $this->expressionLanguageProviders = [ |
| 31 | 29 | DocumentTypeFunctionProvider::class |
| 32 | 30 | ]; |