Website Summary Files Commits Branches @commit @diff @stats
path: root / views / archive / item.php
diff options
context:
space:
mode:
Commitd7c2e638a5ea39caeadd40406f840e9b90f893d5 (patch)
Author
 Syndamia <kamen@syndamia.com>
2025-02-02 15:04:59 +0200
Committer
 Syndamia <kamen@syndamia.com>
2025-02-02 15:05:05 +0200
Files3568f96aa508e01b9c7ee34cba261f4e16d186a2 /views/archive/item.php
nowayforward_human-d7c2e638a5ea39caeadd40406f840e9b90f893d5.tar
nowayforward_human-d7c2e638a5ea39caeadd40406f840e9b90f893d5.tar.gz
nowayforward_human-d7c2e638a5ea39caeadd40406f840e9b90f893d5.zip
Parentd6dcab722a4e4f3472d3e4128bd6f4a6d5661a31 (diff)
feat(views/archive): Implement archive deletion
1 files changed, 12 insertions, 2 deletions
-rw-r--r--views/archive/item.php14
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>