Categories > OpenTBS with ODT >

code to simplify header and footer merge (OPENTBS_SELECT_HEADER/OPENTBS_SELECT_FOOOTER)

The forum is closed. Please use Stack Overflow for submitting new questions. Use tags: tinybutstrong , opentbs
By: gerhard
Date: 2016-05-20
Time: 12:01

code to simplify header and footer merge (OPENTBS_SELECT_HEADER/OPENTBS_SELECT_FOOOTER)

Changing the following 5 lines in tbs_plugin_opentbs.php makes OPENTBS_SELECT_HEADER/OPENTBS_SELECT_FOOOTER more useful when using odt templates.
Otherwise you have to do a manual $tbs->PlugIn(OPENTBS_SELECT_FILE, "styles.xml"); and you have to write different code for .docx and .odt.

Great thanks to all who made this template engine such a great software !

--- a/external/tinybutstrong/plugins/tbs_plugin_opentbs.php
+++ b/external/tinybutstrong/plugins/tbs_plugin_opentbs.php
@@ -614,7 +614,10 @@ class clsOpenTBS extends clsTbsZip {
        $x2 = intval($x2); // 0 by default
        $file = $this->MsWord_GetHeaderFooterFile($Cmd, $x1, $x2);
        break;
-     case 'odt': case 'ods': case 'odp':
+     case 'odt':
+       $file = "styles.xml";
+       break;
+     case 'ods': case 'odp':
        $file = $this->ExtInfo['main'];
      case 'xlsx': case 'pptx':
        return false;