@@ -8,23 +8,29 @@
|
||||
include '../start.php';
|
||||
|
||||
Security::verifyUser();
|
||||
page_head('Feed page');
|
||||
|
||||
if ($_SERVER['REQUEST_METHOD'] == 'POST') {
|
||||
// TODO: get feed, add if new, reject if existing but not owned by this user, update otherwise
|
||||
$feed = array();
|
||||
$feed = [ 'id' => $_POST['id'], 'url' => $_POST['url'] ];
|
||||
$title = 'TODO';
|
||||
} else {
|
||||
// TODO: Retrieve feed by ID if not new
|
||||
$feed = [ 'id' => $_GET['id'], 'url' => '' ];
|
||||
$title = 'Add RSS Feed';
|
||||
}
|
||||
page_head($title);
|
||||
|
||||
?>
|
||||
<h1>Add/Edit Feed</h1>
|
||||
<form method=POST action=/feed hx-post=/feed>
|
||||
<input type=hidden name=id value="<?=$feed['id']?>">
|
||||
<label>
|
||||
Feed URL
|
||||
<input type=url name=url required autofocus value="<?=$feed['url']?>">
|
||||
</label>
|
||||
</form>
|
||||
<h1><?=$title?></h1>
|
||||
<article>
|
||||
<form method=POST action=/feed hx-post=/feed>
|
||||
<input type=hidden name=id value=<?=$feed['id']?>>
|
||||
<label>
|
||||
Feed URL
|
||||
<input type=url name=url required autofocus value="<?=$feed['url']?>">
|
||||
</label><br>
|
||||
<button type=submit>Save</button>
|
||||
</form>
|
||||
</article>
|
||||
<?php
|
||||
page_foot();
|
||||
|
||||
Reference in New Issue
Block a user