Skip to content
Snippets Groups Projects
Commit ade20f16 authored by Kevin Ditscheid's avatar Kevin Ditscheid
Browse files

[BUGFIX] Adapt PageBrowserViewHelper to FluidStandalone AbstractViewHelper

parent c505c7f7
No related branches found
No related tags found
2 merge requests!13Feature remove sg news ajax plugin,!8Feature upgrade to9 lts
Pipeline #29 failed
......@@ -26,7 +26,8 @@ namespace SGalinski\SgNews\ViewHelpers;
* This copyright notice MUST APPEAR in all copies of the script!
***************************************************************/
use TYPO3\CMS\Fluid\Core\ViewHelper\AbstractViewHelper;
use TYPO3\CMS\Extbase\Object\ObjectManager;
use TYPO3Fluid\Fluid\Core\ViewHelper\AbstractViewHelper;
use TYPO3\CMS\Frontend\ContentObject\ContentObjectRenderer;
/**
......@@ -46,14 +47,36 @@ class PageBrowserViewHelper extends AbstractViewHelper {
*/
protected $escapeOutput = FALSE;
/**
* @var ObjectManager
*/
protected $objectManager;
/**
* Inject the ObjectManager
*
* @param ObjectManager $objectManager
*/
public function injectObjectManager(ObjectManager $objectManager) {
$this->objectManager = $objectManager;
}
/**
* Initialize the ViewHelpers arguments
*/
public function initializeArguments() {
parent::initializeArguments();
$this->registerArgument('numberOfPages', 'int', 'The number of pages to browse', TRUE);
}
/**
* Render method of the view helper.
*
* @param integer $numberOfPages
* @return string
* @throws \UnexpectedValueException
*/
public function render($numberOfPages): string {
public function render(): string {
$numberOfPages = $this->arguments['numberOfPages'];
$configuration = $GLOBALS['TSFE']->tmpl->setup['plugin.']['tx_sgnews.']['pagebrowser.'];
$configuration['settings.']['numberOfPages'] = (int) $numberOfPages;
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment