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

index eda03d126393d779da581af22da5bef827646cae..aa018ee10d3a959a0d335edbca461b6677c6cbcd 100644 (file)
@@ -1751,7 +1751,7 @@ class Pref_Feeds extends Handler_Protected {
        }
 
        function batchSubscribe() {
-               print "<input dojoType=\"dijit.form.TextBox\" style=\"display : none\" name=\"op\" value=\"rpc\">";
+               print "<input dojoType=\"dijit.form.TextBox\" style=\"display : none\" name=\"op\" value=\"pref-feeds\">";
                print "<input dojoType=\"dijit.form.TextBox\" style=\"display : none\" name=\"method\" value=\"batchaddfeeds\">";
 
                print "<table width='100%'><tr><td>
@@ -1798,6 +1798,41 @@ class Pref_Feeds extends Handler_Protected {
                        </div>";
        }
 
+       function batchAddFeeds() {
+               $cat_id = db_escape_string($this->link, $_REQUEST['cat']);
+               $feeds = explode("\n", db_escape_string($this->link, $_REQUEST['feeds']));
+               $login = db_escape_string($this->link, $_REQUEST['login']);
+               $pass = db_escape_string($this->link, $_REQUEST['pass']);
+
+               foreach ($feeds as $feed) {
+                       $feed = trim($feed);
+
+                       if (validate_feed_url($feed)) {
+
+                               db_query($this->link, "BEGIN");
+
+                               if ($cat_id == "0" || !$cat_id) {
+                                       $cat_qpart = "NULL";
+                               } else {
+                                       $cat_qpart = "'$cat_id'";
+                               }
+
+                               $result = db_query($this->link,
+                                       "SELECT id FROM ttrss_feeds
+                                       WHERE feed_url = '$feed' AND owner_uid = ".$_SESSION["uid"]);
+
+                               if (db_num_rows($result) == 0) {
+                                       $result = db_query($this->link,
+                                               "INSERT INTO ttrss_feeds
+                                                       (owner_uid,feed_url,title,cat_id,auth_login,auth_pass,update_method)
+                                               VALUES ('".$_SESSION["uid"]."', '$feed',
+                                                       '[Unknown]', $cat_qpart, '$login', '$pass', 0)");
+                               }
+
+                               db_query($this->link, "COMMIT");
+                       }
+               }
+       }
 
 }
 ?>
index d7872477efe0d97ad326037e1efc80cd161a62bf..36d7083a598ce8ffbdad4293bd4359df5c8e15a9 100644 (file)
@@ -640,42 +640,6 @@ class RPC extends Handler_Protected {
                return;
        }
 
-       function batchAddFeeds() {
-               $cat_id = db_escape_string($this->link, $_REQUEST['cat']);
-               $feeds = explode("\n", db_escape_string($this->link, $_REQUEST['feeds']));
-               $login = db_escape_string($this->link, $_REQUEST['login']);
-               $pass = db_escape_string($this->link, $_REQUEST['pass']);
-
-               foreach ($feeds as $feed) {
-                       $feed = trim($feed);
-
-                       if (validate_feed_url($feed)) {
-
-                               db_query($this->link, "BEGIN");
-
-                               if ($cat_id == "0" || !$cat_id) {
-                                       $cat_qpart = "NULL";
-                               } else {
-                                       $cat_qpart = "'$cat_id'";
-                               }
-
-                               $result = db_query($this->link,
-                                       "SELECT id FROM ttrss_feeds
-                                       WHERE feed_url = '$feed' AND owner_uid = ".$_SESSION["uid"]);
-
-                               if (db_num_rows($result) == 0) {
-                                       $result = db_query($this->link,
-                                               "INSERT INTO ttrss_feeds
-                                                       (owner_uid,feed_url,title,cat_id,auth_login,auth_pass,update_method)
-                                               VALUES ('".$_SESSION["uid"]."', '$feed',
-                                                       '[Unknown]', $cat_qpart, '$login', '$pass', 0)");
-                               }
-
-                               db_query($this->link, "COMMIT");
-                       }
-               }
-       }
-
        function setScore() {
                $ids = db_escape_string($this->link, $_REQUEST['id']);
                $score = (int)db_escape_string($this->link, $_REQUEST['score']);