rpc: move completeTags to article

This commit is contained in:
Andrew Dolgov 2013-04-02 14:53:36 +04:00
parent 5df8be5c0a
commit c83554bddd
3 changed files with 18 additions and 17 deletions

View File

@ -284,4 +284,21 @@ class Article extends Handler_Protected {
"content" => $tags_str, "content_full" => $tags_str_full)); "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 "<ul>";
while ($line = db_fetch_assoc($result)) {
print "<li>" . $line["tag_name"] . "</li>";
}
print "</ul>";
}
} }

View File

@ -363,22 +363,6 @@ class RPC extends Handler_Protected {
print "</ul>"; print "</ul>";
} }
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 "<ul>";
while ($line = db_fetch_assoc($result)) {
print "<li>" . $line["tag_name"] . "</li>";
}
print "</ul>";
}
function purge() { function purge() {
$ids = explode(",", db_escape_string($this->link, $_REQUEST["ids"])); $ids = explode(",", db_escape_string($this->link, $_REQUEST["ids"]));
$days = sprintf("%d", $_REQUEST["days"]); $days = sprintf("%d", $_REQUEST["days"]);

View File

@ -1114,7 +1114,7 @@ function editArticleTags(id) {
dojo.disconnect(tmph); dojo.disconnect(tmph);
new Ajax.Autocompleter('tags_str', 'tags_choices', new Ajax.Autocompleter('tags_str', 'tags_choices',
"backend.php?op=rpc&method=completeTags", "backend.php?op=article&method=completeTags",
{ tokens: ',', paramName: "search" }); { tokens: ',', paramName: "search" });
}); });