asdsa
This commit is contained in:
20
partials/landingpage/accountsetup/accountsetup_config.php
Normal file
20
partials/landingpage/accountsetup/accountsetup_config.php
Normal file
@@ -0,0 +1,20 @@
|
||||
<?php
|
||||
$appBaseUrl = $GLOBALS['app_base_url'] ?? '';
|
||||
|
||||
$defaultNavLinks = [
|
||||
['id' => 'dashboard', 'label' => 'Dashboard', 'href' => $appBaseUrl . '/admin/dashboard.php'],
|
||||
['id' => 'settings', 'label' => 'Administration','href' => $appBaseUrl . '/admin/settings.php'],
|
||||
['id' => 'bridge', 'label' => 'Bridge Setup', 'href' => $appBaseUrl . '/admin/bridge.php'],
|
||||
['id' => 'profile', 'label' => 'Mein Konto', 'href' => $appBaseUrl . '/admin/profile.php'],
|
||||
];
|
||||
|
||||
if (empty($navLinks)) {
|
||||
$navLinks = $defaultNavLinks;
|
||||
}
|
||||
|
||||
$layoutSharedCss = $layoutSharedCss ?? [];
|
||||
if (!is_array($layoutSharedCss)) {
|
||||
$layoutSharedCss = [$layoutSharedCss];
|
||||
}
|
||||
$layoutSharedCss[] = '/assets/css/accountsetup.css';
|
||||
$layoutSharedCss = array_values(array_unique(array_filter($layoutSharedCss)));
|
||||
140
partials/landingpage/accountsetup/bridge.php
Normal file
140
partials/landingpage/accountsetup/bridge.php
Normal file
@@ -0,0 +1,140 @@
|
||||
<?php
|
||||
$pageTitle = 'Email Template System – Bridge Setup';
|
||||
$pageId = 'bridge-setup';
|
||||
$navActive = 'bridge';
|
||||
require __DIR__ . '/accountsetup_config.php';
|
||||
require dirname(__DIR__) . '/../structure/layout_start.php';
|
||||
?>
|
||||
<main class="max-w-4xl mx-auto p-4 md:p-6 flex-1 w-full space-y-6">
|
||||
<section class="section-card">
|
||||
<h4>Bridge-Datei vorbereiten</h4>
|
||||
<p class="text-sm text-slate-600 mb-3">
|
||||
Diese Angaben werden nur verwendet, um die <strong>emailtemplate_bridge.php</strong> zu generieren. Das EmailTemplate-System selbst behält Zugriff auf alle Tabellen; die hier definierten Whitelists greifen ausschließlich in der Bridge-Datei.
|
||||
</p>
|
||||
<form id="bridgeSetupForm" class="space-y-4">
|
||||
<div>
|
||||
<label class="block text-sm text-slate-600">Tabellen-Whitelist (optional)</label>
|
||||
<textarea name="tables" class="input mt-1" rows="3" placeholder="z.B. customers, orders"></textarea>
|
||||
<p class="text-xs text-slate-500 mt-1">Kommagetrennt oder je Zeile eine Tabelle. Leer lassen = keine Einschränkung.</p>
|
||||
<div id="selectedTables" class="flex flex-wrap gap-2 text-sm text-slate-600 mt-2">Noch keine Tabellen angegeben.</div>
|
||||
</div>
|
||||
|
||||
<fieldset class="border border-slate-200 rounded-xl p-4">
|
||||
<legend class="px-2 text-sm font-semibold">Datenbankquelle</legend>
|
||||
<div class="flex flex-wrap gap-4 text-sm text-slate-600 mb-3">
|
||||
<label class="inline-flex items-center gap-2">
|
||||
<input type="radio" name="db_mode" value="direct" checked> Direkte Angaben (Host, DB, Benutzer …)
|
||||
</label>
|
||||
<label class="inline-flex items-center gap-2">
|
||||
<input type="radio" name="db_mode" value="config"> Aus bestehender Konfigurationsdatei laden
|
||||
</label>
|
||||
</div>
|
||||
|
||||
<div id="directFields" class="grid md:grid-cols-2 gap-3">
|
||||
<label class="block text-sm text-slate-600">Server / Host
|
||||
<input type="text" name="direct_host" class="input mt-1" placeholder="127.0.0.1">
|
||||
</label>
|
||||
<label class="block text-sm text-slate-600">Port
|
||||
<input type="number" name="direct_port" class="input mt-1" placeholder="3306">
|
||||
</label>
|
||||
<label class="block text-sm text-slate-600">Datenbankname
|
||||
<input type="text" name="direct_database" class="input mt-1" placeholder="kunden_db">
|
||||
</label>
|
||||
<label class="block text-sm text-slate-600">Zeichensatz
|
||||
<input type="text" name="direct_charset" class="input mt-1" value="utf8mb4">
|
||||
</label>
|
||||
<label class="block text-sm text-slate-600">Benutzername
|
||||
<input type="text" name="direct_user" class="input mt-1" placeholder="db_user">
|
||||
</label>
|
||||
<label class="block text-sm text-slate-600">Passwort
|
||||
<input type="text" name="direct_password" class="input mt-1" placeholder="••••">
|
||||
</label>
|
||||
</div>
|
||||
|
||||
<div id="configFields" class="hidden space-y-3">
|
||||
<div>
|
||||
<label class="block text-sm text-slate-600">Pfad zur Konfigurationsdatei</label>
|
||||
<input type="text" name="config_file" class="input mt-1" placeholder="../config/database.php">
|
||||
<p class="text-xs text-slate-500 mt-1">Relativ zur Bridge-Datei oder absolut. Die Datei sollte ein Array oder Objekt mit den Zugangsdaten liefern.</p>
|
||||
<button type="button" id="btn-config-example" class="btn mt-2 text-xs" data-role="admin">Beispiel: Array-Mapping</button>
|
||||
</div>
|
||||
<div>
|
||||
<label class="block text-sm text-slate-600">Basis-Pfad im Array (optional)</label>
|
||||
<input type="text" name="config_base" class="input mt-1" placeholder="database.connections.mysql">
|
||||
<p class="text-xs text-slate-500 mt-1">Dot-Notation, um in verschachtelte Arrays zu springen.</p>
|
||||
</div>
|
||||
<div class="grid md:grid-cols-2 gap-3">
|
||||
<label class="block text-sm text-slate-600">Host-Key
|
||||
<input type="text" name="config_host_key" class="input mt-1" placeholder="host">
|
||||
</label>
|
||||
<label class="block text-sm text-slate-600">Port-Key
|
||||
<input type="text" name="config_port_key" class="input mt-1" placeholder="port">
|
||||
</label>
|
||||
<label class="block text-sm text-slate-600">DB-Name-Key
|
||||
<input type="text" name="config_database_key" class="input mt-1" placeholder="database">
|
||||
</label>
|
||||
<label class="block text-sm text-slate-600">Charset-Key
|
||||
<input type="text" name="config_charset_key" class="input mt-1" placeholder="charset">
|
||||
</label>
|
||||
<label class="block text-sm text-slate-600">User-Key
|
||||
<input type="text" name="config_user_key" class="input mt-1" placeholder="username">
|
||||
</label>
|
||||
<label class="block text-sm text-slate-600">Passwort-Key
|
||||
<input type="text" name="config_password_key" class="input mt-1" placeholder="password">
|
||||
</label>
|
||||
</div>
|
||||
<p class="text-xs text-slate-500">Alle Keys nutzen Dot-Notation relativ zum Basis-Pfad.</p>
|
||||
</div>
|
||||
</fieldset>
|
||||
|
||||
<div class="flex flex-wrap gap-2">
|
||||
<button type="button" id="btn-load-remote" class="btn" data-role="admin">Tabellen vom Bridge-Endpunkt laden</button>
|
||||
<button type="button" id="btn-import-bridge" class="btn" data-role="admin">Bridge-Datei importieren …</button>
|
||||
<input type="file" id="bridgeImportInput" accept="application/x-php,text/plain" class="hidden" />
|
||||
<button type="submit" class="btn">Bridge-Setup speichern</button>
|
||||
</div>
|
||||
<p class="text-xs text-slate-500">Der Import liest nur den automatisch generierten Kommentarblock aus einer Bridge-Datei.</p>
|
||||
<div id="setupStatus" class="text-xs text-slate-500">Noch nicht gespeichert.</div>
|
||||
</form>
|
||||
</section>
|
||||
</main>
|
||||
|
||||
<div id="toast-root"></div>
|
||||
|
||||
<dialog id="configExampleDialog" class="rounded-xl max-w-2xl w-[90vw]">
|
||||
<form method="dialog" class="space-y-3">
|
||||
<h3 class="text-lg font-semibold">Beispiel: Mapping einer Config-Datei</h3>
|
||||
<p class="text-sm text-slate-600">Angenommen, deine <code>../config/database.php</code> liefert folgendes Array:</p>
|
||||
<pre class="bg-slate-900 text-slate-100 text-xs p-3 rounded-lg overflow-auto"><?php echo htmlspecialchars(<<<'PHP'
|
||||
<?php
|
||||
return [
|
||||
'database' => [
|
||||
'connections' => [
|
||||
'default' => [
|
||||
'host' => '127.0.0.1',
|
||||
'port' => 3306,
|
||||
'database' => 'kunden_db',
|
||||
'username' => 'dbuser',
|
||||
'password' => 'secret',
|
||||
'charset' => 'utf8mb4',
|
||||
],
|
||||
],
|
||||
],
|
||||
];
|
||||
PHP, ENT_QUOTES); ?></pre>
|
||||
<p class="text-sm text-slate-600">Dann trägst du ein:</p>
|
||||
<ul class="text-sm text-slate-700 list-disc ps-5">
|
||||
<li><strong>Pfad zur Konfigurationsdatei:</strong> <code>../config/database.php</code></li>
|
||||
<li><strong>Basis-Pfad:</strong> <code>database.connections.default</code></li>
|
||||
<li><strong>Host-/Port-/DB-/User-/Pass-/Charset-Key:</strong> jeweils <code>host</code>, <code>port</code>, <code>database</code>, <code>username</code>, <code>password</code>, <code>charset</code></li>
|
||||
</ul>
|
||||
<p class="text-sm text-slate-600">Die Bridge liest dann automatisch die Werte aus diesem Array und baut daraus den DSN.</p>
|
||||
<div class="text-right">
|
||||
<button type="submit" class="btn">Verstanden</button>
|
||||
</div>
|
||||
</form>
|
||||
</dialog>
|
||||
<?php
|
||||
tpl_add_script(app_asset_url('/assets/js/toast.js'));
|
||||
tpl_add_script(app_asset_url('/assets/js/bridge-setup.js'), 'footer', false, false, '', null, true);
|
||||
require dirname(__DIR__) . '/../structure/layout_end.php';
|
||||
61
partials/landingpage/accountsetup/dashboard.php
Normal file
61
partials/landingpage/accountsetup/dashboard.php
Normal file
@@ -0,0 +1,61 @@
|
||||
<?php
|
||||
$pageTitle = 'Email Template System – Dashboard';
|
||||
$pageId = 'dashboard';
|
||||
$navActive = 'dashboard';
|
||||
require __DIR__ . '/accountsetup_config.php';
|
||||
require dirname(__DIR__) . '/../structure/layout_start.php';
|
||||
?>
|
||||
<main class="max-w-5xl mx-auto p-4 md:p-6 flex-1 w-full">
|
||||
<section class="stat-grid" id="dashboardCounts">
|
||||
<div class="stat-card">
|
||||
<h4>Templates</h4>
|
||||
<strong id="count-templates">–</strong>
|
||||
</div>
|
||||
<div class="stat-card">
|
||||
<h4>Sections</h4>
|
||||
<strong id="count-sections">–</strong>
|
||||
</div>
|
||||
<div class="stat-card">
|
||||
<h4>Blocks</h4>
|
||||
<strong id="count-blocks">–</strong>
|
||||
</div>
|
||||
<div class="stat-card">
|
||||
<h4>Snippets</h4>
|
||||
<strong id="count-snippets">–</strong>
|
||||
</div>
|
||||
</section>
|
||||
|
||||
<section class="section-card">
|
||||
<div class="flex items-center justify-between mb-3">
|
||||
<h3 class="font-semibold text-base text-slate-900">Aktivität</h3>
|
||||
<button type="button" class="btn" id="btn-refresh">Aktualisieren</button>
|
||||
</div>
|
||||
<ul id="activityList" class="space-y-2 text-sm text-slate-600"></ul>
|
||||
</section>
|
||||
|
||||
<section class="section-card">
|
||||
<div class="flex items-center justify-between mb-4">
|
||||
<h3 class="font-semibold text-base text-slate-900">Nutzung & Speicher</h3>
|
||||
<span class="text-xs text-slate-500">Letzte 30 Tage</span>
|
||||
</div>
|
||||
<div class="overflow-auto">
|
||||
<table class="usage-table" id="usageTable">
|
||||
<thead>
|
||||
<tr>
|
||||
<th>Datum</th>
|
||||
<th>Aktionen</th>
|
||||
<th>Templates veröffentlicht</th>
|
||||
<th>Versandtests</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody></tbody>
|
||||
</table>
|
||||
</div>
|
||||
</section>
|
||||
</main>
|
||||
|
||||
<div id="toast-root"></div>
|
||||
<?php
|
||||
tpl_add_script(app_asset_url('/assets/js/toast.js'));
|
||||
tpl_add_script(app_asset_url('/assets/js/dashboard.js'), 'footer', false, false, '', null, true);
|
||||
require dirname(__DIR__) . '/../structure/layout_end.php';
|
||||
53
partials/landingpage/accountsetup/profile.php
Normal file
53
partials/landingpage/accountsetup/profile.php
Normal file
@@ -0,0 +1,53 @@
|
||||
<?php
|
||||
$pageTitle = 'Email Template System – Mein Konto';
|
||||
$pageId = 'account';
|
||||
$navActive = 'profile';
|
||||
require __DIR__ . '/accountsetup_config.php';
|
||||
require dirname(__DIR__) . '/../structure/layout_start.php';
|
||||
?>
|
||||
<main class="max-w-5xl mx-auto p-4 md:p-6 flex-1 w-full">
|
||||
<div class="user-tabs">
|
||||
<button type="button" data-user-tab="profile" class="btn bg-sky-50 text-sky-700 flex-1">Profil</button>
|
||||
<button type="button" data-user-tab="security" class="btn flex-1">Passwort</button>
|
||||
</div>
|
||||
|
||||
<section data-user-panel="profile" class="section-card">
|
||||
<h4>Profil</h4>
|
||||
<form id="profileForm" class="space-y-3">
|
||||
<label class="block text-sm text-slate-600">Name
|
||||
<input type="text" id="profile_name" name="name" class="input mt-1" required>
|
||||
</label>
|
||||
<label class="block text-sm text-slate-600">E-Mail
|
||||
<input type="email" id="profile_email" name="email" class="input mt-1" required>
|
||||
</label>
|
||||
<div class="flex justify-end">
|
||||
<button type="submit" class="btn">Speichern</button>
|
||||
</div>
|
||||
</form>
|
||||
</section>
|
||||
|
||||
<section data-user-panel="security" class="section-card hidden">
|
||||
<h4>Passwort ändern</h4>
|
||||
<form id="passwordForm" class="space-y-3">
|
||||
<label class="block text-sm text-slate-600">Aktuelles Passwort
|
||||
<input type="password" name="current_password" class="input mt-1" required>
|
||||
</label>
|
||||
<label class="block text-sm text-slate-600">Neues Passwort (min. 8 Zeichen)
|
||||
<input type="password" name="new_password" class="input mt-1" required minlength="8">
|
||||
</label>
|
||||
<div class="flex justify-end">
|
||||
<button type="submit" class="btn">Aktualisieren</button>
|
||||
</div>
|
||||
</form>
|
||||
</section>
|
||||
|
||||
<section class="section-card">
|
||||
<p class="text-sm text-slate-600">Teammitglieder, Absender und Integrationen verwaltest du im Bereich <strong>Administration</strong>. Öffne ihn über das Avatar-Menü oben rechts.</p>
|
||||
</section>
|
||||
</main>
|
||||
|
||||
<div id="toast-root"></div>
|
||||
<?php
|
||||
tpl_add_script(app_asset_url('/assets/js/toast.js'));
|
||||
tpl_add_script(app_asset_url('/assets/js/account.js'), 'footer', false, false, '', null, true);
|
||||
require dirname(__DIR__) . '/../structure/layout_end.php';
|
||||
132
partials/landingpage/accountsetup/settings.php
Normal file
132
partials/landingpage/accountsetup/settings.php
Normal file
@@ -0,0 +1,132 @@
|
||||
<?php
|
||||
$pageTitle = 'Email Template System – Administration';
|
||||
$pageId = 'admin';
|
||||
$navActive = 'settings';
|
||||
require __DIR__ . '/accountsetup_config.php';
|
||||
require dirname(__DIR__) . '/../structure/layout_start.php';
|
||||
?>
|
||||
<main class="max-w-5xl mx-auto p-4 md:p-6 flex-1 w-full space-y-6">
|
||||
<section class="section-card" data-role="owner">
|
||||
<div class="flex items-center justify-between mb-3">
|
||||
<h4>Team</h4>
|
||||
<button type="button" id="btn-user-add" class="btn">+ Nutzer</button>
|
||||
</div>
|
||||
<div class="overflow-auto">
|
||||
<table class="team-table" id="teamTable">
|
||||
<thead>
|
||||
<tr><th>Name</th><th>E-Mail</th><th>Rolle</th><th>Status</th><th class="text-right">Aktionen</th></tr>
|
||||
</thead>
|
||||
<tbody></tbody>
|
||||
</table>
|
||||
</div>
|
||||
<form id="userForm" class="space-y-3 mt-4 hidden">
|
||||
<input type="hidden" name="user_id">
|
||||
<label class="block text-sm text-slate-600">Name
|
||||
<input type="text" name="name" class="input mt-1" required>
|
||||
</label>
|
||||
<label class="block text-sm text-slate-600">E-Mail
|
||||
<input type="email" name="email" class="input mt-1" required>
|
||||
</label>
|
||||
<label class="block text-sm text-slate-600">Rolle
|
||||
<select name="role" class="input mt-1">
|
||||
<option value="owner">Owner</option>
|
||||
<option value="admin">Admin</option>
|
||||
<option value="editor">Editor</option>
|
||||
<option value="viewer">Viewer</option>
|
||||
</select>
|
||||
</label>
|
||||
<label class="inline-flex items-center gap-2 text-sm text-slate-600">
|
||||
<input type="checkbox" name="is_active" checked> Aktiv
|
||||
</label>
|
||||
<label class="inline-flex items-center gap-2 text-sm text-slate-600 reset-only hidden">
|
||||
<input type="checkbox" name="reset_password"> Passwort zurücksetzen
|
||||
</label>
|
||||
<div class="flex justify-end gap-2">
|
||||
<button type="button" id="userFormCancel" class="btn">Abbrechen</button>
|
||||
<button type="submit" class="btn">Speichern</button>
|
||||
</div>
|
||||
</form>
|
||||
</section>
|
||||
|
||||
<section class="section-card" data-role="admin">
|
||||
<div class="flex items-center justify-between mb-3">
|
||||
<h4>Absender für Testmails</h4>
|
||||
<button type="button" id="btn-sender-add" class="btn">+ Absender</button>
|
||||
</div>
|
||||
<div class="overflow-auto">
|
||||
<table class="team-table" id="senderTable">
|
||||
<thead>
|
||||
<tr><th>Bezeichnung</th><th>From-Name</th><th>E-Mail</th><th>Reply-To</th><th class="text-right">Aktionen</th></tr>
|
||||
</thead>
|
||||
<tbody></tbody>
|
||||
</table>
|
||||
</div>
|
||||
<form id="senderForm" class="space-y-3 mt-4 hidden">
|
||||
<input type="hidden" name="sender_id">
|
||||
<label class="block text-sm text-slate-600">Bezeichnung
|
||||
<input type="text" name="label" class="input mt-1" placeholder="Interner Name (optional)">
|
||||
</label>
|
||||
<label class="block text-sm text-slate-600">Absender-Name
|
||||
<input type="text" name="from_name" class="input mt-1" placeholder="z.B. Newsletter Team">
|
||||
</label>
|
||||
<label class="block text-sm text-slate-600">Absender-E-Mail
|
||||
<input type="email" name="from_email" class="input mt-1" required placeholder="news@example.com">
|
||||
</label>
|
||||
<label class="block text-sm text-slate-600">Reply-To (optional)
|
||||
<input type="email" name="reply_to" class="input mt-1" placeholder="support@example.com">
|
||||
</label>
|
||||
<div class="flex justify-end gap-2">
|
||||
<button type="button" id="senderFormCancel" class="btn">Abbrechen</button>
|
||||
<button type="submit" class="btn">Speichern</button>
|
||||
</div>
|
||||
</form>
|
||||
</section>
|
||||
|
||||
<section class="section-card" data-role="admin">
|
||||
<h4>Integrationen, Downloads & Tokens</h4>
|
||||
<p class="text-sm text-slate-600 mb-4">Die Dateien enthalten automatisch deine aktuellen Tokens. Nach dem Speichern neuer Tokens bitte die Dateien erneut herunterladen.</p>
|
||||
<form id="settingsForm" class="space-y-3">
|
||||
<label class="block text-sm text-slate-600">Bridge-URL
|
||||
<input type="url" name="bridge_url" class="input mt-1" placeholder="https://domain.tld/emailtemplate_bridge.php">
|
||||
</label>
|
||||
<div>
|
||||
<label class="block text-sm text-slate-600">Bridge Token</label>
|
||||
<div class="flex gap-2 mt-1">
|
||||
<input type="text" name="bridge_token" class="input" readonly>
|
||||
<button type="button" class="btn" data-rotate="bridge">Neu erstellen</button>
|
||||
</div>
|
||||
</div>
|
||||
<div>
|
||||
<label class="block text-sm text-slate-600">Sender Token</label>
|
||||
<div class="flex gap-2 mt-1">
|
||||
<input type="text" name="sender_token" class="input" readonly>
|
||||
<button type="button" class="btn" data-rotate="sender">Neu erstellen</button>
|
||||
</div>
|
||||
</div>
|
||||
<div>
|
||||
<label class="block text-sm text-slate-600">Externer API-Token</label>
|
||||
<div class="flex gap-2 mt-1">
|
||||
<input type="text" name="external_api_token" class="input" readonly>
|
||||
<button type="button" class="btn" data-rotate="external">Neu erstellen</button>
|
||||
</div>
|
||||
</div>
|
||||
<div class="flex flex-col gap-2">
|
||||
<a href="<?= htmlspecialchars($appBaseUrl . '/admin/bridge.php') ?>" class="btn w-max" data-role="admin">Bridge-Setup & Tabellen öffnen</a>
|
||||
<p class="text-xs text-slate-500">Dort kannst du Tabellen-Filter sowie DB-Quellen für die Bridge-Datei konfigurieren.</p>
|
||||
</div>
|
||||
<div class="flex justify-between gap-2 flex-wrap pt-2">
|
||||
<div class="flex gap-2" data-role="admin">
|
||||
<button type="button" class="btn" data-download="bridge">Bridge-Datei</button>
|
||||
<button type="button" class="btn" data-download="sender">Sender-Datei</button>
|
||||
</div>
|
||||
<button type="submit" class="btn ms-auto">Einstellungen speichern</button>
|
||||
</div>
|
||||
</form>
|
||||
</section>
|
||||
</main>
|
||||
|
||||
<div id="toast-root"></div>
|
||||
<?php
|
||||
tpl_add_script(app_asset_url('/assets/js/toast.js'));
|
||||
tpl_add_script(app_asset_url('/assets/js/account.js'), 'footer', false, false, '', null, true);
|
||||
require dirname(__DIR__) . '/../structure/layout_end.php';
|
||||
Reference in New Issue
Block a user