init.php 707 B

1234567891011121314151617181920212223242526272829303132333435363738
  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. function get_css() {
  14. return "i.icon-close-article { color : red; }";
  15. }
  16. /**
  17. * @SuppressWarnings(PHPMD.UnusedFormalParameter)
  18. */
  19. function hook_article_button($line) {
  20. if (!get_pref("COMBINED_DISPLAY_MODE")) {
  21. $rv = "<i class='material-icons icon-close-article'
  22. style='cursor : pointer' onclick='Article.close()'
  23. title='".__('Close article')."'>close</i>";
  24. }
  25. return $rv;
  26. }
  27. function api_version() {
  28. return 2;
  29. }
  30. }