action.php 1.2 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253
  1. <?php
  2. /**
  3. * JCapture plugin.
  4. *
  5. * @author Pavel Vlasov
  6. */
  7. if (!defined('DOKU_INC')) {
  8. die();
  9. }
  10. if (!defined('DOKU_PLUGIN')) {
  11. define('DOKU_PLUGIN', DOKU_INC.'lib/plugins/');
  12. }
  13. require_once DOKU_PLUGIN.'action.php';
  14. class action_plugin_jcapture extends DokuWiki_Action_Plugin
  15. {
  16. /**
  17. * return some info.
  18. */
  19. public function getInfo()
  20. {
  21. return [
  22. 'author' => 'Pavel Vlasov',
  23. 'email' => 'Pavel.Vlasov@nasdanika.com',
  24. 'name' => 'JCapture',
  25. 'desc' => 'Plugin for making screen captures.',
  26. 'url' => 'http://www.nasdanika.com/wiki/doku.php?id=products:jcapture:start',
  27. ];
  28. }
  29. /**
  30. * Register the eventhandlers.
  31. */
  32. public function register(&$controller)
  33. {
  34. $controller->register_hook('TOOLBAR_DEFINE', 'AFTER', $this, 'insert_button', []);
  35. }
  36. /**
  37. * Inserts the toolbar button.
  38. */
  39. public function insert_button(&$event, $param)
  40. {
  41. $event->data[] = [
  42. 'type' => 'JCapture',
  43. 'title' => 'Screen capture',
  44. 'icon' => '../../plugins/jcapture/camera.png',
  45. 'open' => '<abutton>',
  46. 'close' => '</abutton>',
  47. ];
  48. }
  49. }