34 lines
764 B
PHP
34 lines
764 B
PHP
|
<?php
|
||
|
class syntax_plugin_usetheme extends DokuWiki_Syntax_Plugin
|
||
|
{
|
||
|
public function getType()
|
||
|
{
|
||
|
return 'substition';
|
||
|
}
|
||
|
|
||
|
public function getPType()
|
||
|
{
|
||
|
return 'block';
|
||
|
}
|
||
|
|
||
|
public function getSort()
|
||
|
{
|
||
|
return 156;
|
||
|
}
|
||
|
|
||
|
public function connectTo($mode)
|
||
|
{
|
||
|
$this->Lexer->addSpecialPattern('~~USETHEME:\w+~~', $mode, 'plugin_usetheme');
|
||
|
}
|
||
|
|
||
|
public function handle($match, $state, $pos, Doku_Handler $handler)
|
||
|
{
|
||
|
$match = substr($match, 11, -2); // cut match down to the template name
|
||
|
return array(strtolower($match));
|
||
|
}
|
||
|
|
||
|
public function render($format, Doku_Renderer $renderer, $data)
|
||
|
{
|
||
|
return ""; // show nothing, we want to change the template
|
||
|
}
|
||
|
}
|