* @author Till Biskup */ class action_plugin_latexcaption extends \dokuwiki\Extension\ActionPlugin { 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) { $captiontag = $this->getConf('captiontag'); $event->data[] = array ( 'type' => 'picker', 'title' => $this->getLang('latexcaption'), 'icon' => '../../plugins/latexcaption/images/picker.png', 'class' => 'captionpicker', 'list' => array( array( 'type' => 'format', 'title' => $this->getLang('figure'), 'icon' => '../../plugins/latexcaption/images/fig.png', 'open' => '
\n', 'sample' => '{{:img |title}}', 'close' => '\n<'.$captiontag.'>caption\n
', ), array( 'type' => 'format', 'title' => $this->getLang('table'), 'icon' => '../../plugins/latexcaption/images/tab.png', 'open' => '\n<'.$captiontag.'>caption\n', 'sample' => '^ Header1 ^ Header2 ^\n| foo | bar |\n', 'close' => '
', ), array( 'type' => 'format', 'title' => $this->getLang('code'), 'icon' => '../../plugins/latexcaption/images/code.png', 'open' => '\n<'.$captiontag.'>caption\n', 'sample' => '\n...\n\n', 'close' => '', ), array( 'type' => 'format', 'title' => $this->getLang('file'), 'icon' => '../../plugins/latexcaption/images/file.png', 'open' => '\n<'.$captiontag.'>caption\n', 'sample' => '\n...\n\n', 'close' => '', ), array( 'type' => 'insert', 'title' => $this->getLang('reference'), 'icon' => '../../plugins/latexcaption/images/ref.png', 'insert' => '{{ref>label}}', ) ) ); } }