*/ // must be run within Dokuwiki if(!defined('DOKU_INC')) die(); if(!defined('DOKU_PLUGIN')) define('DOKU_PLUGIN',DOKU_INC.'lib/plugins/'); require_once(DOKU_INC.'lib/plugins/syntax.php'); /** * All DokuWiki plugins to extend the parser/rendering mechanism * need to inherit from this class */ class syntax_plugin_googlevideo extends DokuWiki_Syntax_Plugin { /** * return some info */ function getInfo(){ return array( 'author' => 'François Laperruque', 'email' => 'francois.laperruque@toulouse.inra.fr', 'date' => '2007-08-02', 'name' => 'Google Video Plugin', 'desc' => 'Google Video link and object', 'url' => 'http://flap.mynetmemo.com/?p=15', ); } function getType(){ return 'substition'; } function getSort(){ return 159; } function connectTo($mode) { $this->Lexer->addSpecialPattern('\{\{googlevideo>[^}]*\}\}',$mode,'plugin_googlevideo'); } /** * Handle the match */ function handle($match, $state, $pos, &$handler){ $match = substr($match,14,-2); // Strip markup return array($state,explode(':',$match)); } /** * Create output */ function render($mode, &$renderer, $data) { if($mode == 'xhtml') { list($state, $match) = $data; list($disptype,$id) = $match; $href_start = ''; $LOGO_URL = '/_media/icon/googlevideo.png'; if ($disptype=='link'){ $renderer->doc .= $href_start; $renderer->doc .= 'movie-'.$id.''; } elseif ($disptype=='large') { $obj = ''; $obj .= ''; $renderer->doc .= $obj; } elseif($disptype=='small'){ $obj = ''; $obj .= ''; $renderer->doc .= $obj; } else { $renderer->doc .="??"; } return true; } return false; } } ?>