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