removed invitelayout resources

This commit is contained in:
Codex Agent
2025-12-12 11:48:31 +01:00
parent 7cf7c4b8df
commit bbf8d4a0f4
17 changed files with 941 additions and 1260 deletions

View File

@@ -244,22 +244,22 @@ class EventJoinTokenLayoutController extends Controller
private function buildAdvancedLayout(array $layout, $customization, string $qrPngDataUri, string $tokenUrl, string $eventName): ?array
{
if (! is_array($customization)) {
$customization = is_array($customization) ? $customization : [];
$hasLayoutElements = is_array($layout['elements'] ?? null) && ! empty($layout['elements']);
$isAdvancedRequested = ($customization['mode'] ?? null) === 'advanced';
if (! $isAdvancedRequested && ! $hasLayoutElements) {
return null;
}
if (($customization['mode'] ?? null) !== 'advanced') {
return null;
}
$elements = $customization['elements'] ?? null;
$elements = $customization['elements'] ?? ($layout['elements'] ?? null);
if (! is_array($elements) || empty($elements)) {
return null;
}
$width = (int) ($layout['svg']['width'] ?? 1080);
$height = (int) ($layout['svg']['height'] ?? 1520);
$width = (int) ($layout['canvas_width'] ?? $layout['svg']['width'] ?? 1080);
$height = (int) ($layout['canvas_height'] ?? $layout['svg']['height'] ?? 1520);
$accent = $layout['accent'] ?? '#6366F1';
$text = $layout['text'] ?? '#0F172A';
$secondary = $layout['secondary'] ?? '#1F2937';
@@ -273,11 +273,11 @@ class EventJoinTokenLayoutController extends Controller
$resolved = [];
foreach ($elements as $element) {
if (! is_array($element) || empty($element['id']) || empty($element['type'])) {
if (! is_array($element) || empty($element['id']) || (! isset($element['type']) && ! isset($element['role']))) {
continue;
}
$type = (string) $element['type'];
$type = (string) ($element['role'] ?? $element['type']);
$dimensions = $this->normalizeElementDimensions($type, $element, $width, $height);
$content = $this->resolveElementContent($type, $customization, $layout, $eventName, $tokenUrl, $element['content'] ?? null);