Lexer -> addEntryPattern('(?=.*?)', $mode, 'plugin_twcheckliste'); } function postConnect() { $this -> Lexer -> addExitPattern('', 'plugin_twcheckliste'); } function handle($match, $state, $pos, &$handler) { switch ($state) { case DOKU_LEXER_ENTER : $return = array('active' => 'true', 'element' => Array(), 'onHidden' => '', 'onVisible' => '', 'initialState' => 'hidden', 'state' => $state, 'printHead' => true, 'bytepos_start' => $pos, 'edit' => false, 'editText' => $this -> getLang('edit'), 'onExportPdf' => ''); $match = substr($match, 11, -1); if (trim($match) == "angebot") { $this -> match_kind = 1; } else { $this -> match_kind = 0; } return $return; case DOKU_LEXER_UNMATCHED : $html = $this -> replaceTags($match); print_r($match); print_r($html); return array($state, $html); default : return array('state' => $state, 'bytepos_end' => $pos + strlen($match)); } } private function _grepOption(&$options, $tag, &$match) { preg_match("/$tag *= *\"([^\"]*)\" ?/i", $match, $text); if (count($text) != 0) { $match = str_replace($text[0], '', $match); $options[$tag] = $text[1]; } } function render($mode, &$renderer, $data) { if ($mode == 'xhtml') { switch ($data['state']) { case DOKU_LEXER_ENTER : $renderer -> doc .= '
'; break; case DOKU_LEXER_UNMATCHED : $text = $renderer -> _xmlEntities($data['text']); if (preg_match("/^[ \t]*={2,}[^\n]+={2,}[ \t]*$/", $text, $match)) { $title = trim($match[0]); $level = 7 - strspn($title, '='); if ($level < 1) $level = 1; $title = trim($title, '='); $title = trim($title); $renderer -> header($title, $level, 0); } else { $renderer -> doc .= $text; } break; case DOKU_LEXER_EXIT : $renderer -> doc .= '

Wegen aktuellen Bug im Druck von Webkit Browser bitte Firefox verwenden !!!

'; $renderer -> doc = str_replace ("ROLLE_PM<", "ROLLE_PM<", $renderer -> doc); $renderer -> doc = str_replace ("UNCHECKED<", "UNCHECKED<", $renderer -> doc); //close hiddenBody and hiddenGlobal /*if (array_pop($this -> editableBlocks)) { $renderer -> finishSectionEdit($data['bytepos_end']); }*/ break; } return true; } return false; } function replaceTags($match) { $search = array('#CLsection#i', '#CLarea#i', '#CLcheckpoint#i', '#CLcoption#i'); $replace = array('h2', 'h3', 'h4', 'li'); return preg_replace($search, $replace, $match); } }