1 diff --git a/helper.php b/helper.php
2 index 0beb7ac..dd9af45 100644
5 @@ -223,6 +223,38 @@ class helper_plugin_include extends DokuWiki_Plugin { // DokuWiki_Helper_Plugin
10 + * Builds the ODT to embed the page to include
12 + function renderODT(&$renderer){
15 + if (!$this->page['id']) return ''; // page must be set first
16 + if (!$this->page['exists'] && ($this->page['perm'] < AUTH_CREATE)) return '';
19 + $this->renderer =& $renderer;
21 + // get instructions and render them on the fly
22 + $this->ins = p_cached_instructions($this->page['file']);
24 + // show only a given section?
25 + if ($this->page['section'] && $this->page['exists']) $this->_getSection();
27 + // convert relative links
28 + $this->_convertInstructions();
30 + // render the included page
31 + $backupID = $ID; // store the current ID
32 + $ID = $this->page['id']; // change ID to the included page
33 + // remove document_start and document_end to avoid zipping
34 + $this->ins = array_slice($this->ins, 1, -1);
35 + p_render('odt', $this->ins, $info);
36 + $ID = $backupID; // restore ID
38 + $this->helper_plugin_include();
41 /* ---------- Private Methods ---------- */
44 diff --git a/syntax.php b/syntax.php
45 index fb6548b..5d08253 100644
48 @@ -100,6 +100,21 @@ class syntax_plugin_include extends DokuWiki_Syntax_Plugin {
52 + } elseif ($mode == 'odt'){
53 + if ($nocache) $renderer->info['cache'] = false;
55 + // current section level
57 + preg_match_all('|<text:h text:style-name="Heading_20_\d" text:outline-level="(\d)">|i', $renderer->doc, $matches, PREG_SET_ORDER);
58 + $n = count($matches) - 1;
59 + if ($n > -1) $clevel = $matches[$n][1];
60 + $include->setLevel($clevel);
62 + // include the page now
63 + $include->renderODT($renderer);
67 // for metadata renderer
68 } elseif ($mode == 'metadata'){
69 if (!$flg_macro) $renderer->meta['relation']['haspart'][$id] = $exists;