@@ -74,15 +74,15 @@ public function whenAuthenticated(MunicipioAuthenticatedUserInterface $user, Mun
7474 'email ' => $ ticket ['email ' ] ?? '' ,
7575 ],
7676 'saveUrl ' => $ navigation ->getModifiedHomeUrl (removeQueryArgs: ['action ' ]),
77- 'actions ' => $ this ->getActions ($ navigation ),
77+ 'actions ' => $ this ->getActions ($ navigation, true ),
7878 'logoutUrl ' => $ navigation ->getModifiedHomeUrl (addQueryArgs: ['action ' => 'logout ' ]),
7979 'ticket ' => [
8080 'validUntil ' => $ this ->formatDate ($ ticket ['validUntil ' ] ?? null ),
8181 ]
8282 ]);
8383 }
8484
85- private function getActions (MunicipioAuthNavigationInterface $ navigation ): array
85+ private function getActions (MunicipioAuthNavigationInterface $ navigation, bool $ hasValidKulturkort = false ): array
8686 {
8787 $ actions = [];
8888
@@ -94,6 +94,14 @@ private function getActions(MunicipioAuthNavigationInterface $navigation): array
9494 );
9595 }
9696
97+ if (!empty ($ this ->attributes ['renewLink ' ] ?? '' )) {
98+ $ actions [] = ActionCreator::create (
99+ $ hasValidKulturkort ? $ this ->wpService ->__ ('Renew ' , 'municipio ' ) : $ this ->wpService ->__ ('Buy ' , 'municipio ' ),
100+ $ this ->attributes ['renewLink ' ],
101+ 'shopping_cart '
102+ );
103+ }
104+
97105 $ actions [] = ActionCreator::create (
98106 $ this ->wpService ->__ ('Logout ' , 'municipio ' ),
99107 $ navigation ->getModifiedHomeUrl (addQueryArgs: ['action ' => 'logout ' ]),
0 commit comments