refactor(settings): split admin/settings into hub + per-section subpages
Splits the 755-line monolithic settings page into a tile-based landing hub
and six focused subpages (general, security, email, api, sso, branding),
each with its own form, CSRF scope and POST handler. Each subpage offers
Save / Save & close buttons plus a Cancel/back link to the hub.
Backend (AdminSettingsService, gateways, policies, DB schema) unchanged.
A new settingsSectionMergePost() helper overlays section POSTs onto the
current DB values so partial saves don't wipe unrelated fields (the
service defaults missing keys to 0/empty).
Sub-action files (logo/favicon/tokens/lifecycle) redirect to the matching
subpage, and architecture contracts now check the subpage files instead
of the removed monolithic index.
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
2026-04-24 22:43:12 +02:00
|
|
|
<?php
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* @var bool $canUpdateSettings
|
|
|
|
|
*/
|
|
|
|
|
|
|
|
|
|
use MintyPHP\Session;
|
|
|
|
|
|
|
|
|
|
$canUpdateSettings = (bool) ($canUpdateSettings ?? false);
|
|
|
|
|
$hasLogo = app(\MintyPHP\Service\Branding\BrandingLogoService::class)->hasLogo();
|
|
|
|
|
$hasFavicon = app(\MintyPHP\Service\Branding\BrandingFaviconService::class)->hasFavicon();
|
|
|
|
|
?>
|
|
|
|
|
|
|
|
|
|
<div class="app-details-container">
|
|
|
|
|
<section>
|
|
|
|
|
<?php
|
|
|
|
|
$titlebar = [
|
|
|
|
|
'title' => t('Branding settings'),
|
|
|
|
|
'backHref' => 'admin/settings',
|
|
|
|
|
'backTitle' => t('Cancel'),
|
|
|
|
|
'actions' => [],
|
|
|
|
|
];
|
|
|
|
|
require templatePath('partials/app-details-titlebar.phtml');
|
|
|
|
|
?>
|
|
|
|
|
|
2026-04-25 18:37:55 +02:00
|
|
|
<?php if ($canUpdateSettings): ?>
|
|
|
|
|
<form id="branding-logo-form" method="post" action="admin/settings/logo"
|
|
|
|
|
enctype="multipart/form-data" data-standard-detail-form="1" hidden>
|
|
|
|
|
<?php Session::getCsrfInput(); ?>
|
|
|
|
|
</form>
|
|
|
|
|
<form id="branding-logo-delete-form" method="post" action="admin/settings/logo-delete" hidden>
|
|
|
|
|
<?php Session::getCsrfInput(); ?>
|
|
|
|
|
</form>
|
|
|
|
|
<form id="branding-favicon-form" method="post" action="admin/settings/favicon"
|
|
|
|
|
enctype="multipart/form-data" hidden>
|
|
|
|
|
<?php Session::getCsrfInput(); ?>
|
|
|
|
|
</form>
|
|
|
|
|
<form id="branding-favicon-delete-form" method="post" action="admin/settings/favicon-delete" hidden>
|
|
|
|
|
<?php Session::getCsrfInput(); ?>
|
|
|
|
|
</form>
|
|
|
|
|
<?php endif; ?>
|
|
|
|
|
|
|
|
|
|
<div class="grid">
|
|
|
|
|
<details class="app-details-card" name="settings-branding-logo" data-details-key="settings-branding-logo" open>
|
|
|
|
|
<summary>
|
|
|
|
|
<span class="app-details-card-summary-title"><?php e(t('App logo')); ?></span>
|
|
|
|
|
<span class="app-details-card-summary-meta">
|
|
|
|
|
<span class="badge" data-variant="neutral"><?php e($hasLogo ? t('Configured') : t('Default')); ?></span>
|
|
|
|
|
</span>
|
|
|
|
|
</summary>
|
|
|
|
|
<div class="app-details-card-container">
|
|
|
|
|
<?php
|
|
|
|
|
$fileUpload = [
|
|
|
|
|
'name' => 'logo',
|
|
|
|
|
'accept' => 'image/svg+xml,image/png,image/jpeg,image/webp',
|
|
|
|
|
'hint' => t('Allowed file types: SVG, PNG, JPG, WEBP'),
|
|
|
|
|
'currentSrc' => $hasLogo ? appLogoUrl(256) : '',
|
|
|
|
|
'currentLabel' => t('App logo'),
|
|
|
|
|
'formId' => $canUpdateSettings ? 'branding-logo-form' : '',
|
|
|
|
|
'deleteFormId' => $hasLogo && $canUpdateSettings ? 'branding-logo-delete-form' : '',
|
|
|
|
|
'deleteConfirm' => t('Remove the app logo?'),
|
|
|
|
|
];
|
|
|
|
|
require templatePath('partials/app-file-upload.phtml');
|
|
|
|
|
?>
|
|
|
|
|
<?php if ($canUpdateSettings): ?>
|
refactor(settings): split admin/settings into hub + per-section subpages
Splits the 755-line monolithic settings page into a tile-based landing hub
and six focused subpages (general, security, email, api, sso, branding),
each with its own form, CSRF scope and POST handler. Each subpage offers
Save / Save & close buttons plus a Cancel/back link to the hub.
Backend (AdminSettingsService, gateways, policies, DB schema) unchanged.
A new settingsSectionMergePost() helper overlays section POSTs onto the
current DB values so partial saves don't wipe unrelated fields (the
service defaults missing keys to 0/empty).
Sub-action files (logo/favicon/tokens/lifecycle) redirect to the matching
subpage, and architecture contracts now check the subpage files instead
of the removed monolithic index.
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
2026-04-24 22:43:12 +02:00
|
|
|
<div class="app-form-actions">
|
2026-04-25 18:37:55 +02:00
|
|
|
<button type="submit" form="branding-logo-form" name="action" value="save" class="secondary outline">
|
refactor(settings): split admin/settings into hub + per-section subpages
Splits the 755-line monolithic settings page into a tile-based landing hub
and six focused subpages (general, security, email, api, sso, branding),
each with its own form, CSRF scope and POST handler. Each subpage offers
Save / Save & close buttons plus a Cancel/back link to the hub.
Backend (AdminSettingsService, gateways, policies, DB schema) unchanged.
A new settingsSectionMergePost() helper overlays section POSTs onto the
current DB values so partial saves don't wipe unrelated fields (the
service defaults missing keys to 0/empty).
Sub-action files (logo/favicon/tokens/lifecycle) redirect to the matching
subpage, and architecture contracts now check the subpage files instead
of the removed monolithic index.
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
2026-04-24 22:43:12 +02:00
|
|
|
<?php e(t('Save')); ?>
|
|
|
|
|
</button>
|
2026-04-25 18:37:55 +02:00
|
|
|
<button type="submit" form="branding-logo-form" name="action" value="save_close" class="primary">
|
refactor(settings): split admin/settings into hub + per-section subpages
Splits the 755-line monolithic settings page into a tile-based landing hub
and six focused subpages (general, security, email, api, sso, branding),
each with its own form, CSRF scope and POST handler. Each subpage offers
Save / Save & close buttons plus a Cancel/back link to the hub.
Backend (AdminSettingsService, gateways, policies, DB schema) unchanged.
A new settingsSectionMergePost() helper overlays section POSTs onto the
current DB values so partial saves don't wipe unrelated fields (the
service defaults missing keys to 0/empty).
Sub-action files (logo/favicon/tokens/lifecycle) redirect to the matching
subpage, and architecture contracts now check the subpage files instead
of the removed monolithic index.
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
2026-04-24 22:43:12 +02:00
|
|
|
<?php e(t('Save & close')); ?>
|
|
|
|
|
</button>
|
|
|
|
|
</div>
|
2026-04-25 18:37:55 +02:00
|
|
|
<?php endif; ?>
|
|
|
|
|
</div>
|
|
|
|
|
</details>
|
refactor(settings): split admin/settings into hub + per-section subpages
Splits the 755-line monolithic settings page into a tile-based landing hub
and six focused subpages (general, security, email, api, sso, branding),
each with its own form, CSRF scope and POST handler. Each subpage offers
Save / Save & close buttons plus a Cancel/back link to the hub.
Backend (AdminSettingsService, gateways, policies, DB schema) unchanged.
A new settingsSectionMergePost() helper overlays section POSTs onto the
current DB values so partial saves don't wipe unrelated fields (the
service defaults missing keys to 0/empty).
Sub-action files (logo/favicon/tokens/lifecycle) redirect to the matching
subpage, and architecture contracts now check the subpage files instead
of the removed monolithic index.
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
2026-04-24 22:43:12 +02:00
|
|
|
|
2026-04-25 18:37:55 +02:00
|
|
|
<details class="app-details-card" name="settings-branding-favicon" data-details-key="settings-branding-favicon" open>
|
|
|
|
|
<summary>
|
|
|
|
|
<span class="app-details-card-summary-title"><?php e(t('Favicon')); ?></span>
|
|
|
|
|
<span class="app-details-card-summary-meta">
|
|
|
|
|
<span class="badge" data-variant="neutral"><?php e($hasFavicon ? t('Configured') : t('Default')); ?></span>
|
|
|
|
|
</span>
|
|
|
|
|
</summary>
|
|
|
|
|
<div class="app-details-card-container">
|
|
|
|
|
<?php
|
|
|
|
|
$fileUpload = [
|
|
|
|
|
'name' => 'favicon',
|
|
|
|
|
'accept' => 'image/png',
|
|
|
|
|
'hint' => t('PNG, square recommended (icons are center-cropped)'),
|
|
|
|
|
'currentSrc' => $hasFavicon ? asset('favicon/favicon-32x32.png') : '',
|
|
|
|
|
'currentLabel' => t('Favicon'),
|
|
|
|
|
'formId' => $canUpdateSettings ? 'branding-favicon-form' : '',
|
|
|
|
|
'deleteFormId' => $hasFavicon && $canUpdateSettings ? 'branding-favicon-delete-form' : '',
|
|
|
|
|
'deleteConfirm' => t('Remove the favicon?'),
|
|
|
|
|
];
|
|
|
|
|
require templatePath('partials/app-file-upload.phtml');
|
|
|
|
|
?>
|
|
|
|
|
<?php if ($canUpdateSettings): ?>
|
refactor(settings): split admin/settings into hub + per-section subpages
Splits the 755-line monolithic settings page into a tile-based landing hub
and six focused subpages (general, security, email, api, sso, branding),
each with its own form, CSRF scope and POST handler. Each subpage offers
Save / Save & close buttons plus a Cancel/back link to the hub.
Backend (AdminSettingsService, gateways, policies, DB schema) unchanged.
A new settingsSectionMergePost() helper overlays section POSTs onto the
current DB values so partial saves don't wipe unrelated fields (the
service defaults missing keys to 0/empty).
Sub-action files (logo/favicon/tokens/lifecycle) redirect to the matching
subpage, and architecture contracts now check the subpage files instead
of the removed monolithic index.
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
2026-04-24 22:43:12 +02:00
|
|
|
<div class="app-form-actions">
|
2026-04-25 18:37:55 +02:00
|
|
|
<button type="submit" form="branding-favicon-form" name="action" value="save" class="secondary outline">
|
refactor(settings): split admin/settings into hub + per-section subpages
Splits the 755-line monolithic settings page into a tile-based landing hub
and six focused subpages (general, security, email, api, sso, branding),
each with its own form, CSRF scope and POST handler. Each subpage offers
Save / Save & close buttons plus a Cancel/back link to the hub.
Backend (AdminSettingsService, gateways, policies, DB schema) unchanged.
A new settingsSectionMergePost() helper overlays section POSTs onto the
current DB values so partial saves don't wipe unrelated fields (the
service defaults missing keys to 0/empty).
Sub-action files (logo/favicon/tokens/lifecycle) redirect to the matching
subpage, and architecture contracts now check the subpage files instead
of the removed monolithic index.
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
2026-04-24 22:43:12 +02:00
|
|
|
<?php e(t('Save')); ?>
|
|
|
|
|
</button>
|
2026-04-25 18:37:55 +02:00
|
|
|
<button type="submit" form="branding-favicon-form" name="action" value="save_close" class="primary">
|
refactor(settings): split admin/settings into hub + per-section subpages
Splits the 755-line monolithic settings page into a tile-based landing hub
and six focused subpages (general, security, email, api, sso, branding),
each with its own form, CSRF scope and POST handler. Each subpage offers
Save / Save & close buttons plus a Cancel/back link to the hub.
Backend (AdminSettingsService, gateways, policies, DB schema) unchanged.
A new settingsSectionMergePost() helper overlays section POSTs onto the
current DB values so partial saves don't wipe unrelated fields (the
service defaults missing keys to 0/empty).
Sub-action files (logo/favicon/tokens/lifecycle) redirect to the matching
subpage, and architecture contracts now check the subpage files instead
of the removed monolithic index.
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
2026-04-24 22:43:12 +02:00
|
|
|
<?php e(t('Save & close')); ?>
|
|
|
|
|
</button>
|
|
|
|
|
</div>
|
2026-04-25 18:37:55 +02:00
|
|
|
<?php endif; ?>
|
|
|
|
|
</div>
|
|
|
|
|
</details>
|
|
|
|
|
</div>
|
refactor(settings): split admin/settings into hub + per-section subpages
Splits the 755-line monolithic settings page into a tile-based landing hub
and six focused subpages (general, security, email, api, sso, branding),
each with its own form, CSRF scope and POST handler. Each subpage offers
Save / Save & close buttons plus a Cancel/back link to the hub.
Backend (AdminSettingsService, gateways, policies, DB schema) unchanged.
A new settingsSectionMergePost() helper overlays section POSTs onto the
current DB values so partial saves don't wipe unrelated fields (the
service defaults missing keys to 0/empty).
Sub-action files (logo/favicon/tokens/lifecycle) redirect to the matching
subpage, and architecture contracts now check the subpage files instead
of the removed monolithic index.
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
2026-04-24 22:43:12 +02:00
|
|
|
</section>
|
|
|
|
|
<aside id="app-details-aside-section">
|
|
|
|
|
<div class="app-details-aside-section"></div>
|
|
|
|
|
</aside>
|
|
|
|
|
</div>
|