-
-
Notifications
You must be signed in to change notification settings - Fork 255
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[TASK] Refactor LastSearches and FrequentlySearched widgets
- Loading branch information
1 parent
3bb3dad
commit 2bfc641
Showing
8 changed files
with
119 additions
and
191 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,61 @@ | ||
<?php | ||
namespace ApacheSolrForTypo3\Solr\ViewHelpers; | ||
|
||
/* | ||
* This file is part of the TYPO3 CMS project. | ||
* | ||
* It is free software; you can redistribute it and/or modify it under | ||
* the terms of the GNU General Public License, either version 2 | ||
* of the License, or any later version. | ||
* | ||
* For the full copyright and license information, please read the | ||
* LICENSE.txt file that was distributed with this source code. | ||
* | ||
* The TYPO3 project - inspiring people to share! | ||
*/ | ||
|
||
use ApacheSolrForTypo3\Solr\Domain\Search\LastSearches\LastSearchesService; | ||
use ApacheSolrForTypo3\Solr\System\Configuration\ConfigurationManager; | ||
use TYPO3\CMS\Core\Utility\GeneralUtility; | ||
use TYPO3Fluid\Fluid\Core\Rendering\RenderingContextInterface; | ||
|
||
/** | ||
* Class LastSearchesViewHelper | ||
* | ||
* @author Rudy Gnodde <rudy.gnodde@beech.it> | ||
*/ | ||
class LastSearchesViewHelper extends AbstractSolrViewHelper | ||
{ | ||
|
||
/** | ||
* @var bool | ||
*/ | ||
protected $escapeChildren = false; | ||
|
||
/** | ||
* @var bool | ||
*/ | ||
protected $escapeOutput = false; | ||
|
||
/** | ||
* @param array $arguments | ||
* @param \Closure $renderChildrenClosure | ||
* @param RenderingContextInterface $renderingContext | ||
* @return mixed|void | ||
*/ | ||
public static function renderStatic(array $arguments, \Closure $renderChildrenClosure, RenderingContextInterface $renderingContext) | ||
{ | ||
/** @var ConfigurationManager $configurationManager */ | ||
$configurationManager = GeneralUtility::makeInstance(ConfigurationManager::class); | ||
$typoScriptConfiguration = $configurationManager->getTypoScriptConfiguration(); | ||
$lastSearchesService = GeneralUtility::makeInstance( | ||
LastSearchesService::class, | ||
$typoScriptConfiguration | ||
); | ||
$templateVariableContainer = $renderingContext->getVariableProvider(); | ||
$templateVariableContainer->add('lastSearches', $lastSearchesService->getLastSearches()); | ||
$output = $renderChildrenClosure(); | ||
$templateVariableContainer->remove('lastSearches'); | ||
return $output; | ||
} | ||
} |
41 changes: 0 additions & 41 deletions
41
Classes/ViewHelpers/Widget/Controller/LastSearchesController.php
This file was deleted.
Oops, something went wrong.
50 changes: 0 additions & 50 deletions
50
Classes/ViewHelpers/Widget/FrequentlySearchedViewHelper.php
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.