]> git.wh0rd.org Git - tt-rss.git/commitdiff
move addInstance call to instances plugin
authorAndrew Dolgov <fox@madoka.volgo-balt.ru>
Mon, 1 Apr 2013 08:31:55 +0000 (12:31 +0400)
committerAndrew Dolgov <fox@madoka.volgo-balt.ru>
Mon, 1 Apr 2013 08:31:55 +0000 (12:31 +0400)
classes/dlg.php
plugins/instances/init.php
plugins/instances/instances.js

index 36f3ee07590f451919ce2415b9c9e599a8f5d63b..376f8d265d22980ff251136c5d842bdbc6847352 100644 (file)
@@ -383,55 +383,6 @@ class Dlg extends Handler_Protected {
 
        }
 
-       function addInstance() {
-               print "<input dojoType=\"dijit.form.TextBox\" style=\"display : none\"  name=\"op\" value=\"pref-instances\">";
-               print "<input dojoType=\"dijit.form.TextBox\" style=\"display : none\"  name=\"method\" value=\"add\">";
-
-               print "<div class=\"dlgSec\">".__("Instance")."</div>";
-
-               print "<div class=\"dlgSecCont\">";
-
-               /* URL */
-
-               print __("URL:") . " ";
-
-               print "<input dojoType=\"dijit.form.ValidationTextBox\" required=\"1\"
-                       placeHolder=\"".__("Instance URL")."\"
-                       regExp='^(http|https)://.*'
-                       style=\"font-size : 16px; width: 20em\" name=\"access_url\">";
-
-               print "<hr/>";
-
-               $access_key = sha1(uniqid(rand(), true));
-
-               /* Access key */
-
-               print __("Access key:") . " ";
-
-               print "<input dojoType=\"dijit.form.ValidationTextBox\" required=\"1\"
-                       placeHolder=\"".__("Access key")."\" regExp='\w{40}'
-                       style=\"width: 20em\" name=\"access_key\" id=\"instance_add_key\"
-                       value=\"$access_key\">";
-
-               print "<p class='insensitive'>" . __("Use one access key for both linked instances.");
-
-               print "</div>";
-
-               print "<div class=\"dlgButtons\">
-                       <div style='float : left'>
-                               <button dojoType=\"dijit.form.Button\"
-                                       onclick=\"return dijit.byId('instanceAddDlg').regenKey()\">".
-                                       __('Generate new key')."</button>
-                       </div>
-                       <button dojoType=\"dijit.form.Button\"
-                               onclick=\"return dijit.byId('instanceAddDlg').execute()\">".
-                               __('Create link')."</button>
-                       <button dojoType=\"dijit.form.Button\"
-                               onclick=\"return dijit.byId('instanceAddDlg').hide()\"\">".
-                               __('Cancel')."</button></div>";
-
-               return;
-       }
 
        function batchSubscribe() {
                print "<input dojoType=\"dijit.form.TextBox\" style=\"display : none\" name=\"op\" value=\"rpc\">";
index 6e8d43e9bdf73f2354727ac8396e9e5756428a76..6a7f7003a9a90076a167652c91f374ec133c57d7 100644 (file)
@@ -392,6 +392,55 @@ class Instances extends Plugin implements IHandler {
                }
        }
 
+       function addInstance() {
+               print "<input dojoType=\"dijit.form.TextBox\" style=\"display : none\"  name=\"op\" value=\"pref-instances\">";
+               print "<input dojoType=\"dijit.form.TextBox\" style=\"display : none\"  name=\"method\" value=\"add\">";
+
+               print "<div class=\"dlgSec\">".__("Instance")."</div>";
+
+               print "<div class=\"dlgSecCont\">";
+
+               /* URL */
+
+               print __("URL:") . " ";
+
+               print "<input dojoType=\"dijit.form.ValidationTextBox\" required=\"1\"
+                       placeHolder=\"".__("Instance URL")."\"
+                       regExp='^(http|https)://.*'
+                       style=\"font-size : 16px; width: 20em\" name=\"access_url\">";
+
+               print "<hr/>";
+
+               $access_key = sha1(uniqid(rand(), true));
+
+               /* Access key */
+
+               print __("Access key:") . " ";
+
+               print "<input dojoType=\"dijit.form.ValidationTextBox\" required=\"1\"
+                       placeHolder=\"".__("Access key")."\" regExp='\w{40}'
+                       style=\"width: 20em\" name=\"access_key\" id=\"instance_add_key\"
+                       value=\"$access_key\">";
+
+               print "<p class='insensitive'>" . __("Use one access key for both linked instances.");
+
+               print "</div>";
+
+               print "<div class=\"dlgButtons\">
+                       <div style='float : left'>
+                               <button dojoType=\"dijit.form.Button\"
+                                       onclick=\"return dijit.byId('instanceAddDlg').regenKey()\">".
+                                       __('Generate new key')."</button>
+                       </div>
+                       <button dojoType=\"dijit.form.Button\"
+                               onclick=\"return dijit.byId('instanceAddDlg').execute()\">".
+                               __('Create link')."</button>
+                       <button dojoType=\"dijit.form.Button\"
+                               onclick=\"return dijit.byId('instanceAddDlg').hide()\"\">".
+                               __('Cancel')."</button></div>";
+
+               return;
+       }
 
 }
 ?>
index 83213896d8f91bb52ebf511340ac378d018e0e2a..4a60692b3ce572de0a5c548469659f22fa84d5f8 100644 (file)
@@ -1,6 +1,6 @@
 function addInstance() {
        try {
-               var query = "backend.php?op=dlg&method=addInstance";
+               var query = "backend.php?op=pluginhandler&plugin=instances&method=addInstance";
 
                if (dijit.byId("instanceAddDlg"))
                        dijit.byId("instanceAddDlg").destroyRecursive();