Add mimetype to creators
Signed-off-by: Julius Härtl <jus@bitgrid.net>
This commit is contained in:
parent
9a2694fcb0
commit
329e8c2604
|
@ -102,12 +102,9 @@ class Capabilities implements ICapability {
|
|||
'id' => $id,
|
||||
'name' => $creator->getName(),
|
||||
'extension' => $creator->getExtension(),
|
||||
'templates' => false
|
||||
'templates' => $creator instanceof ACreateFromTemplate,
|
||||
'mimetype' => $creator->getMimetype()
|
||||
];
|
||||
if ($creator instanceof ACreateFromTemplate) {
|
||||
$capabilities['creators'][$id]['templates'] = true;
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
return $capabilities;
|
||||
|
|
|
@ -59,6 +59,14 @@ abstract class ACreateEmpty {
|
|||
*/
|
||||
abstract public function getExtension(): string;
|
||||
|
||||
/**
|
||||
* Mimetype of the resulting created file
|
||||
*
|
||||
* @since 18.0.0
|
||||
* @return string
|
||||
*/
|
||||
abstract public function getMimetype(): string;
|
||||
|
||||
/**
|
||||
* Add content when creating empty files
|
||||
*
|
||||
|
|
|
@ -31,6 +31,10 @@ class CreateEmpty extends ACreateEmpty {
|
|||
public function getExtension(): string {
|
||||
return '.txt';
|
||||
}
|
||||
|
||||
public function getMimetype(): string {
|
||||
return 'text/plain';
|
||||
}
|
||||
}
|
||||
|
||||
class Editor implements IEditor {
|
||||
|
|
Loading…
Reference in New Issue