]> git.wh0rd.org - tt-rss.git/blame - classes/backend.php
pngcrush.sh
[tt-rss.git] / classes / backend.php
CommitLineData
611efae7
AD
1<?php
2class 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
c2f0f24e 12 $rv = Digest::prepare_headlines_digest($_SESSION['uid'], 1, 1000);
8437c066
AD
13
14 $rv[3] = "<pre>" . $rv[3] . "</pre>";
15
16 print_r($rv);
4f09f594
AD
17 }
18
b8cb4d08 19 private function display_main_help() {
6322ac79
AD
20 $info = get_hotkeys_info();
21 $imap = get_hotkeys_map();
b8cb4d08
AD
22 $omap = array();
23
b8cb4d08 24 foreach ($imap[1] as $sequence => $action) {
c2e4e8fe
AD
25 if (!isset($omap[$action])) $omap[$action] = array();
26
27 array_push($omap[$action], $sequence);
b8cb4d08
AD
28 }
29
fcef9eea
AD
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
b8cb4d08
AD
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) {
e5e2cf3b 43
7d272e5c
AD
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));
5b18c936
AD
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);
7d272e5c
AD
72 }
73
74 print "<li>";
75 print "<span class='hksequence'>$sequence</span>";
76 print $description;
77 print "</li>";
c2e4e8fe 78 }
c2e4e8fe
AD
79 }
80 }
b8cb4d08
AD
81 }
82
83 print "</ul>";
b8cb4d08
AD
84 }
85
4f09f594 86 function help() {
e6532439 87 $topic = basename(clean($_REQUEST["topic"]));
4f09f594 88
b8cb4d08
AD
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")) {
66be620a 107 include("help/$topic.php");
4f09f594
AD
108 } else {
109 print "<p>".__("Help topic not found.")."</p>";
b8cb4d08 110 } */
66be620a 111 /* print "<div align='center'>
4f09f594 112 <button onclick=\"javascript:window.close()\">".
66be620a 113 __('Close this window')."</button></div>"; */
4f09f594
AD
114
115 }
ea79a0e0 116}