@@ -12,7 +12,11 @@ Security::verifyUser();
|
||||
if ($_SERVER['REQUEST_METHOD'] == 'POST') {
|
||||
// TODO: get feed, add if new, reject if existing but not owned by this user, update otherwise
|
||||
$result = Feed::add($_POST['url']);
|
||||
echo '<pre>'; var_dump($result); echo '</pre>';
|
||||
if (array_key_exists('ok', $result)) {
|
||||
add_message('INFO', 'Feed added successfully');
|
||||
} else {
|
||||
add_message('ERROR', $result['error']);
|
||||
}
|
||||
$feed = [ 'id' => $_POST['id'], 'url' => $_POST['url'] ];
|
||||
$title = 'TODO';
|
||||
} else {
|
||||
@@ -20,9 +24,8 @@ if ($_SERVER['REQUEST_METHOD'] == 'POST') {
|
||||
$feed = [ 'id' => $_GET['id'], 'url' => '' ];
|
||||
$title = 'Add RSS Feed';
|
||||
}
|
||||
page_head($title);
|
||||
|
||||
?>
|
||||
page_head($title); ?>
|
||||
<h1><?=$title?></h1>
|
||||
<article>
|
||||
<form method=POST action=/feed hx-post=/feed>
|
||||
@@ -33,6 +36,5 @@ page_head($title);
|
||||
</label><br>
|
||||
<button type=submit>Save</button>
|
||||
</form>
|
||||
</article>
|
||||
<?php
|
||||
</article><?php
|
||||
page_foot();
|
||||
|
||||
Reference in New Issue
Block a user