init.php 727 B

123456789101112131415161718192021222324252627282930313233343536
  1. <?php
  2. class Toggle_Sort_Titles extends Plugin {
  3. private $host;
  4. function about() {
  5. return array(1.0,
  6. "Add a 't' hotkey to toggle headlines sorting by title and by default",
  7. "ggrandou" );
  8. }
  9. function init($host) {
  10. $this->host = $host;
  11. $host->add_hook($host::HOOK_HOTKEY_INFO, $this);
  12. $host->add_hook($host::HOOK_HOTKEY_MAP, $this);
  13. }
  14. function hook_hotkey_info($hotkeys) {
  15. $hotkeys[__("Feed")]["feed_toggle_title"] = __("Toggle Headlines grouping by Titles");
  16. return $hotkeys;
  17. }
  18. function hook_hotkey_map($hotkeys) {
  19. $hotkeys["t"] = "feed_toggle_title";
  20. return $hotkeys;
  21. }
  22. function get_js() {
  23. return file_get_contents(__DIR__ . "/init.js");
  24. }
  25. function api_version() {
  26. return 2;
  27. }
  28. }
  29. ?>