1
|
|
|
<?php |
2
|
|
|
namespace ApacheSolrForTypo3\Solr\ViewHelpers\Uri\Paginate; |
3
|
|
|
|
4
|
|
|
/* |
5
|
|
|
* This file is part of the TYPO3 CMS project. |
6
|
|
|
* |
7
|
|
|
* It is free software; you can redistribute it and/or modify it under |
8
|
|
|
* the terms of the GNU General Public License, either version 2 |
9
|
|
|
* of the License, or any later version. |
10
|
|
|
* |
11
|
|
|
* For the full copyright and license information, please read the |
12
|
|
|
* LICENSE.txt file that was distributed with this source code. |
13
|
|
|
* |
14
|
|
|
* The TYPO3 project - inspiring people to share! |
15
|
|
|
*/ |
16
|
|
|
|
17
|
|
|
use ApacheSolrForTypo3\Solr\Domain\Search\ResultSet\Grouping\GroupItem; |
18
|
|
|
use ApacheSolrForTypo3\Solr\ViewHelpers\Uri\AbstractUriViewHelper; |
19
|
|
|
use TYPO3Fluid\Fluid\Core\Rendering\RenderingContextInterface; |
20
|
|
|
|
21
|
|
|
/** |
22
|
|
|
* Class GroupItemPageViewHelper |
23
|
|
|
* |
24
|
|
|
* @author Frans Saris <[email protected]> |
25
|
|
|
* @author Timo Hund <[email protected]> |
26
|
|
|
* @package ApacheSolrForTypo3\Solr\ViewHelpers\Link |
27
|
|
|
*/ |
28
|
|
|
class GroupItemPageViewHelper extends AbstractUriViewHelper |
29
|
|
|
{ |
30
|
|
|
|
31
|
|
|
/** |
32
|
|
|
* Initializes the arguments |
33
|
|
|
*/ |
34
|
|
|
public function initializeArguments() |
35
|
|
|
{ |
36
|
|
|
parent::initializeArguments(); |
37
|
|
|
$this->registerArgument('page', 'int', 'The page', false, 0); |
38
|
|
|
$this->registerArgument('groupItem', GroupItem::class, 'The group item', true); |
39
|
|
|
|
40
|
|
|
} |
41
|
|
|
|
42
|
|
|
/** |
43
|
|
|
* @param array $arguments |
44
|
|
|
* @param \Closure $renderChildrenClosure |
45
|
|
|
* @param RenderingContextInterface $renderingContext |
46
|
|
|
* @return string |
47
|
|
|
*/ |
48
|
|
|
public static function renderStatic(array $arguments, \Closure $renderChildrenClosure, RenderingContextInterface $renderingContext) |
49
|
|
|
{ |
50
|
|
|
$page = $arguments['page']; |
51
|
|
|
$groupItem = $arguments['groupItem']; |
52
|
|
|
$previousRequest = static::getUsedSearchRequestFromRenderingContext($renderingContext); |
53
|
|
|
$uri = self::getSearchUriBuilder()->getResultGroupItemPageUri($previousRequest, $groupItem, (int)$page); |
54
|
|
|
return $uri; |
55
|
|
|
} |
56
|
|
|
} |
57
|
|
|
|