1
0
mirror of https://git.tt-rss.org/git/tt-rss.git synced 2026-01-19 14:35:28 +00:00

sharepopup: implement assigning labels while sharing

This commit is contained in:
Andrew Dolgov
2012-10-31 12:55:24 +04:00
parent 4021d61ada
commit 1b4d1a6b44
6 changed files with 91 additions and 6 deletions

View File

@@ -2,7 +2,7 @@
class RPC extends Handler_Protected {
function csrf_ignore($method) {
$csrf_ignored = array("sanitycheck", "buttonplugin", "exportget", "sharepopup");
$csrf_ignored = array("sanitycheck", "buttonplugin", "exportget", "completelabels");
return array_search($method, $csrf_ignored) !== false;
}
@@ -426,6 +426,23 @@ class RPC extends Handler_Protected {
print json_encode(array("link" => $new_link));
}
function completeLabels() {
$search = db_escape_string($_REQUEST["search"]);
$result = db_query($this->link, "SELECT DISTINCT caption FROM
ttrss_labels2
WHERE owner_uid = '".$_SESSION["uid"]."' AND
LOWER(caption) LIKE LOWER('$search%') ORDER BY caption
LIMIT 5");
print "<ul>";
while ($line = db_fetch_assoc($result)) {
print "<li>" . $line["caption"] . "</li>";
}
print "</ul>";
}
function completeTags() {
$search = db_escape_string($_REQUEST["search"]);