*/
// must be run within Dokuwiki
if (!defined('DOKU_INC')) die();
class syntax_plugin_togglewrap extends DokuWiki_Syntax_Plugin {
public function getType() {
return 'substition';
}
public function getPType() {
return 'normal';
}
public function getSort() {
return 308;
}
public function connectTo($mode) {
$this->Lexer->addSpecialPattern('{{togglewrap>.*?}}',$mode,'plugin_togglewrap');
}
public function handle($match, $state, $pos, Doku_Handler &$handler){
$match = substr($match, 13, -2);
list ($opts,$label) = explode('|',$match, 2);
list ($class,$opts) = explode('&', $opts, 2);
if (!$label) $label = $class;
$opts = explode('&',$opts);
return array($class, $label, $pos, $opts);
}
public function render($mode, Doku_Renderer &$renderer, $data) {
if($mode != 'xhtml') return false;
list($class, $label, $pos, $opts) = $data;
$renderer->doc .= '';
return true;
}
}