Skip to content
Snippets Groups Projects
Unverified Commit 329e8c26 authored by Julius Härtl's avatar Julius Härtl
Browse files

Add mimetype to creators


Signed-off-by: default avatarJulius Härtl <jus@bitgrid.net>
parent 9a2694fc
No related branches found
No related tags found
No related merge requests found
......@@ -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 {
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment