X-Git-Url: https://git.immae.eu/?a=blobdiff_plain;f=src%2FWallabag%2FCoreBundle%2FHelper%2FEntriesExport.php;h=e50c68a67a91f0870a97f254df0328ace7e886c8;hb=20bf78b9352ca04372fb9665ed125bd068ff8b67;hp=e91007e1ba7eeccb6781e601a770ebfcb182bd5d;hpb=f9feca5c64309a2a202258bb92ae24b7a1dbe31c;p=github%2Fwallabag%2Fwallabag.git diff --git a/src/Wallabag/CoreBundle/Helper/EntriesExport.php b/src/Wallabag/CoreBundle/Helper/EntriesExport.php index e91007e1..e50c68a6 100644 --- a/src/Wallabag/CoreBundle/Helper/EntriesExport.php +++ b/src/Wallabag/CoreBundle/Helper/EntriesExport.php @@ -21,11 +21,10 @@ class EntriesExport private $entries = []; private $authors = ['wallabag']; private $language = ''; - private $tags = []; private $footerTemplate = '

Produced by wallabag with %EXPORT_METHOD%

Please open an issue if you have trouble with the display of this E-Book on your device.

- '; /** * @param Config $craueConfig CraueConfig instance to get wallabag instance url from database @@ -53,10 +52,6 @@ class EntriesExport $this->entries = $entries; - foreach ($entries as $entry) { - $this->tags[] = $entry->getTags(); - } - return $this; } @@ -159,8 +154,8 @@ class EntriesExport // 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 @@ -265,8 +260,8 @@ class EntriesExport * 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(); @@ -302,7 +297,7 @@ class EntriesExport $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( @@ -315,6 +310,7 @@ class EntriesExport implode(', ', $entry->getTags()->toArray()), $entry->getMimetype(), $entry->getLanguage(), + $entry->getCreatedAt()->format('d/m/Y h:i:s'), ], $delimiter, $enclosure