init.php 810 B

12345678910111213141516171819202122232425262728293031323334353637383940414243
  1. <?php
  2. class Mark_Button extends Plugin {
  3. private $host;
  4. function init($host) {
  5. $this->host = $host;
  6. $host->add_hook($host::HOOK_ARTICLE_BUTTON, $this);
  7. }
  8. function about() {
  9. return array(1.0,
  10. "Bottom un/star button for the combined mode",
  11. "fox");
  12. }
  13. function hook_article_button($line) {
  14. $marked_pic = "";
  15. $id = $line["id"];
  16. if (get_pref("COMBINED_DISPLAY_MODE")) {
  17. if (sql_bool_to_bool($line["marked"])) {
  18. $marked_pic = "<img
  19. src=\"images/mark_set.png\"
  20. class=\"markedPic\" alt=\"Unstar article\"
  21. onclick='toggleMark($id)'>";
  22. } else {
  23. $marked_pic = "<img
  24. src=\"images/mark_unset.png\"
  25. class=\"markedPic\" alt=\"Star article\"
  26. onclick='toggleMark($id)'>";
  27. }
  28. }
  29. return $marked_pic;
  30. }
  31. function api_version() {
  32. return 2;
  33. }
  34. }
  35. ?>