From 4f09f594c24a2fbdacd6124ecdeb07b92814cb88 Mon Sep 17 00:00:00 2001 From: Andrew Dolgov Date: Tue, 13 Dec 2011 11:02:43 +0400 Subject: move help to backend class --- backend.php | 15 --------------- classes/backend.php | 18 ++++++++++++++++++ js/functions.js | 2 +- 3 files changed, 19 insertions(+), 16 deletions(-) diff --git a/backend.php b/backend.php index 0390ed761..8f197ee30 100644 --- a/backend.php +++ b/backend.php @@ -171,26 +171,11 @@ 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...") . " " . - ""; - break; // loading - default: header("Content-Type: text/plain"); print json_encode(array("error" => array("code" => 7))); diff --git a/classes/backend.php b/classes/backend.php index 47fc2d826..f7e7b84b8 100644 --- a/classes/backend.php +++ b/classes/backend.php @@ -6,5 +6,23 @@ class Backend extends Handler { print __("Loading, please wait...") . " " . ""; } + + 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 "

".__("Help topic not found.")."

"; + } + print "
+
"; + + } } ?> diff --git a/js/functions.js b/js/functions.js index 37aa73bc9..69406f3e1 100644 --- a/js/functions.js +++ b/js/functions.js @@ -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"); -- cgit v1.2.3