init.php 650 B

1234567891011121314151617181920212223242526272829303132333435
  1. <?php
  2. class Close_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. "Adds a button to close article panel",
  11. "fox");
  12. }
  13. /**
  14. * @SuppressWarnings(PHPMD.UnusedFormalParameter)
  15. */
  16. function hook_article_button($line) {
  17. if (!get_pref("COMBINED_DISPLAY_MODE")) {
  18. $rv = "<img src=\"plugins/close_button/button.png\"
  19. class='tagsPic' style=\"cursor : pointer\"
  20. onclick=\"closeArticlePanel()\"
  21. title='".__('Close article')."'>";
  22. }
  23. return $rv;
  24. }
  25. function api_version() {
  26. return 2;
  27. }
  28. }