]> git.wh0rd.org - tt-rss.git/blame - classes/backend.php
remove $link
[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
f1611683
AD
12 require_once "digest.php";
13
6322ac79 14 $rv = prepare_headlines_digest( $_SESSION['uid'], 1, 1000);
8437c066
AD
15
16 $rv[3] = "<pre>" . $rv[3] . "</pre>";
17
18 print_r($rv);
4f09f594
AD
19 }
20
b8cb4d08 21 private function display_main_help() {
6322ac79
AD
22 $info = get_hotkeys_info();
23 $imap = get_hotkeys_map();
b8cb4d08
AD
24 $omap = array();
25
b8cb4d08 26 foreach ($imap[1] as $sequence => $action) {
c2e4e8fe
AD
27 if (!isset($omap[$action])) $omap[$action] = array();
28
29 array_push($omap[$action], $sequence);
b8cb4d08
AD
30 }
31
fcef9eea
AD
32 print_notice("<a target=\"_blank\" href=\"http://tt-rss.org/wiki/InterfaceTips\">".
33 __("Other interface tips are available in the Tiny Tiny RSS wiki.") .
34 "</a>");
35
b8cb4d08
AD
36 print "<ul class='helpKbList' id='helpKbList'>";
37
38 print "<h2>" . __("Keyboard Shortcuts") . "</h2>";
39
40 foreach ($info as $section => $hotkeys) {
41
42 print "<li><h3>" . $section . "</h3></li>";
43
44 foreach ($hotkeys as $action => $description) {
e5e2cf3b 45
7d272e5c
AD
46 if (is_array($omap[$action])) {
47 foreach ($omap[$action] as $sequence) {
48 if (strpos($sequence, "|") !== FALSE) {
49 $sequence = substr($sequence,
50 strpos($sequence, "|")+1,
51 strlen($sequence));
5b18c936
AD
52 } else {
53 $keys = explode(" ", $sequence);
54
55 for ($i = 0; $i < count($keys); $i++) {
56 if (strlen($keys[$i]) > 1) {
57 $tmp = '';
58 foreach (str_split($keys[$i]) as $c) {
59 switch ($c) {
60 case '*':
61 $tmp .= __('Shift') . '+';
62 break;
63 case '^':
64 $tmp .= __('Ctrl') . '+';
65 break;
66 default:
67 $tmp .= $c;
68 }
69 }
70 $keys[$i] = $tmp;
71 }
72 }
73 $sequence = join(" ", $keys);
7d272e5c
AD
74 }
75
76 print "<li>";
77 print "<span class='hksequence'>$sequence</span>";
78 print $description;
79 print "</li>";
c2e4e8fe 80 }
c2e4e8fe
AD
81 }
82 }
b8cb4d08
AD
83 }
84
85 print "</ul>";
b8cb4d08
AD
86 }
87
4f09f594 88 function help() {
66be620a 89 $topic = basename($_REQUEST["topic"]);
4f09f594 90
b8cb4d08
AD
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")) {
66be620a 109 include("help/$topic.php");
4f09f594
AD
110 } else {
111 print "<p>".__("Help topic not found.")."</p>";
b8cb4d08 112 } */
66be620a 113 /* print "<div align='center'>
4f09f594 114 <button onclick=\"javascript:window.close()\">".
66be620a 115 __('Close this window')."</button></div>"; */
4f09f594
AD
116
117 }
611efae7
AD
118}
119?>