*/ class action_plugin_caption extends DokuWiki_Action_Plugin { public function register(Doku_Event_Handler $controller) { $controller->register_hook("TOOLBAR_DEFINE", "AFTER", $this, "insert_button", array ()); } /** * Inserts a toolbar button */ public function insert_button(&$event, $param) { $event->data[] = array ( 'type' => 'picker', 'title' => $this->getLang('picker'), 'icon' => '../../plugins/caption/images/picker.png', 'class' => 'captionpicker', 'list' => array( array( 'type' => 'format', 'title' => $this->getLang('figure'), 'icon' => '../../plugins/caption/images/fig.png', 'open' => '
\n', 'sample' => '{{:img |title}}', 'close' => '\ncaption\n
', ), array( 'type' => 'format', 'title' => $this->getLang('table'), 'icon' => '../../plugins/caption/images/tab.png', 'open' => '\n\n', 'sample' => '^ Header1 ^ Header2 ^\n| foo | bar |\n', 'close' => '
caption
', ), array( 'type' => 'format', 'title' => $this->getLang('code'), 'icon' => '../../plugins/caption/images/code.png', 'open' => '\ncaption\n', 'sample' => '\n...\n\n', 'close' => '', ), array( 'type' => 'format', 'title' => $this->getLang('file'), 'icon' => '../../plugins/caption/images/file.png', 'open' => '\ncaption\n', 'sample' => '\n...\n\n', 'close' => '', ), array( 'type' => 'insert', 'title' => $this->getLang('reference'), 'icon' => '../../plugins/caption/images/ref.png', 'insert' => '{{ref>label}}', ) ) ); } }