first commit. dokuwiki.
[h2N7SspZmY.git] / lib / plugins / s5 / syntax.php
blob504066bcd513dd58b9824c840712e70d8aa59010
1 <?php
2 /**
3 * S5 Plugin: Display a Wiki page as S5 slideshow presentation
5 * @license GPL 2 (http://www.gnu.org/licenses/gpl.html)
6 * @author Andreas Gohr <andi@splitbrain.org>
7 */
8 // must be run within Dokuwiki
9 if(!defined('DOKU_INC')) die();
11 if(!defined('DOKU_PLUGIN')) define('DOKU_PLUGIN',DOKU_INC.'lib/plugins/');
12 require_once(DOKU_PLUGIN.'syntax.php');
14 /**
15 * All DokuWiki plugins to extend the parser/rendering mechanism
16 * need to inherit from this class
18 class syntax_plugin_s5 extends DokuWiki_Syntax_Plugin {
20 /**
21 * What kind of syntax are we?
23 function getType(){
24 return 'substition';
27 /**
28 * What about paragraphs?
30 function getPType(){
31 return 'normal';
34 /**
35 * Where to sort in?
37 function getSort(){
38 return 800;
42 /**
43 * Connect pattern to lexer
45 function connectTo($mode) {
46 $this->Lexer->addSpecialPattern('~~SLIDESHOW~~',$mode,'plugin_s5');
50 /**
51 * Handle the match
53 function handle($match, $state, $pos, &$handler){
54 return array();
57 /**
58 * Create output
60 function render($format, &$renderer, $data) {
61 global $ID;
62 if($format != 'xhtml') return false;
64 $renderer->doc .= '<a href="'.exportlink($ID, 's5').'" title="'.$this->getLang('view').'">';
65 $renderer->doc .= '<img src="'.DOKU_BASE.'lib/plugins/s5/screen.gif" align="right" alt="'.$this->getLang('view').'" width="48" height="48" />';
66 $renderer->doc .= '</a>';
67 return true;
71 //Setup VIM: ex: et ts=4 enc=utf-8 :