use PHPePub\Core\EPub;
use PHPePub\Core\Structure\OPF\DublinCore;
use Symfony\Component\HttpFoundation\Response;
-use Craue\ConfigBundle\Util\Config;
/**
* This class doesn't have unit test BUT it's fully covered by a functional test with ExportControllerTest.
private $entries = [];
private $authors = ['wallabag'];
private $language = '';
- private $tags = [];
private $footerTemplate = '<div style="text-align:center;">
<p>Produced by wallabag with %EXPORT_METHOD%</p>
<p>Please open <a href="https://github.com/wallabag/wallabag/issues">an issue</a> if you have trouble with the display of this E-Book on your device.</p>
</div>';
/**
- * @param Config $craueConfig CraueConfig instance to get wallabag instance url from database
+ * @param string $wallabagUrl Wallabag instance url
* @param string $logoPath Path to the logo FROM THE BUNDLE SCOPE
*/
- public function __construct(Config $craueConfig, $logoPath)
+ public function __construct($wallabagUrl, $logoPath)
{
- $this->wallabagUrl = $craueConfig->get('wallabag_url');
+ $this->wallabagUrl = $wallabagUrl;
$this->logoPath = $logoPath;
}
throw new \InvalidArgumentException(sprintf('The format "%s" is not yet supported.', $format));
}
+ public function exportJsonData()
+ {
+ return $this->prepareSerializingContent('json');
+ }
+
/**
* Use PHPePub to dump a .epub file.
*
$book->setCoverImage('Cover.png', file_get_contents($this->logoPath), 'image/png');
}
- $book->addChapter('Notices', 'Cover2.html', $content_start.$this->getExportInformation('PHPePub').$bookEnd);
-
$book->buildTOC();
/*
$book->addChapter($entry->getTitle(), htmlspecialchars($filename).'.html', $chapter, true, EPub::EXTERNAL_REF_ADD);
}
+ $book->addChapter('Notices', 'Cover2.html', $content_start.$this->getExportInformation('PHPePub').$bookEnd);
+
return Response::create(
$book->getBook(),
200,