]>
Commit | Line | Data |
---|---|---|
611efae7 AD |
1 | <?php |
2 | class Backend extends Handler { | |
611efae7 AD |
3 | function loading() { |
4 | header("Content-type: text/html"); | |
5 | print __("Loading, please wait...") . " " . | |
6 | "<img src='images/indicator_tiny.gif'>"; | |
7 | } | |
4f09f594 | 8 | |
8437c066 AD |
9 | function digestTest() { |
10 | header("Content-type: text/html"); | |
11 | ||
f1611683 AD |
12 | require_once "digest.php"; |
13 | ||
8437c066 AD |
14 | $rv = prepare_headlines_digest($this->link, $_SESSION['uid'], 1, 1000); |
15 | ||
16 | $rv[3] = "<pre>" . $rv[3] . "</pre>"; | |
17 | ||
18 | print_r($rv); | |
4f09f594 AD |
19 | } |
20 | ||
b8cb4d08 AD |
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) { | |
e5e2cf3b AD |
47 | if (strpos($omap[$action], "|") !== FALSE) { |
48 | $omap[$action] = substr($omap[$action], | |
49 | strpos($omap[$action], "|")+1, | |
50 | strlen($omap[$action])); | |
51 | } | |
52 | ||
b8cb4d08 | 53 | print "<li>"; |
b8cb4d08 AD |
54 | print "<span class='hksequence'>" . $omap[$action] . "</span>"; |
55 | print $description; | |
56 | print "</li>"; | |
57 | } | |
58 | ||
59 | } | |
60 | ||
61 | print "</ul>"; | |
62 | ||
63 | print "<p><a target=\"_blank\" href=\"http://tt-rss.org/wiki/InterfaceTips\">". | |
64 | __("Other interface tips are available in the Tiny Tiny RSS wiki.") . | |
65 | "</a></p>"; | |
66 | } | |
67 | ||
4f09f594 | 68 | function help() { |
66be620a | 69 | $topic = basename($_REQUEST["topic"]); |
4f09f594 | 70 | |
b8cb4d08 AD |
71 | switch ($topic) { |
72 | case "main": | |
73 | $this->display_main_help(); | |
74 | break; | |
75 | case "prefs": | |
76 | //$this->display_prefs_help(); | |
77 | break; | |
78 | default: | |
79 | print "<p>".__("Help topic not found.")."</p>"; | |
80 | } | |
81 | ||
82 | print "<div align='center'>"; | |
83 | print "<button dojoType=\"dijit.form.Button\" | |
84 | onclick=\"return dijit.byId('helpDlg').hide()\">". | |
85 | __('Close this window')."</button>"; | |
86 | print "</div>"; | |
87 | ||
88 | /* if (file_exists("help/$topic.php")) { | |
66be620a | 89 | include("help/$topic.php"); |
4f09f594 AD |
90 | } else { |
91 | print "<p>".__("Help topic not found.")."</p>"; | |
b8cb4d08 | 92 | } */ |
66be620a | 93 | /* print "<div align='center'> |
4f09f594 | 94 | <button onclick=\"javascript:window.close()\">". |
66be620a | 95 | __('Close this window')."</button></div>"; */ |
4f09f594 AD |
96 | |
97 | } | |
611efae7 AD |
98 | } |
99 | ?> |