From 09861abab7ba79f50801623f6dfc9d3278c40942 Mon Sep 17 00:00:00 2001 From: redmatrix Date: Mon, 11 Apr 2016 20:53:08 -0700 Subject: when saving bookmarks from a post allow choice of bookmark to be saved (default is all of them); this implements the backend. Additional work will be required on the front end or within plugins to make this happen. --- mod/bookmarks.php | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) (limited to 'mod') diff --git a/mod/bookmarks.php b/mod/bookmarks.php index 02fe2f2e1..5c48ce5a9 100644 --- a/mod/bookmarks.php +++ b/mod/bookmarks.php @@ -4,6 +4,8 @@ function bookmarks_init(&$a) { if(! local_channel()) return; $item_id = intval($_REQUEST['item']); + $burl = trim($_REQUEST['burl']); + if(! $item_id) return; @@ -36,7 +38,14 @@ function bookmarks_init(&$a) { killme(); } foreach($terms as $t) { - bookmark_add($u,$s[0],$t,$item['item_private']); + if($burl) { + if($burl == $t['url']) { + bookmark_add($u,$s[0],$t,$item['item_private']); + } + } + else + bookmark_add($u,$s[0],$t,$item['item_private']); + info( t('Bookmark added') . EOL); } } -- cgit v1.2.3