Skip to content

Commit

Permalink
Merge pull request #73 from catalyst/extra_extensions
Browse files Browse the repository at this point in the history
Add extra extenstions
  • Loading branch information
tuanngocnguyen authored Feb 8, 2024
2 parents a58d605 + 9d81d26 commit 99a74ec
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 2 deletions.
4 changes: 4 additions & 0 deletions classes/converter.php
Original file line number Diff line number Diff line change
Expand Up @@ -43,17 +43,21 @@ class converter implements \core_files\converter_interface {
private static $imports = [
'doc' => 'application/msword',
'docx' => 'application/vnd.openxmlformats-officedocument.wordprocessingml.document',
'dotx' => 'application/vnd.openxmlformats-officedocument.wordprocessingml.template',
'rtf' => 'application/rtf',
'xls' => 'application/vnd.ms-excel',
'xlsx' => 'application/vnd.openxmlformats-officedocument.spreadsheetml.sheet',
'pot' => 'application/vnd.ms-powerpoint',
'ppt' => 'application/vnd.ms-powerpoint',
'pptx' => 'application/vnd.ms-powerpoint',
'html' => 'text/html',
'odt' => 'application/vnd.oasis.opendocument.text',
'ods' => 'application/vnd.oasis.opendocument.spreadsheet',
'png' => 'image/png',
'jpeg' => 'image/jpeg',
'jpg' => 'image/jpeg',
'txt' => 'text/plain',
'csv' => 'text/csv',
'gif' => 'image/gif',
];

Expand Down
10 changes: 8 additions & 2 deletions tests/converter_test.php
Original file line number Diff line number Diff line change
Expand Up @@ -549,25 +549,31 @@ public function test_conversion_record_deduplication() {

/**
* Data provider for test_supports
* Supported formats: 'doc', 'docx', 'rtf', 'xls', 'xlsx', 'ppt', 'pptx', 'html', 'odt',
* 'ods', 'txt', 'png', 'jpg', 'gif', 'pdf'
*
* @return array
*/
public function supports_provider() {
return [
['doc', true], ['DOC', true],
['docm', false], ['DOCM', false],
['docx', true], ['DOCX', true],
['dotx', true], ['DOTX', true],
['rtf', true], ['RTF', true],
['xls', true], ['XLS', true],
['xlsm', false], ['XLSM', false],
['xlsx', true], ['XLSX', true],
['xltm', false], ['XLTM', false],
['pot', true], ['POT', true],
['ppt', true], ['PPT', true],
['pptm', false], ['PPTM', false],
['pptx', true], ['PPTX', true],
['html', true], ['HTML', true],
['odt', true], ['ODT', true],
['ods', true], ['ODS', true],
['txt', true], ['TXT', true],
['csv', true], ['CSV', true],
['png', true], ['PNG', true],
['jpeg', true], ['JPEG', true],
['jpg', true], ['JPG', true],
['gif', true], ['GIF', true],
['pdf', false], ['PDF', false],
Expand Down

0 comments on commit 99a74ec

Please sign in to comment.