isFrontendRequest(); $request = $this->getCurrentRequest(); $typoScriptSettings = $this->extbaseConfigurationManager->getConfiguration( ExtbaseConfigurationManagerInterface::CONFIGURATION_TYPE_SETTINGS, 'form' ); return $this->extFormConfigurationManager->getYamlConfiguration( $typoScriptSettings, $isFrontend, $isFrontend ? $request : null ); } /** * Get persistence manager settings as a typed DTO */ public function getPersistenceManagerConfiguration(): PersistenceManagerConfiguration { $formSettings = $this->getFormSettings(); return PersistenceManagerConfiguration::fromArray($formSettings['persistenceManager'] ?? []); } /** * Get allowed extension paths from form configuration * * @return string[] Array of allowed extension paths (e.g., ["EXT:my_extension/Configuration/Forms/"]) */ public function getAllowedExtensionPaths(): array { return $this->getPersistenceManagerConfiguration()->allowedExtensionPaths; } /** * Get allowed pages for form storage. * * Forms are always stored on pid 0 (root level). * * @return array Array of allowed page IDs */ public function getAllowedPages(): array { return [ 0 => [ 'uid' => 0, 'title' => 'Root', ], ]; } /** * Check if saving to extension paths is allowed */ public function isAllowedToSaveToExtensionPaths(): bool { return $this->getPersistenceManagerConfiguration()->allowSaveToExtensionPaths; } /** * Check if deleting from extension paths is allowed */ public function isAllowedToDeleteFromExtensionPaths(): bool { return $this->getPersistenceManagerConfiguration()->allowDeleteFromExtensionPaths; } /** * Get sort configuration for form listing * * @return array{sortByKeys: string[], sortAscending: bool} */ public function getSortConfiguration(): array { $configuration = $this->getPersistenceManagerConfiguration(); return [ 'sortByKeys' => $configuration->sortByKeys, 'sortAscending' => $configuration->sortAscending, ]; } /** * Check if current request is a frontend request */ private function isFrontendRequest(): bool { $request = $this->getCurrentRequest(); if ($request !== null) { return ApplicationType::fromRequest($request)->isFrontend(); } return false; } /** * Get current request from globals */ private function getCurrentRequest(): ?ServerRequestInterface { return $GLOBALS['TYPO3_REQUEST'] ?? null; } }