* @author Sascha Leib */ class action_plugin_adhoctags extends DokuWiki_Action_Plugin { /** * register the eventhandlers * * @author Andreas Gohr * @author Sascha Leib */ function register(Doku_Event_Handler $controller){ $controller->register_hook('TOOLBAR_DEFINE', 'AFTER', $this, 'handle_toolbar', array ()); } function handle_toolbar(Doku_Event $event, $param) { $syntaxDiv = $this->getConf('syntaxDiv'); $syntaxSpan = $this->getConf('syntaxSpan'); $event->data[] = array ( 'type' => 'picker', 'title' => $this->getLang('picker'), 'icon' => '../../plugins/adhoctags/images/code-tags.svg', 'id' => 'tbbtn_adhoctagsInline', 'list' => array( /* inline elements */ array( 'type' => 'format', 'title' => $this->getLang('b').': <𝚋>', 'icon' => '../../plugins/adhoctags/images/format-bold.svg', 'open' => '', 'close' => '', 'sample' => 'Bold' ), array( 'type' => 'format', 'title' => $this->getLang('i').': <𝚒>', 'icon' => '../../plugins/adhoctags/images/format-italic.svg', 'open' => '', 'close' => '', 'sample' => 'Italic' ), array( 'type' => 'format', 'title' => $this->getLang('s').': <𝚜>', 'icon' => '../../plugins/adhoctags/images/format-strikethrough-variant.svg', 'open' => '', 'close' => '', 'sample' => 'Strikethrough' ), array( 'type' => 'format', 'title' => $this->getLang('u').': <𝚞>', 'icon' => '../../plugins/adhoctags/images/format-underline-wavy.svg', 'open' => '', 'close' => '', 'sample' => 'Underline' ), array( 'type' => 'format', 'title' => $this->getLang('small').': <𝚜𝚖𝚊𝚕𝚕>', 'icon' => '../../plugins/adhoctags/images/format-size.svg', 'open' => '', 'close' => '', 'sample' => 'smaller' ), array( 'type' => 'format', 'title' => $this->getLang('q').': <𝚚>', 'icon' => '../../plugins/adhoctags/images/format-quote-open.svg', 'open' => '', 'close' => '', 'sample' => 'Quotation' ), array( 'type' => 'format', 'title' => $this->getLang('abbr').': <𝚊𝚋𝚋𝚛>', 'icon' => '../../plugins/adhoctags/images/abbr.svg', 'open' => '', 'close' => '', 'sample' => 'ABBR' ), array( 'type' => 'format', 'title' => $this->getLang('dfn').': <𝚍𝚏𝚗>', 'icon' => '../../plugins/adhoctags/images/def.svg', 'open' => '', 'close' => '', 'sample' => 'Definition' ), array( 'type' => 'format', 'title' => $this->getLang('kbd').': <𝚔𝚋𝚍>', 'icon' => '../../plugins/adhoctags/images/keyboard-variant.svg', 'open' => '', 'close' => '', 'sample' => 'Ctrl' ), array( 'type' => 'format', 'title' => $this->getLang('samp').': <𝚜𝚊𝚖𝚙>', 'icon' => '../../plugins/adhoctags/images/export.svg', 'open' => '', 'close' => '', 'sample' => 'Output' ), array( 'type' => 'format', 'title' => $this->getLang('var').': <𝚟𝚊𝚛>', 'icon' => '../../plugins/adhoctags/images/variable.svg', 'open' => '', 'close' => '', 'sample' => 'x' ), array( 'type' => 'format', 'title' => $this->getLang('mark').': <𝚖𝚊𝚛𝚔>', 'icon' => '../../plugins/adhoctags/images/format-color-highlight.svg', 'open' => '', 'close' => '', 'sample' => 'marked' ), array( 'type' => 'format', 'title' => $this->getLang('cite').': <𝚌𝚒𝚝𝚎>', 'icon' => '../../plugins/adhoctags/images/comment-quote-outline.svg', 'open' => '', 'close' => '', 'sample' => 'Citation' ), array( 'type' => 'format', 'title' => $this->getLang('time').': <𝚝𝚒𝚖𝚎>', 'icon' => '../../plugins/adhoctags/images/calendar-clock.svg', 'open' => '', 'sample' => 'datetime' ), /* block-level elements: */ array( 'type' => 'format', 'title' => $this->getLang('section').': <𝚜𝚎𝚌𝚝𝚒𝚘𝚗>', 'icon' => '../../plugins/adhoctags/images/code-brackets.svg', 'open' => '
\n', 'close' => '\n
', 'sample' => 'Section' ), array( 'type' => 'format', 'title' => $this->getLang('figure').': <𝚏𝚒𝚐𝚞𝚛𝚎>/<𝚏𝚒𝚐𝚌𝚊𝚙𝚝𝚒𝚘𝚗>', 'icon' => '../../plugins/adhoctags/images/figure-caption.svg', 'open' => '
\n', 'close' => '\n
Caption
\n
', 'sample' => 'figure content' ), array( 'type' => 'format', 'title' => $this->getLang('aside').': <𝚊𝚜𝚒𝚍𝚎>', 'icon' => '../../plugins/adhoctags/images/aside.svg', 'open' => '', 'sample' => 'Aside text' ), array( 'type' => 'format', 'title' => $this->getLang('article').': <𝚊𝚛𝚝𝚒𝚌𝚕𝚎>', 'icon' => '../../plugins/adhoctags/images/subtitles-outline.svg', 'open' => '
\n', 'close' => '\n
', 'sample' => 'Article text' ), array( 'type' => 'format', 'title' => $this->getLang('dl').': <𝚍𝚕>/<𝚍𝚝>/<𝚍𝚍>', 'icon' => '../../plugins/adhoctags/images/definition-list.svg', 'open' => '
\n
', 'close' => '
\n
Description
\n
', 'sample' => 'Term' ), array( 'type' => 'format', 'title' => $this->getLang('address').': <𝚊𝚍𝚍𝚛𝚎𝚜𝚜>', 'icon' => '../../plugins/adhoctags/images/card-account-details-outline.svg', 'open' => '
\n', 'close' => '\n
', 'sample' => 'Address' ), array( 'type' => 'format', 'title' => $this->getLang('details').': <𝚍𝚎𝚝𝚊𝚒𝚕𝚜>/<𝚜𝚞𝚖𝚖𝚊𝚛𝚢>', 'icon' => '../../plugins/adhoctags/images/details-summary.svg', 'open' => '
', 'close' => '\nDetails\n
', 'sample' => 'Summary' ) ) ); } }