Fix compatibility with chwala-0.4 (Bifrost#T31552)

This commit is contained in:
Aleksander Machniak 2017-05-16 10:57:50 +02:00
parent e5d2934e31
commit fdcb5c0c58

View file

@ -1435,18 +1435,15 @@ class kolab_files_engine
if (array_key_exists($type, $this->mimetypes)) {
$mimetypes = $this->mimetypes[$type];
}
else {
$mimetypes = $this->mimetypes;
}
}
// fallback to static definition if old Chwala is used
if ($type == 'edit' && empty($mimetypes)) {
else if ($type == 'edit') {
$mimetypes = array(
'application/vnd.oasis.opendocument.text' => 'odt',
'text/plain' => 'txt',
'text/html' => 'html',
);
if (!empty($_SESSION['kolab_files_caps']['MANTICORE'])) {
$mimetypes = array_merge(array('application/vnd.oasis.opendocument.text' => 'odt'), $mimetypes);
}
foreach (array_keys($mimetypes) as $type) {
list ($app, $label) = explode('/', $type);
@ -1457,6 +1454,10 @@ class kolab_files_engine
);
}
}
else {
$mimetypes = $this->mimetypes;
}
}
}
catch (Exception $e) {
rcube::raise_error(array(