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
|
// Add new bookmark
|
||||||
Router\get_action('bookmark', function () {
|
Router\get_action('bookmark', function () {
|
||||||
$id = Request\param('id');
|
$id = Request\param('id');
|
||||||
$menu = Request\param('menu', 'unread');
|
$menu = Request\param('menu');
|
||||||
$source = Request\param('source', 'unread');
|
$redirect = Request\param('redirect', 'unread');
|
||||||
$offset = Request\int_param('offset', 0);
|
$offset = Request\int_param('offset', 0);
|
||||||
$feed_id = Request\int_param('feed_id', 0);
|
$feed_id = Request\int_param('feed_id', 0);
|
||||||
|
|
||||||
Model\Item\set_bookmark_value($id, Request\int_param('value'));
|
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=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
|
// Display bookmarks page
|
||||||
|
@ -2,14 +2,14 @@
|
|||||||
<?php if ($item['bookmark']): ?>
|
<?php if ($item['bookmark']): ?>
|
||||||
<a
|
<a
|
||||||
class="bookmark"
|
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-action="bookmark"
|
||||||
data-reverse-label="<?= t('bookmark') ?>"
|
data-reverse-label="<?= t('bookmark') ?>"
|
||||||
><?= t('remove bookmark') ?></a>
|
><?= t('remove bookmark') ?></a>
|
||||||
<?php else: ?>
|
<?php else: ?>
|
||||||
<a
|
<a
|
||||||
class="bookmark"
|
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-action="bookmark"
|
||||||
data-reverse-label="<?= t('remove bookmark') ?>"
|
data-reverse-label="<?= t('remove bookmark') ?>"
|
||||||
><?= t('bookmark') ?></a>
|
><?= t('bookmark') ?></a>
|
||||||
|
@ -10,7 +10,7 @@
|
|||||||
<span class="item-icons">
|
<span class="item-icons">
|
||||||
<a
|
<a
|
||||||
class="bookmark-icon"
|
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') ?>"
|
title="<?= ($item['bookmark']) ? t('remove bookmark') : t('bookmark') ?>"
|
||||||
data-action="bookmark"
|
data-action="bookmark"
|
||||||
data-reverse-title="<?= ($item['bookmark']) ? t('bookmark') : t('remove bookmark') ?>"
|
data-reverse-title="<?= ($item['bookmark']) ? t('bookmark') : t('remove bookmark') ?>"
|
||||||
|
@ -37,7 +37,7 @@
|
|||||||
<li>
|
<li>
|
||||||
<a
|
<a
|
||||||
class="bookmark-icon"
|
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') ?>"
|
title="<?= ($item['bookmark']) ? t('remove bookmark') : t('bookmark') ?>"
|
||||||
data-reverse-title="<?= ($item['bookmark']) ? t('bookmark') :t('remove bookmark') ?>"
|
data-reverse-title="<?= ($item['bookmark']) ? t('bookmark') :t('remove bookmark') ?>"
|
||||||
data-action="bookmark"
|
data-action="bookmark"
|
||||||
|
Loading…
Reference in New Issue
Block a user