diff options
feat(views/archive): Implement archive deletion
1 files changed, 12 insertions, 2 deletions
| -rw-r--r-- | views/archive/item.php | 14 |
diff --git a/views/archive/item.php b/views/archive/item.php index e6b9cf0..467fb2c 100644 --- a/views/archive/item.php +++ b/views/archive/item.php @@ -15,9 +15,19 @@ <input type="hidden" name="wid" value="<?= $page->WID ?>"> <button> <!-- Tabler icons https://tabler.io/icons --> - <svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="list-icon"><path stroke="none" d="M0 0h24v24H0z" fill="none"/><path d="M12 17l-6 4v-14a4 4 0 0 1 4 -4h4a4 4 0 0 1 4 4v5" /><path d="M16 19h6" /><path d="M19 16v6" /></svg> + <svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="list-icon"><path stroke="none" d="M0 0h24v24H0z" fill="none"/><path d="M12 17l-6 4v-14a4 4 0 0 1 4 -4h4a4 4 0 0 1 4 4v5" /><path d="M16 19h6" /><path d="M19 16v6" /></svg> </button> </form> - <span><!-- Delete (when admin) button --></span> + <?php if ($user !== null && $user->Role === 'Admin'): ?> + <form action="/archive/delete" method="GET"> + <input type="hidden" name="wid" value="<?= $page->WID ?>"> + <button> + <!-- Tabler icons https://tabler.io/icons --> + <svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="list-icon"><path stroke="none" d="M0 0h24v24H0z" fill="none"/><path d="M4 7l16 0" /><path d="M10 11l0 6" /><path d="M14 11l0 6" /><path d="M5 7l1 12a2 2 0 0 0 2 2h8a2 2 0 0 0 2 -2l1 -12" /><path d="M9 7v-3a1 1 0 0 1 1 -1h4a1 1 0 0 1 1 1v3" /></svg> + </button> + </form> + <?php else: ?> + <span></span> + <?php endif; ?> </section> </section> |
