*/ /** * Add the template as a page dependency for the caching system */ class action_plugin_talkpage extends DokuWiki_Action_Plugin { /** @inheritdoc */ function register(Doku_Event_Handler $controller) { $controller->register_hook('TEMPLATE_PAGETOOLS_DISPLAY', 'BEFORE', $this, 'addLegacyButton'); $controller->register_hook('MENU_ITEMS_ASSEMBLY', 'AFTER', $this, 'addMenuButton'); } /** * Add talk page to the old menu * * @param Doku_Event $event * @return bool */ public function addLegacyButton(Doku_Event $event) { if (!$this->getConf('showbutton')) return false; if (!$event->data['view'] == 'main') return false; /** @var syntax_plugin_talkpage $helper */ $helper = plugin_load('syntax', 'talkpage'); $data = $helper->getLink(); $data['attr']['class'] .= ' action'; $link = '