]> git.wh0rd.org Git - tt-rss.git/commitdiff
move help to backend class
authorAndrew Dolgov <fox@fakecake.org>
Tue, 13 Dec 2011 07:02:43 +0000 (11:02 +0400)
committerAndrew Dolgov <fox@fakecake.org>
Tue, 13 Dec 2011 07:02:43 +0000 (11:02 +0400)
backend.php
classes/backend.php
js/functions.js

index 0390ed761a8e1a94d81eae02b0941deb43d5ea19..8f197ee3074249b49ed5abb96581d6cd7474d57e 100644 (file)
                        module_pref_users($link);
                break; // prefs-users
 
-               case "help":
-                       require_once "modules/help.php";
-                       module_help($link);
-               break; // help
-
                case "pref-instances":
                        require_once "modules/pref-instances.php";
                        module_pref_instances($link);
                break; // pref-instances
 
-               case "digestSend":
-                       send_headlines_digests($link);
-               break; // digestSend
-
-               case "loading":
-                       header("Content-type: text/html");
-                       print __("Loading, please wait...") . " " .
-                               "<img src='images/indicator_tiny.gif'>";
-               break; // loading
-
                default:
                        header("Content-Type: text/plain");
                        print json_encode(array("error" => array("code" => 7)));
index 47fc2d826e5a3691c1eac1939498ceb96cbad1e6..f7e7b84b816e55abbd436dafbe5a21a08c3e801a 100644 (file)
@@ -6,5 +6,23 @@ class Backend extends Handler {
                print __("Loading, please wait...") . " " .
                        "<img src='images/indicator_tiny.gif'>";
        }
+
+       function digestSend() {
+               send_headlines_digests($this->link);
+       }
+
+       function help() {
+               $tid = (int) $_REQUEST["tid"];
+
+               if (file_exists("help/$tid.php")) {
+                       include("help/$tid.php");
+               } else {
+                       print "<p>".__("Help topic not found.")."</p>";
+               }
+               print "<div align='center'>
+                       <button onclick=\"javascript:window.close()\">".
+                       __('Close this window')."</button></div>";
+
+       }
 }
 ?>
index 37aa73bc97ae98f436cef7138ca7832ae673c999..69406f3e1100954f966de325a74c40d6b127db4f 100644 (file)
@@ -636,7 +636,7 @@ function explainError(code) {
 
 function displayHelpInfobox(topic_id) {
 
-       var url = "backend.php?op=help&tid=" + param_escape(topic_id);
+       var url = "backend.php?op=backend&method=help&tid=" + param_escape(topic_id);
 
        window.open(url, "ttrss_help",
                "status=0,toolbar=0,location=0,width=450,height=500,scrollbars=1,menubar=0");