]> git.wh0rd.org Git - tt-rss.git/commitdiff
rpc: move setScore to article
authorAndrew Dolgov <fox@madoka.volgo-balt.ru>
Tue, 2 Apr 2013 10:41:41 +0000 (14:41 +0400)
committerAndrew Dolgov <fox@madoka.volgo-balt.ru>
Tue, 2 Apr 2013 10:41:41 +0000 (14:41 +0400)
classes/article.php
classes/rpc.php
js/viewfeed.js

index 79c94f59b482aaa81ded73851ea86ea18e55577f..6e42369366f34017263955fe9bcaf2709f2888aa 100644 (file)
@@ -208,5 +208,16 @@ class Article extends Handler_Protected {
 
        }
 
+       function setScore() {
+               $ids = db_escape_string($this->link, $_REQUEST['id']);
+               $score = (int)db_escape_string($this->link, $_REQUEST['score']);
+
+               db_query($this->link, "UPDATE ttrss_user_entries SET
+                       score = '$score' WHERE ref_id IN ($ids) AND owner_uid = " . $_SESSION["uid"]);
+
+               print json_encode(array("id" => $id,
+                       "score_pic" => get_score_pic($score)));
+       }
+
 
 }
index 64e09d1e7f8d0511a76639a6ad520ea23500a8af..d61b2891ad3c5286d85195e12a54e3d88e4d4bae 100644 (file)
@@ -632,17 +632,6 @@ class RPC extends Handler_Protected {
                return;
        }
 
-       function setScore() {
-               $ids = db_escape_string($this->link, $_REQUEST['id']);
-               $score = (int)db_escape_string($this->link, $_REQUEST['score']);
-
-               db_query($this->link, "UPDATE ttrss_user_entries SET
-                       score = '$score' WHERE ref_id IN ($ids) AND owner_uid = " . $_SESSION["uid"]);
-
-               print json_encode(array("id" => $id,
-                       "score_pic" => get_score_pic($score)));
-       }
-
        function setpanelmode() {
                $wide = (int) $_REQUEST["wide"];
 
index e3d73b89bb82c41812b41110edd3a1effba572b2..be2b88f4d80439436b7bdb31a76eb744ab75db65 100644 (file)
@@ -2020,7 +2020,7 @@ function setSelectionScore() {
                        var score = prompt(__("Please enter new score for selected articles:"), score);
 
                        if (score != undefined) {
-                               var query = "op=rpc&method=setScore&id=" + param_escape(ids.toString()) +
+                               var query = "op=article&method=setScore&id=" + param_escape(ids.toString()) +
                                        "&score=" + param_escape(score);
 
                                new Ajax.Request("backend.php", {
@@ -2063,7 +2063,7 @@ function changeScore(id, pic) {
 
                if (new_score != undefined) {
 
-                       var query = "op=rpc&method=setScore&id=" + param_escape(id) +
+                       var query = "op=article&method=setScore&id=" + param_escape(id) +
                                "&score=" + param_escape(new_score);
 
                        new Ajax.Request("backend.php", {