added them selection in syntax. closes #2

code comes from the wiki page. unknown author
This commit is contained in:
Andreas Gohr 2014-07-03 14:53:24 +02:00
parent fdedbf4860
commit 25ce19ea9a
2 changed files with 6 additions and 4 deletions

View File

@ -45,7 +45,8 @@ class renderer_plugin_s5 extends Doku_Renderer_xhtml {
);
p_set_metadata($ID,array('format' => array('s5' => $headers) ));
$this->base = DOKU_BASE.'lib/plugins/s5/ui/';
$this->tpl = $this->getConf('template');
$this->tpl = isset($_GET['s5theme'])?$_GET['s5theme']:$this->getConf('template');
$this->tpl = preg_replace('/[^a-z0-9_-]+/', '', $this->tpl); // clean user provided path
}
/**

View File

@ -43,7 +43,7 @@ class syntax_plugin_s5 extends DokuWiki_Syntax_Plugin {
* Connect pattern to lexer
*/
function connectTo($mode) {
$this->Lexer->addSpecialPattern('~~SLIDESHOW~~',$mode,'plugin_s5');
$this->Lexer->addSpecialPattern('~~SLIDESHOW[^~]*~~',$mode,'plugin_s5');
}
@ -51,7 +51,8 @@ class syntax_plugin_s5 extends DokuWiki_Syntax_Plugin {
* Handle the match
*/
function handle($match, $state, $pos, &$handler){
return array();
if($match!='~~SLIDESHOW~~') return array(trim(substr($match,11,-2)));
return array();
}
/**
@ -61,7 +62,7 @@ class syntax_plugin_s5 extends DokuWiki_Syntax_Plugin {
global $ID;
if($format != 'xhtml') return false;
$renderer->doc .= '<a href="'.exportlink($ID, 's5').'" title="'.$this->getLang('view').'">';
$renderer->doc .= '<a href="'.exportlink($ID, 's5',sizeof($data)?array('s5theme'=>$data[0]):null).'" title="'.$this->getLang('view').'">';
$renderer->doc .= '<img src="'.DOKU_BASE.'lib/plugins/s5/screen.gif" align="right" alt="'.$this->getLang('view').'" width="48" height="48" />';
$renderer->doc .= '</a>';
return true;