- fputcsv($output, array($entry->getTitle(),
- $entry->getURL(),
- $entry->getContent(),
- implode(', ', $entry->getTags()->toArray()),
- $entry->getMimetype(),
- $entry->getLanguage(), ));
+ fputcsv(
+ $handle,
+ array(
+ $entry->getTitle(),
+ $entry->getURL(),
+ $entry->getContent(),
+ implode(', ', $entry->getTags()->toArray()),
+ $entry->getMimetype(),
+ $entry->getLanguage(),
+ ),
+ $delimiter,
+ $enclosure
+ );
+ }
+
+ rewind($handle);
+ $output = stream_get_contents($handle);
+ fclose($handle);
+
+ return Response::create(
+ $output,
+ 200,
+ array(
+ 'Content-type' => 'application/csv',
+ 'Content-Disposition' => 'attachment; filename="'.$this->title.'.csv"',
+ 'Content-Transfer-Encoding' => 'UTF-8',
+ )
+ )->send();
+ }
+
+ /**
+ * Return a kind of footer / information for the epub.
+ *
+ * @param string $type Generator of the export, can be: tdpdf, PHPePub, PHPMobi
+ *
+ * @return string
+ */
+ private function getExportInformation($type)
+ {
+ $info = str_replace('%EXPORT_METHOD%', $type, $this->footerTemplate);
+
+ if ('tcpdf' === $type) {
+ return str_replace('%IMAGE%', '<img src="'.$this->logoPath.'" />', $info);