From 518b7644af4a88d4f00382dfe0cf43d605ee0f6e Mon Sep 17 00:00:00 2001 From: Shikiryu Date: Sun, 8 Mar 2015 13:38:54 +0100 Subject: [PATCH] Update for existing bookmark : now gets existing associated tags, fix #127 --- controller/webviewcontroller.php | 10 +++++++++- templates/addBookmarklet.php | 8 ++++---- 2 files changed, 13 insertions(+), 5 deletions(-) diff --git a/controller/webviewcontroller.php b/controller/webviewcontroller.php index ba44d0d9..2b8f7c4a 100644 --- a/controller/webviewcontroller.php +++ b/controller/webviewcontroller.php @@ -48,11 +48,19 @@ class WebViewController extends Controller { public function bookmarklet($url = "", $title = "") { $bookmarkExists = Bookmarks::bookmarkExists($url, $this->userId, $this->db); $description = ""; + $tags = []; if ($bookmarkExists != false){ $bookmark = Bookmarks::findUniqueBookmark($bookmarkExists, $this->userId, $this->db); $description = $bookmark['description']; + $tags = $bookmark['tags']; } - $params = array('url' => $url, 'title' => $title, 'description' => $description, 'bookmarkExists' => $bookmarkExists); + $params = array( + 'url' => $url, + 'title' => $title, + 'description' => $description, + 'bookmarkExists'=> $bookmarkExists, + 'tags' => $tags + ); return new TemplateResponse('bookmarks', 'addBookmarklet', $params); // templates/main.php } diff --git a/templates/addBookmarklet.php b/templates/addBookmarklet.php index 0de385f1..c7a5839a 100644 --- a/templates/addBookmarklet.php +++ b/templates/addBookmarklet.php @@ -34,10 +34,10 @@ $bookmarkExists = $_['bookmarkExists'];
  • -