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:
parent
52ec490ad4
commit
518b7644af
@ -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
|
||||
}
|
||||
|
||||
|
@ -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>
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user