|
@@ -2,14 +2,10 @@
|
|
|
|
|
|
|
|
namespace Opentalent\OtTemplating\ViewHelpers\EventsPage;
|
|
namespace Opentalent\OtTemplating\ViewHelpers\EventsPage;
|
|
|
|
|
|
|
|
-use Closure;
|
|
|
|
|
use Opentalent\OtCore\Website\OtPageRepository;
|
|
use Opentalent\OtCore\Website\OtPageRepository;
|
|
|
use Opentalent\OtCore\ViewHelpers\OtAbstractViewHelper;
|
|
use Opentalent\OtCore\ViewHelpers\OtAbstractViewHelper;
|
|
|
use Opentalent\OtCore\Website\OtWebsiteRepository;
|
|
use Opentalent\OtCore\Website\OtWebsiteRepository;
|
|
|
-use TYPO3\CMS\Core\Utility\GeneralUtility;
|
|
|
|
|
-use TYPO3\CMS\Extbase\Object\ObjectManager;
|
|
|
|
|
-use TYPO3Fluid\Fluid\Core\Rendering\RenderingContextInterface;
|
|
|
|
|
-
|
|
|
|
|
|
|
+use Opentalent\OtTemplating\ViewHelpers\RootPage\GetIdViewHelper as RootPageGetIdViewHelper;
|
|
|
/**
|
|
/**
|
|
|
* Retrieves and returns the uid of the events' page of the current site
|
|
* Retrieves and returns the uid of the events' page of the current site
|
|
|
* The events page is the first page found with the template 'OpenTalent.OtTemplating->events'
|
|
* The events page is the first page found with the template 'OpenTalent.OtTemplating->events'
|
|
@@ -27,6 +23,7 @@ class GetIdViewHelper extends OtAbstractViewHelper
|
|
|
{
|
|
{
|
|
|
public function __construct(
|
|
public function __construct(
|
|
|
private readonly OtPageRepository $otPageRepository,
|
|
private readonly OtPageRepository $otPageRepository,
|
|
|
|
|
+ private readonly OtWebsiteRepository $otWebsiteRepository,
|
|
|
) {}
|
|
) {}
|
|
|
|
|
|
|
|
/**
|
|
/**
|
|
@@ -52,11 +49,7 @@ class GetIdViewHelper extends OtAbstractViewHelper
|
|
|
*/
|
|
*/
|
|
|
public function render(): ?int
|
|
public function render(): ?int
|
|
|
{
|
|
{
|
|
|
- $rootId = \Opentalent\OtTemplating\ViewHelpers\RootPage\GetIdViewHelper::renderStatic(
|
|
|
|
|
- $this->arguments,
|
|
|
|
|
- $this->renderChildrenClosure,
|
|
|
|
|
- $this->renderingContext
|
|
|
|
|
- );
|
|
|
|
|
|
|
+ $rootId = $this->otWebsiteRepository->getCurrentRootpageUidFromFEGlobals();
|
|
|
|
|
|
|
|
$subpages = $this->otPageRepository->getAllSubpagesForPage($rootId);
|
|
$subpages = $this->otPageRepository->getAllSubpagesForPage($rootId);
|
|
|
|
|
|