|
@@ 196-207 (lines=12) @@
|
| 193 |
|
* @return string |
| 194 |
|
*/ |
| 195 |
|
private function getGoogleDocExtension($mimetype) { |
| 196 |
|
if ($mimetype === self::DOCUMENT) { |
| 197 |
|
return 'odt'; |
| 198 |
|
} else if ($mimetype === self::SPREADSHEET) { |
| 199 |
|
return 'ods'; |
| 200 |
|
} else if ($mimetype === self::DRAWING) { |
| 201 |
|
return 'jpg'; |
| 202 |
|
} else if ($mimetype === self::PRESENTATION) { |
| 203 |
|
// Download as .odp is not available |
| 204 |
|
return 'pdf'; |
| 205 |
|
} else { |
| 206 |
|
return ''; |
| 207 |
|
} |
| 208 |
|
} |
| 209 |
|
|
| 210 |
|
public function mkdir($path) { |
|
@@ 578-590 (lines=13) @@
|
| 575 |
|
// Convert Google Doc mimetypes, choosing Open Document formats for download |
| 576 |
|
if ($mimetype === self::FOLDER) { |
| 577 |
|
return 'httpd/unix-directory'; |
| 578 |
|
} else if ($mimetype === self::DOCUMENT) { |
| 579 |
|
return 'application/vnd.oasis.opendocument.text'; |
| 580 |
|
} else if ($mimetype === self::SPREADSHEET) { |
| 581 |
|
return 'application/x-vnd.oasis.opendocument.spreadsheet'; |
| 582 |
|
} else if ($mimetype === self::DRAWING) { |
| 583 |
|
return 'image/jpeg'; |
| 584 |
|
} else if ($mimetype === self::PRESENTATION) { |
| 585 |
|
// Download as .odp is not available |
| 586 |
|
return 'application/pdf'; |
| 587 |
|
} else { |
| 588 |
|
// use extension-based detection, could be an encrypted file |
| 589 |
|
return parent::getMimeType($path); |
| 590 |
|
} |
| 591 |
|
} else { |
| 592 |
|
return false; |
| 593 |
|
} |