If openoffice template specifies pagerepeat, use it

This commit is contained in:
Nathan Gray 2012-05-07 21:09:31 +00:00
parent 679073abcf
commit 94cd19a50c

View File

@ -658,6 +658,8 @@ abstract class bo_merge
}
if ($mimetype == 'application/vnd.oasis.opendocument.text' && count($ids) > 1)
{
if(strpos($content, '$$pagerepeat') === false)
{
//for odt files we have to split the content and add a style for page break to the style area
list($contentstart,$contentrepeat,$contentend) = preg_split('/office:body>/',$content,-1, PREG_SPLIT_NO_EMPTY); //get differt parts of document, seperatet by Pagerepeat
@ -669,6 +671,12 @@ abstract class bo_merge
$contentstart .= '<office:body>';
$contentend = '</office:body></office:document-content>';
}
else
{
// Template specifies where to repeat
list($contentstart,$contentrepeat,$contentend) = preg_split('/\$\$pagerepeat\$\$/',$content,-1, PREG_SPLIT_NO_EMPTY); //get different parts of document, seperated by pagerepeat
}
}
if ($mimetype == 'application/vnd.openxmlformats-officedocument.wordprocessingml.document' && count($ids) > 1)
{
//for Word 2007 XML files we have to split the content and add a style for page break to the style area
@ -1380,7 +1388,6 @@ abstract class bo_merge
//error_log(__METHOD__."() !this->merge() err=$err");
return $err;
}
// Apply HTML formatting to target document, if possible
// check if we can use the XSL extension, to not give a fatal error and rendering whole merge-print non-functional
if (class_exists(XSLTProcessor) && class_exists(DOMDocument) && $this->parse_html_styles)