feat: basic themes for event sites
This commit is contained in:
@@ -6,8 +6,10 @@ use App\BusProNet\DataProvider\CountryDataProvider;
|
||||
use App\Form\Model\BookingDto;
|
||||
use App\Form\Service\CreateFieldStateProvider;
|
||||
use App\Form\Service\EditFieldStateProvider;
|
||||
use App\Service\BookingService;
|
||||
use App\Service\ParticipantEligibilityService;
|
||||
use Symfony\Component\Form\FormView;
|
||||
use Symfony\Component\HttpFoundation\RequestStack;
|
||||
use Twig\Environment;
|
||||
use Twig\Extension\RuntimeExtensionInterface;
|
||||
use Twig\Extra\Intl\IntlExtension;
|
||||
@@ -20,6 +22,7 @@ class AppRuntime implements RuntimeExtensionInterface
|
||||
private readonly ParticipantEligibilityService $participantEligibilityService,
|
||||
private readonly CreateFieldStateProvider $createFieldStateProvider,
|
||||
private readonly EditFieldStateProvider $editFieldStateProvider,
|
||||
private readonly RequestStack $requestStack,
|
||||
private readonly string $environment,
|
||||
) {
|
||||
}
|
||||
@@ -211,6 +214,21 @@ class AppRuntime implements RuntimeExtensionInterface
|
||||
return $labels;
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns the current booking theme from session.
|
||||
*
|
||||
* Defaults to 'base' if no theme is set.
|
||||
*/
|
||||
public function getBookingTheme(): string
|
||||
{
|
||||
$request = $this->requestStack->getCurrentRequest();
|
||||
if (null === $request) {
|
||||
return BookingService::DEFAULT_THEME;
|
||||
}
|
||||
|
||||
return $request->getSession()->get(BookingService::THEME_KEY, BookingService::DEFAULT_THEME);
|
||||
}
|
||||
|
||||
/**
|
||||
* Gets the appropriate field state provider based on booking mode.
|
||||
*
|
||||
|
||||
Reference in New Issue
Block a user