init.php 614 B

123456789101112131415161718192021222324252627282930
  1. <?php
  2. class Close_Button extends Plugin {
  3. private $link;
  4. private $host;
  5. function init($host) {
  6. $this->link = $host->get_link();
  7. $this->host = $host;
  8. $host->add_hook($host::HOOK_ARTICLE_BUTTON, $this);
  9. }
  10. function about() {
  11. return array(1.0,
  12. "Adds a button to close article panel",
  13. "fox");
  14. }
  15. function hook_article_button($line) {
  16. if (!get_pref($this->link, "COMBINED_DISPLAY_MODE")) {
  17. $rv = "<img src=\"plugins/close_button/button.png\"
  18. class='tagsPic' style=\"cursor : pointer\"
  19. onclick=\"closeArticlePanel()\"
  20. title='".__('Close article')."'>";
  21. }
  22. return $rv;
  23. }
  24. }
  25. ?>