Skip to content

Commit

Permalink
Add extra extenstions
Browse files Browse the repository at this point in the history
  • Loading branch information
Nathan Nguyen committed Jan 24, 2024
1 parent a58d605 commit e42d989
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 2 deletions.
8 changes: 8 additions & 0 deletions classes/converter.php
Original file line number Diff line number Diff line change
Expand Up @@ -42,18 +42,26 @@ class converter implements \core_files\converter_interface {
/** @var array $imports List of supported import file formats */
private static $imports = [
'doc' => 'application/msword',
'docm' => 'application/vnd.ms-word.document.macroEnabled.12 ',
'docx' => 'application/vnd.openxmlformats-officedocument.wordprocessingml.document',
'dotx' => 'application/vnd.openxmlformats-officedocument.wordprocessingml.template',
'rtf' => 'application/rtf',
'xls' => 'application/vnd.ms-excel',
'xlsm' => 'application/vnd.ms-excel.sheet.macroEnabled.12',
'xlsx' => 'application/vnd.openxmlformats-officedocument.spreadsheetml.sheet',
'xltm' => 'application/vnd.ms-excel.template.macroEnabled.12',
'pot' => 'application/vnd.ms-powerpoint',
'ppt' => 'application/vnd.ms-powerpoint',
'pptm' => 'application/vnd.openxmlformats-officedocument.presentationml.presentation',
'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', true], ['DOCM', true],
['docx', true], ['DOCX', true],
['dotx', true], ['DOTX', true],
['rtf', true], ['RTF', true],
['xls', true], ['XLS', true],
['xlsm', true], ['XLSM', true],
['xlsx', true], ['XLSX', true],
['xltm', true], ['XLTM', true],
['pot', true], ['POT', true],
['ppt', true], ['PPT', true],
['pptm', true], ['PPTM', true],
['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 e42d989

Please sign in to comment.