]> git.immae.eu Git - github/wallabag/wallabag.git/commitdiff
fixed bug for epub export #755 ; also better metadata title 771/head
authortcit <tcit@tcit.fr>
Sat, 19 Jul 2014 22:45:45 +0000 (00:45 +0200)
committertcit <tcit@tcit.fr>
Sat, 19 Jul 2014 22:45:45 +0000 (00:45 +0200)
inc/poche/Routing.class.php
inc/poche/WallabagEpub.class.php

index eb4c4d90073913bba0c334ce4592e5fa6b38f569..2db57d1275e2b3d20f094cc659951315bc300161 100644 (file)
@@ -111,7 +111,7 @@ class Routing
         } elseif (isset($_GET['deluser'])) {
             $this->wallabag->deleteUser($_POST['password4deletinguser']);
         } elseif (isset($_GET['epub'])) {
-            $epub = new WallabagEpub($this->wallabag, $_GET['method'], $_GET['id'], $_GET['value']);
+            $epub = new WallabagEpub($this->wallabag, $_GET['method'], $_GET['value']);
             $epub->run();
         } elseif (isset($_GET['import'])) {
             $import = $this->wallabag->import();
index b81d9bfd248b6eed8098f8a983c040f9eb2206da..9c4d3566d558fdcc7207f6b20720e4ef1a66ee7f 100644 (file)
@@ -12,14 +12,12 @@ class WallabagEpub
 {
     protected $wallabag;
     protected $method;
-    protected $id;
     protected $value;
 
-    public function __construct(Poche $wallabag, $method, $id, $value)
+    public function __construct(Poche $wallabag, $method, $value)
     {
         $this->wallabag = $wallabag;
         $this->method   = $method;
-        $this->id       = $id;
         $this->value    = $value;
     }
 
@@ -30,7 +28,7 @@ class WallabagEpub
     {
         switch ($this->method) {
             case 'id':
-                $entryID = filter_var($this->id, FILTER_SANITIZE_NUMBER_INT);
+                $entryID = filter_var($this->value, FILTER_SANITIZE_NUMBER_INT);
                 $entry = $this->wallabag->store->retrieveOneById($entryID, $this->wallabag->user->getId());
                 $entries = array($entry);
                 $bookTitle = $entry['title'];
@@ -87,7 +85,7 @@ class WallabagEpub
         $log->logLine("getCurrentServerURL: " . $book->getCurrentServerURL());
         $log->logLine("getCurrentPageURL..: " . $book->getCurrentPageURL());
 
-        $book->setTitle(_('wallabag\'s articles'));
+        $book->setTitle($bookTitle);
         $book->setIdentifier("http://$_SERVER[HTTP_HOST]", EPub::IDENTIFIER_URI); // Could also be the ISBN number, prefered for published books, or a UUID.
         //$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.
         $book->setDescription(_("Some articles saved on my wallabag"));