aboutsummaryrefslogtreecommitdiffhomepage
path: root/inc/poche/WallabagEpub.class.php
diff options
context:
space:
mode:
authortcit <tcit@tcit.fr>2014-07-20 00:45:45 +0200
committertcit <tcit@tcit.fr>2014-07-20 00:45:45 +0200
commit2b58426b2d4a7f1585d5d7667c0a4fbea4cd29dd (patch)
tree0e1cfa41a296a2d366cb44b644fd7d0734517dc8 /inc/poche/WallabagEpub.class.php
parent6a4bbf0fe5afe1f0783c685fda1478f9c33a90b2 (diff)
downloadwallabag-2b58426b2d4a7f1585d5d7667c0a4fbea4cd29dd.tar.gz
wallabag-2b58426b2d4a7f1585d5d7667c0a4fbea4cd29dd.tar.zst
wallabag-2b58426b2d4a7f1585d5d7667c0a4fbea4cd29dd.zip
fixed bug for epub export #755 ; also better metadata title
Diffstat (limited to 'inc/poche/WallabagEpub.class.php')
-rw-r--r--inc/poche/WallabagEpub.class.php8
1 files changed, 3 insertions, 5 deletions
diff --git a/inc/poche/WallabagEpub.class.php b/inc/poche/WallabagEpub.class.php
index b81d9bfd..9c4d3566 100644
--- a/inc/poche/WallabagEpub.class.php
+++ b/inc/poche/WallabagEpub.class.php
@@ -12,14 +12,12 @@ class WallabagEpub
12{ 12{
13 protected $wallabag; 13 protected $wallabag;
14 protected $method; 14 protected $method;
15 protected $id;
16 protected $value; 15 protected $value;
17 16
18 public function __construct(Poche $wallabag, $method, $id, $value) 17 public function __construct(Poche $wallabag, $method, $value)
19 { 18 {
20 $this->wallabag = $wallabag; 19 $this->wallabag = $wallabag;
21 $this->method = $method; 20 $this->method = $method;
22 $this->id = $id;
23 $this->value = $value; 21 $this->value = $value;
24 } 22 }
25 23
@@ -30,7 +28,7 @@ class WallabagEpub
30 { 28 {
31 switch ($this->method) { 29 switch ($this->method) {
32 case 'id': 30 case 'id':
33 $entryID = filter_var($this->id, FILTER_SANITIZE_NUMBER_INT); 31 $entryID = filter_var($this->value, FILTER_SANITIZE_NUMBER_INT);
34 $entry = $this->wallabag->store->retrieveOneById($entryID, $this->wallabag->user->getId()); 32 $entry = $this->wallabag->store->retrieveOneById($entryID, $this->wallabag->user->getId());
35 $entries = array($entry); 33 $entries = array($entry);
36 $bookTitle = $entry['title']; 34 $bookTitle = $entry['title'];
@@ -87,7 +85,7 @@ class WallabagEpub
87 $log->logLine("getCurrentServerURL: " . $book->getCurrentServerURL()); 85 $log->logLine("getCurrentServerURL: " . $book->getCurrentServerURL());
88 $log->logLine("getCurrentPageURL..: " . $book->getCurrentPageURL()); 86 $log->logLine("getCurrentPageURL..: " . $book->getCurrentPageURL());
89 87
90 $book->setTitle(_('wallabag\'s articles')); 88 $book->setTitle($bookTitle);
91 $book->setIdentifier("http://$_SERVER[HTTP_HOST]", EPub::IDENTIFIER_URI); // Could also be the ISBN number, prefered for published books, or a UUID. 89 $book->setIdentifier("http://$_SERVER[HTTP_HOST]", EPub::IDENTIFIER_URI); // Could also be the ISBN number, prefered for published books, or a UUID.
92 //$book->setLanguage("en"); // Not needed, but included for the example, Language is mandatory, but EPub defaults to "en". Use RFC3066 Language codes, such as "en", "da", "fr" etc. 90 //$book->setLanguage("en"); // Not needed, but included for the example, Language is mandatory, but EPub defaults to "en". Use RFC3066 Language codes, such as "en", "da", "fr" etc.
93 $book->setDescription(_("Some articles saved on my wallabag")); 91 $book->setDescription(_("Some articles saved on my wallabag"));