]> git.wh0rd.org Git - tt-rss.git/commitdiff
api: implement setting article note through updateArticle
authorAndrew Dolgov <fox@madoka.volgo-balt.ru>
Tue, 29 Nov 2011 05:54:21 +0000 (09:54 +0400)
committerAndrew Dolgov <fox@madoka.volgo-balt.ru>
Tue, 29 Nov 2011 05:54:21 +0000 (09:54 +0400)
api/index.php

index 1c4c52fd9479875115eeb8b4b9a0d38fb8ce67b8..8aa4c1907e519de6b83eef1ccb22a564e135b1bf 100644 (file)
                case "updateArticle":
                        $article_ids = array_filter(explode(",", db_escape_string($_REQUEST["article_ids"])), is_numeric);
                        $mode = (int) db_escape_string($_REQUEST["mode"]);
+                       $data = db_escape_string($_REQUEST["data"]);
                        $field_raw = (int)db_escape_string($_REQUEST["field"]);
 
                        $field = "";
                                case 2:
                                        $field = "unread";
                                        break;
+                               case 3:
+                                       $field = "note";
                        };
 
                        switch ($mode) {
                                        break;
                        }
 
+                       if ($field == "note") $set_to = "'$data'";
+
                        if ($field && $set_to && count($article_ids) > 0) {
 
                                $article_ids = join(", ", $article_ids);