mirror of
https://github.com/wallabag/wallabag.git
synced 2025-08-11 17:51:02 +00:00
Remove remaining MOBI stuff
This commit is contained in:
parent
bdb297f2b4
commit
c6ff0bc691
6 changed files with 6 additions and 132 deletions
|
@ -411,7 +411,7 @@ class EntryRestController extends WallabagRestController
|
|||
* required=true,
|
||||
* @OA\Schema(
|
||||
* type="string",
|
||||
* enum={"xml", "json", "txt", "csv", "pdf", "epub", "mobi"},
|
||||
* enum={"xml", "json", "txt", "csv", "pdf", "epub"},
|
||||
* )
|
||||
* ),
|
||||
* @OA\Response(
|
||||
|
|
|
@ -21,7 +21,7 @@ class ExportController extends AbstractController
|
|||
* Gets one entry content.
|
||||
*
|
||||
* @Route("/export/{id}.{format}", name="export_entry", requirements={
|
||||
* "format": "epub|mobi|pdf|json|xml|txt|csv",
|
||||
* "format": "epub|pdf|json|xml|txt|csv",
|
||||
* "id": "\d+"
|
||||
* })
|
||||
*
|
||||
|
@ -55,7 +55,7 @@ class ExportController extends AbstractController
|
|||
* Export all entries for current user.
|
||||
*
|
||||
* @Route("/export/{category}.{format}", name="export_entries", requirements={
|
||||
* "format": "epub|mobi|pdf|json|xml|txt|csv",
|
||||
* "format": "epub|pdf|json|xml|txt|csv",
|
||||
* "category": "all|unread|starred|archive|tag_entries|untagged|search|annotated|same_domain"
|
||||
* })
|
||||
*
|
||||
|
|
|
@ -247,55 +247,6 @@ class EntriesExport
|
|||
);
|
||||
}
|
||||
|
||||
/**
|
||||
* Use PHPMobi to dump a .mobi file.
|
||||
*
|
||||
* @return Response
|
||||
*/
|
||||
private function produceMobi()
|
||||
{
|
||||
$mobi = new \MOBI();
|
||||
$content = new \MOBIFile();
|
||||
|
||||
/*
|
||||
* Book metadata
|
||||
*/
|
||||
$content->set('title', $this->title);
|
||||
$content->set('author', $this->author);
|
||||
$content->set('subject', $this->title);
|
||||
|
||||
/*
|
||||
* Front page
|
||||
*/
|
||||
$content->appendParagraph($this->getExportInformation('PHPMobi'));
|
||||
if (file_exists($this->logoPath)) {
|
||||
$content->appendImage(imagecreatefrompng($this->logoPath));
|
||||
}
|
||||
$content->appendPageBreak();
|
||||
|
||||
/*
|
||||
* Adding actual entries
|
||||
*/
|
||||
foreach ($this->entries as $entry) {
|
||||
$content->appendChapterTitle($entry->getTitle());
|
||||
$content->appendParagraph($entry->getContent());
|
||||
$content->appendPageBreak();
|
||||
}
|
||||
$mobi->setContentProvider($content);
|
||||
|
||||
return Response::create(
|
||||
$mobi->toString(),
|
||||
200,
|
||||
[
|
||||
'Accept-Ranges' => 'bytes',
|
||||
'Content-Description' => 'File Transfer',
|
||||
'Content-type' => 'application/x-mobipocket-ebook',
|
||||
'Content-Disposition' => 'attachment; filename="' . $this->getSanitizedFilename() . '.mobi"',
|
||||
'Content-Transfer-Encoding' => 'binary',
|
||||
]
|
||||
);
|
||||
}
|
||||
|
||||
/**
|
||||
* Use TCPDF to dump a .pdf file.
|
||||
*
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue