diff options
author | Nicolas LÅ“uillet <nicolas@loeuillet.org> | 2014-09-16 15:21:12 +0200 |
---|---|---|
committer | Nicolas LÅ“uillet <nicolas@loeuillet.org> | 2014-09-16 15:21:12 +0200 |
commit | 657245dcbdbca323621952d2b6f9e991dd94fa03 (patch) | |
tree | f92a44b3f779d7532f5f044d6398dd5d2d60b48e /inc | |
parent | a818ff2000c721c6f078c206c3f5214c558a5546 (diff) | |
parent | 2b58426b2d4a7f1585d5d7667c0a4fbea4cd29dd (diff) | |
download | wallabag-657245dcbdbca323621952d2b6f9e991dd94fa03.tar.gz wallabag-657245dcbdbca323621952d2b6f9e991dd94fa03.tar.zst wallabag-657245dcbdbca323621952d2b6f9e991dd94fa03.zip |
Merge pull request #771 from tcitworld/refactor
fixed bug for epub export #755 ; also better metadata title
Diffstat (limited to 'inc')
-rw-r--r-- | inc/poche/Routing.class.php | 2 | ||||
-rw-r--r-- | inc/poche/WallabagEpub.class.php | 8 |
2 files changed, 4 insertions, 6 deletions
diff --git a/inc/poche/Routing.class.php b/inc/poche/Routing.class.php index eb4c4d90..2db57d12 100644 --- a/inc/poche/Routing.class.php +++ b/inc/poche/Routing.class.php | |||
@@ -111,7 +111,7 @@ class Routing | |||
111 | } elseif (isset($_GET['deluser'])) { | 111 | } elseif (isset($_GET['deluser'])) { |
112 | $this->wallabag->deleteUser($_POST['password4deletinguser']); | 112 | $this->wallabag->deleteUser($_POST['password4deletinguser']); |
113 | } elseif (isset($_GET['epub'])) { | 113 | } elseif (isset($_GET['epub'])) { |
114 | $epub = new WallabagEpub($this->wallabag, $_GET['method'], $_GET['id'], $_GET['value']); | 114 | $epub = new WallabagEpub($this->wallabag, $_GET['method'], $_GET['value']); |
115 | $epub->run(); | 115 | $epub->run(); |
116 | } elseif (isset($_GET['import'])) { | 116 | } elseif (isset($_GET['import'])) { |
117 | $import = $this->wallabag->import(); | 117 | $import = $this->wallabag->import(); |
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")); |