Skip to content
This repository has been archived by the owner on Jul 24, 2018. It is now read-only.

Commit

Permalink
Merge pull request #616 from owncloud/stable9-592
Browse files Browse the repository at this point in the history
[stable9] Add more supported mimes read ODF formats
  • Loading branch information
VicDeo committed Mar 3, 2016
2 parents 902d3fa + 4cabd8d commit 2e28e36
Showing 1 changed file with 9 additions and 1 deletion.
10 changes: 9 additions & 1 deletion lib/storage.php
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,11 @@

class Storage {
const MIMETYPE_LIBREOFFICE_WORDPROCESSOR = 'application/vnd.oasis.opendocument.text';
private static $SUPPORTED_MIMES_READ = array(
'application/vnd.oasis.opendocument.spreadsheet',
'application/vnd.oasis.opendocument.presentation',
'application/vnd.oasis.opendocument.graphics',
);

public static function getDocuments() {
$list = array_filter(
Expand Down Expand Up @@ -92,14 +97,17 @@ public static function onDelete($params) {
protected static function searchDocuments(){
$documents = array();
foreach (self::getSupportedMimetypes() as $mime){
$documents = array_merge($documents, \OCP\Files::searchByMime($mime));
if (!in_array($mime, self::$SUPPORTED_MIMES_READ)) {
$documents = array_merge($documents, \OCP\Files::searchByMime($mime));
}
}
return $documents;
}

public static function getSupportedMimetypes(){
return array_merge(
array(self::MIMETYPE_LIBREOFFICE_WORDPROCESSOR),
self::$SUPPORTED_MIMES_READ,
Filter::getAll()
);
}
Expand Down

0 comments on commit 2e28e36

Please sign in to comment.