register_hook('TPL_ACT_UNKNOWN','BEFORE', $this, 'nsexport'); $controller->register_hook('ACTION_ACT_PREPROCESS','BEFORE', $this, 'act'); } public function act(Doku_Event $event , $param) { if ($event->data !== 'nsexport') { return; } $event->preventDefault(); $this->run = true; } public function nsexport(Doku_Event $event, $param) { if (!$this->run) return; // stops default action handler $event->preventDefault(); if ($this->getConf('autoexport')){ $id = ' plugin_nsexport__started'; echo $this->locale_xhtml('autointro'); }else{ $id = ''; echo $this->locale_xhtml('intro'); } echo '

' . $this->getLang('packer___ziphtml___intro') . '

'; $this->_listPages($id); } /** * Create a list of pages about to be exported within a form * to start the export */ public function _listPages($id){ global $ID; $pages = array(); $base = dirname(wikiFN($ID)); search($pages,$base,'search_allpages',array()); $pages = array_reverse($pages); echo '
'; echo '

'; $ns = getNS($ID); if(!$ns) $ns = '*'; printf($this->getLang('inns'), $ns); echo '

'; echo ''; echo '
'; } public function tpl_link($return = false) { global $ID; $caption = hsc($this->getLang('link')); return tpl_link(wl($ID, array('do' => 'nsexport')), $caption, 'class="action nsexport" rel="nofollow" ' . 'title="' . $caption . '"', $return); } }