'Myron Turner', 'email' => 'turnermm02@shaw.ca', 'date' => '2011-07-1', 'name' => 'epub', 'desc' => 'ebook creator', 'url' => 'http://www.dokuwiki.org/plugin:epub'); } function getType(){ return 'container'; } function getPType(){ return 'block'; } function getAllowedTypes() { return array(); } function getSort(){ return 25; } function connectTo($mode) { $this->Lexer->addEntryPattern('(?=.*?)',$mode,'plugin_epub'); } function postConnect() { $this->Lexer->addExitPattern('','plugin_epub'); } function __construct() { $this->helper =& plugin_load('helper', 'epub'); } function handle($match, $state, $pos, Doku_Handler $handler) { $match = str_replace(';',';',$match); $match = str_replace(',',',',$match); switch ($state) { case DOKU_LEXER_ENTER : $title = substr($match, 6, -1); if($title) $this->title = $title; else $this->title="Dokuwiki EBook"; return array($state, trim($title)); case DOKU_LEXER_UNMATCHED : return array($state, $match); case DOKU_LEXER_EXIT : return array($state,$match); default: return array($state,$match); } } function render($mode, Doku_Renderer $renderer, $data) { global $INFO; if($mode == 'xhtml'){ $renderer->nocache(); list($state, $match) = $data; switch ($state) { case DOKU_LEXER_ENTER : $this->helper->writeCache($INFO['id']); $renderer->doc .= '
'; break; case DOKU_LEXER_UNMATCHED : $id = $INFO['id']; $renderer->doc .= "\n\n"; break; case DOKU_LEXER_EXIT : $throbber = DOKU_BASE . 'lib/plugins/epub/throbber.gif'; $renderer->doc .= ''; $renderer->doc .= "\n
"; break; } return true; } // unsupported $mode return false; } function write_debug($what) { return; if(is_array($what)) $what = print_r($what,true); $handle = fopen('epub.txt', 'a'); fwrite($handle,"$what\n"); fclose($handle); } } //Setup VIM: ex: et ts=4 enc=utf-8 : ?>