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';
+ </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;
}
$this->entries = $entries;
- foreach ($entries as $entry) {
- $this->tags[] = $entry->getTags();
- }
-
return $this;
}
// set tags as subjects
foreach ($this->entries as $entry) {
- foreach ($this->tags as $tag) {
- $book->setSubject($tag['value']);
+ foreach ($entry->getTags() as $tag) {
+ $book->setSubject($tag->getLabel());
}
// the reader in Kobo Devices doesn't likes special caracters
* Adding actual entries
*/
foreach ($this->entries as $entry) {
- foreach ($this->tags as $tag) {
- $pdf->SetKeywords($tag['value']);
+ foreach ($entry->getTags() as $tag) {
+ $pdf->SetKeywords($tag->getLabel());
}
$pdf->AddPage();
$enclosure = '"';
$handle = fopen('php://memory', 'rb+');
- fputcsv($handle, ['Title', 'URL', 'Content', 'Tags', 'MIME Type', 'Language'], $delimiter, $enclosure);
+ fputcsv($handle, ['Title', 'URL', 'Content', 'Tags', 'MIME Type', 'Language', 'Creation date'], $delimiter, $enclosure);
foreach ($this->entries as $entry) {
fputcsv(
implode(', ', $entry->getTags()->toArray()),
$entry->getMimetype(),
$entry->getLanguage(),
+ $entry->getCreatedAt()->format('d/m/Y h:i:s'),
],
$delimiter,
$enclosure