]> git.wh0rd.org - tt-rss.git/blob - classes/backend.php
pngcrush.sh
[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 $rv = Digest::prepare_headlines_digest($_SESSION['uid'], 1, 1000);
13
14 $rv[3] = "<pre>" . $rv[3] . "</pre>";
15
16 print_r($rv);
17 }
18
19 private function display_main_help() {
20 $info = get_hotkeys_info();
21 $imap = get_hotkeys_map();
22 $omap = array();
23
24 foreach ($imap[1] as $sequence => $action) {
25 if (!isset($omap[$action])) $omap[$action] = array();
26
27 array_push($omap[$action], $sequence);
28 }
29
30 print_notice("<a target=\"_blank\" href=\"http://tt-rss.org/wiki/InterfaceTips\">".
31 __("Other interface tips are available in the Tiny Tiny RSS wiki.") .
32 "</a>");
33
34 print "<ul class='helpKbList' id='helpKbList'>";
35
36 print "<h2>" . __("Keyboard Shortcuts") . "</h2>";
37
38 foreach ($info as $section => $hotkeys) {
39
40 print "<li><h3>" . $section . "</h3></li>";
41
42 foreach ($hotkeys as $action => $description) {
43
44 if (is_array($omap[$action])) {
45 foreach ($omap[$action] as $sequence) {
46 if (strpos($sequence, "|") !== FALSE) {
47 $sequence = substr($sequence,
48 strpos($sequence, "|")+1,
49 strlen($sequence));
50 } else {
51 $keys = explode(" ", $sequence);
52
53 for ($i = 0; $i < count($keys); $i++) {
54 if (strlen($keys[$i]) > 1) {
55 $tmp = '';
56 foreach (str_split($keys[$i]) as $c) {
57 switch ($c) {
58 case '*':
59 $tmp .= __('Shift') . '+';
60 break;
61 case '^':
62 $tmp .= __('Ctrl') . '+';
63 break;
64 default:
65 $tmp .= $c;
66 }
67 }
68 $keys[$i] = $tmp;
69 }
70 }
71 $sequence = join(" ", $keys);
72 }
73
74 print "<li>";
75 print "<span class='hksequence'>$sequence</span>";
76 print $description;
77 print "</li>";
78 }
79 }
80 }
81 }
82
83 print "</ul>";
84 }
85
86 function help() {
87 $topic = basename(clean($_REQUEST["topic"]));
88
89 switch ($topic) {
90 case "main":
91 $this->display_main_help();
92 break;
93 case "prefs":
94 //$this->display_prefs_help();
95 break;
96 default:
97 print "<p>".__("Help topic not found.")."</p>";
98 }
99
100 print "<div align='center'>";
101 print "<button dojoType=\"dijit.form.Button\"
102 onclick=\"return dijit.byId('helpDlg').hide()\">".
103 __('Close this window')."</button>";
104 print "</div>";
105
106 /* if (file_exists("help/$topic.php")) {
107 include("help/$topic.php");
108 } else {
109 print "<p>".__("Help topic not found.")."</p>";
110 } */
111 /* print "<div align='center'>
112 <button onclick=\"javascript:window.close()\">".
113 __('Close this window')."</button></div>"; */
114
115 }
116 }