backend.php 2.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899
  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. function digestTest() {
  9. header("Content-type: text/html");
  10. require_once "digest.php";
  11. $rv = prepare_headlines_digest($this->link, $_SESSION['uid'], 1, 1000);
  12. $rv[3] = "<pre>" . $rv[3] . "</pre>";
  13. print_r($rv);
  14. }
  15. private function display_main_help() {
  16. $info = get_hotkeys_info($this->link);
  17. $imap = get_hotkeys_map($this->link);
  18. $omap = array();
  19. // :(
  20. $tinycharmap = array(
  21. "(9)" => "{TAB}",
  22. "(191)" => "?");
  23. foreach ($imap[1] as $sequence => $action) {
  24. if (!isset($omap[$action])) {
  25. $omap[$action] = isset($tinycharmap[$sequence]) ? $tinycharmap[$sequence] :
  26. $sequence;
  27. }
  28. }
  29. print "<ul class='helpKbList' id='helpKbList'>";
  30. print "<h2>" . __("Keyboard Shortcuts") . "</h2>";
  31. foreach ($info as $section => $hotkeys) {
  32. print "<li><h3>" . $section . "</h3></li>";
  33. foreach ($hotkeys as $action => $description) {
  34. if (strpos($omap[$action], "|") !== FALSE) {
  35. $omap[$action] = substr($omap[$action],
  36. strpos($omap[$action], "|")+1,
  37. strlen($omap[$action]));
  38. }
  39. print "<li>";
  40. print "<span class='hksequence'>" . $omap[$action] . "</span>";
  41. print $description;
  42. print "</li>";
  43. }
  44. }
  45. print "</ul>";
  46. print "<p><a target=\"_blank\" href=\"http://tt-rss.org/wiki/InterfaceTips\">".
  47. __("Other interface tips are available in the Tiny Tiny RSS wiki.") .
  48. "</a></p>";
  49. }
  50. function help() {
  51. $topic = basename($_REQUEST["topic"]);
  52. switch ($topic) {
  53. case "main":
  54. $this->display_main_help();
  55. break;
  56. case "prefs":
  57. //$this->display_prefs_help();
  58. break;
  59. default:
  60. print "<p>".__("Help topic not found.")."</p>";
  61. }
  62. print "<div align='center'>";
  63. print "<button dojoType=\"dijit.form.Button\"
  64. onclick=\"return dijit.byId('helpDlg').hide()\">".
  65. __('Close this window')."</button>";
  66. print "</div>";
  67. /* if (file_exists("help/$topic.php")) {
  68. include("help/$topic.php");
  69. } else {
  70. print "<p>".__("Help topic not found.")."</p>";
  71. } */
  72. /* print "<div align='center'>
  73. <button onclick=\"javascript:window.close()\">".
  74. __('Close this window')."</button></div>"; */
  75. }
  76. }
  77. ?>