*/ // must be run within Dokuwiki if(!defined('DOKU_INC')) define('DOKU_INC',(dirname(__FILE__).'/../../').'/'); if(!defined('DOKU_PLUGIN')) define('DOKU_PLUGIN',DOKU_INC.'lib/plugins/'); require_once(DOKU_PLUGIN.'syntax.php'); /** * All DokuWiki plugins to extend the parser/rendering mechanism * need to inherit from this class */ class syntax_plugin_geonav extends DokuWiki_Syntax_Plugin { function getInfo() { return array( 'author' => 'Tom Cafferty', 'email' => 'tcafferty@glocalfocal.com', 'date' => '2011-12-29', 'name' => 'geonav', 'desc' => 'Integrate google map with dokuwiki for navigation', 'url' => 'http://www.dokuwiki.org/plugin:geonav' ); } /** * What kind of syntax are we? */ function getType(){ return 'substition'; } function getPType(){ return 'block'; } /** * Where to sort in? */ function getSort(){ return 160; } /** * Connect pattern to lexer */ function connectTo($mode) { $this->Lexer->addSpecialPattern('.*?',$mode,'plugin_geonav'); } /** * Handle the match */ function handle($match, $state, $pos, &$handler){ parse_str($match, $return); return $return; } /** * Render output */ function render($mode, &$R, $data) { global $INFO; global $conf; require_once(DOKU_PLUGIN.'geonav/lang/en/lang.php'); // store meta info for this page if($mode == 'metadata'){ $R->meta['plugin']['geonav'] = true; return true; } if($mode != 'xhtml') return false; $path = $INFO['id']; $topic = str_replace ( ':earth', '', $path); $R->info['cache'] = false; // no cache please $R->doc .= '
'; $R->doc .= ''; $R->doc .= ''; $R->doc .= '
'.$lang['focus'].'
'; $R->doc .= '
'; $R->doc .= $this->_script($topic); return true; } function _script($category){ $str = ''; return $str; } }