Skip to content

Commit

Permalink
Add OpenDocument flat mimetypes and x-office/drawing alias
Browse files Browse the repository at this point in the history
Signed-off-by: Julius Härtl <jus@bitgrid.net>
  • Loading branch information
juliusknorr committed Oct 12, 2021
1 parent 6294786 commit 0d2e05a
Show file tree
Hide file tree
Showing 6 changed files with 34 additions and 1 deletion.
1 change: 1 addition & 0 deletions core/img/filetypes/x-office-drawing.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
7 changes: 7 additions & 0 deletions core/js/mimetypelist.js
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,13 @@ OC.MimeTypeList={
"application/vnd.oasis.opendocument.text": "x-office/document",
"application/vnd.oasis.opendocument.text-master": "x-office/document",
"application/vnd.oasis.opendocument.text-template": "x-office/document",
"application/vnd.oasis.opendocument.graphics": "x-office/drawing",
"application/vnd.oasis.opendocument.graphics-template": "x-office/drawing",
"application/vnd.oasis.opendocument.text-web": "x-office/document",
"application/vnd.oasis.opendocument.text-flat-xml": "x-office/document",
"application/vnd.oasis.opendocument.spreadsheet-flat-xml": "x-office/spreadsheet",
"application/vnd.oasis.opendocument.graphics-flat-xml": "x-office/drawing",
"application/vnd.oasis.opendocument.presentation-flat-xml": "x-office/presentation",
"application/vnd.openxmlformats-officedocument.presentationml.presentation": "x-office/presentation",
"application/vnd.openxmlformats-officedocument.presentationml.slideshow": "x-office/presentation",
"application/vnd.openxmlformats-officedocument.presentationml.template": "x-office/presentation",
Expand Down Expand Up @@ -129,6 +135,7 @@ OC.MimeTypeList={
"text-vcard",
"video",
"x-office-document",
"x-office-drawing",
"x-office-presentation",
"x-office-spreadsheet"
],
Expand Down
15 changes: 15 additions & 0 deletions lib/private/Repair/RepairMimeTypes.php
Original file line number Diff line number Diff line change
Expand Up @@ -192,6 +192,17 @@ private function introduceOpenDocumentTemplates() {
return $this->updateMimetypes($updatedMimetypes);
}

private function introduceFlatOpenDocumentType() {
$updatedMimetypes = [
"fodt" => "application/vnd.oasis.opendocument.text-flat-xml",
"fods" => "application/vnd.oasis.opendocument.spreadsheet-flat-xml",
"fodg" => "application/vnd.oasis.opendocument.graphics-flat-xml",
"fodp" => "application/vnd.oasis.opendocument.presentation-flat-xml",
];

return $this->updateMimetypes($updatedMimetypes);
}

private function introduceOrgModeType() {
$updatedMimetypes = [
'org' => 'text/org'
Expand Down Expand Up @@ -245,5 +256,9 @@ public function run(IOutput $out) {
if (version_compare($ocVersionFromBeforeUpdate, '21.0.0.7', '<') && $this->introduceOrgModeType()) {
$out->info('Fixed orgmode mime types');
}

if (version_compare($ocVersionFromBeforeUpdate, '23.0.0.2', '<') && $this->introduceFlatOpenDocumentType()) {
$out->info('Fixed Flat OpenDocument mime types');
}
}
}
6 changes: 6 additions & 0 deletions resources/config/mimetypealiases.dist.json
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,13 @@
"application/vnd.oasis.opendocument.text": "x-office/document",
"application/vnd.oasis.opendocument.text-master": "x-office/document",
"application/vnd.oasis.opendocument.text-template": "x-office/document",
"application/vnd.oasis.opendocument.graphics": "x-office/drawing",
"application/vnd.oasis.opendocument.graphics-template": "x-office/drawing",
"application/vnd.oasis.opendocument.text-web": "x-office/document",
"application/vnd.oasis.opendocument.text-flat-xml": "x-office/document",
"application/vnd.oasis.opendocument.spreadsheet-flat-xml": "x-office/spreadsheet",
"application/vnd.oasis.opendocument.graphics-flat-xml": "x-office/drawing",
"application/vnd.oasis.opendocument.presentation-flat-xml": "x-office/presentation",
"application/vnd.openxmlformats-officedocument.presentationml.presentation": "x-office/presentation",
"application/vnd.openxmlformats-officedocument.presentationml.slideshow": "x-office/presentation",
"application/vnd.openxmlformats-officedocument.presentationml.template": "x-office/presentation",
Expand Down
4 changes: 4 additions & 0 deletions resources/config/mimetypemapping.dist.json
Original file line number Diff line number Diff line change
Expand Up @@ -127,6 +127,10 @@
"ots": ["application/vnd.oasis.opendocument.spreadsheet-template"],
"otp": ["application/vnd.oasis.opendocument.presentation-template"],
"otg": ["application/vnd.oasis.opendocument.graphics-template"],
"fodt": ["application/vnd.oasis.opendocument.text-flat-xml"],
"fods": ["application/vnd.oasis.opendocument.spreadsheet-flat-xml"],
"fodg": ["application/vnd.oasis.opendocument.graphics-flat-xml"],
"fodp": ["application/vnd.oasis.opendocument.presentation-flat-xml"],
"oga": ["audio/ogg"],
"ogg": ["audio/ogg"],
"ogv": ["video/ogg"],
Expand Down
2 changes: 1 addition & 1 deletion version.php
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@
// between betas, final and RCs. This is _not_ the public version number. Reset minor/patchlevel
// when updating major/minor version number.

$OC_Version = [23, 0, 0, 1];
$OC_Version = [23, 0, 0, 2];

// The human readable string
$OC_VersionString = '23.0.0 alpha';
Expand Down

0 comments on commit 0d2e05a

Please sign in to comment.