refresh admin interface layouts
Redesign authentication and website manager layouts and views for a responsive, accessible interface. Update page, menu, file, info, and settings screens, and refresh the generated WebsiteManager stylesheet.
This commit is contained in:
Vendored
+1
-1
File diff suppressed because one or more lines are too long
@@ -2,21 +2,25 @@
|
||||
<html lang="<?= phpb_current_language() ?>">
|
||||
<head>
|
||||
<meta charset="utf-8">
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no">
|
||||
<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">
|
||||
</head>
|
||||
<body>
|
||||
<body class="min-h-screen bg-base-200 text-base-content">
|
||||
|
||||
<div class="container p-4">
|
||||
<?php require __DIR__ . "/" . $viewFile . ".php"; ?>
|
||||
<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">
|
||||
<?php require __DIR__ . "/" . $viewFile . ".php"; ?>
|
||||
</div>
|
||||
</section>
|
||||
|
||||
<footer class="my-5 pt-5 text-muted text-center text-small">
|
||||
<p class="mb-1">Powered by <a href="https://github.com/deepDiverPaul/plugi" target="_blank">Plugi Page Builder</a></p>
|
||||
<footer class="text-center text-sm text-base-content/60">
|
||||
<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>
|
||||
</main>
|
||||
|
||||
</body>
|
||||
</html>
|
||||
|
||||
@@ -1,14 +1,14 @@
|
||||
<div class="py-5 text-center">
|
||||
<h2><?= phpb_trans('auth.title') ?></h2>
|
||||
<div class="mb-2 text-center">
|
||||
<h2 class="text-2xl font-semibold text-base-content"><?= phpb_trans('auth.title') ?></h2>
|
||||
</div>
|
||||
|
||||
<form class="login-form mt-3 flex flex-col gap-3 items-center" method="post" action="<?= phpb_url('auth', ['action' => 'login']) ?>">
|
||||
<form class="login-form flex w-full flex-col gap-4" method="post" action="<?= phpb_url('auth', ['action' => 'login']) ?>">
|
||||
<?php phpb_csrf_field(); ?>
|
||||
<?php
|
||||
if (phpb_flash('message')):
|
||||
?>
|
||||
<div class="hidden alert-warning"></div>
|
||||
<div class="alert alert-<?= phpb_flash('message-type') ?> mb-6">
|
||||
<div class="alert alert-<?= phpb_flash('message-type') ?> w-full" role="alert">
|
||||
<i class="text-xl ph-duotone ph-warning"></i>
|
||||
<span><?= phpb_flash('message') ?></span>
|
||||
</div>
|
||||
@@ -16,8 +16,14 @@
|
||||
endif;
|
||||
?>
|
||||
|
||||
<input type="text" name="username" class="input input-bordered w-full max-w-xs" placeholder="<?= phpb_trans('auth.username') ?>" required autofocus>
|
||||
<input type="password" name="password" class="input input-bordered w-full max-w-xs" placeholder="<?= phpb_trans('auth.password') ?>" required>
|
||||
<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>
|
||||
</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>
|
||||
</label>
|
||||
|
||||
<button class="btn btn-outline btn-primary w-full max-w-xs" type="submit"><?= phpb_trans('auth.login-button') ?></button>
|
||||
<button class="btn btn-primary mt-2 w-full" type="submit"><?= phpb_trans('auth.login-button') ?></button>
|
||||
</form>
|
||||
|
||||
@@ -2,18 +2,16 @@
|
||||
<html lang="<?= phpb_current_language() ?>">
|
||||
<head>
|
||||
<meta charset="utf-8">
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no">
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1">
|
||||
<title>Plugi Page Builder</title>
|
||||
|
||||
<link href="<?= phpb_asset('WebsiteManager.css') ?>" rel="stylesheet">
|
||||
|
||||
</head>
|
||||
<body class="bg-light">
|
||||
<body class="min-h-screen bg-base-200 text-base-content">
|
||||
|
||||
<div class="container">
|
||||
<?php
|
||||
require __DIR__ . '/../views/' . $viewFile . '.php';
|
||||
?>
|
||||
<div class="mx-auto min-h-screen w-full max-w-7xl px-4 py-8 sm:px-6 lg:px-8">
|
||||
<?php require __DIR__ . '/../views/' . $viewFile . '.php'; ?>
|
||||
</div>
|
||||
|
||||
<script src="<?= phpb_asset('WebsiteManager.js') ?>"></script>
|
||||
|
||||
@@ -12,7 +12,7 @@ if (isset($_GET['tab'])) {
|
||||
<html lang="<?= phpb_current_language() ?>">
|
||||
<head>
|
||||
<meta charset="utf-8">
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no">
|
||||
<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') ?>
|
||||
@@ -22,26 +22,25 @@ if (isset($_GET['tab'])) {
|
||||
<link href="<?= phpb_asset('icons/bold/style.css') ?>" rel="stylesheet">
|
||||
<?= Extensions::getHtmlBlocks('admin-head') ?>
|
||||
</head>
|
||||
<body>
|
||||
<body class="min-h-screen bg-base-200 text-base-content">
|
||||
<?= Extensions::getHtmlBlocks('admin-body-start') ?>
|
||||
|
||||
<div class="drawer lg:drawer-open">
|
||||
<div class="drawer min-h-screen lg:drawer-open">
|
||||
<input id="my-drawer-2" type="checkbox" class="drawer-toggle" />
|
||||
<div class="drawer-content flex flex-col items-center justify-top">
|
||||
<!-- Page content here -->
|
||||
<div class="navbar lg:hidden bg-base-100">
|
||||
<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-accent drawer-button border-primary">
|
||||
<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>
|
||||
</label>
|
||||
</div>
|
||||
<div class="navbar-center">
|
||||
<span class="text-xl text-primary">
|
||||
<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>
|
||||
<div class="navbar-end">
|
||||
<a href="<?= phpb_url('auth', ['action' => 'logout']) ?>" class="btn btn-square btn-ghost">
|
||||
<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>
|
||||
</div>
|
||||
@@ -50,23 +49,24 @@ if (isset($_GET['tab'])) {
|
||||
require __DIR__ . '/../views/' . $viewFile . '.php';
|
||||
?>
|
||||
|
||||
<footer class="my-5 pt-5 text-muted text-center text-small">
|
||||
<p class="mb-1">Powered by <a href="https://github.com/deepDiverPaul/plugi" target="_blank">Plugi Page Builder</a></p>
|
||||
<footer class="mt-auto px-4 py-8 text-center text-sm text-base-content/60">
|
||||
<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">
|
||||
<div class="drawer-side z-40">
|
||||
<label for="my-drawer-2" class="drawer-overlay"></label>
|
||||
<ul class="menu p-4 w-80 h-full bg-base-200 text-base-content">
|
||||
<!-- Sidebar content here -->
|
||||
<div class="py-5 text-2xl text-center text-primary">
|
||||
<h2"><i class="inline-block ph-bold ph-brackets-square rotate-90"></i> <?= phpb_trans('website-manager.title') ?></h2>
|
||||
</div>
|
||||
<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') ?>
|
||||
</span>
|
||||
</li>
|
||||
<?php
|
||||
foreach ($tabs as $slug => $tab) :
|
||||
?>
|
||||
<li class="mb-1">
|
||||
<a class="<?= phpb_e($slug === $activeSlug ? 'bg-accent text-primary' : '' ) ?>" href="?tab=<?= phpb_e($slug) ?>">
|
||||
<li>
|
||||
<a class="<?= phpb_e($slug === $activeSlug ? 'menu-active' : '' ) ?>" 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>
|
||||
@@ -76,8 +76,8 @@ if (isset($_GET['tab'])) {
|
||||
<?php
|
||||
if (phpb_config('auth.use_login')):
|
||||
?>
|
||||
<li class="lg:flex hidden">
|
||||
<a href="<?= phpb_url('auth', ['action' => 'logout']) ?>" class="">
|
||||
<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') ?>
|
||||
</a>
|
||||
</li>
|
||||
|
||||
@@ -5,26 +5,18 @@ if (isset($page)) {
|
||||
}
|
||||
?>
|
||||
|
||||
<div class="py-5 text-center">
|
||||
<h2><?= phpb_trans('website-manager.title') ?></h2>
|
||||
</div>
|
||||
<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 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">
|
||||
<i class="ph ph-arrow-left" aria-hidden="true"></i> <?= phpb_trans('website-manager.back') ?>
|
||||
</a>
|
||||
</header>
|
||||
|
||||
<div class="row">
|
||||
<div class="col-12">
|
||||
|
||||
<div class="manager-panel">
|
||||
<h4><?= phpb_trans('website-manager.render-thumbs') ?></h4>
|
||||
|
||||
<div class="main-spacing">
|
||||
<iframe class="thumb-renderer" src="<?= phpb_url('pagebuilder', ['route' => 'thumb_generator', 'action' => 'renderNextBlockThumb']) ?>"></iframe>
|
||||
</div>
|
||||
|
||||
<hr class="mb-3">
|
||||
|
||||
<a href="<?= phpb_url('website_manager') ?>" class="btn btn-light btn-sm mr-1">
|
||||
<?= phpb_trans('website-manager.back') ?>
|
||||
</a>
|
||||
<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>
|
||||
<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>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
</section>
|
||||
</main>
|
||||
|
||||
@@ -1,12 +1,14 @@
|
||||
<div class="max-w-4xl p-8 mx-auto w-full">
|
||||
<div class="text-center text-3xl font-bold mb-8 mt-2">
|
||||
<?= phpb_e($tabs[$activeSlug]['title']) ?>
|
||||
</div>
|
||||
<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>
|
||||
</header>
|
||||
<?php
|
||||
if (phpb_flash('message')):
|
||||
?>
|
||||
<div class="hidden alert-success alert-error"></div>
|
||||
<div class="alert alert-<?= phpb_flash('message-type') ?> mb-6">
|
||||
<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>' : '' ?>
|
||||
<span><?= phpb_flash('message') ?></span>
|
||||
@@ -14,9 +16,9 @@
|
||||
<?php
|
||||
endif;
|
||||
?>
|
||||
<div class="">
|
||||
<?php
|
||||
include $tabs[$activeSlug]['include'];
|
||||
?>
|
||||
</div>
|
||||
</div>
|
||||
<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">
|
||||
<?php include $tabs[$activeSlug]['include']; ?>
|
||||
</div>
|
||||
</section>
|
||||
</main>
|
||||
|
||||
@@ -23,28 +23,30 @@ $javascriptValue = static function (string $value): string {
|
||||
?>
|
||||
|
||||
|
||||
<div class="manager-panel p-8 w-full">
|
||||
<form method="post" action="<?= phpb_url('website_manager', ['route' => 'page_settings', 'action' => $action]) ?><?= $pageUrlParam ?>">
|
||||
<section class="card w-full border border-base-300 bg-base-100 p-4 shadow-sm 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(); ?>
|
||||
<div class="text-center text-3xl font-bold mb-8 mt-2">
|
||||
<?php
|
||||
if ($action === 'create'):
|
||||
echo phpb_trans('website-manager.add-new-page');
|
||||
else:
|
||||
echo phpb_trans('website-manager.edit-page');
|
||||
endif;
|
||||
?>
|
||||
</div>
|
||||
<header class="border-b border-base-300 pb-4">
|
||||
<h1 class="text-2xl font-semibold text-base-content sm:text-3xl">
|
||||
<?php
|
||||
if ($action === 'create'):
|
||||
echo phpb_trans('website-manager.add-new-page');
|
||||
else:
|
||||
echo phpb_trans('website-manager.edit-page');
|
||||
endif;
|
||||
?>
|
||||
</h1>
|
||||
</header>
|
||||
|
||||
<?php if (! empty($errorMessage)): ?>
|
||||
<div class="alert alert-error mb-6" role="alert">
|
||||
<div class="alert alert-error" role="alert">
|
||||
<span><?= phpb_e($errorMessage) ?></span>
|
||||
</div>
|
||||
<?php endif; ?>
|
||||
|
||||
<div class="max-w-lg p-4 mx-auto" x-data="{type: <?= $javascriptValue($fieldValue('type') !== '' ? $fieldValue('type') : 'static') ?>}">
|
||||
<div class="form-control w-full mb-4">
|
||||
<label class="label">
|
||||
<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>
|
||||
@@ -54,12 +56,12 @@ $javascriptValue = static function (string $value): string {
|
||||
</label>
|
||||
</div>
|
||||
|
||||
<div class="form-control w-full mb-4">
|
||||
<label class="label">
|
||||
<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" x-model="type" id="type" name="type" required>
|
||||
<select class="select select-bordered w-full" x-model="type" id="type" name="type" required>
|
||||
<?php
|
||||
$types = ['static', 'redirect'];
|
||||
$value = $fieldValue('type');
|
||||
@@ -74,12 +76,12 @@ $javascriptValue = static function (string $value): string {
|
||||
</select>
|
||||
</div>
|
||||
|
||||
<div class="form-control w-full mb-4" x-show="type !== 'redirect'">
|
||||
<label class="label">
|
||||
<div class="form-control w-full" x-show="type !== 'redirect'">
|
||||
<label class="label" for="layout">
|
||||
<span class="label-text"><?= phpb_trans('website-manager.layout') ?></span>
|
||||
<span class="label-text-alt"><?= phpb_trans('website-manager.required') ?></span> <!-- TODO add to lang -->
|
||||
</label>
|
||||
<select class="select select-bordered" id="layout" name="layout" required>
|
||||
<select class="select select-bordered w-full" id="layout" name="layout" required>
|
||||
<?php
|
||||
$value = $fieldValue('layout');
|
||||
foreach ($theme->getThemeLayouts() as $layout):
|
||||
@@ -97,11 +99,11 @@ $javascriptValue = static function (string $value): string {
|
||||
$firstLang = true;
|
||||
foreach (phpb_active_languages() as $languageCode => $languageTranslation):
|
||||
?>
|
||||
<details class="collapse collapse-plus bg-white mt-6" <?= phpb_e($firstLang ? 'open' : '') ?>>
|
||||
<summary class="collapse-title text-xl font-medium"><?= phpb_trans('languages.' . $languageCode) ?></summary>
|
||||
<div class="collapse-content">
|
||||
<div 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 mb-2">
|
||||
<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">
|
||||
<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">
|
||||
<span class="label-text"><?= phpb_trans('website-manager.page-title') ?></span>
|
||||
<span class="label-text-alt"><?= phpb_trans('website-manager.required') ?></span>
|
||||
@@ -109,37 +111,37 @@ $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 mb-2" x-show="type === 'static'">
|
||||
<div class="form-control w-full" x-show="type === 'static'">
|
||||
<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 mb-2" x-show="type === 'static'">
|
||||
<div class="form-control w-full" x-show="type === 'static'">
|
||||
<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 class="form-control w-full mb-2" x-show="type === 'redirect'">
|
||||
<div class="form-control w-full" x-show="type === 'redirect'">
|
||||
<label class="label" for="<?= phpb_e($languageCode) ?>-page-target-redirect">
|
||||
<span class="label-text"><?= phpb_trans('website-manager.target-redirect') ?></span>
|
||||
</label>
|
||||
<input type="text" class="input input-bordered w-full" id="<?= phpb_e($languageCode) ?>-page-target-redirect" name="target[<?= phpb_e($languageCode) ?>]" value="<?= phpb_e($fieldValue('target', $languageCode)) ?>" />
|
||||
</div>
|
||||
|
||||
<div class="form-control w-full mb-2">
|
||||
<div class="form-control w-full">
|
||||
<label class="label" for="<?= phpb_e($languageCode) ?>-page-route">
|
||||
<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'">
|
||||
<i class="ph ph-pencil" x-show="disabled"></i>
|
||||
<i class="ph ph-pencil-slash" x-show="!disabled"></i>
|
||||
<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')) ?>">
|
||||
<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>
|
||||
</div>
|
||||
</div>
|
||||
@@ -152,11 +154,11 @@ $javascriptValue = static function (string $value): string {
|
||||
endforeach;
|
||||
?>
|
||||
|
||||
<div class="text-center mt-8">
|
||||
<a href="<?= phpb_url('website_manager') ?>" class="btn btn-light btn-sm mr-1">
|
||||
<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">
|
||||
<?= phpb_trans('website-manager.back') ?>
|
||||
</a>
|
||||
<button class="btn btn-primary btn-sm">
|
||||
<button type="submit" class="btn btn-primary btn-sm">
|
||||
<?php
|
||||
if ($action === 'create'):
|
||||
echo phpb_trans('website-manager.add-new-page');
|
||||
@@ -171,4 +173,4 @@ $javascriptValue = static function (string $value): string {
|
||||
|
||||
</form>
|
||||
|
||||
</div>
|
||||
</section>
|
||||
|
||||
@@ -1,32 +1,32 @@
|
||||
<div class="mb-8 flex justify-center">
|
||||
<input type="file" id="fileupload" class="file-input file-input-bordered file-input-primary w-full max-w-md" name="fileupload" onchange="uploadFile()" onselect="uploadFile()" />
|
||||
</div>
|
||||
|
||||
<div class="flex flex-wrap justify-center gap-4">
|
||||
<?php
|
||||
foreach ($files as $file) :
|
||||
?>
|
||||
<div class="relative">
|
||||
<img src="<?= phpb_e($file->getUrl()) ?>" alt="<?= phpb_e($file->public_id) ?>" class="h-40 rounded">
|
||||
<div class="absolute top-1 right-1">
|
||||
<button onclick="deleteFile('<?= phpb_e($file->public_id) ?>')" class="btn btn-error btn-circle btn-sm mb-2">
|
||||
<i class="ph-duotone ph-trash"></i>
|
||||
</button>
|
||||
<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>
|
||||
<input type="file" id="fileupload" class="file-input file-input-bordered file-input-primary w-full" name="fileupload" onchange="uploadFile()" onselect="uploadFile()" />
|
||||
</label>
|
||||
</div>
|
||||
|
||||
<?php if (count($files) === 0) : ?>
|
||||
<div class="alert alert-info" role="status">
|
||||
<span>No files uploaded yet.</span>
|
||||
</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">
|
||||
<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')) ?>">
|
||||
<i class="ph-duotone ph-trash" aria-hidden="true"></i>
|
||||
</button>
|
||||
</figure>
|
||||
</li>
|
||||
<?php endforeach; ?>
|
||||
</ul>
|
||||
<?php endif; ?>
|
||||
</div>
|
||||
<?php
|
||||
endforeach;
|
||||
?>
|
||||
<?php
|
||||
if (count($files) === 0) :
|
||||
?>
|
||||
<div class="relative">
|
||||
No files...
|
||||
</div>
|
||||
<?php
|
||||
endif;
|
||||
?>
|
||||
</div>
|
||||
</section>
|
||||
|
||||
<script>
|
||||
async function uploadFile() {
|
||||
|
||||
@@ -3,8 +3,10 @@
|
||||
use Plugi\Setting;
|
||||
|
||||
?>
|
||||
<div class="overflow-x-auto">
|
||||
<table class="table table-zebra">
|
||||
<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]">
|
||||
<tbody>
|
||||
<tr>
|
||||
<th class="w-36 md:w-60">PHP Version</th>
|
||||
@@ -55,11 +57,13 @@ use Plugi\Setting;
|
||||
endforeach;
|
||||
if ($actionNeeded) :
|
||||
?>
|
||||
<button class="btn" type="submit">Update</button>
|
||||
<button class="btn btn-primary" type="submit">Update</button>
|
||||
<?php
|
||||
else :
|
||||
?>
|
||||
<div>Database is up-to-date. <span class="hidden md:inline text-gray-400">(<?= $phpb_db->getDBDefinitionHash() ?>)</span></div>
|
||||
<div class="alert alert-success" role="status">
|
||||
<span>Database is up-to-date. <span class="hidden md:inline text-base-content/60">(<?= $phpb_db->getDBDefinitionHash() ?>)</span></span>
|
||||
</div>
|
||||
<?php
|
||||
endif;
|
||||
?>
|
||||
@@ -70,7 +74,7 @@ use Plugi\Setting;
|
||||
<tr>
|
||||
<th class="align-top">Installed extensions</th>
|
||||
<td x-data="{show: false}">
|
||||
<ul>
|
||||
<ul class="list-disc space-y-1 pl-5">
|
||||
<?php
|
||||
foreach (\Plugi\Extensions::getConfigs() as $ext) :
|
||||
?>
|
||||
@@ -82,9 +86,9 @@ use Plugi\Setting;
|
||||
?>
|
||||
</ul>
|
||||
<div>
|
||||
<button @click="show = !show" class="btn btn-xs btn-outline" x-text="show ? 'hide' : 'show config'"></button>
|
||||
<button type="button" @click="show = !show" class="btn btn-xs btn-outline" :aria-expanded="show" x-text="show ? 'hide' : 'show config'"></button>
|
||||
</div>
|
||||
<pre class="mt-4" x-show="show"><?php
|
||||
<pre class="mt-4 max-h-96 overflow-auto rounded-box bg-base-200 p-4 text-xs" x-show="show"><?php
|
||||
print_r(\Plugi\Extensions::getConfigs());
|
||||
?></pre>
|
||||
</td>
|
||||
@@ -93,9 +97,9 @@ print_r(\Plugi\Extensions::getConfigs());
|
||||
<th class="align-top">Config</th>
|
||||
<td x-data="{show: false}">
|
||||
<div>
|
||||
<button @click="show = !show" class="btn btn-xs btn-outline" x-text="show ? 'hide' : 'show'"></button>
|
||||
<button type="button" @click="show = !show" class="btn btn-xs btn-outline" :aria-expanded="show" x-text="show ? 'hide' : 'show'"></button>
|
||||
</div>
|
||||
<pre class="mt-4" x-show="show"><?php
|
||||
<pre class="mt-4 max-h-96 overflow-auto rounded-box bg-base-200 p-4 text-xs" x-show="show"><?php
|
||||
print_r(phpb_config());
|
||||
?></pre>
|
||||
</td>
|
||||
@@ -104,9 +108,9 @@ print_r(phpb_config());
|
||||
<th class="align-top">Environment</th>
|
||||
<td x-data="{show: false}">
|
||||
<div class="">
|
||||
<button @click="show = !show" class="btn btn-xs btn-outline" x-text="show ? 'hide' : 'show'"></button>
|
||||
<button type="button" @click="show = !show" class="btn btn-xs btn-outline" :aria-expanded="show" x-text="show ? 'hide' : 'show'"></button>
|
||||
</div>
|
||||
<pre class="mt-4" x-show="show"><?php
|
||||
<pre class="mt-4 max-h-96 overflow-auto rounded-box bg-base-200 p-4 text-xs" x-show="show"><?php
|
||||
print_r([
|
||||
'STAGE'=>$_ENV['STAGE'],
|
||||
'BASE_URL'=>$_ENV['BASE_URL']
|
||||
@@ -115,5 +119,7 @@ print_r([
|
||||
</td>
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
</table>
|
||||
</div>
|
||||
</div>
|
||||
</section>
|
||||
|
||||
@@ -10,81 +10,87 @@ $pages = $pageRepository->getAll();
|
||||
<form method="post" action="<?= phpb_url('website_manager', ['route' => 'menus', 'action' => 'update', 'tab' => 'menus']) ?>">
|
||||
<?php phpb_csrf_field(); ?>
|
||||
|
||||
<div class="main-spacing" x-data="{menus: <?= phpb_e($menusJson) ?>, pages: <?= phpb_e($menuPagesJson) ?>}">
|
||||
<div class="space-y-6" x-data="{menus: <?= phpb_e($menusJson) ?>, pages: <?= phpb_e($menuPagesJson) ?>}">
|
||||
|
||||
<div class="text-center mb-8">
|
||||
<div class="flex justify-end">
|
||||
<button type="button" @click.stop.prevent="menus.push({name:'New Menu',pages:[]})" class="btn btn-primary">
|
||||
<?= phpb_trans('website-manager.create-menu'); ?>
|
||||
</button>
|
||||
</div>
|
||||
|
||||
<div class="flex flex-col gap-12">
|
||||
<div class="flex flex-col gap-6">
|
||||
<template x-for="(menu, menuIndex) in menus">
|
||||
<div class="">
|
||||
<div class="px-6 mb-4 flex justify-between" x-data="{ edit: false }">
|
||||
<input type="text" x-model="menu.name" class="input input-bordered w-full max-w-xs" x-show="edit" >
|
||||
<div class="text-2xl font-bold" x-text="menu.name" x-show="!edit"></div>
|
||||
<div>
|
||||
<a href="javascript:void(0)" class="btn btn-square btn-sm" @click="edit = !edit">
|
||||
<i class=" text-2xl ph ph-pencil-line"></i>
|
||||
</a>
|
||||
<a href="javascript:void(0)" class="btn btn-square btn-sm" @click="if (confirm(`<?= phpb_trans('website-manager.delete-menu') ?> ${menu.name}`) === true) arraymove(menus,menuIndex);">
|
||||
<i class=" text-2xl ph ph-trash"></i>
|
||||
</a>
|
||||
<div class="dropdown dropdown-end dropdown-hover" x-show="(menu.pages.length < pages.length)">
|
||||
<label tabindex="0" class="btn btn-square btn-sm">
|
||||
<i class=" text-2xl ph ph-list-plus"></i>
|
||||
</label>
|
||||
<ul tabindex="0" class="dropdown-content menu p-2 shadow bg-base-100 rounded-box w-52 z-10">
|
||||
<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)">
|
||||
<span x-text="page.id" class="mr-3 font-bold"></span>
|
||||
<span x-text="page.title"></span>
|
||||
</a>
|
||||
</li>
|
||||
</template>
|
||||
</ul>
|
||||
<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 }">
|
||||
<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>
|
||||
<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>
|
||||
</button>
|
||||
<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">
|
||||
<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">
|
||||
<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)">
|
||||
<span x-text="page.id" class="mr-3 font-bold"></span>
|
||||
<span x-text="page.title"></span>
|
||||
</a>
|
||||
</li>
|
||||
</template>
|
||||
</ul>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<input type="hidden" :name="menu.name" :value="menu.pages.map(p=>p.id).join(',')">
|
||||
<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>
|
||||
<tr>
|
||||
<th class="w-16">ID</th>
|
||||
<th class="w-5/12"><?= phpb_trans('website-manager.name') ?></th>
|
||||
<th><?= phpb_trans('website-manager.route') ?></th>
|
||||
<th class="w-36"><?= phpb_trans('website-manager.actions') ?></th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
<template x-for="(page, index) in menu.pages">
|
||||
<tr>
|
||||
<th x-text="page.id"></th>
|
||||
<td class="font-medium" x-text="page.title"></td>
|
||||
<td x-text="page.route"></td>
|
||||
<td>
|
||||
<div class="flex items-center gap-1">
|
||||
<button type="button" @click.stop.prevent="arraymove(menu.pages,index,index-1)" class="btn btn-ghost btn-square btn-sm" :disabled="index === 0" aria-label="Move page up" title="Move page up">
|
||||
<i class="ph-duotone ph-arrow-fat-up text-xl" aria-hidden="true"></i>
|
||||
</button>
|
||||
<button type="button" @click.stop.prevent="arraymove(menu.pages,index,index+1)" class="btn btn-ghost btn-square btn-sm" :disabled="index === menu.pages.length - 1" aria-label="Move page down" title="Move page down">
|
||||
<i class="ph-duotone ph-arrow-fat-down text-xl" aria-hidden="true"></i>
|
||||
</button>
|
||||
<button type="button" @click.stop.prevent="arraymove(menu.pages,index)" class="btn btn-error btn-square btn-sm" aria-label="Remove page" title="Remove page">
|
||||
<i class="ph-duotone ph-trash text-xl" aria-hidden="true"></i>
|
||||
</button>
|
||||
</div>
|
||||
</td>
|
||||
</tr>
|
||||
</template>
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
</div>
|
||||
<input type="hidden" :name="menu.name" :value="menu.pages.map(p=>p.id).join(',')">
|
||||
<table class="table table-zebra w-full" x-show="menu.pages.length > 0">
|
||||
<thead>
|
||||
<tr>
|
||||
<th class="w-5">ID</th>
|
||||
<th class="w-5/12"><?= phpb_trans('website-manager.name') ?></th>
|
||||
<th><?= phpb_trans('website-manager.route') ?></th>
|
||||
<th class="w-36"><?= phpb_trans('website-manager.actions') ?></th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
<template x-for="(page, index) in menu.pages">
|
||||
<tr>
|
||||
<th x-text="page.id"></th>
|
||||
<td x-text="page.title"></td>
|
||||
<td x-text="page.route"></td>
|
||||
<td>
|
||||
<button type="button" @click.stop.prevent="arraymove(menu.pages,index,index-1)" class="btn btn-outline btn-circle btn-sm" :disabled="index === 0">
|
||||
<i class="ph-duotone ph-arrow-fat-up text-xl"></i>
|
||||
</button>
|
||||
<button type="button" @click.stop.prevent="arraymove(menu.pages,index,index+1)" class="btn btn-outline btn-circle btn-sm" :disabled="index === menu.pages.length - 1">
|
||||
<i class="ph-duotone ph-arrow-fat-down text-xl"></i>
|
||||
</button>
|
||||
<button @click.stop.prevent="arraymove(menu.pages,index)" class="btn btn-outline btn-circle btn-error btn-sm">
|
||||
<i class="ph-duotone ph-trash text-xl"></i>
|
||||
</button>
|
||||
</td>
|
||||
</tr>
|
||||
</template>
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
</section>
|
||||
</template>
|
||||
</div>
|
||||
|
||||
<div class="text-center mt-8">
|
||||
<button class="btn btn-primary">
|
||||
<div class="flex justify-end">
|
||||
<button type="submit" class="btn btn-primary">
|
||||
<?= phpb_trans('website-manager.save-menus'); ?>
|
||||
</button>
|
||||
</div>
|
||||
|
||||
@@ -1,54 +1,55 @@
|
||||
<table class="table table-zebra w-full">
|
||||
<thead>
|
||||
<tr>
|
||||
<th class="w-5">ID</th>
|
||||
<th><?= phpb_trans('website-manager.name') ?></th>
|
||||
<th><?= phpb_trans('website-manager.route') ?></th>
|
||||
<th class="w-36 md:w-44"><?= phpb_trans('website-manager.actions') ?></th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
<?php
|
||||
foreach ($pages as $page):
|
||||
?>
|
||||
<tr>
|
||||
<td>
|
||||
<?= phpb_e($page->getId()) ?>
|
||||
</td>
|
||||
<td>
|
||||
<?= phpb_e($page->getName()) ?>
|
||||
</td>
|
||||
<td>
|
||||
<div class="hidden pl-4 pl-8"></div>
|
||||
<div class="pl-<?= phpb_e((count(explode('/', $page->getRoute()))-2)*4) ?>">
|
||||
<?= phpb_e($page->getRoute()) ?>
|
||||
</div>
|
||||
<div class="space-y-6">
|
||||
<div class="overflow-x-auto rounded-box border border-base-300">
|
||||
<table class="table table-zebra w-full min-w-[48rem]">
|
||||
<thead>
|
||||
<tr>
|
||||
<th class="w-16">ID</th>
|
||||
<th><?= phpb_trans('website-manager.name') ?></th>
|
||||
<th><?= phpb_trans('website-manager.route') ?></th>
|
||||
<th class="w-44"><?= phpb_trans('website-manager.actions') ?></th>
|
||||
</tr>
|
||||
</thead>
|
||||
<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>
|
||||
</tr>
|
||||
<?php endif; ?>
|
||||
<?php foreach ($pages as $page): ?>
|
||||
<tr>
|
||||
<td><?= phpb_e($page->getId()) ?></td>
|
||||
<td class="font-medium"><?= phpb_e($page->getName()) ?></td>
|
||||
<td>
|
||||
<div class="hidden pl-4 pl-8"></div>
|
||||
<div class="pl-<?= phpb_e((count(explode('/', $page->getRoute()))-2)*4) ?>">
|
||||
<?= phpb_e($page->getRoute()) ?>
|
||||
</div>
|
||||
</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' : '' ?>">
|
||||
<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')) ?>">
|
||||
<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">
|
||||
<i class="text-xl ph-duotone ph-gear" aria-hidden="true"></i>
|
||||
</a>
|
||||
<a href="<?= phpb_url('website_manager', ['route' => 'page_settings', 'action' => 'destroy', 'page' => $page->getId()]) ?>" title="<?= phpb_trans('website-manager.remove') ?>" aria-label="<?= phpb_e(phpb_trans('website-manager.remove')) ?>" class="btn btn-error btn-square btn-sm">
|
||||
<i class="text-xl ph-duotone ph-trash" aria-hidden="true"></i>
|
||||
</a>
|
||||
</div>
|
||||
</td>
|
||||
</tr>
|
||||
<?php endforeach; ?>
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
|
||||
</td>
|
||||
<td class="actions">
|
||||
<a href="<?= phpb_e(phpb_full_url($page->getRoute())) ?>" title="<?= phpb_trans('website-manager.view') ?>" target="_blank" class="btn btn-light btn-outline btn-sm btn-circle <?= $page->get('type') === 'redirect' ? 'btn-disabled' : '' ?>">
|
||||
<i class="text-xl ph-duotone ph-eye"></i>
|
||||
</a>
|
||||
<a href="<?= phpb_url('pagebuilder', ['page' => $page->getId()]) ?>" class="btn btn-primary hidden md:inline-flex btn-sm btn-circle <?= $page->get('type') === 'redirect' ? 'btn-disabled' : '' ?>" title="<?= phpb_trans('website-manager.edit') ?>">
|
||||
<i class="text-xl ph-duotone ph-pencil-line"></i>
|
||||
</a>
|
||||
<a href="<?= phpb_url('website_manager', ['route' => 'page_settings', 'action' => 'edit', 'page' => $page->getId()]) ?>" title="<?= phpb_trans('website-manager.settings') ?>" class="btn btn-secondary btn-sm btn-circle">
|
||||
<i class="text-xl ph-duotone ph-gear"></i>
|
||||
</a>
|
||||
<a href="<?= phpb_url('website_manager', ['route' => 'page_settings', 'action' => 'destroy', 'page' => $page->getId()]) ?>" title="<?= phpb_trans('website-manager.remove') ?>" class="btn btn-error btn-sm btn-circle">
|
||||
<i class="text-xl ph-duotone ph-trash"></i>
|
||||
</a>
|
||||
</td>
|
||||
</tr>
|
||||
<?php
|
||||
endforeach;
|
||||
?>
|
||||
</tbody>
|
||||
</table>
|
||||
|
||||
|
||||
<div class="text-center mt-8">
|
||||
<a href="<?= phpb_url('website_manager', ['route' => 'page_settings', 'action' => 'create']) ?>" class="btn btn-primary">
|
||||
<?= phpb_trans('website-manager.add-new-page') ?>
|
||||
</a>
|
||||
<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>
|
||||
|
||||
@@ -7,24 +7,23 @@ $settingIns = phpb_instance('setting');
|
||||
|
||||
<form method="post" action="<?= phpb_url('website_manager', ['route' => 'settings', 'action' => 'update', 'tab' => 'settings']) ?>">
|
||||
<?php phpb_csrf_field(); ?>
|
||||
<div class="" x-data="{activeTab: 0, tabs: ['Website','Language','Theme','Extensions']}">
|
||||
<div class="tabs mb-6">
|
||||
<div class="border-b border-base-300 grow"></div>
|
||||
<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">
|
||||
<template x-for="(tab, index) in tabs">
|
||||
<a class="tab tab-lifted" x-text="tab" @click="activeTab = index" :class="activeTab === index ? 'tab-active' : ''"></a>
|
||||
<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>
|
||||
</template>
|
||||
<div class="border-b border-base-300 grow"></div>
|
||||
</div>
|
||||
<div class="" x-show="activeTab === 0">
|
||||
<div id="settings-panel-0" class="space-y-6" role="tabpanel" aria-labelledby="settings-tab-0" x-show="activeTab === 0">
|
||||
</div>
|
||||
<div class="" x-show="activeTab === 1">
|
||||
<div class="w-full mb-6">
|
||||
<div class="label-text text-left"><?= phpb_trans('website-manager.website-languages') ?></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">
|
||||
<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="label cursor-pointer">
|
||||
<label class="flex cursor-pointer items-center justify-between gap-4 rounded-box border border-base-300 px-4 py-3">
|
||||
<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>
|
||||
@@ -32,64 +31,67 @@ $settingIns = phpb_instance('setting');
|
||||
<?php
|
||||
endforeach;
|
||||
?>
|
||||
</div>
|
||||
<div class="form-control w-full mb-6">
|
||||
<label for="admin_language" class="label">
|
||||
<span class="label-text"><?= phpb_trans('website-manager.admin-language') ?> <strong><?= phpb_current_language() ?></strong></span>
|
||||
</label>
|
||||
<select class="select select-bordered w-full" id="admin_language" name="admin_language" title="<?= phpb_trans('website-manager.languages-selector-placeholder') ?>" required>
|
||||
<?php
|
||||
$beLanguages = ['de', 'en', 'sv'];
|
||||
foreach ($beLanguages as $locale):
|
||||
</div>
|
||||
</section>
|
||||
<section class="max-w-2xl rounded-box border border-base-300 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>
|
||||
</label>
|
||||
<select class="select select-bordered w-full" id="admin_language" name="admin_language" title="<?= phpb_trans('website-manager.languages-selector-placeholder') ?>" required>
|
||||
<?php
|
||||
$beLanguages = ['de', 'en', 'sv'];
|
||||
foreach ($beLanguages as $locale):
|
||||
?>
|
||||
<option value="<?= phpb_e($locale) ?>" <?= phpb_e(phpb_config('general.language') === $locale ? 'selected' : '') ?>><?= phpb_e(phpb_trans('languages.'.$locale)) ?></option>
|
||||
<?php
|
||||
endforeach;
|
||||
?>
|
||||
<option value="<?= phpb_e($locale) ?>" <?= phpb_e(phpb_config('general.language') === $locale ? 'selected' : '') ?>><?= phpb_e(phpb_trans('languages.'.$locale)) ?></option>
|
||||
</select>
|
||||
</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 class="form-control w-full">
|
||||
<label for="selected_theme" class="label">
|
||||
<span class="label-text"><?= phpb_trans('website-manager.selected-theme') ?></span>
|
||||
</label>
|
||||
<select class="select select-bordered w-full" id="selected_theme" name="selected_theme" title="<?= phpb_trans('website-manager.languages-selector-placeholder') ?>" required>
|
||||
<?php
|
||||
$themes = phpb_themes();
|
||||
foreach ($themes as $theme => $themeConfig):
|
||||
?>
|
||||
<option value="<?= phpb_e($theme) ?>" <?= phpb_e(phpb_config('theme.active_theme') === $theme ? 'selected' : '') ?>><?= phpb_e($themeConfig['title']) ?></option>
|
||||
<?php
|
||||
endforeach;
|
||||
?>
|
||||
</select>
|
||||
</div>
|
||||
</select>
|
||||
</div>
|
||||
</section>
|
||||
</div>
|
||||
<div class="" x-show="activeTab === 2">
|
||||
<div class="form-control w-full mb-6">
|
||||
<label for="selected_theme" class="label">
|
||||
<span class="label-text"><?= phpb_trans('website-manager.selected-theme') ?></span>
|
||||
</label>
|
||||
<select class="select select-bordered w-full" id="selected_theme" name="selected_theme" title="<?= phpb_trans('website-manager.languages-selector-placeholder') ?>" required>
|
||||
<?php
|
||||
$themes = phpb_themes();
|
||||
foreach ($themes as $theme => $themeConfig):
|
||||
?>
|
||||
<option value="<?= phpb_e($theme) ?>" <?= phpb_e(phpb_config('theme.active_theme') === $theme ? 'selected' : '') ?>><?= phpb_e($themeConfig['title']) ?></option>
|
||||
<?php
|
||||
endforeach;
|
||||
?>
|
||||
</select>
|
||||
</div>
|
||||
</div>
|
||||
<div class="" x-show="activeTab === 3">
|
||||
<div class="flex flex-col gap-6">
|
||||
<div id="settings-panel-3" class="space-y-6" role="tabpanel" aria-labelledby="settings-tab-3" x-show="activeTab === 3">
|
||||
<div class="flex flex-col gap-4">
|
||||
<?php
|
||||
foreach (Extensions::getConfigs() as $extKey => $config):
|
||||
if(count(Extensions::getSettings($extKey)) === 0){
|
||||
continue;
|
||||
}
|
||||
?>
|
||||
<details class="collapse collapse-plus bg-base-200">
|
||||
<summary class="collapse-title text-xl font-medium"><?= phpb_e($config['title']) ?></summary>
|
||||
<details class="collapse collapse-plus 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="">
|
||||
<div class="space-y-4">
|
||||
<?php
|
||||
foreach (Extensions::getSettings($extKey) as $setting):
|
||||
?>
|
||||
<?php
|
||||
if ($setting['type'] === 'text'):
|
||||
?>
|
||||
<div class="form-control w-full">
|
||||
<label class="label">
|
||||
<span class="label-text"><?= phpb_e($setting['label'] ?: $setting['name']) ?></span>
|
||||
</label>
|
||||
<label class="form-control w-full gap-2">
|
||||
<span class="label-text"><?= phpb_e($setting['label'] ?: $setting['name']) ?></span>
|
||||
<input type="text" name="<?= phpb_e($setting['key']) ?>" value="<?= phpb_e($setting['value']) ?>" class="input input-bordered w-full" />
|
||||
</div>
|
||||
</label>
|
||||
<?php
|
||||
endif;
|
||||
?>
|
||||
@@ -100,7 +102,7 @@ $settingIns = phpb_instance('setting');
|
||||
<label class="label cursor-pointer">
|
||||
<span class="label-text"><?= phpb_e($setting['label'] ?: $setting['name']) ?></span>
|
||||
<input type='hidden' :value="state" name="<?= phpb_e($setting['key']) ?>">
|
||||
<input type="checkbox" class="toggle" x-model="state" />
|
||||
<input type="checkbox" class="toggle" x-model="state" />
|
||||
</label>
|
||||
</div>
|
||||
<?php
|
||||
@@ -117,8 +119,8 @@ $settingIns = phpb_instance('setting');
|
||||
?>
|
||||
</div>
|
||||
</div>
|
||||
<div class="text-center mt-8">
|
||||
<button class="btn btn-primary ">
|
||||
<div class="flex justify-end border-t border-base-300 pt-6">
|
||||
<button type="submit" class="btn btn-primary">
|
||||
<?= phpb_trans('website-manager.save-settings'); ?>
|
||||
</button>
|
||||
</div>
|
||||
|
||||
@@ -1,10 +1,16 @@
|
||||
<div id="welcome-page">
|
||||
|
||||
<h1 class="text-center">Welcome to Plugi Page Builder</h1>
|
||||
|
||||
<div class="text-center intro-links">
|
||||
<a href="<?= phpb_url('website_manager') ?>">Get started</a>
|
||||
<a href="https://github.com/deepDiverPaul/plugi" target="_blank"><i class="fab fa-github"></i> Visit GitHub</a>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
<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">
|
||||
<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>
|
||||
</div>
|
||||
<div class="flex 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
|
||||
</a>
|
||||
</div>
|
||||
</div>
|
||||
</section>
|
||||
</main>
|
||||
|
||||
Reference in New Issue
Block a user