dokuwiki-plugin-usetheme/syntax.php

34 lines
764 B
PHP
Raw Normal View History

2021-07-12 18:25:16 +02:00
<?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
}
}