'James GuanFeng Lin', 'email' => 'guanfenglin@gmail.com', 'date' => '2009-08-24', 'name' => 'Table Math Plugin', 'desc' => 'Enables calculated columns in built in table syntax', 'url' => 'https://www.dokuwiki.org/plugin:tablemath', ); } function getType() { return 'substition'; } function getSort() { return 1213; } /** * Connect pattern to lexer */ function connectTo($mode) { $this->Lexer->addSpecialPattern("~~=[a-zA-Z0-9_]*\([0-9,:]*\)~~", $mode, 'plugin_tablemath'); } /** * Handle the match */ function handle($match, $state, $pos, &$handler) { global $ID, $ACT, $INFO; $match = str_replace('~~', '', $match); $match = str_replace('=', '', $match); $tmp = explode('(', $match); if (count($tmp)>1) { $tmp[1] = str_replace(')', '', $tmp[1]); return array('method'=>$tmp[0],'set'=>$tmp[1], 'divid'=>'tm'.rand()); } return array(); } function render($mode, &$renderer, $data) { global $INFO, $ID, $conf; if($mode == 'xhtml'){ // get discussion meta file name $renderer->doc .= '
'; return true; } return false; } }