diff --git a/api/src/Storage/Merge.php b/api/src/Storage/Merge.php index 00b8de3e3a..bb8a2d6705 100644 --- a/api/src/Storage/Merge.php +++ b/api/src/Storage/Merge.php @@ -174,6 +174,10 @@ abstract class Merge return true; // rtf files case 'application/vnd.oasis.opendocument.text': // oo text case 'application/vnd.oasis.opendocument.spreadsheet': // oo spreadsheet + case 'application/vnd.oasis.opendocument.presentation': + case 'application/vnd.oasis.opendocument.text-template': + case 'application/vnd.oasis.opendocument.spreadsheet-template': + case 'application/vnd.oasis.opendocument.presentation-template': if (!$zip_available) break; return true; // open office write xml files case 'application/vnd.openxmlformats-officedocument.wordprocessingml.document': // ms word 2007 xml format @@ -592,8 +596,12 @@ abstract class Merge $replace_tags = array(); switch($mimetype.$mso_application_progid) { - case 'application/vnd.oasis.opendocument.text': // open office - case 'application/vnd.oasis.opendocument.spreadsheet': + case 'application/vnd.oasis.opendocument.text': // oo text + case 'application/vnd.oasis.opendocument.spreadsheet': // oo spreadsheet + case 'application/vnd.oasis.opendocument.presentation': + case 'application/vnd.oasis.opendocument.text-template': + case 'application/vnd.oasis.opendocument.spreadsheet-template': + case 'application/vnd.oasis.opendocument.presentation-template': // It seems easier to split the parent tags here $replace_tags = array( '/<(ol|ul|table)( [^>]*)?>/' => '<$1$2>', @@ -734,7 +742,7 @@ abstract class Merge } } - if ($mimetype == 'application/vnd.oasis.opendocument.text' && count($ids) > 1) + if (in_array($mimetype, array('application/vnd.oasis.opendocument.text','application/vnd.oasis.opendocument.text-template')) && count($ids) > 1) { if(strpos($content, '$$pagerepeat') === false) { @@ -786,8 +794,12 @@ abstract class Merge case 'text/rtf': $joiner = '\\par \\page\\pard\\plain'; break; - case 'application/vnd.oasis.opendocument.text': - case 'application/vnd.oasis.opendocument.spreadsheet': + case 'application/vnd.oasis.opendocument.text': // oo text + case 'application/vnd.oasis.opendocument.spreadsheet': // oo spreadsheet + case 'application/vnd.oasis.opendocument.presentation': + case 'application/vnd.oasis.opendocument.text-template': + case 'application/vnd.oasis.opendocument.spreadsheet-template': + case 'application/vnd.oasis.opendocument.presentation-template': case 'application/xml': case 'text/html': $joiner = ''; @@ -898,8 +910,12 @@ abstract class Merge case 'text/rtf': return $contentstart.implode('\\par \\page\\pard\\plain',$contentrepeatpages).$contentend; case 'application/vnd.oasis.opendocument.text': + case 'application/vnd.oasis.opendocument.presentation': + case 'application/vnd.oasis.opendocument.text-template': + case 'application/vnd.oasis.opendocument.presentation-template': return $contentstart.implode('',$contentrepeatpages).$contentend; case 'application/vnd.oasis.opendocument.spreadsheet': + case 'application/vnd.oasis.opendocument.spreadsheet-template': return $contentstart.implode('',$contentrepeatpages).$contentend; case 'application/vnd.openxmlformats-officedocument.wordprocessingml.document': case 'application/vnd.ms-word.document.macroenabled.12': @@ -940,6 +956,10 @@ abstract class Merge { case 'application/vnd.oasis.opendocument.text': // open office case 'application/vnd.oasis.opendocument.spreadsheet': + case 'application/vnd.oasis.opendocument.presentation': + case 'application/vnd.oasis.opendocument.text-template': + case 'application/vnd.oasis.opendocument.spreadsheet-template': + case 'application/vnd.oasis.opendocument.presentation-template': case 'application/vnd.openxmlformats-officedocument.wordprocessingml.document': // ms office 2007 case 'application/vnd.ms-word.document.macroenabled.12': case 'application/vnd.openxmlformats-officedocument.spreadsheetml.sheet': @@ -1007,6 +1027,10 @@ abstract class Merge break; case 'application/vnd.oasis.opendocument.text': // open office case 'application/vnd.oasis.opendocument.spreadsheet': + case 'application/vnd.oasis.opendocument.presentation': + case 'application/vnd.oasis.opendocument.text-template': + case 'application/vnd.oasis.opendocument.spreadsheet-template': + case 'application/vnd.oasis.opendocument.presentation-template': $replace_tags = array( '','','','','','','
    ','