mirror of
https://codeberg.org/PostERG/xamxam.git
synced 2026-06-25 16:19:19 +02:00
style: normalize headers, overtype editor rounded corners, remove duplicate cover preview, thesis-add-header grid layout, subtitle below header with top gradient
This commit is contained in:
46
app/public/admin/licence-fragment.php
Normal file
46
app/public/admin/licence-fragment.php
Normal file
@@ -0,0 +1,46 @@
|
||||
<?php
|
||||
/**
|
||||
* HTMX fragment (admin): renders the licence section with conditional required states.
|
||||
*
|
||||
* POST: access_type_id, license_id, license_custom, cc2r, admin_mode
|
||||
*
|
||||
* Admin mode: never required.
|
||||
*/
|
||||
require_once __DIR__ . '/../../bootstrap.php';
|
||||
require_once __DIR__ . '/../../src/AdminAuth.php';
|
||||
AdminAuth::requireLogin();
|
||||
|
||||
$accessTypeId = $_POST['access_type_id'] ?? '2';
|
||||
$licenseId = $_POST['license_id'] ?? '';
|
||||
$licenseCustom = $_POST['license_custom'] ?? '';
|
||||
$cc2r = !empty($_POST['cc2r']);
|
||||
$adminMode = true;
|
||||
|
||||
require_once APP_ROOT . '/src/Database.php';
|
||||
$db = Database::getInstance();
|
||||
$licenseTypes = $db->getAllLicenseTypes();
|
||||
?>
|
||||
|
||||
<div class="licence-license-choice">
|
||||
<?php
|
||||
$name = 'license_id'; $label = 'Licence :'; $options = $licenseTypes;
|
||||
$selected = $licenseId; $placeholder = '— Sélectionner —'; $required = false;
|
||||
include APP_ROOT . '/templates/partials/form/select-field.php';
|
||||
?>
|
||||
|
||||
<?php
|
||||
$name = 'license_custom'; $label = 'Ou précisez une autre licence :';
|
||||
$value = htmlspecialchars($licenseCustom);
|
||||
$hint = 'Ex: CC BY-NC 4.0, Tous droits réservés...';
|
||||
include APP_ROOT . '/templates/partials/form/text-field.php';
|
||||
?>
|
||||
|
||||
<div class="admin-form-group">
|
||||
<label class="admin-checkbox-label">
|
||||
<input type="checkbox" name="cc2r" value="1"
|
||||
<?= $cc2r ? 'checked' : '' ?>>
|
||||
J'accepte les Conditions Collectives de Réutilisation (CC2r)
|
||||
</label>
|
||||
<small><a href="https://cc2r.net/" target="_blank" rel="noopener">En savoir plus sur la CC2r ↗</a></small>
|
||||
</div>
|
||||
</div>
|
||||
Reference in New Issue
Block a user