Autosave: 20260408-233827

This commit is contained in:
Flatlogic Bot 2026-04-08 23:38:27 +00:00
parent 0c4d8aefa9
commit 91b9902c51
3 changed files with 2 additions and 15 deletions

Binary file not shown.

After

Width:  |  Height:  |  Size: 193 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 14 KiB

View File

@ -33,7 +33,7 @@ if ($_SERVER['REQUEST_METHOD'] === 'POST') {
$webhook_id = (int) ($_POST['webhook_id'] ?? 0);
$cl_scwebhook_name = trim((string) ($_POST['cl_scwebhook_name'] ?? ''));
$cl_scwebhook_url = trim((string) ($_POST['cl_scwebhook_url'] ?? ''));
$cl_scwebhook_is_forum = isset($_POST['cl_scwebhook_is_forum']) ? 1 : 0;
$cl_scwebhook_is_forum = 0;
if ($cl_scwebhook_name === '' || $cl_scwebhook_url === '') {
auth_flash_set('error', 'Le nom et lURL du webhook sont obligatoires.');
@ -570,7 +570,7 @@ $banners = $stmt_banners->fetchAll();
<aside class="stack">
<section class="glass-card">
<h2 id="webhookFormTitle">Nouveau webhook Discord</h2>
<p class="section-note">Ajoute la nomination du webhook et son URL. Active loption forum si ce webhook doit créer un fil lors de lenvoi.</p>
<p class="section-note">Ajoute la nomination du webhook et son URL. Tous les webhooks enregistrés ici sont traités comme des webhooks Discord génériques.</p>
<form method="post" id="webhookForm" class="form-grid">
<input type="hidden" name="csrf_token" value="<?php echo htmlspecialchars($csrf_token, ENT_QUOTES, 'UTF-8'); ?>">
<input type="hidden" name="action" id="webhookAction" value="add_webhook">
@ -586,10 +586,6 @@ $banners = $stmt_banners->fetchAll();
<input type="url" id="cl_scwebhook_url" name="cl_scwebhook_url" class="form-control" required placeholder="https://discord.com/api/webhooks/...">
</div>
<label class="checkbox-row">
<input type="checkbox" id="cl_scwebhook_is_forum" name="cl_scwebhook_is_forum" value="1">
<span>Webhook de type forum / fil de discussion</span>
</label>
<button type="submit" class="btn-modern" id="webhookSubmitBtn">Ajouter le webhook</button>
<button type="button" class="btn-modern secondary" id="webhookCancelBtn" style="display:none;" onclick="resetWebhookForm()">Annuler lédition</button>
@ -637,7 +633,6 @@ $banners = $stmt_banners->fetchAll();
<tr>
<th>Nomination</th>
<th>URL</th>
<th>Type</th>
<th style="text-align:right;">Actions</th>
</tr>
</thead>
@ -650,11 +645,6 @@ $banners = $stmt_banners->fetchAll();
<td>
<span class="muted"><?php echo htmlspecialchars(scdiscord_mask_webhook_url((string) $webhook['cl_scwebhook_url']), ENT_QUOTES, 'UTF-8'); ?></span>
</td>
<td>
<span class="pill <?php echo ((int) $webhook['cl_scwebhook_is_forum'] === 1) ? 'forum' : ''; ?>">
<?php echo ((int) $webhook['cl_scwebhook_is_forum'] === 1) ? 'Forum' : 'Classique'; ?>
</span>
</td>
<td>
<div class="actions-inline">
<button
@ -664,7 +654,6 @@ $banners = $stmt_banners->fetchAll();
'id' => (int) $webhook['cl_scwebhook_id'],
'name' => (string) $webhook['cl_scwebhook_name'],
'url' => (string) $webhook['cl_scwebhook_url'],
'is_forum' => (int) $webhook['cl_scwebhook_is_forum'],
], JSON_UNESCAPED_UNICODE | JSON_UNESCAPED_SLASHES); ?>)'
>Éditer</button>
<form method="post" onsubmit="return confirm('Supprimer ce webhook Discord ?');">
@ -750,7 +739,6 @@ $banners = $stmt_banners->fetchAll();
document.getElementById('webhookId').value = webhook.id || '';
document.getElementById('cl_scwebhook_name').value = webhook.name || '';
document.getElementById('cl_scwebhook_url').value = webhook.url || '';
document.getElementById('cl_scwebhook_is_forum').checked = Number(webhook.is_forum || 0) === 1;
document.getElementById('webhookSubmitBtn').textContent = 'Mettre à jour le webhook';
document.getElementById('webhookCancelBtn').style.display = 'inline-flex';
}
@ -761,7 +749,6 @@ $banners = $stmt_banners->fetchAll();
document.getElementById('webhookId').value = '';
document.getElementById('cl_scwebhook_name').value = '';
document.getElementById('cl_scwebhook_url').value = '';
document.getElementById('cl_scwebhook_is_forum').checked = false;
document.getElementById('webhookSubmitBtn').textContent = 'Ajouter le webhook';
document.getElementById('webhookCancelBtn').style.display = 'none';
}