register_hook('TOOLBAR_DEFINE', 'AFTER', $this, 'handle_toolbar', array());
}
function handle_toolbar(&$event, $param): bool
{
/**
* Relative path against
* DOKUBASE/lib/images/toolbar/
*/
$imageBase = '../../plugins/combo/resources/images';
$unit = array(
'type' => 'format',
'title' => 'Insert an unit test',
'icon' => $imageBase . '/unit-doc-block.png',
'open' => '\n\n\n\t',
'close' => '\n\t
\n\t\n\t\n',
// 'key' => $unitShortcutKey
);
/**
* This is called from the js.php with a get HTTP
* There is no knowledge of which page is modified
*/
$frontmatterInsert = << 'insert',
'title' => 'Insert a frontmatter',
'icon' => $imageBase . '/table-of-contents.svg',
'insert' => $frontmatterInsert,
'block' => true
);
$blockquote = array(
'type' => 'format',
'title' => 'blockquote',
'icon' => $imageBase . '/blockquote-icon.png',
'open' => '',
'close' => '
',
);
$webcode = array(
'type' => 'format',
'title' => 'webcode',
'icon' => $imageBase . '/code-square.svg',
'open' => '\n',
'close' => '\n\n'
//'key' => $webCodeShortcutKey
);
$twitter = array(
'type' => 'format',
'title' => 'twitter',
'icon' => $imageBase . '/twitter.svg',
'open' => '\n[[',
'close' => ']]\n
\n'
//'key' => $webCodeShortcutKey
);
$event->data[] = array(
'type' => 'picker',
'title' => "Choose comboStrap component",
'icon' => $imageBase . '/logo.svg',
'list' => array($frontmatter, $blockquote, $webcode, $twitter, $unit)
);
return true;
}
}