1
0
mirror of https://github.com/owncloud/bookmarks.git synced 2025-01-22 18:52:10 +01:00

Update for existing bookmark : now gets existing associated tags, fix #127

This commit is contained in:
Shikiryu 2015-03-08 13:38:54 +01:00 committed by Arthur Schiwon
parent 52ec490ad4
commit 518b7644af
2 changed files with 13 additions and 5 deletions

View File

@ -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
}

View File

@ -34,10 +34,10 @@ $bookmarkExists = $_['bookmarkExists'];
</li>
<li>
<ul class="tags" >
<ul class="tags" >
<li></li>
</ul>
<ul id="tags" class="tags" >
<?php foreach ($_['tags'] as $tag): ?>
<li><?php p($tag); ?></li>
<?php endforeach; ?>
</ul>
</li>