unify redirect/menu/source url parameter
This commit is contained in:
parent
b1187f5071
commit
0b4ee5d347
@ -18,18 +18,18 @@ Router\post_action('bookmark', function () {
|
||||
// Add new bookmark
|
||||
Router\get_action('bookmark', function () {
|
||||
$id = Request\param('id');
|
||||
$menu = Request\param('menu', 'unread');
|
||||
$source = Request\param('source', 'unread');
|
||||
$menu = Request\param('menu');
|
||||
$redirect = Request\param('redirect', 'unread');
|
||||
$offset = Request\int_param('offset', 0);
|
||||
$feed_id = Request\int_param('feed_id', 0);
|
||||
|
||||
Model\Item\set_bookmark_value($id, Request\int_param('value'));
|
||||
|
||||
if ($source === 'show') {
|
||||
if ($redirect === 'show') {
|
||||
Response\redirect('?action=show&menu='.$menu.'&id='.$id);
|
||||
}
|
||||
|
||||
Response\redirect('?action='.$menu.'&offset='.$offset.'&feed_id='.$feed_id.'#item-'.$id);
|
||||
Response\redirect('?action='.$redirect.'&offset='.$offset.'&feed_id='.$feed_id.'#item-'.$id);
|
||||
});
|
||||
|
||||
// Display bookmarks page
|
||||
|
@ -2,14 +2,14 @@
|
||||
<?php if ($item['bookmark']): ?>
|
||||
<a
|
||||
class="bookmark"
|
||||
href="?action=bookmark&value=0&id=<?= $item['id'] ?>&offset=<?= $offset ?>&menu=<?= $menu ?>&feed_id=<?= $item['feed_id'] ?>"
|
||||
href="?action=bookmark&value=0&id=<?= $item['id'] ?>&offset=<?= $offset ?>&redirect=<?= $menu ?>&feed_id=<?= $item['feed_id'] ?>"
|
||||
data-action="bookmark"
|
||||
data-reverse-label="<?= t('bookmark') ?>"
|
||||
><?= t('remove bookmark') ?></a>
|
||||
<?php else: ?>
|
||||
<a
|
||||
class="bookmark"
|
||||
href="?action=bookmark&value=1&id=<?= $item['id'] ?>&offset=<?= $offset ?>&menu=<?= $menu ?>&feed_id=<?= $item['feed_id'] ?>"
|
||||
href="?action=bookmark&value=1&id=<?= $item['id'] ?>&offset=<?= $offset ?>&redirect=<?= $menu ?>&feed_id=<?= $item['feed_id'] ?>"
|
||||
data-action="bookmark"
|
||||
data-reverse-label="<?= t('remove bookmark') ?>"
|
||||
><?= t('bookmark') ?></a>
|
||||
|
@ -10,7 +10,7 @@
|
||||
<span class="item-icons">
|
||||
<a
|
||||
class="bookmark-icon"
|
||||
href="?action=bookmark&value=<?= (int)!$item['bookmark'] ?>&id=<?= $item['id'] ?>&offset=<?= $offset ?>&menu=<?= $menu ?>&feed_id=<?= $item['feed_id'] ?>"
|
||||
href="?action=bookmark&value=<?= (int)!$item['bookmark'] ?>&id=<?= $item['id'] ?>&offset=<?= $offset ?>&redirect=<?= $menu ?>&feed_id=<?= $item['feed_id'] ?>"
|
||||
title="<?= ($item['bookmark']) ? t('remove bookmark') : t('bookmark') ?>"
|
||||
data-action="bookmark"
|
||||
data-reverse-title="<?= ($item['bookmark']) ? t('bookmark') : t('remove bookmark') ?>"
|
||||
|
@ -37,7 +37,7 @@
|
||||
<li>
|
||||
<a
|
||||
class="bookmark-icon"
|
||||
href="?action=bookmark&value=<?= (int)!$item['bookmark'] ?>&id=<?= $item['id'] ?>&source=show&menu=<?= $menu ?>"
|
||||
href="?action=bookmark&value=<?= (int)!$item['bookmark'] ?>&id=<?= $item['id'] ?>&redirect=show&menu=<?= $menu ?>"
|
||||
title="<?= ($item['bookmark']) ? t('remove bookmark') : t('bookmark') ?>"
|
||||
data-reverse-title="<?= ($item['bookmark']) ? t('bookmark') :t('remove bookmark') ?>"
|
||||
data-action="bookmark"
|
||||
|
Loading…
Reference in New Issue
Block a user