Fix compatibility with chwala-0.4 (Bifrost#T31552)
This commit is contained in:
parent
e5d2934e31
commit
fdcb5c0c58
1 changed files with 19 additions and 18 deletions
|
@ -1435,28 +1435,29 @@ class kolab_files_engine
|
||||||
if (array_key_exists($type, $this->mimetypes)) {
|
if (array_key_exists($type, $this->mimetypes)) {
|
||||||
$mimetypes = $this->mimetypes[$type];
|
$mimetypes = $this->mimetypes[$type];
|
||||||
}
|
}
|
||||||
|
// fallback to static definition if old Chwala is used
|
||||||
|
else if ($type == 'edit') {
|
||||||
|
$mimetypes = array(
|
||||||
|
'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);
|
||||||
|
$label = preg_replace('/[^a-z]/', '', $label);
|
||||||
|
$mimetypes[$type] = array(
|
||||||
|
'ext' => $mimetypes[$type],
|
||||||
|
'label' => $this->plugin->gettext('type.' . $label),
|
||||||
|
);
|
||||||
|
}
|
||||||
|
}
|
||||||
else {
|
else {
|
||||||
$mimetypes = $this->mimetypes;
|
$mimetypes = $this->mimetypes;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// fallback to static definition if old Chwala is used
|
|
||||||
if ($type == 'edit' && empty($mimetypes)) {
|
|
||||||
$mimetypes = array(
|
|
||||||
'application/vnd.oasis.opendocument.text' => 'odt',
|
|
||||||
'text/plain' => 'txt',
|
|
||||||
'text/html' => 'html',
|
|
||||||
);
|
|
||||||
|
|
||||||
foreach (array_keys($mimetypes) as $type) {
|
|
||||||
list ($app, $label) = explode('/', $type);
|
|
||||||
$label = preg_replace('/[^a-z]/', '', $label);
|
|
||||||
$mimetypes[$type] = array(
|
|
||||||
'ext' => $mimetypes[$type],
|
|
||||||
'label' => $this->plugin->gettext('type.' . $label),
|
|
||||||
);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
catch (Exception $e) {
|
catch (Exception $e) {
|
||||||
rcube::raise_error(array(
|
rcube::raise_error(array(
|
||||||
|
|
Loading…
Add table
Reference in a new issue