*/
class action_plugin_dokudrawingboard extends \dokuwiki\Extension\ActionPlugin
{
/** @inheritDoc */
public function register(Doku_Event_Handler $controller)
{
$controller->register_hook('TOOLBAR_DEFINE', 'AFTER', $this, 'handle_toolbar_define',array());
$controller->register_hook('TPL_METAHEADER_OUTPUT', 'BEFORE', $this,'_hookjs');
$controller->register_hook('ACTION_ACT_PREPROCESS', 'BEFORE', $this, 'allowMyAction');
$controller->register_hook('TPL_ACT_UNKNOWN', 'BEFORE', $this, 'performMyAction');
}
/**
* FIXME Event handler for
*
* @param Doku_Event $event event object by reference
* @param mixed $param optional parameter passed when event was registered
* @return void
*/
public function handle_toolbar_define(Doku_Event $event, $param)
{
$event->data[] = array (
'type' => 'dokudrawingboard',
'title' => $this->getLang('qb_abutton'),
'icon' => '../../plugins/dokudrawingboard/drawingboard.png',
);
}
public function _hookjs(Doku_Event $event, $param) {
$event->data['script'][] = array(
'type' => 'text/javascript',
'charset' => 'utf-8',
'_data' => '',
'src' => DOKU_BASE.'lib/plugins/dokudrawingboard/script.js');
}
public function allowMyAction(Doku_Event $event, $param) {
if($event->data != 'dokudrawingboard') return;
$event->preventDefault();
}
public function performMyAction(Doku_Event $event, $param) {
if($event->data != 'dokudrawingboard') return;
$event->preventDefault();
// width =100% height = "1000 px"
echo'';
echo'';
}
}