Merge Publication fieldset's is_published checkbox into Backoffice fieldset

Move the is_published checkbox from its own separate Publication fieldset
into the Backoffice fieldset (as item #8). This means the publish control
is now present in both add and edit admin forms (previously it was only
shown in edit mode via $showPublish).
This commit is contained in:
Pontoporeia
2026-05-09 18:54:14 +02:00
parent c4a23d5c2d
commit bcf683c5c1
3 changed files with 14 additions and 21 deletions

View File

@@ -32,9 +32,9 @@
* bool $showContact — Contact checkbox fieldset
* bool $showCoverPreview — cover image preview + remove checkbox
* bool $showExistingFiles — existing thesis files list (sortable, deletable)
* bool $showBackoffice — Backoffice fieldset (context_note, jury_points, remarks, baiu_link, exemplaires, contact_interne)
* bool $showBackoffice — Backoffice fieldset (context_note, jury_points, remarks, baiu_link, exemplaires, contact_interne, is_published)
* bool $showEmailConfirmation — E-mail de confirmation fieldset
* bool $showPublish — Publication checkbox fieldset
* string $helpFn — fn(string $key): string (for help blocks)
* string $helpContent — current help block content (for help-block renders)
* array $helpBlocks — all help blocks (for intro)
@@ -88,7 +88,6 @@ $showExistingFiles = $showExistingFiles ?? false;
$showBannerPreview = false; // Banners merged into covers — field removed
$showBackoffice = $showBackoffice ?? false;
$showEmailConfirmation = $showEmailConfirmation ?? false;
$showPublish = $showPublish ?? false;
$oldFn = $oldFn ?? (function_exists('old') ? 'old' : fn($k, $d = '') => $d);
$withAutofocusFn = $withAutofocusFn ?? fn($field, $attrs = []) => $attrs;
@@ -501,6 +500,17 @@ $checkedFormatsForSiteWeb = $checkedFormatsForSiteWeb ?? [];
placeholder="ton.email@exemple.be">
<small>Adresse de contact interne (non visible publiquement).</small>
</div>
<!-- 8. Publication -->
<div class="admin-form-group">
<label class="admin-checkbox-label">
<input type="checkbox" name="is_published" value="1"
<?= !empty($currentRaw["is_published"] ?? false)
? "checked"
: "" ?>>
Publier ce TFE sur le site public
</label>
</div>
</fieldset>
<?php endif; ?>
@@ -529,22 +539,6 @@ $checkedFormatsForSiteWeb = $checkedFormatsForSiteWeb ?? [];
</fieldset>
<?php endif; ?>
<?php if ($showPublish): ?>
<!-- ═══════════════════ Publication ════════════════════════ -->
<fieldset>
<legend>Publication</legend>
<div>
<label class="admin-checkbox-label">
<input type="checkbox" name="is_published" value="1"
<?= !empty($currentRaw["is_published"] ?? false)
? "checked"
: "" ?>>
Publier ce TFE sur le site public
</label>
</div>
</fieldset>
<?php endif; ?>
<div class="form-footer admin-form-footer">
<button type="submit" name="go" class="btn btn--primary"><?= $mode === 'edit' ? 'Enregistrer' : 'Soumettre' ?></button>
<?php if ($mode === 'add' || $mode === 'edit'): ?>