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 = "") {
|
public function bookmarklet($url = "", $title = "") {
|
||||||
$bookmarkExists = Bookmarks::bookmarkExists($url, $this->userId, $this->db);
|
$bookmarkExists = Bookmarks::bookmarkExists($url, $this->userId, $this->db);
|
||||||
$description = "";
|
$description = "";
|
||||||
|
$tags = [];
|
||||||
if ($bookmarkExists != false){
|
if ($bookmarkExists != false){
|
||||||
$bookmark = Bookmarks::findUniqueBookmark($bookmarkExists, $this->userId, $this->db);
|
$bookmark = Bookmarks::findUniqueBookmark($bookmarkExists, $this->userId, $this->db);
|
||||||
$description = $bookmark['description'];
|
$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
|
return new TemplateResponse('bookmarks', 'addBookmarklet', $params); // templates/main.php
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -34,10 +34,10 @@ $bookmarkExists = $_['bookmarkExists'];
|
|||||||
</li>
|
</li>
|
||||||
|
|
||||||
<li>
|
<li>
|
||||||
<ul class="tags" >
|
<ul id="tags" class="tags" >
|
||||||
<ul class="tags" >
|
<?php foreach ($_['tags'] as $tag): ?>
|
||||||
<li></li>
|
<li><?php p($tag); ?></li>
|
||||||
</ul>
|
<?php endforeach; ?>
|
||||||
</ul>
|
</ul>
|
||||||
</li>
|
</li>
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user