]> git.wh0rd.org Git - tt-rss.git/commitdiff
instances: fix a few wrong calls, move genHash method from rpc
authorAndrew Dolgov <fox@madoka.volgo-balt.ru>
Tue, 2 Apr 2013 10:27:15 +0000 (14:27 +0400)
committerAndrew Dolgov <fox@madoka.volgo-balt.ru>
Tue, 2 Apr 2013 10:27:15 +0000 (14:27 +0400)
classes/rpc.php
plugins/instances/init.php
plugins/instances/instances.js

index 34f623b061b594ec043a433d660b659f779cbafc..d7872477efe0d97ad326037e1efc80cd161a62bf 100644 (file)
@@ -640,32 +640,6 @@ class RPC extends Handler_Protected {
                return;
        }
 
-       function verifyRegexp() {
-               $reg_exp = $_REQUEST["reg_exp"];
-
-               $status = @preg_match("/$reg_exp/i", "TEST") !== false;
-
-               print json_encode(array("status" => $status));
-       }
-
-       /* function buttonPlugin() {
-               $pclass = "button_" . basename($_REQUEST['plugin']);
-               $method = $_REQUEST['plugin_method'];
-
-               if (class_exists($pclass)) {
-                       $plugin = new $pclass($this->link);
-                       if (method_exists($plugin, $method)) {
-                               return $plugin->$method();
-                       }
-               }
-       } */
-
-       function genHash() {
-               $hash = sha1(uniqid(rand(), true));
-
-               print json_encode(array("hash" => $hash));
-       }
-
        function batchAddFeeds() {
                $cat_id = db_escape_string($this->link, $_REQUEST['cat']);
                $feeds = explode("\n", db_escape_string($this->link, $_REQUEST['feeds']));
index 6a7f7003a9a90076a167652c91f374ec133c57d7..7f822c7bffc8ea26f01a1f995c6432ed84f66a09 100644 (file)
@@ -442,5 +442,12 @@ class Instances extends Plugin implements IHandler {
                return;
        }
 
+       function genHash() {
+               $hash = sha1(uniqid(rand(), true));
+
+               print json_encode(array("hash" => $hash));
+       }
+
+
 }
 ?>
index 4a60692b3ce572de0a5c548469659f22fa84d5f8..f699acf72a010b6dc6548e2fcd8dcc87360cb19e 100644 (file)
@@ -11,7 +11,7 @@ function addInstance() {
                        style: "width: 600px",
                        regenKey: function() {
                                new Ajax.Request("backend.php", {
-                                       parameters: "?op=rpc&method=genHash",
+                                       parameters: "op=pluginhandler&plugin=instances&method=genHash",
                                        onComplete: function(transport) {
                                                var reply = JSON.parse(transport.responseText);
                                                if (reply)
@@ -47,7 +47,7 @@ function addInstance() {
 
 function updateInstanceList(sort_key) {
        new Ajax.Request("backend.php", {
-               parameters: "?op=pref-instances&sort=" + param_escape(sort_key),
+               parameters: "op=pluginhandler&plugin=instances&sort=" + param_escape(sort_key),
                onComplete: function(transport) {
                        dijit.byId('instanceConfigTab').attr('content', transport.responseText);
                        selectTab("instanceConfig", true);
@@ -62,7 +62,7 @@ function editInstance(id, event) {
                selectTableRows('prefInstanceList', 'none');
                selectTableRowById('LIRR-'+id, 'LICHK-'+id, true);
 
-               var query = "backend.php?op=pref-instances&method=edit&id=" +
+               var query = "backend.php?op=pluginhandler&plugin=instances&method=edit&id=" +
                        param_escape(id);
 
                if (dijit.byId("instanceEditDlg"))
@@ -74,7 +74,7 @@ function editInstance(id, event) {
                        style: "width: 600px",
                        regenKey: function() {
                                new Ajax.Request("backend.php", {
-                                       parameters: "?op=rpc&method=genHash",
+                                       parameters: "op=pluginhandler&plugin=instances&method=genHash",
                                        onComplete: function(transport) {
                                                var reply = JSON.parse(transport.responseText);
                                                if (reply)
@@ -124,7 +124,7 @@ function removeSelectedInstances() {
                        if (ok) {
                                notify_progress("Removing selected instances...");
 
-                               var query = "?op=pref-instances&method=remove&ids="+
+                               var query = "op=pluginhandler&plugin=instances&method=remove&ids="+
                                        param_escape(sel_rows.toString());
 
                                new Ajax.Request("backend.php", {