big update

This commit is contained in:
2025-12-10 01:05:55 +01:00
parent db4e718d85
commit e59ceaad99
12 changed files with 667 additions and 344 deletions

View File

@@ -0,0 +1,27 @@
<?php
$layoutScripts = $layoutScripts ?? [];
if (!is_array($layoutScripts)) {
$layoutScripts = [$layoutScripts];
}
?>
<?php require __DIR__ . '/footer.php'; ?>
<?php foreach ($layoutScripts as $script): ?>
<?php if (is_string($script)): ?>
<?= $script . PHP_EOL ?>
<?php elseif (is_array($script) && isset($script['src'])): ?>
<?php
$attrs = [];
if (!empty($script['defer'])) {
$attrs[] = 'defer';
}
if (!empty($script['module'])) {
$attrs[] = 'type="module"';
} elseif (!empty($script['type'])) {
$attrs[] = 'type="' . htmlspecialchars($script['type'], ENT_QUOTES) . '"';
}
?>
<script src="<?= htmlspecialchars($script['src'], ENT_QUOTES) ?>" <?= implode(' ', $attrs) ?>></script>
<?php endif; ?>
<?php endforeach; ?>
</body>
</html>