/** * Wraps the included page in a div and writes section edits for the action component * so it can detect where an included page starts/ends. * * @author Michael Klier <*****@*****.**> * @author Michael Hamann <*****@*****.**> */ function render($mode, Doku_Renderer &$renderer, $data) { if ($mode == 'xhtml') { list($state, $page, $redirect, $secid) = $data; switch ($state) { case 'open': if ($redirect) { $renderer->startSectionEdit(0, 'plugin_include_start', $page); } else { $renderer->startSectionEdit(0, 'plugin_include_start_noredirect', $page); } $renderer->finishSectionEdit(); // Start a new section with type != section so headers in the included page // won't print section edit buttons of the parent page $renderer->startSectionEdit(0, 'plugin_include_end', $page); if ($secid === NULL) { $id = ''; } else { $id = ' id="' . $secid . '"'; } $renderer->doc .= '<div class="plugin_include_content plugin_include__' . $page . '"' . $id . '>' . DOKU_LF; if (is_a($renderer, 'renderer_plugin_dw2pdf')) { $renderer->doc .= '<a name="' . $secid . '" />'; } break; case 'close': $renderer->finishSectionEdit(); $renderer->doc .= '</div>' . DOKU_LF; break; } return true; } return false; }
/** * Create output */ function render($mode, Doku_Renderer $renderer, $indata) { if($mode == 'xhtml'){ /** @var Doku_Renderer_xhtml $renderer */ $renderer->finishSectionEdit(); return true; } return false; }
/** * Renders an include edit button * * @author Michael Klier <*****@*****.**> */ function render($mode, Doku_Renderer &$renderer, $data) { list($title) = $data; if ($mode == 'xhtml') { $renderer->startSectionEdit(0, 'plugin_include_editbtn', $title); $renderer->finishSectionEdit(); return true; } return false; }
/** * Finishes the last open section edit */ function render($mode, Doku_Renderer $renderer, $data) { if ($mode == 'xhtml') { /** @var Doku_Renderer_xhtml $renderer */ list($endpos) = $data; $renderer->finishSectionEdit($endpos); return true; } return false; }
/** * Create output */ function render($mode, Doku_Renderer $renderer, $indata) { if (empty($indata)) { return false; } list($state, $data) = $indata; if ($mode == 'xhtml') { /** @var Doku_Renderer_xhtml $renderer */ switch ($state) { case DOKU_LEXER_ENTER: // add a section edit right at the beginning of the wrap output $renderer->startSectionEdit(0, 'plugin_wrap_start'); $renderer->finishSectionEdit(); // add a section edit for the end of the wrap output. This prevents the renderer // from closing the last section edit so the next section button after the wrap syntax will // include the whole wrap syntax $renderer->startSectionEdit(0, 'plugin_wrap_end'); $wrap =& plugin_load('helper', 'wrap'); $attr = $wrap->buildAttributes($data, 'plugin_wrap'); $renderer->doc .= '<div' . $attr . '>'; break; case DOKU_LEXER_EXIT: $renderer->doc .= "</div>"; $renderer->finishSectionEdit(); break; } return true; } return false; }
/** * Create output */ function render($mode, Doku_Renderer $renderer, $indata) { static $type_stack = array (); if (empty($indata)) return false; list($state, $data) = $indata; if($mode == 'xhtml'){ /** @var Doku_Renderer_xhtml $renderer */ switch ($state) { case DOKU_LEXER_ENTER: // add a section edit right at the beginning of the wrap output $renderer->startSectionEdit(0, 'plugin_wrap_start'); $renderer->finishSectionEdit(); // add a section edit for the end of the wrap output. This prevents the renderer // from closing the last section edit so the next section button after the wrap syntax will // include the whole wrap syntax $renderer->startSectionEdit(0, 'plugin_wrap_end'); case DOKU_LEXER_SPECIAL: $wrap = $this->loadHelper('wrap'); $attr = $wrap->buildAttributes($data, 'plugin_wrap'); $renderer->doc .= '<div'.$attr.'>'; if ($state == DOKU_LEXER_SPECIAL) $renderer->doc .= '</div>'; break; case DOKU_LEXER_EXIT: $renderer->doc .= '</div>'; $renderer->finishSectionEdit(); break; } return true; } if($mode == 'odt'){ switch ($state) { case DOKU_LEXER_ENTER: $wrap = plugin_load('helper', 'wrap'); array_push ($type_stack, $wrap->renderODTElementOpen($renderer, 'div', $data)); break; case DOKU_LEXER_EXIT: $element = array_pop ($type_stack); $wrap = plugin_load('helper', 'wrap'); $wrap->renderODTElementClose ($renderer, $element); break; } return true; } return false; }