From: Andrew Dolgov Date: Tue, 2 Apr 2013 10:53:36 +0000 (+0400) Subject: rpc: move completeTags to article X-Git-Tag: 1.7.6~25 X-Git-Url: https://git.wh0rd.org/?a=commitdiff_plain;h=c83554bdddd1efb8a600d2dc6dbd119e3104013c;p=tt-rss.git rpc: move completeTags to article --- diff --git a/classes/article.php b/classes/article.php index bf1e5566..e75af0e7 100644 --- a/classes/article.php +++ b/classes/article.php @@ -284,4 +284,21 @@ class Article extends Handler_Protected { "content" => $tags_str, "content_full" => $tags_str_full)); } + + function completeTags() { + $search = db_escape_string($this->link, $_REQUEST["search"]); + + $result = db_query($this->link, "SELECT DISTINCT tag_name FROM ttrss_tags + WHERE owner_uid = '".$_SESSION["uid"]."' AND + tag_name LIKE '$search%' ORDER BY tag_name + LIMIT 10"); + + print ""; + } + + } diff --git a/classes/rpc.php b/classes/rpc.php index a78e079c..04b763c4 100644 --- a/classes/rpc.php +++ b/classes/rpc.php @@ -363,22 +363,6 @@ class RPC extends Handler_Protected { print ""; } - - function completeTags() { - $search = db_escape_string($this->link, $_REQUEST["search"]); - - $result = db_query($this->link, "SELECT DISTINCT tag_name FROM ttrss_tags - WHERE owner_uid = '".$_SESSION["uid"]."' AND - tag_name LIKE '$search%' ORDER BY tag_name - LIMIT 10"); - - print ""; - } - function purge() { $ids = explode(",", db_escape_string($this->link, $_REQUEST["ids"])); $days = sprintf("%d", $_REQUEST["days"]); diff --git a/js/viewfeed.js b/js/viewfeed.js index be2b88f4..31eff1b8 100644 --- a/js/viewfeed.js +++ b/js/viewfeed.js @@ -1114,7 +1114,7 @@ function editArticleTags(id) { dojo.disconnect(tmph); new Ajax.Autocompleter('tags_str', 'tags_choices', - "backend.php?op=rpc&method=completeTags", + "backend.php?op=article&method=completeTags", { tokens: ',', paramName: "search" }); });