'text/html; charset=utf-8' ]; p_set_metadata($ID, ['format' => ['s5' => $headers] ]); $this->base = DOKU_BASE . 'lib/plugins/s5/ui/'; $this->tpl = $_GET['s5theme'] ?? $this->getConf('template'); $this->tpl = preg_replace('/[^a-z0-9_-]+/', '', $this->tpl); // clean user provided path } /** * Print the header of the page * * Gets called when the very first H1 header is discovered. It includes * all the S5 CSS and JavaScript magic */ protected function s5_init($title) { global $conf; global $lang; global $INFO; global $ID; //throw away any previous content $this->doc = ' ' . hsc($title) . '
'; } /** * Closes the document */ public function document_end() { // we don't care for footnotes and toc // but cleanup is nice $this->doc = preg_replace('#

\s*

#', '', $this->doc); if ($this->slideopen) { $this->doc .= '
' . DOKU_LF; //close previous slide } $this->doc .= ' '; } /** * This is what creates new slides * * A new slide is started for each H2 header */ public function header($text, $level, $pos, $returnonly = false) { if ($level == 1) { if (!$this->slideopen) { $this->s5_init($text); // this is the first slide $level = 2; } else { return; } } if ($level == 2) { if ($this->slideopen) { $this->doc .= '' . DOKU_LF; //close previous slide } $this->doc .= '
' . DOKU_LF; $this->slideopen = true; } $this->doc .= ''; $this->doc .= $this->_xmlEntities($text); $this->doc .= '' . DOKU_LF; } /** * Top-Level Sections are slides */ public function section_open($level) { if ($level < 3) { $this->doc .= '
' . DOKU_LF; } else { $this->doc .= '
' . DOKU_LF; } // we don't use it } /** * Throw away footnote */ public function footnote_close() { $this->doc = $this->store; $this->store = ''; } /** * No acronyms in a presentation */ public function acronym($acronym) { $this->doc .= $this->_xmlEntities($acronym); } /** * A line stops the slide and start the handout section */ public function hr() { $this->doc .= '
' . DOKU_LF; $this->doc .= '
' . DOKU_LF; } }