]> git.wh0rd.org - tt-rss.git/blob - classes/backend.php
help cleanup, use dijit dialog
[tt-rss.git] / classes / backend.php
1 <?php
2 class Backend extends Handler {
3 function loading() {
4 header("Content-type: text/html");
5 print __("Loading, please wait...") . " " .
6 "<img src='images/indicator_tiny.gif'>";
7 }
8
9 function digestTest() {
10 header("Content-type: text/html");
11
12 require_once "digest.php";
13
14 $rv = prepare_headlines_digest($this->link, $_SESSION['uid'], 1, 1000);
15
16 $rv[3] = "<pre>" . $rv[3] . "</pre>";
17
18 print_r($rv);
19 }
20
21 private function display_main_help() {
22 $info = get_hotkeys_info($this->link);
23 $imap = get_hotkeys_map($this->link);
24 $omap = array();
25
26 // :(
27 $tinycharmap = array(
28 "(9)" => "{TAB}",
29 "(191)" => "?");
30
31 foreach ($imap[1] as $sequence => $action) {
32 if (!isset($omap[$action])) {
33 $omap[$action] = isset($tinycharmap[$sequence]) ? $tinycharmap[$sequence] :
34 $sequence;
35 }
36 }
37
38 print "<ul class='helpKbList' id='helpKbList'>";
39
40 print "<h2>" . __("Keyboard Shortcuts") . "</h2>";
41
42 foreach ($info as $section => $hotkeys) {
43
44 print "<li><h3>" . $section . "</h3></li>";
45
46 foreach ($hotkeys as $action => $description) {
47 print "<li>";
48 print "<input dojoType=\"dijit.form.CheckBox\"
49 type=\"checkbox\" disabled=\"1\" checked=\"1\">";
50 print "<span class='hksequence'>" . $omap[$action] . "</span>";
51 print $description;
52 print "</li>";
53 }
54
55 }
56
57 print "</ul>";
58
59 print "<p><a target=\"_blank\" href=\"http://tt-rss.org/wiki/InterfaceTips\">".
60 __("Other interface tips are available in the Tiny Tiny RSS wiki.") .
61 "</a></p>";
62 }
63
64 function help() {
65 $topic = basename($_REQUEST["topic"]);
66
67 switch ($topic) {
68 case "main":
69 $this->display_main_help();
70 break;
71 case "prefs":
72 //$this->display_prefs_help();
73 break;
74 default:
75 print "<p>".__("Help topic not found.")."</p>";
76 }
77
78 print "<div align='center'>";
79 print "<button dojoType=\"dijit.form.Button\"
80 onclick=\"return dijit.byId('helpDlg').hide()\">".
81 __('Close this window')."</button>";
82 print "</div>";
83
84 /* if (file_exists("help/$topic.php")) {
85 include("help/$topic.php");
86 } else {
87 print "<p>".__("Help topic not found.")."</p>";
88 } */
89 /* print "<div align='center'>
90 <button onclick=\"javascript:window.close()\">".
91 __('Close this window')."</button></div>"; */
92
93 }
94 }
95 ?>