|
|
@ -77,20 +77,20 @@ switch ($VARS['action']) {
|
|
|
|
switch ($VARS['type']) {
|
|
|
|
switch ($VARS['type']) {
|
|
|
|
case "html":
|
|
|
|
case "html":
|
|
|
|
header("Content-Type: text/html; charset=UTF-8");
|
|
|
|
header("Content-Type: text/html; charset=UTF-8");
|
|
|
|
header("Content-disposition: attachment; filename=\"" . $note->getCleanTitle() . "_" . $note->getModified() . ".html\"");
|
|
|
|
header("Content-disposition: attachment; filename=\"" . $note->getTitle() . "_" . $note->getModified() . ".html\"");
|
|
|
|
echo $note->getHTML(false);
|
|
|
|
echo $note->getHTML(false);
|
|
|
|
break;
|
|
|
|
break;
|
|
|
|
case "odt":
|
|
|
|
case "odt":
|
|
|
|
if ($SETTINGS['pandoc'] != "") {
|
|
|
|
if ($SETTINGS['pandoc'] != "") {
|
|
|
|
header("Content-Type: application/vnd.oasis.opendocument.text");
|
|
|
|
header("Content-Type: application/vnd.oasis.opendocument.text");
|
|
|
|
header("Content-disposition: attachment; filename=\"" . $note->getCleanTitle() . "_" . $note->getModified() . ".odt\"");
|
|
|
|
header("Content-disposition: attachment; filename=\"" . $note->getTitle() . "_" . $note->getModified() . ".odt\"");
|
|
|
|
$pandoc = new Pandoc\Pandoc();
|
|
|
|
$pandoc = new Pandoc\Pandoc();
|
|
|
|
echo $pandoc->convert($note->getText(), "markdown_github", "odt");
|
|
|
|
echo $pandoc->convert($note->getText(), "markdown_github", "odt");
|
|
|
|
break;
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
default:
|
|
|
|
default:
|
|
|
|
header("Content-Type: text/markdown; charset=UTF-8");
|
|
|
|
header("Content-Type: text/markdown; charset=UTF-8");
|
|
|
|
header("Content-disposition: attachment; filename=\"" . $note->getCleanTitle() . "_" . $note->getModified() . ".md\"");
|
|
|
|
header("Content-disposition: attachment; filename=\"" . $note->getTitle() . "_" . $note->getModified() . ".md\"");
|
|
|
|
echo $note->getText();
|
|
|
|
echo $note->getText();
|
|
|
|
}
|
|
|
|
}
|
|
|
|
break;
|
|
|
|
break;
|
|
|
|