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:
@@ -19,17 +19,19 @@ if(isset($_GET['id']))
|
||||
$isEditing = isset($form['id']) && $form['id'] > 0;
|
||||
?>
|
||||
|
||||
<div class="mb-6">
|
||||
<header class="mb-6 flex flex-col gap-4 sm:flex-row sm:items-center sm:justify-between">
|
||||
<div class="flex items-center gap-3">
|
||||
<a href="?tab=ext--form" class="btn btn-ghost btn-sm btn-circle" aria-label="Back to forms" title="Back to forms">
|
||||
<i class="ph-duotone ph-arrow-left text-xl"></i>
|
||||
<a href="?tab=ext--form" class="btn btn-ghost btn-square btn-sm" aria-label="Back to forms" title="Back to forms">
|
||||
<i class="ph-duotone ph-arrow-left text-xl" aria-hidden="true"></i>
|
||||
</a>
|
||||
<div>
|
||||
<h2 class="text-xl font-bold"><?= $isEditing ? 'Edit form' : 'New form' ?></h2>
|
||||
<div class="space-y-1">
|
||||
<p class="text-xs font-semibold uppercase tracking-[0.18em] text-primary">Form builder</p>
|
||||
<h2 class="text-xl font-bold tracking-tight"><?= $isEditing ? 'Edit form' : 'New form' ?></h2>
|
||||
<p class="text-sm text-base-content/60"><?= $isEditing ? 'Change your form settings.' : 'Create a new form with fields and actions.' ?></p>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<span class="badge badge-outline self-start sm:self-center"><?= $isEditing ? 'Editing form' : 'New form' ?></span>
|
||||
</header>
|
||||
|
||||
<script>
|
||||
const fields = <?= $form["fields"] ?>;
|
||||
@@ -37,7 +39,7 @@ $isEditing = isset($form['id']) && $form['id'] > 0;
|
||||
const finisherDefinitions = <?= json_encode($finisherDefinitions, JSON_HEX_TAG | JSON_HEX_APOS | JSON_HEX_AMP | JSON_HEX_QUOT) ?>;
|
||||
</script>
|
||||
|
||||
<form action="/ext--form/save-form" method="post" x-data="{
|
||||
<form action="/ext--form/save-form" method="post" class="space-y-6" x-data="{
|
||||
fields: fields,
|
||||
finishers: finishers,
|
||||
defaultField: {name: 'form_field', label: 'Form field', type: 'text', required: false, options: []},
|
||||
@@ -104,42 +106,52 @@ $isEditing = isset($form['id']) && $form['id'] > 0;
|
||||
if(isset($form['id'])) echo '<input type="hidden" name="id" value="'.$form['id'].'">';
|
||||
?>
|
||||
|
||||
<div class="card mb-6 border border-base-300/60 bg-base-100 shadow-sm">
|
||||
<div class="card-body">
|
||||
<div class="flex items-center gap-2 mb-4">
|
||||
<i class="ph-duotone ph-text-aa text-2xl text-primary" aria-hidden="true"></i>
|
||||
<h3 class="card-title text-lg">Basics</h3>
|
||||
</div>
|
||||
<div class="form-control">
|
||||
<section class="card border border-base-300 bg-base-100 shadow-sm" aria-labelledby="form-basics-title">
|
||||
<div class="card-body gap-5 p-4 sm:p-6 lg:p-8">
|
||||
<header class="flex items-start gap-3 border-b border-base-300 pb-4">
|
||||
<span class="grid size-10 shrink-0 place-items-center rounded-xl bg-primary/10 text-primary">
|
||||
<i class="text-xl ph-duotone ph-text-aa" aria-hidden="true"></i>
|
||||
</span>
|
||||
<div>
|
||||
<h3 class="card-title text-lg" id="form-basics-title">Basics</h3>
|
||||
<p class="mt-1 text-sm text-base-content/60">Give the form a name that will be easy to identify later.</p>
|
||||
</div>
|
||||
</header>
|
||||
<div class="form-control w-full max-w-2xl gap-1">
|
||||
<label class="label" for="form-name">
|
||||
<span class="label-text font-medium">Form name</span>
|
||||
<span class="label-text-alt">Required</span>
|
||||
</label>
|
||||
<input id="form-name" type="text" name="name" value="<?= phpb_e($form['name']) ?>" placeholder="e.g. Contact form" class="input input-bordered w-full" required />
|
||||
<span class="label-text-alt text-base-content/60">A unique name for your form.</span>
|
||||
<input id="form-name" type="text" name="name" value="<?= phpb_e($form['name']) ?>" placeholder="e.g. Contact form" class="input input-bordered w-full" required aria-describedby="form-name-help" />
|
||||
<span class="label-text-alt mt-1 text-base-content/60" id="form-name-help">A unique name for your form.</span>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</section>
|
||||
|
||||
<div class="card mb-6 border border-base-300/60 bg-base-100 shadow-sm">
|
||||
<div class="card-body">
|
||||
<div class="flex items-center gap-2 mb-4">
|
||||
<i class="ph-duotone ph-list-dashes text-2xl text-primary" aria-hidden="true"></i>
|
||||
<h3 class="card-title text-lg">Form fields</h3>
|
||||
</div>
|
||||
<p class="text-sm text-base-content/60 mb-4">Define the fields users can fill out.</p>
|
||||
<section class="card border border-base-300 bg-base-100 shadow-sm" aria-labelledby="form-fields-title">
|
||||
<div class="card-body gap-5 p-4 sm:p-6 lg:p-8">
|
||||
<header class="flex items-start gap-3 border-b border-base-300 pb-4">
|
||||
<span class="grid size-10 shrink-0 place-items-center rounded-xl bg-secondary/10 text-secondary">
|
||||
<i class="text-xl ph-duotone ph-list-dashes" aria-hidden="true"></i>
|
||||
</span>
|
||||
<div>
|
||||
<h3 class="card-title text-lg" id="form-fields-title">Form fields</h3>
|
||||
<p class="mt-1 text-sm text-base-content/60">Define the fields people can fill out. Drag a field to change its order.</p>
|
||||
</div>
|
||||
</header>
|
||||
|
||||
<input type="hidden" name="fields" :value="JSON.stringify(fields)">
|
||||
|
||||
<div x-show="fields.length === 0" class="rounded-box border-2 border-dashed border-base-300 px-4 py-8 text-center">
|
||||
<i class="ph-duotone ph-plus-circle text-4xl text-base-content/30"></i>
|
||||
<p class="text-sm text-base-content/50 mt-2">No fields added yet</p>
|
||||
<button type="button" @click="addField()" class="btn btn-sm btn-primary mt-2">Add your first field</button>
|
||||
<div x-show="fields.length === 0" class="rounded-box border border-dashed border-base-300 bg-base-200/40 px-4 py-10 text-center">
|
||||
<i class="ph-duotone ph-plus-circle text-4xl text-base-content/30" aria-hidden="true"></i>
|
||||
<p class="mt-2 text-sm text-base-content/60">No fields added yet</p>
|
||||
<button type="button" @click="addField()" class="btn btn-primary btn-sm mt-3">Add your first field</button>
|
||||
</div>
|
||||
|
||||
<div x-show="fields.length > 0" class="space-y-3">
|
||||
<div x-show="fields.length > 0" class="space-y-4">
|
||||
<template x-for="(field, index) in fields">
|
||||
<div
|
||||
class="border rounded-lg p-3 bg-base-200/50 transition-colors"
|
||||
class="rounded-box border border-base-300 bg-base-200/40 p-4 shadow-sm transition-colors sm:p-5"
|
||||
:class="{
|
||||
'border-error': getValidationErrors(field, index).length > 0,
|
||||
'border-base-300': getValidationErrors(field, index).length === 0,
|
||||
@@ -151,10 +163,10 @@ $isEditing = isset($form['id']) && $form['id'] > 0;
|
||||
@drop.prevent="moveField(dragIndex, index)"
|
||||
@dragend="dragIndex = null"
|
||||
>
|
||||
<div class="mb-2 flex flex-col gap-2 sm:flex-row sm:items-center">
|
||||
<div class="mb-3 flex flex-col gap-2 sm:flex-row sm:items-center">
|
||||
<!-- Drag handle -->
|
||||
<button type="button" class="btn btn-ghost btn-xs btn-square cursor-grab active:cursor-grabbing text-base-content/40 hover:text-base-content" title="Drag to move" aria-label="Drag to move field">
|
||||
<i class="ph-duotone ph-dots-six-vertical text-lg"></i>
|
||||
<i class="ph-duotone ph-dots-six-vertical text-lg" aria-hidden="true"></i>
|
||||
</button>
|
||||
<span class="text-xs font-mono text-base-content/40 w-6">#[<span x-text="index + 1"></span>]</span>
|
||||
<div class="w-full flex-1">
|
||||
@@ -179,10 +191,10 @@ $isEditing = isset($form['id']) && $form['id'] > 0;
|
||||
</div>
|
||||
</div>
|
||||
<!-- Validation errors -->
|
||||
<div x-show="getValidationErrors(field, index).length > 0" x-transition class="mb-2 rounded border border-error/30 bg-error/10 p-2 text-xs text-error" role="alert" aria-live="polite">
|
||||
<div x-show="getValidationErrors(field, index).length > 0" x-transition class="alert alert-error alert-soft mb-3 px-3 py-2 text-xs" role="alert" aria-live="polite">
|
||||
<template x-for="(error, errIndex) in getValidationErrors(field, index)">
|
||||
<div :key="errIndex" class="flex items-center gap-1">
|
||||
<i class="ph-duotone ph-warning text-sm"></i>
|
||||
<i class="ph-duotone ph-warning text-sm" aria-hidden="true"></i>
|
||||
<span x-text="error"></span>
|
||||
</div>
|
||||
</template>
|
||||
@@ -204,11 +216,11 @@ $isEditing = isset($form['id']) && $form['id'] > 0;
|
||||
<i class="ph-duotone ph-trash"></i>
|
||||
</button>
|
||||
</div>
|
||||
<div x-show="field.type === 'select' || field.type === 'checkbox' || field.type === 'radio'" x-transition class="mt-3 border-l-2 border-primary/30 pl-3 sm:ml-2 sm:pl-4">
|
||||
<div class="flex items-center gap-2 mb-2">
|
||||
<span class="text-xs font-medium text-base-content/60 uppercase tracking-wide" x-text="getOptionsLabel(field.type)"></span>
|
||||
<div x-show="field.type === 'select' || field.type === 'checkbox' || field.type === 'radio'" x-transition class="mt-4 rounded-box border-l-2 border-primary/50 bg-base-100 p-3 sm:ml-2 sm:p-4">
|
||||
<div class="mb-3 flex items-center gap-2">
|
||||
<span class="text-xs font-semibold uppercase tracking-wide text-base-content/60" x-text="getOptionsLabel(field.type)"></span>
|
||||
<button type="button" @click="field.options.push({label: 'Option', value: 'option'})" class="btn btn-xs btn-ghost btn-primary">
|
||||
<i class="ph-duotone ph-plus"></i>
|
||||
<i class="ph-duotone ph-plus" aria-hidden="true"></i>
|
||||
Add
|
||||
</button>
|
||||
</div>
|
||||
@@ -229,35 +241,39 @@ $isEditing = isset($form['id']) && $form['id'] > 0;
|
||||
</template>
|
||||
</div>
|
||||
|
||||
<div class="mt-4">
|
||||
<div class="border-t border-base-300 pt-4">
|
||||
<button type="button" @click="addField()" class="btn btn-outline btn-sm btn-primary">
|
||||
<i class="ph-duotone ph-plus"></i>
|
||||
<i class="ph-duotone ph-plus" aria-hidden="true"></i>
|
||||
Add field
|
||||
</button>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</section>
|
||||
|
||||
<div class="card mb-6 border border-base-300/60 bg-base-100 shadow-sm">
|
||||
<div class="card-body">
|
||||
<div class="flex items-center gap-2 mb-4">
|
||||
<i class="ph-duotone ph-gear text-2xl text-primary" aria-hidden="true"></i>
|
||||
<h3 class="card-title text-lg">Actions</h3>
|
||||
</div>
|
||||
<p class="text-sm text-base-content/60 mb-4">What should happen when a form is submitted?</p>
|
||||
<section class="card border border-base-300 bg-base-100 shadow-sm" aria-labelledby="form-actions-title">
|
||||
<div class="card-body gap-5 p-4 sm:p-6 lg:p-8">
|
||||
<header class="flex items-start gap-3 border-b border-base-300 pb-4">
|
||||
<span class="grid size-10 shrink-0 place-items-center rounded-xl bg-accent/15 text-base-content">
|
||||
<i class="text-xl ph-duotone ph-gear" aria-hidden="true"></i>
|
||||
</span>
|
||||
<div>
|
||||
<h3 class="card-title text-lg" id="form-actions-title">Actions</h3>
|
||||
<p class="mt-1 text-sm text-base-content/60">Choose what should happen when someone submits this form.</p>
|
||||
</div>
|
||||
</header>
|
||||
|
||||
<input type="hidden" name="finishers" :value="JSON.stringify(finishers)">
|
||||
|
||||
<div x-show="finishers.length === 0" class="rounded-box border-2 border-dashed border-base-300 px-4 py-8 text-center">
|
||||
<i class="ph-duotone ph-plus-circle text-4xl text-base-content/30"></i>
|
||||
<p class="text-sm text-base-content/50 mt-2">No actions added yet</p>
|
||||
<button type="button" @click="addFinisher()" class="btn btn-sm btn-primary mt-2">Add your first action</button>
|
||||
<div x-show="finishers.length === 0" class="rounded-box border border-dashed border-base-300 bg-base-200/40 px-4 py-10 text-center">
|
||||
<i class="ph-duotone ph-plus-circle text-4xl text-base-content/30" aria-hidden="true"></i>
|
||||
<p class="mt-2 text-sm text-base-content/60">No actions added yet</p>
|
||||
<button type="button" @click="addFinisher()" class="btn btn-primary btn-sm mt-3">Add your first action</button>
|
||||
</div>
|
||||
|
||||
<div x-show="finishers.length > 0" class="space-y-2">
|
||||
<div x-show="finishers.length > 0" class="space-y-4">
|
||||
<template x-for="(finisher, index) in finishers">
|
||||
<div class="p-3 border border-base-300 rounded-lg bg-base-200/50 space-y-3">
|
||||
<div class="flex items-center gap-3">
|
||||
<div class="space-y-4 rounded-box border border-base-300 bg-base-200/40 p-4 shadow-sm sm:p-5">
|
||||
<div class="flex flex-col gap-3 sm:flex-row sm:items-center">
|
||||
<span class="text-xs font-mono text-base-content/40">#[<span x-text="index + 1"></span>]</span>
|
||||
<select :value="finisher.type" @change="setFinisherType(finisher, $event.target.value)" class="select select-bordered select-sm min-w-40 flex-1" :aria-label="'Action ' + (index + 1) + ' type'">
|
||||
<template x-for="(definition, type) in finisherDefinitions" :key="type">
|
||||
@@ -265,10 +281,10 @@ $isEditing = isset($form['id']) && $form['id'] > 0;
|
||||
</template>
|
||||
</select>
|
||||
<button @click="finishers.splice(index, 1)" type="button" class="btn btn-ghost btn-sm btn-circle text-error" title="Remove" :aria-label="'Remove action ' + (index + 1)">
|
||||
<i class="ph-duotone ph-trash"></i>
|
||||
<i class="ph-duotone ph-trash" aria-hidden="true"></i>
|
||||
</button>
|
||||
</div>
|
||||
<div x-show="getFinisherSettings(finisher.type).length > 0" class="space-y-3 pl-8">
|
||||
<div x-show="getFinisherSettings(finisher.type).length > 0" class="space-y-4 border-t border-base-300 pt-4 sm:pl-9">
|
||||
<template x-for="setting in getFinisherSettings(finisher.type)" :key="setting.name">
|
||||
<div class="form-control">
|
||||
<label class="label" :for="'finisher-' + index + '-' + setting.name"><span class="label-text" x-text="setting.label"></span></label>
|
||||
@@ -296,27 +312,27 @@ $isEditing = isset($form['id']) && $form['id'] > 0;
|
||||
<span x-show="setting.help" class="label-text-alt text-base-content/60 mt-1" x-text="setting.help"></span>
|
||||
</div>
|
||||
</template>
|
||||
<span x-show="getFinisherSettings(finisher.type).some(setting => setting.type === 'emailField') && fields.filter(field => field.type === 'email').length === 0" class="label-text-alt text-warning">Add an email field to the form before using this action.</span>
|
||||
<span x-show="getFinisherSettings(finisher.type).some(setting => setting.type === 'emailField') && fields.filter(field => field.type === 'email').length === 0" class="alert alert-warning alert-soft text-sm" role="status">Add an email field to the form before using this action.</span>
|
||||
</div>
|
||||
</div>
|
||||
</template>
|
||||
</div>
|
||||
|
||||
<div class="mt-4">
|
||||
<div class="border-t border-base-300 pt-4">
|
||||
<button type="button" @click="addFinisher()" class="btn btn-outline btn-sm btn-primary">
|
||||
<i class="ph-duotone ph-plus"></i>
|
||||
<i class="ph-duotone ph-plus" aria-hidden="true"></i>
|
||||
Add action
|
||||
</button>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</section>
|
||||
|
||||
<div class="flex flex-col-reverse gap-2 sm:flex-row sm:justify-end">
|
||||
<div class="flex flex-col-reverse gap-2 border-t border-base-300 pt-5 sm:flex-row sm:justify-end">
|
||||
<a href="?tab=ext--form" class="btn btn-ghost btn-sm sm:min-w-28">
|
||||
Cancel
|
||||
</a>
|
||||
<button type="submit" class="btn btn-primary btn-sm sm:min-w-28">
|
||||
<i class="ph-duotone ph-floppy-disk"></i>
|
||||
<i class="ph-duotone ph-floppy-disk" aria-hidden="true"></i>
|
||||
Save
|
||||
</button>
|
||||
</div>
|
||||
|
||||
@@ -1,13 +1,16 @@
|
||||
<section class="card border border-base-300/60 bg-base-100 shadow-sm" aria-labelledby="form-extension-settings-title">
|
||||
<div class="card-body">
|
||||
<div class="flex items-start gap-3 border-b border-base-300/60 pb-4">
|
||||
<i class="ph-duotone ph-gear mt-1 text-2xl text-primary" aria-hidden="true"></i>
|
||||
<div class="card-body gap-5 p-4 sm:p-6 lg:p-8">
|
||||
<div class="flex items-start gap-3 border-b border-base-300 pb-5">
|
||||
<span class="grid size-11 shrink-0 place-items-center rounded-2xl bg-primary/10 text-primary">
|
||||
<i class="text-2xl ph-duotone ph-gear" aria-hidden="true"></i>
|
||||
</span>
|
||||
<div>
|
||||
<h2 class="card-title text-lg" id="form-extension-settings-title">Settings</h2>
|
||||
<p class="text-xs font-semibold uppercase tracking-[0.18em] text-primary">Form extension</p>
|
||||
<h2 class="card-title mt-1 text-xl" id="form-extension-settings-title">Settings</h2>
|
||||
<p class="mt-1 text-sm text-base-content/60">Configure the global settings for the Form extension.</p>
|
||||
</div>
|
||||
</div>
|
||||
<div class="space-y-5 pt-2">
|
||||
<div class="space-y-5">
|
||||
<?php
|
||||
foreach (\Plugi\Extensions::getSettings('form') as $setting) {
|
||||
phpb_render_setting($setting);
|
||||
|
||||
@@ -13,76 +13,78 @@ $entries = $entriesRepository->findWhere('formId', $id);
|
||||
|
||||
?>
|
||||
|
||||
<div class="mb-6">
|
||||
<div class="flex items-center gap-3">
|
||||
<a href="<?= phpb_url('website_manager', ['tab' => 'ext--form']) ?>" class="btn btn-ghost btn-sm btn-circle" aria-label="Back to forms" title="Back to forms">
|
||||
<i class="ph-duotone ph-arrow-left text-xl"></i>
|
||||
</a>
|
||||
<div>
|
||||
<h2 class="text-xl font-bold"><?= phpb_e($form['name']) ?></h2>
|
||||
<p class="text-sm text-base-content/60"><?= count($entries) ?> submission<?= count($entries) !== 1 ? 's' : '' ?> for this form</p>
|
||||
<section class="space-y-5">
|
||||
<header class="flex flex-col gap-4 sm:flex-row sm:items-center sm:justify-between">
|
||||
<div class="flex items-center gap-3">
|
||||
<a href="<?= phpb_url('website_manager', ['tab' => 'ext--form']) ?>" class="btn btn-ghost btn-square btn-sm" aria-label="Back to forms" title="Back to forms">
|
||||
<i class="ph-duotone ph-arrow-left text-xl" aria-hidden="true"></i>
|
||||
</a>
|
||||
<div class="space-y-1">
|
||||
<p class="text-xs font-semibold uppercase tracking-[0.18em] text-primary">Form submissions</p>
|
||||
<h2 class="text-xl font-bold tracking-tight"><?= phpb_e($form['name']) ?></h2>
|
||||
<p class="text-sm text-base-content/60"><?= count($entries) ?> submission<?= count($entries) !== 1 ? 's' : '' ?> for this form</p>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<span class="badge badge-outline self-start sm:self-center"><?= count($entries) ?> total</span>
|
||||
</header>
|
||||
|
||||
<?php if (empty($entries)): ?>
|
||||
<div class="card border border-base-300/60 bg-base-100 shadow-sm">
|
||||
<div class="card-body items-center text-center py-16">
|
||||
<i class="ph-duotone ph-inbox text-6xl text-base-content/20"></i>
|
||||
<h3 class="card-title text-lg mt-4">No submissions yet</h3>
|
||||
<p class="text-base-content/60 mt-1">Submissions will appear here when someone fills out the form.</p>
|
||||
<div class="card border border-dashed border-base-300 bg-base-100 shadow-sm" role="status">
|
||||
<div class="card-body items-center gap-3 px-5 py-12 text-center sm:py-16">
|
||||
<span class="grid size-14 place-items-center rounded-2xl bg-info/10 text-info">
|
||||
<i class="text-3xl ph-duotone ph-inbox" aria-hidden="true"></i>
|
||||
</span>
|
||||
<h3 class="card-title mt-1 text-lg">No submissions yet</h3>
|
||||
<p class="max-w-md text-sm leading-relaxed text-base-content/60">Submissions will appear here when someone fills out the form.</p>
|
||||
</div>
|
||||
</div>
|
||||
<?php else: ?>
|
||||
<div class="card border border-base-300/60 bg-base-100 shadow-sm">
|
||||
<div class="card-body p-0">
|
||||
<div class="overflow-x-auto">
|
||||
<table class="table w-full">
|
||||
<thead>
|
||||
<tr class="bg-base-200/50">
|
||||
<th class="w-16">ID</th>
|
||||
<th class="w-40">Created</th>
|
||||
<?php foreach ($fields as $field): ?>
|
||||
<th><?= phpb_e($field['label']) ?></th>
|
||||
<?php endforeach; ?>
|
||||
<th class="w-40 text-right"><?= phpb_trans('website-manager.actions') ?></th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
<?php foreach ($entries as $entry):
|
||||
$entryData = json_decode($entry['data'], true);
|
||||
$createdDate = new DateTime($entry['created'] . ' UTC');
|
||||
$createdDate->setTimezone(new DateTimeZone(date_default_timezone_get()));
|
||||
<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>
|
||||
<th class="w-16">ID</th>
|
||||
<th class="w-40">Created</th>
|
||||
<?php foreach ($fields as $field): ?>
|
||||
<th><?= phpb_e($field['label']) ?></th>
|
||||
<?php endforeach; ?>
|
||||
<th class="w-40 text-right"><?= phpb_trans('website-manager.actions') ?></th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
<?php foreach ($entries as $entry):
|
||||
$entryData = json_decode($entry['data'], true);
|
||||
$createdDate = new DateTime($entry['created'] . ' UTC');
|
||||
$createdDate->setTimezone(new DateTimeZone(date_default_timezone_get()));
|
||||
?>
|
||||
<tr>
|
||||
<td><span class="badge badge-ghost font-mono"><?= phpb_e($entry['id']) ?></span></td>
|
||||
<td class="text-sm"><?= $createdDate->format('d.m.Y H:i') ?></td>
|
||||
<?php foreach ($fields as $field):
|
||||
$fieldName = $field['name'];
|
||||
$fieldValue = '';
|
||||
if (isset($entryData['fields'][$fieldName])) {
|
||||
$fieldValue = $entryData['fields'][$fieldName];
|
||||
// Handle array values (e.g., from checkboxes)
|
||||
if (is_array($fieldValue)) {
|
||||
$fieldValue = implode(', ', $fieldValue);
|
||||
}
|
||||
}
|
||||
?>
|
||||
<tr class="hover:bg-base-200/30">
|
||||
<td class="font-mono text-sm text-base-content/60"><?= phpb_e($entry['id']) ?></td>
|
||||
<td class="text-sm"><?= $createdDate->format('d.m.Y H:i') ?></td>
|
||||
<?php foreach ($fields as $field):
|
||||
$fieldName = $field['name'];
|
||||
$fieldValue = '';
|
||||
if (isset($entryData['fields'][$fieldName])) {
|
||||
$fieldValue = $entryData['fields'][$fieldName];
|
||||
// Handle array values (e.g., from checkboxes)
|
||||
if (is_array($fieldValue)) {
|
||||
$fieldValue = implode(', ', $fieldValue);
|
||||
}
|
||||
}
|
||||
?>
|
||||
<td class="text-sm"><?= phpb_e($fieldValue) ?></td>
|
||||
<?php endforeach; ?>
|
||||
<td>
|
||||
<div class="flex justify-end">
|
||||
<a href="/ext--form/delete-entry?id=<?= $entry['id'] ?>&formId=<?= $id ?>" class="btn btn-ghost btn-sm btn-circle text-error" title="<?= phpb_trans('website-manager.remove') ?>" aria-label="<?= phpb_trans('website-manager.remove') ?> submission <?= phpb_e($entry['id']) ?>">
|
||||
<i class="ph-duotone ph-trash text-lg"></i>
|
||||
</a>
|
||||
</div>
|
||||
</td>
|
||||
</tr>
|
||||
<td class="max-w-72 text-sm"><span class="line-clamp-3 break-words"><?= phpb_e($fieldValue) ?></span></td>
|
||||
<?php endforeach; ?>
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
</div>
|
||||
<td>
|
||||
<div class="flex justify-end">
|
||||
<a href="/ext--form/delete-entry?id=<?= $entry['id'] ?>&formId=<?= $id ?>" class="btn btn-ghost btn-square btn-sm text-error" title="<?= phpb_trans('website-manager.remove') ?>" aria-label="<?= phpb_trans('website-manager.remove') ?> submission <?= phpb_e($entry['id']) ?>">
|
||||
<i class="ph-duotone ph-trash text-lg" aria-hidden="true"></i>
|
||||
</a>
|
||||
</div>
|
||||
</td>
|
||||
</tr>
|
||||
<?php endforeach; ?>
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
<?php endif; ?>
|
||||
</section>
|
||||
|
||||
|
||||
@@ -6,67 +6,68 @@ $forms = $formsRepository->getAll();
|
||||
|
||||
?>
|
||||
|
||||
<div class="mb-6 flex flex-col gap-4 sm:flex-row sm:items-center sm:justify-between">
|
||||
<div>
|
||||
<h2 class="text-xl font-bold">Forms</h2>
|
||||
<p class="text-sm text-base-content/60"><?= count($forms) ?> form<?= count($forms) !== 1 ? 's' : '' ?> available</p>
|
||||
</div>
|
||||
<a href="<?= phpb_url('website_manager', ['tab' => 'ext--form', 'action' => 'editForm']) ?>" class="btn btn-primary btn-sm">
|
||||
<i class="ph-duotone ph-plus"></i>
|
||||
New form
|
||||
</a>
|
||||
</div>
|
||||
<section 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">
|
||||
<p class="text-xs font-semibold uppercase tracking-[0.18em] text-primary">Form extension</p>
|
||||
<h2 class="text-xl font-bold tracking-tight text-base-content">Forms</h2>
|
||||
<p class="text-sm text-base-content/60"><?= count($forms) ?> form<?= count($forms) !== 1 ? 's' : '' ?> available</p>
|
||||
</div>
|
||||
<a href="<?= phpb_url('website_manager', ['tab' => 'ext--form', 'action' => 'editForm']) ?>" class="btn btn-primary">
|
||||
<i class="ph-duotone ph-plus" aria-hidden="true"></i>
|
||||
New form
|
||||
</a>
|
||||
</header>
|
||||
|
||||
<?php if (empty($forms)): ?>
|
||||
<div class="card border border-base-300/60 bg-base-100 shadow-sm">
|
||||
<div class="card-body items-center text-center py-16">
|
||||
<i class="ph-duotone ph-notebook text-6xl text-base-content/20"></i>
|
||||
<h3 class="card-title text-lg mt-4">No forms yet</h3>
|
||||
<p class="text-base-content/60 mt-1">Create your first form to collect submissions from your website.</p>
|
||||
<a href="<?= phpb_url('website_manager', ['tab' => 'ext--form', 'action' => 'editForm']) ?>" class="btn btn-primary mt-4">
|
||||
<i class="ph-duotone ph-plus"></i>
|
||||
<div class="card border border-dashed border-base-300 bg-base-100 shadow-sm" role="status">
|
||||
<div class="card-body items-center gap-3 px-5 py-12 text-center sm:py-16">
|
||||
<span class="grid size-14 place-items-center rounded-2xl bg-primary/10 text-primary">
|
||||
<i class="text-3xl ph-duotone ph-notebook" aria-hidden="true"></i>
|
||||
</span>
|
||||
<h3 class="card-title mt-1 text-lg">No forms yet</h3>
|
||||
<p class="max-w-md text-sm leading-relaxed text-base-content/60">Create your first form to collect submissions from your website.</p>
|
||||
<a href="<?= phpb_url('website_manager', ['tab' => 'ext--form', 'action' => 'editForm']) ?>" class="btn btn-primary mt-2">
|
||||
<i class="ph-duotone ph-plus" aria-hidden="true"></i>
|
||||
Create your first form
|
||||
</a>
|
||||
</div>
|
||||
</div>
|
||||
<?php else: ?>
|
||||
<div class="card border border-base-300/60 bg-base-100 shadow-sm">
|
||||
<div class="card-body p-0">
|
||||
<div class="overflow-x-auto">
|
||||
<table class="table w-full">
|
||||
<thead>
|
||||
<tr class="bg-base-200/50">
|
||||
<th class="w-16">ID</th>
|
||||
<th><?= phpb_trans('website-manager.name') ?></th>
|
||||
<th class="w-40 text-right"><?= phpb_trans('website-manager.actions') ?></th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
<?php foreach ($forms as $form): ?>
|
||||
<tr class="hover:bg-base-200/30">
|
||||
<td class="font-mono text-sm text-base-content/60"><?= phpb_e($form['id']) ?></td>
|
||||
<td>
|
||||
<div class="font-medium"><?= phpb_e($form['name']) ?></div>
|
||||
</td>
|
||||
<td>
|
||||
<div class="flex items-center justify-end gap-1">
|
||||
<a href="<?= phpb_url('website_manager', ['tab' => 'ext--form', 'action' => 'listEntries', 'id' => $form['id']]) ?>" class="btn btn-ghost btn-sm btn-circle" title="View entries" aria-label="View entries for <?= phpb_e($form['name']) ?>">
|
||||
<i class="ph-duotone ph-eye text-lg"></i>
|
||||
</a>
|
||||
<a href="<?= phpb_url('website_manager', ['tab' => 'ext--form', 'action' => 'editForm', 'id' => $form['id']]) ?>" class="btn btn-ghost btn-sm btn-circle" title="<?= phpb_trans('website-manager.edit') ?>" aria-label="<?= phpb_trans('website-manager.edit') ?> <?= phpb_e($form['name']) ?>">
|
||||
<i class="ph-duotone ph-pencil-line text-lg"></i>
|
||||
</a>
|
||||
<a href="/ext--form/delete-form?id=<?= $form['id'] ?>" class="btn btn-ghost btn-sm btn-circle text-error" title="<?= phpb_trans('website-manager.remove') ?>" aria-label="<?= phpb_trans('website-manager.remove') ?> <?= phpb_e($form['name']) ?>">
|
||||
<i class="ph-duotone ph-trash text-lg"></i>
|
||||
</a>
|
||||
</div>
|
||||
</td>
|
||||
</tr>
|
||||
<?php endforeach; ?>
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
</div>
|
||||
<div class="overflow-x-auto rounded-box border border-base-300 bg-base-100">
|
||||
<table class="table table-zebra w-full min-w-[36rem]">
|
||||
<thead>
|
||||
<tr>
|
||||
<th class="w-16">ID</th>
|
||||
<th><?= phpb_trans('website-manager.name') ?></th>
|
||||
<th class="w-40 text-right"><?= phpb_trans('website-manager.actions') ?></th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
<?php foreach ($forms as $form): ?>
|
||||
<tr>
|
||||
<td><span class="badge badge-ghost font-mono"><?= phpb_e($form['id']) ?></span></td>
|
||||
<td>
|
||||
<div class="font-medium"><?= phpb_e($form['name']) ?></div>
|
||||
</td>
|
||||
<td>
|
||||
<div class="flex items-center justify-end gap-1">
|
||||
<a href="<?= phpb_url('website_manager', ['tab' => 'ext--form', 'action' => 'listEntries', 'id' => $form['id']]) ?>" class="btn btn-ghost btn-square btn-sm" title="View entries" aria-label="View entries for <?= phpb_e($form['name']) ?>">
|
||||
<i class="ph-duotone ph-eye text-lg" aria-hidden="true"></i>
|
||||
</a>
|
||||
<a href="<?= phpb_url('website_manager', ['tab' => 'ext--form', 'action' => 'editForm', 'id' => $form['id']]) ?>" class="btn btn-ghost btn-square btn-sm" title="<?= phpb_trans('website-manager.edit') ?>" aria-label="<?= phpb_trans('website-manager.edit') ?> <?= phpb_e($form['name']) ?>">
|
||||
<i class="ph-duotone ph-pencil-line text-lg" aria-hidden="true"></i>
|
||||
</a>
|
||||
<a href="/ext--form/delete-form?id=<?= $form['id'] ?>" class="btn btn-ghost btn-square btn-sm text-error" title="<?= phpb_trans('website-manager.remove') ?>" aria-label="<?= phpb_trans('website-manager.remove') ?> <?= phpb_e($form['name']) ?>">
|
||||
<i class="ph-duotone ph-trash text-lg" aria-hidden="true"></i>
|
||||
</a>
|
||||
</div>
|
||||
</td>
|
||||
</tr>
|
||||
<?php endforeach; ?>
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
<?php endif; ?>
|
||||
</section>
|
||||
|
||||
|
||||
@@ -34,14 +34,14 @@ if (isset($_GET['action']) && array_key_exists($_GET['action'], $modules)) $acti
|
||||
if ($modules[$activeModule]['showTabs'] === true):
|
||||
?>
|
||||
<nav class="mb-6 overflow-x-auto" aria-label="Form extension navigation">
|
||||
<div class="tabs tabs-boxed w-max min-w-full bg-base-200/50">
|
||||
<div class="tabs tabs-box w-max min-w-full bg-base-200/50">
|
||||
<?php
|
||||
foreach ($modules as $name => $module):
|
||||
if ($module['inMenu'] === false) continue;
|
||||
$icon = $module['icon'] ?? 'ph-circle';
|
||||
?>
|
||||
<a class="tab gap-2 <?= $name === $activeModule ? 'tab-active' : '' ?>" <?= $name === $activeModule ? 'aria-current="page"' : '' ?> href="<?= phpb_url('website_manager', ['tab' => 'ext--form', 'action' => $name]) ?>">
|
||||
<i class="ph-duotone <?= $icon ?>"></i>
|
||||
<i class="ph-duotone <?= $icon ?>" aria-hidden="true"></i>
|
||||
<?= $module['label'] ?>
|
||||
</a>
|
||||
<?php
|
||||
|
||||
+24
-7
@@ -163,9 +163,12 @@ async function buildWebsiteManagerJs() {
|
||||
);
|
||||
}
|
||||
|
||||
function runTailwindCli({ watch = false } = {}) {
|
||||
const input = path.resolve(__dirname, 'src/Modules/WebsiteManager/resources/assets/css/style.css');
|
||||
const output = path.join(DIST_DIR, 'WebsiteManager.css');
|
||||
function runTailwindCli({
|
||||
watch = false,
|
||||
input = path.resolve(__dirname, 'src/Modules/WebsiteManager/resources/assets/css/style.css'),
|
||||
output = path.join(DIST_DIR, 'WebsiteManager.css'),
|
||||
label = 'WebsiteManager.css',
|
||||
} = {}) {
|
||||
const tailwindBin = path.resolve(__dirname, 'node_modules/.bin/tailwindcss');
|
||||
|
||||
const args = ['-i', input, '-o', output];
|
||||
@@ -194,10 +197,10 @@ function runTailwindCli({ watch = false } = {}) {
|
||||
if (code === 0) {
|
||||
const duration = (performance.now() - start).toFixed(1);
|
||||
const size = (fs.statSync(output).size / 1024).toFixed(1);
|
||||
console.log(` \x1b[32m✓\x1b[0m CSS dist/WebsiteManager.css (${size} kB, ${duration}ms)`);
|
||||
console.log(` \x1b[32m✓\x1b[0m CSS dist/${label} (${size} kB, ${duration}ms)`);
|
||||
resolve();
|
||||
} else {
|
||||
console.error(`\x1b[31mError compiling Tailwind CSS:\x1b[0m\n${stderr}`);
|
||||
console.error(`\x1b[31mError compiling ${label}:\x1b[0m\n${stderr}`);
|
||||
reject(new Error(`Tailwind CLI exited with code ${code}`));
|
||||
}
|
||||
});
|
||||
@@ -215,6 +218,12 @@ async function buildAll() {
|
||||
await Promise.all([
|
||||
buildWebsiteManagerJs(),
|
||||
runTailwindCli({ watch: false }),
|
||||
runTailwindCli({
|
||||
watch: false,
|
||||
input: path.resolve(__dirname, 'src/Modules/WebsiteManager/resources/assets/css/admin.css'),
|
||||
output: path.join(DIST_DIR, 'Admin.css'),
|
||||
label: 'Admin.css',
|
||||
}),
|
||||
buildGrapesHead(),
|
||||
buildGrapesBody(),
|
||||
buildPageInjectionJs(),
|
||||
@@ -226,7 +235,15 @@ async function buildAll() {
|
||||
}
|
||||
|
||||
function startWatch() {
|
||||
const tailwindProcess = runTailwindCli({ watch: true });
|
||||
const tailwindProcesses = [
|
||||
runTailwindCli({ watch: true }),
|
||||
runTailwindCli({
|
||||
watch: true,
|
||||
input: path.resolve(__dirname, 'src/Modules/WebsiteManager/resources/assets/css/admin.css'),
|
||||
output: path.join(DIST_DIR, 'Admin.css'),
|
||||
label: 'Admin.css',
|
||||
}),
|
||||
];
|
||||
|
||||
const srcDir = path.resolve(__dirname, 'src');
|
||||
console.log(`\x1b[36mWatching for changes in ${srcDir}...\x1b[0m\n`);
|
||||
@@ -284,7 +301,7 @@ function startWatch() {
|
||||
|
||||
const cleanup = () => {
|
||||
console.log('\nStopping watchers...');
|
||||
if (tailwindProcess) tailwindProcess.kill();
|
||||
tailwindProcesses.forEach((tailwindProcess) => tailwindProcess?.kill());
|
||||
watcher.close();
|
||||
process.exit(0);
|
||||
};
|
||||
|
||||
Vendored
+2
File diff suppressed because one or more lines are too long
Vendored
+1
-1
File diff suppressed because one or more lines are too long
@@ -1,18 +1,25 @@
|
||||
<!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("auth.title") ?></title>
|
||||
|
||||
<link rel="stylesheet" href="https://use.fontawesome.com/releases/v5.8.1/css/all.css" integrity="sha384-50oBUHEmvpQ+1lW4y57PTFmhCaXp0ML5d60M1M7uH2+nqUivzIebhndOJK28anvf" crossorigin="anonymous">
|
||||
<link href="<?= phpb_asset("WebsiteManager.css") ?>" rel="stylesheet">
|
||||
<link href="<?= phpb_asset("Admin.css") ?>" rel="stylesheet">
|
||||
</head>
|
||||
<body class="min-h-screen bg-base-200 text-base-content">
|
||||
<body class="min-h-screen bg-base-200 text-base-content antialiased">
|
||||
|
||||
<main class="flex min-h-screen flex-col items-center justify-center gap-8 px-4 py-10">
|
||||
<section class="card w-full max-w-md bg-base-100 shadow-xl">
|
||||
<div class="card-body">
|
||||
<main class="relative flex min-h-screen flex-col items-center justify-center gap-7 overflow-hidden px-4 py-10">
|
||||
<div class="pointer-events-none absolute inset-x-0 top-0 h-2 bg-gradient-to-r from-primary via-secondary to-accent" aria-hidden="true"></div>
|
||||
<section class="card w-full max-w-md border border-base-300 bg-base-100 shadow-xl shadow-base-content/5">
|
||||
<div class="card-body gap-6 p-6 sm:p-8">
|
||||
<a href="<?= phpb_url('website_manager') ?>" class="mx-auto flex items-center gap-3 rounded-box focus-visible:outline-2 focus-visible:outline-offset-4 focus-visible:outline-primary">
|
||||
<span class="grid size-11 place-items-center rounded-2xl bg-primary text-primary-content">
|
||||
<i class="text-2xl ph-bold ph-brackets-square rotate-90" aria-hidden="true"></i>
|
||||
</span>
|
||||
<span class="text-xl font-bold tracking-tight text-base-content">Plugi</span>
|
||||
</a>
|
||||
<?php require __DIR__ . "/" . $viewFile . ".php"; ?>
|
||||
</div>
|
||||
</section>
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
<div class="mb-2 text-center">
|
||||
<h2 class="text-2xl font-semibold text-base-content"><?= phpb_trans('auth.title') ?></h2>
|
||||
<div class="space-y-1 text-center">
|
||||
<p class="text-xs font-semibold uppercase tracking-[0.18em] text-primary">Secure access</p>
|
||||
<h1 class="text-2xl font-bold tracking-tight text-base-content"><?= phpb_trans('auth.title') ?></h1>
|
||||
</div>
|
||||
|
||||
<form class="login-form flex w-full flex-col gap-4" method="post" action="<?= phpb_url('auth', ['action' => 'login']) ?>">
|
||||
@@ -7,9 +8,9 @@
|
||||
<?php
|
||||
if (phpb_flash('message')):
|
||||
?>
|
||||
<div class="hidden alert-warning"></div>
|
||||
<div class="hidden alert alert-warning alert-error alert-info alert-success"></div>
|
||||
<div class="alert alert-<?= phpb_flash('message-type') ?> w-full" role="alert">
|
||||
<i class="text-xl ph-duotone ph-warning"></i>
|
||||
<i class="text-xl ph-duotone ph-warning-circle" aria-hidden="true"></i>
|
||||
<span><?= phpb_flash('message') ?></span>
|
||||
</div>
|
||||
<?php
|
||||
@@ -18,12 +19,15 @@
|
||||
|
||||
<label class="form-control w-full gap-2">
|
||||
<span class="label-text font-medium"><?= phpb_trans('auth.username') ?></span>
|
||||
<input type="text" name="username" class="input input-bordered w-full" placeholder="<?= phpb_trans('auth.username') ?>" autocomplete="username" required autofocus>
|
||||
<input type="text" name="username" class="input input-bordered w-full" placeholder="<?= phpb_trans('auth.username') ?>" autocomplete="username" required autofocus aria-label="<?= phpb_e(phpb_trans('auth.username')) ?>">
|
||||
</label>
|
||||
<label class="form-control w-full gap-2">
|
||||
<span class="label-text font-medium"><?= phpb_trans('auth.password') ?></span>
|
||||
<input type="password" name="password" class="input input-bordered w-full" placeholder="<?= phpb_trans('auth.password') ?>" autocomplete="current-password" required>
|
||||
<input type="password" name="password" class="input input-bordered w-full" placeholder="<?= phpb_trans('auth.password') ?>" autocomplete="current-password" required aria-label="<?= phpb_e(phpb_trans('auth.password')) ?>">
|
||||
</label>
|
||||
|
||||
<button class="btn btn-primary mt-2 w-full" type="submit"><?= phpb_trans('auth.login-button') ?></button>
|
||||
<button class="btn btn-primary mt-2 w-full" type="submit">
|
||||
<?= phpb_trans('auth.login-button') ?>
|
||||
<i class="ph-bold ph-arrow-right" aria-hidden="true"></i>
|
||||
</button>
|
||||
</form>
|
||||
|
||||
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user