refresh admin interface layouts

Redesign authentication and website manager views with responsive layouts, clearer navigation, and accessibility improvements. Refresh page, menu, file, system information, settings, overview, welcome, page settings, and block thumbnail screens. Add the shared Admin stylesheet and Plugi theme, update the build configuration, and regenerate the admin CSS.
This commit is contained in:
2026-11-25 12:02:54 +01:00
parent 151ac9df4c
commit 9d192c2141
22 changed files with 677 additions and 378 deletions
@@ -0,0 +1,82 @@
@import "tailwindcss";
@import "./plugi-theme.css";
@plugin "daisyui" {
themes: false;
}
@plugin "daisyui/theme" {
name: "plugi-light";
default: true;
prefersdark: false;
color-scheme: light;
--color-base-100: var(--plugi-light-base-100);
--color-base-200: var(--plugi-light-base-200);
--color-base-300: var(--plugi-light-base-300);
--color-base-content: var(--plugi-light-base-content);
--color-primary: var(--plugi-light-primary);
--color-primary-content: var(--plugi-light-primary-content);
--color-secondary: var(--plugi-light-secondary);
--color-secondary-content: var(--plugi-light-secondary-content);
--color-accent: var(--plugi-light-accent);
--color-accent-content: var(--plugi-light-accent-content);
--color-neutral: var(--plugi-light-neutral);
--color-neutral-content: var(--plugi-light-neutral-content);
--color-info: var(--plugi-light-info);
--color-info-content: var(--plugi-light-info-content);
--color-success: var(--plugi-light-success);
--color-success-content: var(--plugi-light-success-content);
--color-warning: var(--plugi-light-warning);
--color-warning-content: var(--plugi-light-warning-content);
--color-error: var(--plugi-light-error);
--color-error-content: var(--plugi-light-error-content);
--radius-selector: var(--plugi-light-radius-selector);
--radius-field: var(--plugi-light-radius-field);
--radius-box: var(--plugi-light-radius-box);
--size-selector: var(--plugi-light-size-selector);
--size-field: var(--plugi-light-size-field);
--border: var(--plugi-light-border);
--depth: var(--plugi-light-depth);
--noise: var(--plugi-light-noise);
}
@plugin "daisyui/theme" {
name: "plugi-dark";
default: false;
prefersdark: true;
color-scheme: dark;
--color-base-100: var(--plugi-dark-base-100);
--color-base-200: var(--plugi-dark-base-200);
--color-base-300: var(--plugi-dark-base-300);
--color-base-content: var(--plugi-dark-base-content);
--color-primary: var(--plugi-dark-primary);
--color-primary-content: var(--plugi-dark-primary-content);
--color-secondary: var(--plugi-dark-secondary);
--color-secondary-content: var(--plugi-dark-secondary-content);
--color-accent: var(--plugi-dark-accent);
--color-accent-content: var(--plugi-dark-accent-content);
--color-neutral: var(--plugi-dark-neutral);
--color-neutral-content: var(--plugi-dark-neutral-content);
--color-info: var(--plugi-dark-info);
--color-info-content: var(--plugi-dark-info-content);
--color-success: var(--plugi-dark-success);
--color-success-content: var(--plugi-dark-success-content);
--color-warning: var(--plugi-dark-warning);
--color-warning-content: var(--plugi-dark-warning-content);
--color-error: var(--plugi-dark-error);
--color-error-content: var(--plugi-dark-error-content);
--radius-selector: var(--plugi-dark-radius-selector);
--radius-field: var(--plugi-dark-radius-field);
--radius-box: var(--plugi-dark-radius-box);
--size-selector: var(--plugi-dark-size-selector);
--size-field: var(--plugi-dark-size-field);
--border: var(--plugi-dark-border);
--depth: var(--plugi-dark-depth);
--noise: var(--plugi-dark-noise);
}
@source "../../views";
@source "../../layouts";
@source "../../../../Auth/resources/views";
@source "../../../../../../../extensions/plugi-ext-form/admin/Views";
@source "../../../../../../../extensions/plugi-ext-form/admin/form.php";
@@ -0,0 +1,59 @@
:where(.plugi-admin-theme, .plugi-form-wrapper) {
--plugi-light-base-100: oklch(98% 0.008 250);
--plugi-light-base-200: oklch(95% 0.014 250);
--plugi-light-base-300: oklch(90% 0.022 250);
--plugi-light-base-content: oklch(24% 0.035 255);
--plugi-light-primary: oklch(48% 0.18 250);
--plugi-light-primary-content: oklch(99% 0.006 250);
--plugi-light-secondary: oklch(52% 0.13 190);
--plugi-light-secondary-content: oklch(99% 0.006 190);
--plugi-light-accent: oklch(76% 0.15 72);
--plugi-light-accent-content: oklch(25% 0.05 72);
--plugi-light-neutral: oklch(29% 0.035 255);
--plugi-light-neutral-content: oklch(97% 0.008 255);
--plugi-light-info: oklch(50% 0.16 240);
--plugi-light-info-content: oklch(99% 0.006 240);
--plugi-light-success: oklch(47% 0.15 155);
--plugi-light-success-content: oklch(99% 0.006 155);
--plugi-light-warning: oklch(78% 0.15 82);
--plugi-light-warning-content: oklch(25% 0.05 82);
--plugi-light-error: oklch(52% 0.19 27);
--plugi-light-error-content: oklch(99% 0.006 27);
--plugi-light-radius-selector: 0.75rem;
--plugi-light-radius-field: 0.75rem;
--plugi-light-radius-box: 1rem;
--plugi-light-size-selector: 0.25rem;
--plugi-light-size-field: 0.25rem;
--plugi-light-border: 1px;
--plugi-light-depth: 1;
--plugi-light-noise: 0;
--plugi-dark-base-100: oklch(22% 0.025 255);
--plugi-dark-base-200: oklch(18% 0.025 255);
--plugi-dark-base-300: oklch(30% 0.032 255);
--plugi-dark-base-content: oklch(94% 0.012 255);
--plugi-dark-primary: oklch(74% 0.14 245);
--plugi-dark-primary-content: oklch(21% 0.04 255);
--plugi-dark-secondary: oklch(75% 0.12 188);
--plugi-dark-secondary-content: oklch(19% 0.03 200);
--plugi-dark-accent: oklch(82% 0.13 75);
--plugi-dark-accent-content: oklch(22% 0.05 75);
--plugi-dark-neutral: oklch(31% 0.035 255);
--plugi-dark-neutral-content: oklch(95% 0.01 255);
--plugi-dark-info: oklch(75% 0.13 235);
--plugi-dark-info-content: oklch(20% 0.035 245);
--plugi-dark-success: oklch(74% 0.14 155);
--plugi-dark-success-content: oklch(19% 0.035 155);
--plugi-dark-warning: oklch(82% 0.14 82);
--plugi-dark-warning-content: oklch(22% 0.05 82);
--plugi-dark-error: oklch(73% 0.16 27);
--plugi-dark-error-content: oklch(20% 0.04 27);
--plugi-dark-radius-selector: 0.75rem;
--plugi-dark-radius-field: 0.75rem;
--plugi-dark-radius-box: 1rem;
--plugi-dark-size-selector: 0.25rem;
--plugi-dark-size-field: 0.25rem;
--plugi-dark-border: 1px;
--plugi-dark-depth: 1;
--plugi-dark-noise: 0;
}
@@ -9,82 +9,93 @@ if (isset($_GET['tab'])) {
}
?>
<!doctype html>
<html lang="<?= phpb_current_language() ?>">
<html lang="<?= phpb_current_language() ?>" class="plugi-admin-theme">
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
<title><?= phpb_trans('website-manager.title') ?></title>
<link rel="icon" href="/plugi-core/dist/images/logo-color.png">
<?php phpb_registered_assets('admin-header') ?>
<link href="<?= phpb_asset('WebsiteManager.css') ?>" rel="stylesheet">
<link href="<?= phpb_asset('Admin.css') ?>" rel="stylesheet">
<link href="<?= phpb_asset('icons/duotone/style.css') ?>" rel="stylesheet">
<link href="<?= phpb_asset('icons/regular/style.css') ?>" rel="stylesheet">
<link href="<?= phpb_asset('icons/bold/style.css') ?>" rel="stylesheet">
<?= Extensions::getHtmlBlocks('admin-head') ?>
</head>
<body class="min-h-screen bg-base-200 text-base-content">
<body class="min-h-screen bg-base-200 text-base-content antialiased">
<?= Extensions::getHtmlBlocks('admin-body-start') ?>
<div class="drawer min-h-screen lg:drawer-open">
<input id="my-drawer-2" type="checkbox" class="drawer-toggle" />
<div class="drawer min-h-screen bg-base-200 lg:drawer-open">
<input id="admin-navigation-drawer" type="checkbox" class="drawer-toggle" />
<div class="drawer-content flex min-h-screen min-w-0 flex-col">
<div class="navbar sticky top-0 z-30 border-b border-base-300 bg-base-100 px-2 lg:hidden">
<div class="navbar-start">
<label for="my-drawer-2" class="btn btn-square btn-ghost drawer-button" aria-label="Open navigation">
<i class="text-lg ph-bold ph-list"></i>
<header class="navbar sticky top-0 z-30 min-h-16 border-b border-base-300 bg-base-100/95 px-3 backdrop-blur sm:px-6">
<div class="navbar-start gap-3">
<label for="admin-navigation-drawer" class="btn btn-square btn-ghost drawer-button lg:hidden" aria-label="Open navigation" title="Open navigation">
<i class="text-xl ph-bold ph-list" aria-hidden="true"></i>
</label>
</div>
<div class="navbar-center">
<span class="text-base font-semibold text-primary sm:text-lg">
<i class="inline-block ph-bold ph-brackets-square rotate-90"></i> <?= phpb_trans('website-manager.title') ?>
</span>
<div class="leading-tight">
<p class="hidden text-xs font-semibold uppercase tracking-[0.18em] text-base-content/50 sm:block">Plugi workspace</p>
<p class="font-semibold text-base-content"><?= phpb_e($tabs[$activeSlug]['title']) ?></p>
</div>
</div>
<div class="navbar-end">
<a href="<?= phpb_url('auth', ['action' => 'logout']) ?>" class="btn btn-square btn-ghost" aria-label="<?= phpb_e(phpb_trans('website-manager.logout')) ?>">
<i class="text-lg ph ph-sign-out"></i>
<a href="<?= phpb_url('auth', ['action' => 'logout']) ?>" class="btn btn-ghost btn-sm lg:hidden">
<i class="ph ph-sign-out" aria-hidden="true"></i>
<span><?= phpb_trans('website-manager.logout') ?></span>
</a>
</div>
</div>
</header>
<?php
require __DIR__ . '/../views/' . $viewFile . '.php';
?>
<footer class="mt-auto px-4 py-8 text-center text-sm text-base-content/60">
<footer class="mt-auto px-4 py-6 text-center text-sm text-base-content/60 sm:px-6">
<p>Powered by <a class="link link-hover" href="https://github.com/deepDiverPaul/plugi" target="_blank" rel="noopener noreferrer">Plugi Page Builder</a></p>
</footer>
</div>
<div class="drawer-side z-40">
<label for="my-drawer-2" class="drawer-overlay"></label>
<ul class="menu min-h-full w-72 gap-1 bg-base-100 p-4 text-base-content">
<li class="menu-title px-3 py-4">
<span class="text-lg font-semibold text-primary">
<i class="inline-block ph-bold ph-brackets-square rotate-90"></i> <?= phpb_trans('website-manager.title') ?>
<div class="drawer-side z-40 lg:z-0">
<label for="admin-navigation-drawer" aria-label="Close navigation" class="drawer-overlay"></label>
<aside class="flex min-h-full w-72 flex-col border-r border-base-300 bg-base-100 p-4 shadow-xl lg:shadow-none">
<a href="<?= phpb_url('website_manager') ?>" class="flex items-center gap-3 rounded-box px-3 py-4 transition-colors hover:bg-base-200 focus-visible:outline-2 focus-visible:outline-offset-2 focus-visible:outline-primary">
<span class="grid size-11 shrink-0 place-items-center rounded-2xl bg-primary text-primary-content shadow-sm">
<i class="text-2xl ph-bold ph-brackets-square rotate-90" aria-hidden="true"></i>
</span>
</li>
<span class="min-w-0">
<span class="block text-lg font-bold leading-tight tracking-tight text-base-content">Plugi</span>
<span class="block text-xs font-medium text-base-content/60">Page Builder</span>
</span>
</a>
<div class="divider my-2"></div>
<nav class="flex-1" aria-label="Website administration">
<ul class="menu menu-md w-full gap-1 px-0">
<li class="menu-title px-3 text-xs uppercase tracking-[0.16em]"><span>Workspace</span></li>
<?php
foreach ($tabs as $slug => $tab) :
?>
<li>
<a class="<?= phpb_e($slug === $activeSlug ? 'menu-active' : '' ) ?>" href="?tab=<?= phpb_e($slug) ?>" <?= $slug === $activeSlug ? 'aria-current="page"' : '' ?>>
<a class="<?= phpb_e($slug === $activeSlug ? 'menu-active font-semibold' : '' ) ?>" href="?tab=<?= phpb_e($slug) ?>" <?= $slug === $activeSlug ? 'aria-current="page"' : '' ?>>
<?= $tab['icon'] ?: '<i class="ph ph-circles-four"></i>' ?> <?= phpb_e($tab['title']) ?>
</a>
</li>
<?php
endforeach;
?>
</ul>
</nav>
<?php
if (phpb_config('auth.use_login')):
?>
<li class="mt-auto hidden border-t border-base-300 pt-2 lg:flex">
<a href="<?= phpb_url('auth', ['action' => 'logout']) ?>">
<i class="ph ph-sign-out"></i> <?= phpb_trans('website-manager.logout') ?>
<div class="mt-auto border-t border-base-300 pt-4">
<a class="btn btn-ghost w-full justify-start" href="<?= phpb_url('auth', ['action' => 'logout']) ?>">
<i class="ph ph-sign-out" aria-hidden="true"></i>
<?= phpb_trans('website-manager.logout') ?>
</a>
</li>
</div>
<?php
endif;
?>
</ul>
</aside>
</div>
</div>
@@ -5,17 +5,23 @@ if (isset($page)) {
}
?>
<main class="mx-auto flex w-full max-w-7xl flex-1 flex-col gap-6 px-4 py-6 sm:px-6 lg:px-8">
<main class="mx-auto flex w-full max-w-7xl flex-1 flex-col gap-6 px-4 py-6 sm:px-6 lg:px-8 lg:py-8">
<header class="flex flex-col gap-4 sm:flex-row sm:items-center sm:justify-between">
<h1 class="text-2xl font-semibold text-base-content sm:text-3xl"><?= phpb_trans('website-manager.title') ?></h1>
<a href="<?= phpb_url('website_manager') ?>" class="btn btn-ghost btn-sm">
<div class="space-y-1">
<p class="text-xs font-semibold uppercase tracking-[0.18em] text-base-content/50">Page builder maintenance</p>
<h1 class="text-2xl font-bold tracking-tight text-base-content sm:text-3xl"><?= phpb_trans('website-manager.title') ?></h1>
</div>
<a href="<?= phpb_url('website_manager') ?>" class="btn btn-ghost btn-sm self-start sm:self-auto">
<i class="ph ph-arrow-left" aria-hidden="true"></i> <?= phpb_trans('website-manager.back') ?>
</a>
</header>
<section class="card min-w-0 border border-base-300 bg-base-100 shadow-sm">
<div class="card-body min-w-0 gap-4 p-4 sm:p-6">
<h2 class="text-lg font-semibold"><?= phpb_trans('website-manager.render-thumbs') ?></h2>
<div class="card-body min-w-0 gap-5 p-4 sm:p-6">
<div class="space-y-1">
<h2 class="card-title text-lg"><?= phpb_trans('website-manager.render-thumbs') ?></h2>
<p class="text-sm text-base-content/60">This maintenance view renders the next missing block thumbnail.</p>
</div>
<iframe class="thumb-renderer min-h-[32rem] w-full rounded-box border border-base-300 bg-base-100" src="<?= phpb_url('pagebuilder', ['route' => 'thumb_generator', 'action' => 'renderNextBlockThumb']) ?>" title="<?= phpb_e(phpb_trans('website-manager.render-thumbs')) ?>"></iframe>
</div>
</section>
@@ -1,24 +1,28 @@
<main class="mx-auto flex w-full max-w-7xl flex-1 flex-col gap-6 px-4 py-6 sm:px-6 lg:px-8">
<header>
<h1 class="text-2xl font-semibold text-base-content sm:text-3xl">
<?= phpb_e($tabs[$activeSlug]['title']) ?>
</h1>
<main class="mx-auto flex w-full max-w-7xl flex-1 flex-col gap-6 px-4 py-6 sm:px-6 lg:px-8 lg:py-8">
<header class="flex items-center gap-4">
<span class="grid size-12 shrink-0 place-items-center rounded-2xl bg-primary/10 text-primary" aria-hidden="true">
<?= $tabs[$activeSlug]['icon'] ?: '<i class="ph ph-circles-four"></i>' ?>
</span>
<div class="space-y-1">
<p class="text-xs font-semibold uppercase tracking-[0.18em] text-base-content/50">Website management</p>
<h1 class="text-2xl font-bold tracking-tight text-base-content sm:text-3xl">
<?= phpb_e($tabs[$activeSlug]['title']) ?>
</h1>
</div>
</header>
<?php
if (phpb_flash('message')):
?>
<div class="hidden alert-success alert-error"></div>
<div class="alert alert-<?= phpb_flash('message-type') ?>" role="alert">
<?= phpb_flash('message-type') === 'success' ? '<i class="text-xl ph-duotone ph-info"></i>' : '' ?>
<?= phpb_flash('message-type') === 'error' ? '<i class="text-xl ph-duotone ph-warning-circle"></i>' : '' ?>
<div class="hidden alert alert-success alert-error"></div>
<div class="alert alert-<?= phpb_flash('message-type') ?> shadow-sm" role="<?= phpb_flash('message-type') === 'error' ? 'alert' : 'status' ?>">
<?= phpb_flash('message-type') === 'success' ? '<i class="text-xl ph-duotone ph-check-circle" aria-hidden="true"></i>' : '' ?>
<?= phpb_flash('message-type') === 'error' ? '<i class="text-xl ph-duotone ph-warning-circle" aria-hidden="true"></i>' : '' ?>
<span><?= phpb_flash('message') ?></span>
</div>
<?php
endif;
?>
<section class="card min-w-0 border border-base-300 bg-base-100 shadow-sm">
<div class="card-body min-w-0 gap-4 p-4 sm:p-6">
<section class="min-w-0">
<?php include $tabs[$activeSlug]['include']; ?>
</div>
</section>
</main>
@@ -5,6 +5,7 @@ if (isset($page)) {
}
$pageTranslations = $page ? $page->getTranslations() : [];
$activeLanguages = phpb_active_languages();
$fieldValue = static function (string $field, ?string $languageCode = null) use ($page, $pageTranslations): string {
if ($languageCode !== null) {
$postedValues = $_POST[$field] ?? null;
@@ -23,11 +24,14 @@ $javascriptValue = static function (string $value): string {
?>
<section class="card w-full border border-base-300 bg-base-100 p-4 shadow-sm sm:p-8">
<main class="mx-auto flex w-full max-w-5xl flex-1 flex-col justify-center px-4 py-6 sm:px-6 lg:py-8">
<section class="card w-full border border-base-300 bg-base-100 shadow-sm">
<div class="card-body gap-6 p-4 sm:p-8">
<form class="space-y-6" method="post" action="<?= phpb_url('website_manager', ['route' => 'page_settings', 'action' => $action]) ?><?= $pageUrlParam ?>">
<?php phpb_csrf_field(); ?>
<header class="border-b border-base-300 pb-4">
<h1 class="text-2xl font-semibold text-base-content sm:text-3xl">
<header class="space-y-2 border-b border-base-300 pb-5">
<p class="text-xs font-semibold uppercase tracking-[0.18em] text-primary">Page configuration</p>
<h1 class="text-2xl font-bold tracking-tight text-base-content sm:text-3xl">
<?php
if ($action === 'create'):
echo phpb_trans('website-manager.add-new-page');
@@ -36,6 +40,7 @@ $javascriptValue = static function (string $value): string {
endif;
?>
</h1>
<p class="max-w-2xl text-sm leading-relaxed text-base-content/60">Set the page type and layout, then configure its route and metadata for each enabled language.</p>
</header>
<?php if (! empty($errorMessage)): ?>
@@ -44,37 +49,37 @@ $javascriptValue = static function (string $value): string {
</div>
<?php endif; ?>
<div class="mx-auto w-full max-w-3xl space-y-5" x-data="{type: <?= $javascriptValue($fieldValue('type') !== '' ? $fieldValue('type') : 'static') ?>}">
<div class="form-control w-full">
<label class="label" for="name">
<span class="label-text"> <?= phpb_trans('website-manager.name') ?></span>
<span class="label-text-alt"><?= phpb_trans('website-manager.required') ?></span>
</label>
<input type="text" id="name" name="name" value="<?= phpb_e($fieldValue('name')) ?>" required class="input input-bordered w-full" />
<label class="label">
<span class="label-text-alt"><?= phpb_trans('website-manager.visible-in-page-overview') ?></span>
</label>
</div>
<div class="w-full space-y-6" x-data="{type: <?= $javascriptValue($fieldValue('type') !== '' ? $fieldValue('type') : 'static') ?>}">
<section class="grid gap-4 rounded-box border border-base-300 bg-base-200/50 p-4 sm:grid-cols-2 sm:p-5">
<div class="form-control w-full">
<label class="label" for="name">
<span class="label-text"> <?= phpb_trans('website-manager.name') ?></span>
<span class="label-text-alt"><?= phpb_trans('website-manager.required') ?></span>
</label>
<input type="text" id="name" name="name" value="<?= phpb_e($fieldValue('name')) ?>" required aria-describedby="page-name-help" class="input input-bordered w-full" />
<p id="page-name-help" class="label text-sm text-base-content/60"><?= phpb_trans('website-manager.visible-in-page-overview') ?></p>
</div>
<div class="form-control w-full">
<label class="label" for="type">
<span class="label-text"><?= phpb_trans('website-manager.page-type') ?></span>
<span class="label-text-alt"><?= phpb_trans('website-manager.required') ?></span> <!-- TODO add to lang -->
</label>
<select class="select select-bordered w-full" x-model="type" id="type" name="type" required>
<?php
$types = ['static', 'redirect'];
$value = $fieldValue('type');
foreach ($types as $type):
if ($type === $value):
echo '<option value="' . phpb_e($type) . '" selected>' . phpb_trans('website-manager.page-types.'.$type) . '</option>';
else:
echo '<option value="' . phpb_e($type) . '">' . phpb_trans('website-manager.page-types.'.$type) . '</option>';
endif;
endforeach;
?>
</select>
</div>
<div class="form-control w-full">
<label class="label" for="type">
<span class="label-text"><?= phpb_trans('website-manager.page-type') ?></span>
<span class="label-text-alt"><?= phpb_trans('website-manager.required') ?></span> <!-- TODO add to lang -->
</label>
<select class="select select-bordered w-full" x-model="type" id="type" name="type" required>
<?php
$types = ['static', 'redirect'];
$value = $fieldValue('type');
foreach ($types as $type):
if ($type === $value):
echo '<option value="' . phpb_e($type) . '" selected>' . phpb_trans('website-manager.page-types.'.$type) . '</option>';
else:
echo '<option value="' . phpb_e($type) . '">' . phpb_trans('website-manager.page-types.'.$type) . '</option>';
endif;
endforeach;
?>
</select>
</div>
</section>
<div class="form-control w-full" x-show="type !== 'redirect'">
<label class="label" for="layout">
@@ -95,13 +100,25 @@ $javascriptValue = static function (string $value): string {
</select>
</div>
<?php
$firstLang = true;
foreach (phpb_active_languages() as $languageCode => $languageTranslation):
<section class="space-y-4">
<div class="flex flex-col gap-1 sm:flex-row sm:items-end sm:justify-between">
<div>
<h2 class="text-lg font-semibold text-base-content">Localized page details</h2>
<p class="text-sm text-base-content/60">Titles, routes, and metadata can vary by language.</p>
</div>
<span class="badge badge-outline"><?= count($activeLanguages) ?> languages</span>
</div>
<?php
$firstLang = true;
foreach ($activeLanguages as $languageCode => $languageTranslation):
?>
<details class="collapse collapse-plus border border-base-300 bg-base-100" <?= phpb_e($firstLang ? 'open' : '') ?>>
<summary class="collapse-title text-lg font-semibold sm:text-xl"><?= phpb_trans('languages.' . $languageCode) ?></summary>
<div class="collapse-content space-y-4">
<details class="collapse collapse-arrow border border-base-300 bg-base-100" <?= phpb_e($firstLang ? 'open' : '') ?>>
<summary class="collapse-title flex min-h-14 items-center text-base font-semibold sm:text-lg">
<span><?= phpb_trans('languages.' . $languageCode) ?></span>
<span class="badge badge-ghost ml-3"><?= phpb_e($languageCode) ?></span>
</summary>
<div class="collapse-content space-y-5">
<div class="space-y-3" x-data="{route: <?= $javascriptValue($fieldValue('route', $languageCode)) ?>, empty: true, locale: <?= $javascriptValue($firstLang ? '' : '/' . $languageCode) ?>}" x-init="empty = route.length === 0">
<div class="form-control w-full">
<label class="label" for="<?= phpb_e($languageCode) ?>-page-title">
@@ -111,19 +128,21 @@ $javascriptValue = static function (string $value): string {
<input type="text" class="input input-bordered w-full" id="<?= phpb_e($languageCode) ?>-page-title" name="title[<?= phpb_e($languageCode) ?>]" value="<?= phpb_e($fieldValue('title', $languageCode)) ?>" @input="if(empty){route=`${locale}/${slugify($event.target.value)}`}" :required="type==='static'" />
</div>
<div class="form-control w-full" x-show="type === 'static'">
<div class="grid gap-4 md:grid-cols-2" x-show="type === 'static'">
<div class="form-control w-full">
<label class="label" for="<?= phpb_e($languageCode) ?>-page-meta-title">
<span class="label-text"><?= phpb_trans('website-manager.page-meta-title') ?></span>
</label>
<input type="text" class="input input-bordered w-full" id="<?= phpb_e($languageCode) ?>-page-meta-title" name="meta_title[<?= phpb_e($languageCode) ?>]" value="<?= phpb_e($fieldValue('meta_title', $languageCode)) ?>" />
</div>
<div class="form-control w-full" x-show="type === 'static'">
<div class="form-control w-full">
<label class="label" for="<?= phpb_e($languageCode) ?>-page-meta-description">
<span class="label-text"><?= phpb_trans('website-manager.page-meta-description') ?></span>
</label>
<input type="text" class="input input-bordered w-full" id="<?= phpb_e($languageCode) ?>-page-meta-description" name="meta_description[<?= phpb_e($languageCode) ?>]" value="<?= phpb_e($fieldValue('meta_description', $languageCode)) ?>" />
</div>
</div>
<div class="form-control w-full" x-show="type === 'redirect'">
<label class="label" for="<?= phpb_e($languageCode) ?>-page-target-redirect">
@@ -137,9 +156,9 @@ $javascriptValue = static function (string $value): string {
<span class="label-text"><?= phpb_trans('website-manager.route') ?></span>
<span class="label-text-alt"><?= phpb_trans('website-manager.required') ?></span>
</label>
<div class="join" x-data="{disabled: true}">
<input type="text" :class="{'join-item': type !== 'redirect'}" class="input input-bordered w-full" id="<?= phpb_e($languageCode) ?>-page-route" name="route[<?= phpb_e($languageCode) ?>]" x-model="route" :readonly="disabled && type !== 'redirect'" required />
<button class="btn join-item btn-outline text-2xl" @click.stop.prevent="disabled=!disabled" type="button" x-show="type !== 'redirect'" aria-label="<?= phpb_e(phpb_trans('website-manager.edit')) ?>" title="<?= phpb_e(phpb_trans('website-manager.edit')) ?>">
<div class="join w-full" x-data="{disabled: true}">
<input type="text" :class="{'join-item': type !== 'redirect'}" class="input input-bordered w-full" id="<?= phpb_e($languageCode) ?>-page-route" name="route[<?= phpb_e($languageCode) ?>]" x-model="route" :readonly="disabled && type !== 'redirect'" :aria-readonly="disabled && type !== 'redirect'" required />
<button class="btn join-item btn-outline" @click.stop.prevent="disabled=!disabled" type="button" x-show="type !== 'redirect'" aria-label="<?= phpb_e(phpb_trans('website-manager.edit')) ?>" title="<?= phpb_e(phpb_trans('website-manager.edit')) ?>">
<i class="ph ph-pencil" x-show="disabled" aria-hidden="true"></i>
<i class="ph ph-pencil-slash" x-show="!disabled" aria-hidden="true"></i>
</button>
@@ -153,12 +172,13 @@ $javascriptValue = static function (string $value): string {
$firstLang = false;
endforeach;
?>
</section>
<div class="flex flex-col-reverse justify-end gap-3 border-t border-base-300 pt-6 sm:flex-row">
<a href="<?= phpb_url('website_manager') ?>" class="btn btn-ghost btn-sm">
<a href="<?= phpb_url('website_manager') ?>" class="btn btn-ghost sm:btn-sm">
<?= phpb_trans('website-manager.back') ?>
</a>
<button type="submit" class="btn btn-primary btn-sm">
<button type="submit" class="btn btn-primary sm:btn-sm">
<?php
if ($action === 'create'):
echo phpb_trans('website-manager.add-new-page');
@@ -173,4 +193,6 @@ $javascriptValue = static function (string $value): string {
</form>
</div>
</section>
</main>
@@ -1,26 +1,40 @@
<section class="card border border-base-300 bg-base-100 shadow-sm">
<div class="card-body gap-6 p-4 sm:p-6">
<div class="flex flex-col gap-4 sm:flex-row sm:items-end sm:justify-between">
<label class="form-control w-full max-w-md gap-2">
<span class="label-text font-medium">Upload a file</span>
<div class="card-body gap-6 p-4 sm:p-6 lg:p-8">
<div class="flex flex-col gap-5 border-b border-base-300 pb-5 sm:flex-row sm:items-end sm:justify-between">
<div class="space-y-1">
<h2 class="text-xl font-bold tracking-tight text-base-content">Media library</h2>
<p class="text-sm text-base-content/60">Upload and manage the files used across your pages.</p>
</div>
<div class="form-control w-full max-w-md gap-1">
<label class="label" for="fileupload">
<span class="label-text font-medium">Upload a file</span>
<span class="label-text-alt">Choose a file</span>
</label>
<input type="file" id="fileupload" class="file-input file-input-bordered file-input-primary w-full" name="fileupload" onchange="uploadFile()" onselect="uploadFile()" />
</label>
</div>
</div>
<?php if (count($files) === 0) : ?>
<div class="alert alert-info" role="status">
<span>No files uploaded yet.</span>
<div class="rounded-box border border-dashed border-base-300 bg-base-200/50 px-5 py-12 text-center" role="status">
<span class="mx-auto mb-4 grid size-12 place-items-center rounded-2xl bg-info/10 text-info">
<i class="text-2xl ph-duotone ph-image" aria-hidden="true"></i>
</span>
<h3 class="font-semibold text-base-content">No files yet</h3>
<p class="mt-1 text-sm text-base-content/60">Your uploaded files will appear here as a visual library.</p>
</div>
<?php else : ?>
<ul class="grid grid-cols-1 gap-4 sm:grid-cols-2 lg:grid-cols-3 xl:grid-cols-4">
<?php foreach ($files as $file) : ?>
<li class="card overflow-hidden border border-base-300 bg-base-100 shadow-sm">
<li class="card overflow-hidden border border-base-300 bg-base-100 shadow-sm transition-shadow hover:shadow-md">
<figure class="relative aspect-video bg-base-200">
<img src="<?= phpb_e($file->getUrl()) ?>" alt="<?= phpb_e($file->public_id) ?>" class="h-full w-full object-cover">
<button type="button" onclick="deleteFile('<?= phpb_e($file->public_id) ?>')" class="btn btn-error btn-square btn-sm absolute right-3 top-3" aria-label="<?= phpb_e(phpb_trans('website-manager.remove')) ?> <?= phpb_e($file->public_id) ?>" title="<?= phpb_e(phpb_trans('website-manager.remove')) ?>">
<button type="button" onclick="deleteFile('<?= phpb_e($file->public_id) ?>')" class="btn btn-error btn-square btn-sm absolute right-3 top-3 shadow-sm" aria-label="<?= phpb_e(phpb_trans('website-manager.remove')) ?> <?= phpb_e($file->public_id) ?>" title="<?= phpb_e(phpb_trans('website-manager.remove')) ?>">
<i class="ph-duotone ph-trash" aria-hidden="true"></i>
</button>
</figure>
<div class="card-body gap-1 p-3">
<p class="truncate text-sm font-medium" title="<?= phpb_e($file->public_id) ?>"><?= phpb_e($file->public_id) ?></p>
</div>
</li>
<?php endforeach; ?>
</ul>
@@ -3,17 +3,20 @@
use Plugi\Setting;
?>
<section class="card border border-base-300 bg-base-100 shadow-sm">
<div class="card-body p-0">
<div class="overflow-x-auto">
<table class="table table-zebra min-w-[42rem]">
<section class="space-y-5">
<header class="space-y-1">
<h2 class="text-xl font-bold tracking-tight text-base-content">System information</h2>
<p class="text-sm text-base-content/60">Review runtime details, database health, and installed extensions.</p>
</header>
<div class="overflow-x-auto rounded-box border border-base-300 bg-base-100">
<table class="table table-zebra min-w-[42rem]">
<tbody>
<tr>
<th class="w-36 md:w-60">PHP Version</th>
<td><?= phpversion() ?></td>
<th scope="row" class="w-36 md:w-60">PHP Version</th>
<td><span class="badge badge-outline"><?= phpversion() ?></span></td>
</tr>
<tr>
<th>Database</th>
<th scope="row" class="align-top">Database</th>
<td>
<form method="post" action="<?= phpb_url('website_manager', ['route' => 'database', 'action' => 'update']) ?>">
<?php phpb_csrf_field(); ?>
@@ -26,16 +29,17 @@ use Plugi\Setting;
if(!is_array($tableDiff)) $actionNeeded = true;
if(is_array($tableDiff) && empty($tableDiff['columns']) && empty($tableDiff['uniqueKeys'])) continue;
?>
<div>
table <strong><?= phpb_e($table) ?></strong> (<?= phpb_e(is_array($tableDiff) ? (empty($tableDiff['columns']) && empty($tableDiff['uniqueKeys']) ? 'is fine' : 'has diff') : 'is not existent') ?>)
<div class="rounded-box border border-base-300 bg-base-200/50 px-3 py-2 text-sm">
Table <strong><?= phpb_e($table) ?></strong>
<span class="text-base-content/60">(<?= phpb_e(is_array($tableDiff) ? (empty($tableDiff['columns']) && empty($tableDiff['uniqueKeys']) ? 'is fine' : 'has diff') : 'is not existent') ?>)</span>
</div>
<?php
if (is_array($tableDiff)) :
foreach ($tableDiff['columns'] as $column => $def) :
$actionNeeded = true;
?>
<div class="ml-4">
<i class="ph ph-arrow-elbow-down-right"></i> column <strong><?= phpb_e($column) ?></strong> (not existent)
<div class="ml-4 flex items-center gap-2 text-sm text-base-content/70">
<i class="ph ph-arrow-elbow-down-right" aria-hidden="true"></i> Column <strong><?= phpb_e($column) ?></strong> (not existent)
</div>
<?php
endforeach;
@@ -46,8 +50,8 @@ use Plugi\Setting;
foreach ($tableDiff['uniqueKeys'] as $key => $def) :
$actionNeeded = true;
?>
<div class="ml-4">
<i class="ph ph-arrow-elbow-down-right"></i> unique key <strong><?= phpb_e($key) ?></strong> (not existent)
<div class="ml-4 flex items-center gap-2 text-sm text-base-content/70">
<i class="ph ph-arrow-elbow-down-right" aria-hidden="true"></i> Unique key <strong><?= phpb_e($key) ?></strong> (not existent)
</div>
<?php
endforeach;
@@ -57,11 +61,15 @@ use Plugi\Setting;
endforeach;
if ($actionNeeded) :
?>
<button class="btn btn-primary" type="submit">Update</button>
<button class="btn btn-primary" type="submit">
<i class="ph-bold ph-arrows-clockwise" aria-hidden="true"></i>
Update database
</button>
<?php
else :
?>
<div class="alert alert-success" role="status">
<div class="alert alert-success alert-soft" role="status">
<i class="ph-duotone ph-check-circle" aria-hidden="true"></i>
<span>Database is up-to-date. <span class="hidden md:inline text-base-content/60">(<?= $phpb_db->getDBDefinitionHash() ?>)</span></span>
</div>
<?php
@@ -72,45 +80,46 @@ use Plugi\Setting;
</td>
</tr>
<tr>
<th class="align-top">Installed extensions</th>
<th scope="row" class="align-top">Installed extensions</th>
<td x-data="{show: false}">
<ul class="list-disc space-y-1 pl-5">
<ul class="space-y-2">
<?php
foreach (\Plugi\Extensions::getConfigs() as $ext) :
?>
<li>
<?= phpb_e($ext['title']) ?> (<?= phpb_e($ext['version']) ?>)
<li class="flex flex-wrap items-center justify-between gap-2 rounded-box border border-base-300 px-3 py-2">
<span class="font-medium"><?= phpb_e($ext['title']) ?></span>
<span class="badge badge-ghost"><?= phpb_e($ext['version']) ?></span>
</li>
<?php
endforeach;
?>
</ul>
<div>
<button type="button" @click="show = !show" class="btn btn-xs btn-outline" :aria-expanded="show" x-text="show ? 'hide' : 'show config'"></button>
<div class="mt-3">
<button type="button" @click="show = !show" class="btn btn-ghost btn-xs" :aria-expanded="show" aria-controls="installed-extension-config" x-text="show ? 'Hide configuration' : 'Show configuration'"></button>
</div>
<pre class="mt-4 max-h-96 overflow-auto rounded-box bg-base-200 p-4 text-xs" x-show="show"><?php
<pre id="installed-extension-config" class="mt-3 max-h-96 overflow-auto rounded-box border border-base-300 bg-base-200 p-4 text-xs" x-show="show"><?php
print_r(\Plugi\Extensions::getConfigs());
?></pre>
</td>
</tr>
<tr>
<th class="align-top">Config</th>
<th scope="row" class="align-top">Config</th>
<td x-data="{show: false}">
<div>
<button type="button" @click="show = !show" class="btn btn-xs btn-outline" :aria-expanded="show" x-text="show ? 'hide' : 'show'"></button>
<button type="button" @click="show = !show" class="btn btn-ghost btn-xs" :aria-expanded="show" aria-controls="application-config" x-text="show ? 'Hide configuration' : 'Show configuration'"></button>
</div>
<pre class="mt-4 max-h-96 overflow-auto rounded-box bg-base-200 p-4 text-xs" x-show="show"><?php
<pre id="application-config" class="mt-3 max-h-96 overflow-auto rounded-box border border-base-300 bg-base-200 p-4 text-xs" x-show="show"><?php
print_r(phpb_config());
?></pre>
</td>
</tr>
<tr>
<th class="align-top">Environment</th>
<th scope="row" class="align-top">Environment</th>
<td x-data="{show: false}">
<div class="">
<button type="button" @click="show = !show" class="btn btn-xs btn-outline" :aria-expanded="show" x-text="show ? 'hide' : 'show'"></button>
<button type="button" @click="show = !show" class="btn btn-ghost btn-xs" :aria-expanded="show" aria-controls="environment-config" x-text="show ? 'Hide values' : 'Show values'"></button>
</div>
<pre class="mt-4 max-h-96 overflow-auto rounded-box bg-base-200 p-4 text-xs" x-show="show"><?php
<pre id="environment-config" class="mt-3 max-h-96 overflow-auto rounded-box border border-base-300 bg-base-200 p-4 text-xs" x-show="show"><?php
print_r([
'STAGE'=>$_ENV['STAGE'],
'BASE_URL'=>$_ENV['BASE_URL']
@@ -119,7 +128,6 @@ print_r([
</td>
</tr>
</tbody>
</table>
</div>
</table>
</div>
</section>
@@ -12,19 +12,33 @@ $pages = $pageRepository->getAll();
<div class="space-y-6" x-data="{menus: <?= phpb_e($menusJson) ?>, pages: <?= phpb_e($menuPagesJson) ?>}">
<div class="flex justify-end">
<header class="flex flex-col gap-4 sm:flex-row sm:items-end sm:justify-between">
<div class="space-y-1">
<h2 class="text-xl font-bold tracking-tight text-base-content">Navigation menus</h2>
<p class="text-sm text-base-content/60">Arrange pages and control the order visitors see in your menus.</p>
</div>
<button type="button" @click.stop.prevent="menus.push({name:'New Menu',pages:[]})" class="btn btn-primary">
<i class="ph-bold ph-plus" aria-hidden="true"></i>
<?= phpb_trans('website-manager.create-menu'); ?>
</button>
</div>
</header>
<div class="flex flex-col gap-6">
<template x-if="menus.length === 0">
<div class="rounded-box border border-dashed border-base-300 bg-base-100 px-5 py-10 text-center">
<span class="mx-auto mb-3 grid size-11 place-items-center rounded-2xl bg-info/10 text-info">
<i class="text-2xl ph-duotone ph-list-dashes" aria-hidden="true"></i>
</span>
<h3 class="font-semibold text-base-content">No menus created</h3>
<p class="mt-1 text-sm text-base-content/60">Create a menu, then add and arrange pages.</p>
</div>
</template>
<template x-for="(menu, menuIndex) in menus">
<section class="card border border-base-300 bg-base-100 shadow-sm">
<div class="card-body gap-4 p-4 sm:p-6">
<div class="flex flex-col gap-4 sm:flex-row sm:items-center sm:justify-between" x-data="{ edit: false }">
<div class="card-body gap-5 p-4 sm:p-6">
<div class="flex flex-col gap-4 border-b border-base-300 pb-4 sm:flex-row sm:items-center sm:justify-between" x-data="{ edit: false }">
<input type="text" x-model="menu.name" class="input input-bordered w-full max-w-md" x-show="edit" aria-label="<?= phpb_e(phpb_trans('website-manager.name')) ?>">
<h2 class="text-xl font-semibold text-base-content sm:text-2xl" x-text="menu.name" x-show="!edit"></h2>
<h3 class="text-lg font-bold text-base-content sm:text-xl" x-text="menu.name" x-show="!edit"></h3>
<div class="flex items-center gap-2">
<button type="button" class="btn btn-ghost btn-square btn-sm" @click="edit = !edit" aria-label="<?= phpb_e(phpb_trans('website-manager.edit')) ?>" title="<?= phpb_e(phpb_trans('website-manager.edit')) ?>">
<i class="text-xl ph ph-pencil-line" aria-hidden="true"></i>
@@ -32,11 +46,11 @@ $pages = $pageRepository->getAll();
<button type="button" class="btn btn-error btn-square btn-sm" @click="if (confirm(`<?= phpb_trans('website-manager.delete-menu') ?> ${menu.name}`) === true) arraymove(menus,menuIndex);" aria-label="<?= phpb_e(phpb_trans('website-manager.remove')) ?>" title="<?= phpb_e(phpb_trans('website-manager.remove')) ?>">
<i class="text-xl ph ph-trash" aria-hidden="true"></i>
</button>
<div class="dropdown dropdown-end" x-show="(menu.pages.length < pages.length)">
<button type="button" tabindex="0" class="btn btn-ghost btn-square btn-sm" aria-label="Add pages to menu" title="Add pages to menu">
<details class="dropdown dropdown-end" x-show="(menu.pages.length < pages.length)">
<summary class="btn btn-ghost btn-square btn-sm list-none" aria-label="Add pages to menu" title="Add pages to menu">
<i class="text-xl ph ph-list-plus" aria-hidden="true"></i>
</button>
<ul tabindex="0" class="dropdown-content menu z-10 w-52 rounded-box bg-base-100 p-2 shadow">
</summary>
<ul class="dropdown-content menu z-10 mt-2 w-64 rounded-box border border-base-300 bg-base-100 p-2 shadow-lg">
<template x-for="page in pages.filter(p=> !menu.pages.map(m=>m.id).includes(p.id))">
<li>
<a href="javascript:void(0)" @click="menu.pages.push(page)">
@@ -46,10 +60,14 @@ $pages = $pageRepository->getAll();
</li>
</template>
</ul>
</div>
</details>
</div>
</div>
<input type="hidden" :name="menu.name" :value="menu.pages.map(p=>p.id).join(',')">
<div class="alert alert-info alert-soft" x-show="menu.pages.length === 0" role="status">
<i class="ph-duotone ph-info" aria-hidden="true"></i>
<span>Add pages to this menu, then use the arrows to arrange their order.</span>
</div>
<div class="overflow-x-auto rounded-box border border-base-300" x-show="menu.pages.length > 0">
<table class="table table-zebra w-full min-w-[42rem]">
<thead>
@@ -89,8 +107,9 @@ $pages = $pageRepository->getAll();
</template>
</div>
<div class="flex justify-end">
<div class="flex justify-end border-t border-base-300 pt-5">
<button type="submit" class="btn btn-primary">
<i class="ph-bold ph-floppy-disk" aria-hidden="true"></i>
<?= phpb_trans('website-manager.save-menus'); ?>
</button>
</div>
@@ -1,5 +1,15 @@
<div class="space-y-6">
<div class="overflow-x-auto rounded-box border border-base-300">
<div class="space-y-5">
<header class="flex flex-col gap-4 sm:flex-row sm:items-end sm:justify-between">
<div class="space-y-1">
<h2 class="text-xl font-bold tracking-tight text-base-content">Your pages</h2>
<p class="text-sm text-base-content/60">Review routes and open the page editor or page settings.</p>
</div>
<a href="<?= phpb_url('website_manager', ['route' => 'page_settings', 'action' => 'create']) ?>" class="btn btn-primary">
<i class="ph-bold ph-plus" aria-hidden="true"></i>
<?= phpb_trans('website-manager.add-new-page') ?>
</a>
</header>
<div class="overflow-x-auto rounded-box border border-base-300 bg-base-100">
<table class="table table-zebra w-full min-w-[48rem]">
<thead>
<tr>
@@ -12,7 +22,13 @@
<tbody>
<?php if (empty($pages)): ?>
<tr>
<td colspan="4" class="py-10 text-center text-base-content/60">No pages yet. Add a page to get started.</td>
<td colspan="4" class="py-12 text-center">
<span class="mx-auto mb-3 grid size-11 place-items-center rounded-2xl bg-info/10 text-info">
<i class="text-2xl ph-duotone ph-files" aria-hidden="true"></i>
</span>
<span class="block font-semibold text-base-content">No pages yet</span>
<span class="mt-1 block text-sm text-base-content/60">Add a page to get your site started.</span>
</td>
</tr>
<?php endif; ?>
<?php foreach ($pages as $page): ?>
@@ -27,10 +43,10 @@
</td>
<td>
<div class="flex items-center gap-1">
<a href="<?= phpb_e(phpb_full_url($page->getRoute())) ?>" title="<?= phpb_trans('website-manager.view') ?>" aria-label="<?= phpb_e(phpb_trans('website-manager.view')) ?>" target="_blank" rel="noopener noreferrer" class="btn btn-ghost btn-square btn-sm <?= $page->get('type') === 'redirect' ? 'btn-disabled' : '' ?>">
<a href="<?= phpb_e(phpb_full_url($page->getRoute())) ?>" title="<?= phpb_trans('website-manager.view') ?>" aria-label="<?= phpb_e(phpb_trans('website-manager.view')) ?>" target="_blank" rel="noopener noreferrer" class="btn btn-ghost btn-square btn-sm <?= $page->get('type') === 'redirect' ? 'btn-disabled' : '' ?>" <?= $page->get('type') === 'redirect' ? 'tabindex="-1" aria-disabled="true"' : '' ?>>
<i class="text-xl ph-duotone ph-eye" aria-hidden="true"></i>
</a>
<a href="<?= phpb_url('pagebuilder', ['page' => $page->getId()]) ?>" class="btn btn-primary btn-square btn-sm <?= $page->get('type') === 'redirect' ? 'btn-disabled' : '' ?>" title="<?= phpb_trans('website-manager.edit') ?>" aria-label="<?= phpb_e(phpb_trans('website-manager.edit')) ?>">
<a href="<?= phpb_url('pagebuilder', ['page' => $page->getId()]) ?>" class="btn btn-primary btn-square btn-sm <?= $page->get('type') === 'redirect' ? 'btn-disabled' : '' ?>" title="<?= phpb_trans('website-manager.edit') ?>" aria-label="<?= phpb_e(phpb_trans('website-manager.edit')) ?>" <?= $page->get('type') === 'redirect' ? 'tabindex="-1" aria-disabled="true"' : '' ?>>
<i class="text-xl ph-duotone ph-pencil-line" aria-hidden="true"></i>
</a>
<a href="<?= phpb_url('website_manager', ['route' => 'page_settings', 'action' => 'edit', 'page' => $page->getId()]) ?>" title="<?= phpb_trans('website-manager.settings') ?>" aria-label="<?= phpb_e(phpb_trans('website-manager.settings')) ?>" class="btn btn-ghost btn-square btn-sm">
@@ -47,9 +63,4 @@
</table>
</div>
<div class="flex justify-end">
<a href="<?= phpb_url('website_manager', ['route' => 'page_settings', 'action' => 'create']) ?>" class="btn btn-primary">
<?= phpb_trans('website-manager.add-new-page') ?>
</a>
</div>
</div>
@@ -8,22 +8,27 @@ $settingIns = phpb_instance('setting');
<form method="post" action="<?= phpb_url('website_manager', ['route' => 'settings', 'action' => 'update', 'tab' => 'settings']) ?>">
<?php phpb_csrf_field(); ?>
<div class="space-y-6" x-data="{activeTab: 0, tabs: ['Website','Language','Theme','Extensions']}">
<div class="tabs mb-6 max-w-full gap-1 overflow-x-auto border-b border-base-300" role="tablist">
<header class="space-y-1">
<h2 class="text-xl font-bold tracking-tight text-base-content">Site settings</h2>
<p class="text-sm text-base-content/60">Configure language, appearance, and extension options for this site.</p>
</header>
<div class="tabs tabs-border mb-6 max-w-full gap-1 overflow-x-auto" role="tablist" aria-label="Site settings sections">
<template x-for="(tab, index) in tabs">
<button type="button" class="tab tab-lifted" role="tab" :id="'settings-tab-' + index" :aria-controls="'settings-panel-' + index" :aria-selected="activeTab === index" :tabindex="activeTab === index ? 0 : -1" x-text="tab" @click="activeTab = index" :class="activeTab === index ? 'tab-active' : ''"></button>
<button type="button" class="tab" role="tab" :id="'settings-tab-' + index" :aria-controls="'settings-panel-' + index" :aria-selected="activeTab === index" :tabindex="activeTab === index ? 0 : -1" x-text="tab" @click="activeTab = index" :class="activeTab === index ? 'tab-active' : ''"></button>
</template>
</div>
<div id="settings-panel-0" class="space-y-6" role="tabpanel" aria-labelledby="settings-tab-0" x-show="activeTab === 0">
<div id="settings-panel-0" class="rounded-box border border-base-300 bg-base-200/50 p-4 text-sm text-base-content/70 sm:p-5" role="tabpanel" aria-labelledby="settings-tab-0" tabindex="0" x-show="activeTab === 0">
Website-wide options are organized in the Language, Theme, and Extensions sections.
</div>
<div id="settings-panel-1" class="space-y-6" role="tabpanel" aria-labelledby="settings-tab-1" x-show="activeTab === 1">
<section class="space-y-4 rounded-box border border-base-300 p-4 sm:p-6">
<div id="settings-panel-1" class="space-y-6" role="tabpanel" aria-labelledby="settings-tab-1" tabindex="0" x-show="activeTab === 1">
<section class="space-y-4 rounded-box border border-base-300 bg-base-100 p-4 sm:p-6">
<h2 class="text-lg font-semibold"><?= phpb_trans('website-manager.website-languages') ?></h2>
<div class="grid gap-3 sm:grid-cols-2 lg:grid-cols-3">
<?php
foreach (phpb_trans('languages') as $locale => $localeText):
?>
<div class="form-control">
<label class="flex cursor-pointer items-center justify-between gap-4 rounded-box border border-base-300 px-4 py-3">
<label class="flex cursor-pointer items-center justify-between gap-4 rounded-box border border-base-300 bg-base-100 px-4 py-3 transition-colors hover:border-primary/40 hover:bg-base-200/50">
<span class="label-text"><?= phpb_e($localeText) ?></span>
<input type="checkbox" name="languages[]" value="<?= phpb_e($locale) ?>" <?= phpb_e($settingIns::has('languages', $locale)) ? 'checked' : '' ?> class="checkbox checkbox-sm" />
</label>
@@ -33,7 +38,7 @@ $settingIns = phpb_instance('setting');
?>
</div>
</section>
<section class="max-w-2xl rounded-box border border-base-300 p-4 sm:p-6">
<section class="max-w-2xl rounded-box border border-base-300 bg-base-100 p-4 sm:p-6">
<div class="form-control w-full">
<label for="admin_language" class="label">
<span class="label-text"><?= phpb_trans('website-manager.admin-language') ?> <strong><?= phpb_current_language() ?></strong></span>
@@ -51,8 +56,8 @@ $settingIns = phpb_instance('setting');
</div>
</section>
</div>
<div id="settings-panel-2" class="space-y-6" role="tabpanel" aria-labelledby="settings-tab-2" x-show="activeTab === 2">
<section class="max-w-2xl rounded-box border border-base-300 p-4 sm:p-6">
<div id="settings-panel-2" class="space-y-6" role="tabpanel" aria-labelledby="settings-tab-2" tabindex="0" x-show="activeTab === 2">
<section class="max-w-2xl rounded-box border border-base-300 bg-base-100 p-4 sm:p-6">
<div class="form-control w-full">
<label for="selected_theme" class="label">
<span class="label-text"><?= phpb_trans('website-manager.selected-theme') ?></span>
@@ -70,7 +75,7 @@ $settingIns = phpb_instance('setting');
</div>
</section>
</div>
<div id="settings-panel-3" class="space-y-6" role="tabpanel" aria-labelledby="settings-tab-3" x-show="activeTab === 3">
<div id="settings-panel-3" class="space-y-6" role="tabpanel" aria-labelledby="settings-tab-3" tabindex="0" x-show="activeTab === 3">
<div class="flex flex-col gap-4">
<?php
foreach (Extensions::getConfigs() as $extKey => $config):
@@ -78,7 +83,7 @@ $settingIns = phpb_instance('setting');
continue;
}
?>
<details class="collapse collapse-plus border border-base-300 bg-base-100">
<details class="collapse collapse-arrow border border-base-300 bg-base-100">
<summary class="collapse-title text-lg font-semibold"><?= phpb_e($config['title']) ?></summary>
<div class="collapse-content">
<div class="space-y-4">
@@ -121,6 +126,7 @@ $settingIns = phpb_instance('setting');
</div>
<div class="flex justify-end border-t border-base-300 pt-6">
<button type="submit" class="btn btn-primary">
<i class="ph-bold ph-floppy-disk" aria-hidden="true"></i>
<?= phpb_trans('website-manager.save-settings'); ?>
</button>
</div>
@@ -1,11 +1,16 @@
<main id="welcome-page" class="mx-auto flex min-h-full w-full max-w-4xl flex-1 items-center px-4 py-10 sm:px-6">
<section class="card w-full border border-base-300 bg-base-100 shadow-sm">
<div class="card-body items-center gap-6 p-8 text-center sm:p-12">
<main id="welcome-page" class="mx-auto flex min-h-full w-full max-w-5xl flex-1 items-center px-4 py-10 sm:px-6 lg:py-16">
<section class="card w-full overflow-hidden border border-base-300 bg-base-100 shadow-xl shadow-base-content/5">
<div class="h-2 bg-gradient-to-r from-primary via-secondary to-accent" aria-hidden="true"></div>
<div class="card-body items-center gap-7 p-8 text-center sm:p-12 lg:p-16">
<span class="grid size-20 place-items-center rounded-[1.75rem] bg-primary text-primary-content shadow-lg shadow-primary/20">
<i class="text-4xl ph-bold ph-brackets-square rotate-90" aria-hidden="true"></i>
</span>
<div class="space-y-2">
<h1 class="text-3xl font-semibold text-base-content">Welcome to Plugi Page Builder</h1>
<p class="text-base-content/70">Manage your pages, menus, and files from one place.</p>
<p class="text-xs font-semibold uppercase tracking-[0.2em] text-primary">Your site workspace</p>
<h1 class="text-3xl font-bold tracking-tight text-base-content sm:text-4xl">Welcome to Plugi Page Builder</h1>
<p class="mx-auto max-w-xl text-base leading-relaxed text-base-content/70">Manage your pages, menus, and files from one clear, focused workspace.</p>
</div>
<div class="flex flex-col gap-3 sm:flex-row">
<div class="card-actions flex-col gap-3 sm:flex-row">
<a class="btn btn-primary" href="<?= phpb_url('website_manager') ?>">Get started</a>
<a class="btn btn-outline" href="https://github.com/deepDiverPaul/plugi" target="_blank" rel="noopener noreferrer">
Visit GitHub