aboutsummaryrefslogtreecommitdiff
path: root/views/list/update/index.php
diff options
context:
space:
mode:
authorSyndamia <kamen@syndamia.com>2025-01-26 22:19:25 +0200
committerSyndamia <kamen@syndamia.com>2025-01-26 22:24:48 +0200
commitcc16ebc3927fa19c86d970067bcb9a16be94e40a (patch)
tree04740380dd81fe2a0ccb6bacef00c972563eaa4c /views/list/update/index.php
parent32f3eadcc72a2c6ef3e732cecbc0706e7cbb267c (diff)
downloadnowayforward_human-cc16ebc3927fa19c86d970067bcb9a16be94e40a.tar
nowayforward_human-cc16ebc3927fa19c86d970067bcb9a16be94e40a.tar.gz
nowayforward_human-cc16ebc3927fa19c86d970067bcb9a16be94e40a.zip
feat(views): Implement adding a list item
Diffstat (limited to 'views/list/update/index.php')
-rw-r--r--views/list/update/index.php32
1 files changed, 32 insertions, 0 deletions
diff --git a/views/list/update/index.php b/views/list/update/index.php
new file mode 100644
index 0000000..6fa91e1
--- /dev/null
+++ b/views/list/update/index.php
@@ -0,0 +1,32 @@
+
+<!-- TODO: Redirect when no user -->
+
+<?php
+ $user = null;
+ $webpage = null;
+ $lists = null;
+
+ try {
+ $user = Database\Cookie::fromDB($TOKEN);
+ $webpage = Database\Webpage::fromDBwid($_GET['wid']);
+ $lists = Database\ArchiveList::allListsByUser($user->UID);
+ }
+ catch (Exception $e) {}
+?>
+
+<!-- TODO: Redirect when no webpage -->
+<!-- TODO: Redirect when lists is empty -->
+
+<h2>To which list do you want to add "<?= $webpage->URL ?>"?</h2>
+
+<form action="/list" method="GET">
+ <input type="hidden" name="method" value="PATCH">
+ <select name="lid">
+ <?php foreach ($lists as $list): ?>
+ <option value="<?= $list->LID ?>"><?= $list->Name ?></option>
+ <?php endforeach; ?>
+ </select>
+ <input type="hidden" name="type" value="add">
+ <input type="hidden" name="wid" value="<?= $_GET['wid'] ?>">
+ <input type="submit" value="Select">
+</form>