'
.''
.''
.'';
var $hidesb_html = '';
var $force_nosb = false;
var $nosb_html = '';
/**
* @return string Syntax mode type
*/
public function getType()
{
return 'substition';
}
/**
* @return string Paragraph type
*/
public function getPType()
{
return 'normal';
}
/**
* @return int Sort order - Low numbers go before high numbers
*/
public function getSort()
{
return 150;
}
/**
* Connect lookup pattern to lexer.
*
* @param string $mode Parser mode
*/
public function connectTo($mode)
{
$this->Lexer->addSpecialPattern('\',$mode,'plugin_dirtylittlehelper_'.$this->getPluginComponent());
$this->Lexer->addSpecialPattern('\',$mode,'plugin_dirtylittlehelper_'.$this->getPluginComponent());
$this->Lexer->addSpecialPattern('\',$mode,'plugin_dirtylittlehelper_'.$this->getPluginComponent());
}
/**
* Handle matches of the DLH syntax
*
* @param string $match The match of the syntax
* @param int $state The state of the handler
* @param int $pos The position in the document
* @param Doku_Handler $handler The handler
*
* @return array Data for the renderer
*/
public function handle($match, $state, $pos, Doku_Handler $handler)
{
switch ($state) {
case DOKU_LEXER_SPECIAL:
if ($match == ''){
return array( $state, 'TOGGLESB',$match);
}elseif( $match == ''){
$this->force_nosb = true;
return array($state, 'NOSB',$match);
}elseif( $match == ''){
return array($state, 'HIDESB',$match);
}
break;
}
return false;
} //handle
/**
* Render xhtml output or metadata
*
* @param string $mode Renderer mode (supported modes: xhtml)
* @param Doku_Renderer $renderer The renderer
* @param array $data The data from the handler() function
*
* @return bool If rendering was successful.
*/
public function render($mode, Doku_Renderer $renderer, $data)
{
if ($mode == 'xhtml') {
if( $data[1]=='TOGGLESB' ){
if( $this->force_nosb == false){
$renderer->doc .= $this->togglesb_html;
return true;
}
return true;
}elseif($data[1]=='HIDESB'){
$renderer->doc .= $this->hidesb_html;
return true;
}elseif($data[1]=='NOSB'){
$renderer->doc .= $this->nosb_html;
return true;
}
return false;
} //mode xhtml
return false;
} //function render
} //class