move help to backend class

This commit is contained in:
Andrew Dolgov 2011-12-13 11:02:43 +04:00
parent 611efae712
commit 4f09f594c2
3 changed files with 19 additions and 16 deletions

View File

@ -171,26 +171,11 @@
module_pref_users($link); module_pref_users($link);
break; // prefs-users break; // prefs-users
case "help":
require_once "modules/help.php";
module_help($link);
break; // help
case "pref-instances": case "pref-instances":
require_once "modules/pref-instances.php"; require_once "modules/pref-instances.php";
module_pref_instances($link); module_pref_instances($link);
break; // pref-instances 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: default:
header("Content-Type: text/plain"); header("Content-Type: text/plain");
print json_encode(array("error" => array("code" => 7))); print json_encode(array("error" => array("code" => 7)));

View File

@ -6,5 +6,23 @@ class Backend extends Handler {
print __("Loading, please wait...") . " " . print __("Loading, please wait...") . " " .
"<img src='images/indicator_tiny.gif'>"; "<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>";
}
} }
?> ?>

View File

@ -636,7 +636,7 @@ function explainError(code) {
function displayHelpInfobox(topic_id) { 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", window.open(url, "ttrss_help",
"status=0,toolbar=0,location=0,width=450,height=500,scrollbars=1,menubar=0"); "status=0,toolbar=0,location=0,width=450,height=500,scrollbars=1,menubar=0");