| @@ 200-211 (lines=12) @@ | ||
| 197 | * @return string |
|
| 198 | */ |
|
| 199 | private function getGoogleDocExtension($mimetype) { |
|
| 200 | if ($mimetype === self::DOCUMENT) { |
|
| 201 | return 'odt'; |
|
| 202 | } else if ($mimetype === self::SPREADSHEET) { |
|
| 203 | return 'ods'; |
|
| 204 | } else if ($mimetype === self::DRAWING) { |
|
| 205 | return 'jpg'; |
|
| 206 | } else if ($mimetype === self::PRESENTATION) { |
|
| 207 | // Download as .odp is not available |
|
| 208 | return 'pdf'; |
|
| 209 | } else { |
|
| 210 | return ''; |
|
| 211 | } |
|
| 212 | } |
|
| 213 | ||
| 214 | /** |
|
| @@ 595-607 (lines=13) @@ | ||
| 592 | // Convert Google Doc mimetypes, choosing Open Document formats for download |
|
| 593 | if ($mimetype === self::FOLDER) { |
|
| 594 | return 'httpd/unix-directory'; |
|
| 595 | } else if ($mimetype === self::DOCUMENT) { |
|
| 596 | return 'application/vnd.oasis.opendocument.text'; |
|
| 597 | } else if ($mimetype === self::SPREADSHEET) { |
|
| 598 | return 'application/x-vnd.oasis.opendocument.spreadsheet'; |
|
| 599 | } else if ($mimetype === self::DRAWING) { |
|
| 600 | return 'image/jpeg'; |
|
| 601 | } else if ($mimetype === self::PRESENTATION) { |
|
| 602 | // Download as .odp is not available |
|
| 603 | return 'application/pdf'; |
|
| 604 | } else { |
|
| 605 | // use extension-based detection, could be an encrypted file |
|
| 606 | return parent::getMimeType($path); |
|
| 607 | } |
|
| 608 | } else { |
|
| 609 | return false; |
|
| 610 | } |
|