|
|
@@ -24,6 +24,20 @@ use TYPO3Fluid\Fluid\Core\Rendering\RenderingContextInterface;
|
|
|
*/
|
|
|
class GetIdViewHelper extends OtAbstractViewHelper
|
|
|
{
|
|
|
+ /**
|
|
|
+ * -- This method is expected by Fluid --
|
|
|
+ * Declares the viewhelper's parameters
|
|
|
+ */
|
|
|
+ public function initializeArguments()
|
|
|
+ {
|
|
|
+ $this->registerArgument(
|
|
|
+ 'children',
|
|
|
+ 'integer',
|
|
|
+ 'If true, look for the events page of the children structures, instead of the current one',
|
|
|
+ false,
|
|
|
+ 0
|
|
|
+ );
|
|
|
+ }
|
|
|
|
|
|
/**
|
|
|
* -- This method is expected by Fluid --
|
|
|
@@ -48,8 +62,12 @@ class GetIdViewHelper extends OtAbstractViewHelper
|
|
|
|
|
|
$subpages = $pageRepository->getAllSubpagesForPage($rootId);
|
|
|
|
|
|
+ $templateName = $arguments['children'] == 1 ?
|
|
|
+ 'OpenTalent.OtTemplating->structuresEvents' :
|
|
|
+ 'OpenTalent.OtTemplating->events';
|
|
|
+
|
|
|
foreach ($subpages as $page) {
|
|
|
- if ($page['tx_fed_page_controller_action'] === 'OpenTalent.OtTemplating->events'
|
|
|
+ if ($page['tx_fed_page_controller_action'] === $templateName
|
|
|
& $page['deleted'] == 0
|
|
|
& $page['hidden'] == 0
|
|
|
) {
|