From 8e9eb0aa2e23b49491e3f58534f621c834bad510 Mon Sep 17 00:00:00 2001 From: Stefan Becker Date: Sun, 2 Aug 2009 12:32:39 +0000 Subject: [PATCH] changed handling of mimetype for other types --- addressbook/inc/class.addressbook_merge.inc.php | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/addressbook/inc/class.addressbook_merge.inc.php b/addressbook/inc/class.addressbook_merge.inc.php index e7267f1b65..8d9e761600 100644 --- a/addressbook/inc/class.addressbook_merge.inc.php +++ b/addressbook/inc/class.addressbook_merge.inc.php @@ -269,6 +269,17 @@ class addressbook_merge // extends bo_merge return false; } list($contentstart,$contentrepeat,$contentend) = preg_split('/\$\$pagerepeat\$\$/',$content,-1, PREG_SPLIT_NO_EMPTY); //get differt parts of document, seperatet by Pagerepeat + if ($mimetype == 'application/vnd.oasis.opendocument.text' && count($ids) > 1) { + //for odt files we have to slpitt 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 + $contentstart = substr($contentstart,0,strlen($contentstart)-1); //remove "<" + $contentrepeat = substr($contentrepeat,0,strlen($contentrepeat)-2); //remove "/',$content,-1, PREG_SPLIT_NO_EMPTY); //get differt parts of document style sheets + $contentstart = $stylestart.''; + $contentstart .= ''; + $contentend = ''; + } list($Labelstart,$Labelrepeat,$Labeltend) = preg_split('/\$\$label\$\$/',$contentrepeat,-1, PREG_SPLIT_NO_EMPTY); //get the Lable content preg_match_all('/\$\$labelplacement\$\$/',$contentrepeat,$countlables, PREG_SPLIT_NO_EMPTY); $countlables = count($countlables[0])+1; @@ -363,7 +374,7 @@ class addressbook_merge // extends bo_merge case 'text/rtf': return $contentstart.implode('\\par \\page\\pard\\plain',$contentrep).$contentend; case 'application/vnd.oasis.opendocument.text': - // todo OO writer files + return $contentstart.implode('',$contentrep).$contentend; break; case 'application/vnd.openxmlformats-officedocument.wordprocessingml.document': case 'application/vnd.openxmlformats-officedocument.wordprocessingml.d': // mimetypes in vfs are limited to 64 chars