feat: Add edit functionality for marketing files and update handling

This commit is contained in:
“VeLiTi”
2026-01-12 10:51:55 +01:00
parent 2520fb2b75
commit be6f73b19c
12 changed files with 222 additions and 1 deletions

View File

@@ -125,6 +125,15 @@ if (isset($_GET['action'])) {
echo $response;
exit;
}
// Marketing update
if ($action === 'marketing_update' && $_SERVER['REQUEST_METHOD'] === 'POST') {
$payload = $_POST;
$response = ioServer('/v2/marketing_update', json_encode($payload));
header('Content-Type: application/json');
echo $response;
exit;
}
} catch (Exception $e) {
header('Content-Type: application/json');
http_response_code(500);
@@ -364,6 +373,42 @@ template_header('Marketing', 'marketing');
</div>
</div>
<!-- Edit File Modal -->
<?php if ($update_allowed === 1): ?>
<div id="editModal" class="modal">
<div class="modal-content">
<div class="modal-header">
<h3>Edit File</h3>
<button class="modal-close">&times;</button>
</div>
<div class="modal-body">
<div class="form-group">
<label for="editTitle">Title:</label>
<input type="text" id="editTitle" class="form-control" placeholder="Enter file title">
</div>
<div class="form-group">
<label for="editFolder">Folder:</label>
<select id="editFolder" class="form-control">
<option value="">Root Folder</option>
</select>
</div>
<div class="form-group">
<label for="editTags">Tags (comma separated):</label>
<input type="text" id="editTags" class="form-control" placeholder="marketing, brochure, product">
</div>
</div>
<div class="modal-footer">
<button id="saveEdit" class="btn btn-primary">
<i class="fa fa-save"></i> Save Changes
</button>
<button class="modal-cancel btn btn-secondary">Cancel</button>
</div>
</div>
</div>
<?php endif; ?>
<script src="./assets/marketing.js"></script>
<?php