mirror of
https://github.com/moparisthebest/wallabag
synced 2024-11-30 04:42:19 -05:00
fixed bug for epub export #755 ; also better metadata title
This commit is contained in:
parent
6a4bbf0fe5
commit
2b58426b2d
@ -111,7 +111,7 @@ class Routing
|
|||||||
} elseif (isset($_GET['deluser'])) {
|
} elseif (isset($_GET['deluser'])) {
|
||||||
$this->wallabag->deleteUser($_POST['password4deletinguser']);
|
$this->wallabag->deleteUser($_POST['password4deletinguser']);
|
||||||
} elseif (isset($_GET['epub'])) {
|
} 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();
|
$epub->run();
|
||||||
} elseif (isset($_GET['import'])) {
|
} elseif (isset($_GET['import'])) {
|
||||||
$import = $this->wallabag->import();
|
$import = $this->wallabag->import();
|
||||||
|
@ -12,14 +12,12 @@ class WallabagEpub
|
|||||||
{
|
{
|
||||||
protected $wallabag;
|
protected $wallabag;
|
||||||
protected $method;
|
protected $method;
|
||||||
protected $id;
|
|
||||||
protected $value;
|
protected $value;
|
||||||
|
|
||||||
public function __construct(Poche $wallabag, $method, $id, $value)
|
public function __construct(Poche $wallabag, $method, $value)
|
||||||
{
|
{
|
||||||
$this->wallabag = $wallabag;
|
$this->wallabag = $wallabag;
|
||||||
$this->method = $method;
|
$this->method = $method;
|
||||||
$this->id = $id;
|
|
||||||
$this->value = $value;
|
$this->value = $value;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -30,7 +28,7 @@ class WallabagEpub
|
|||||||
{
|
{
|
||||||
switch ($this->method) {
|
switch ($this->method) {
|
||||||
case 'id':
|
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());
|
$entry = $this->wallabag->store->retrieveOneById($entryID, $this->wallabag->user->getId());
|
||||||
$entries = array($entry);
|
$entries = array($entry);
|
||||||
$bookTitle = $entry['title'];
|
$bookTitle = $entry['title'];
|
||||||
@ -87,7 +85,7 @@ class WallabagEpub
|
|||||||
$log->logLine("getCurrentServerURL: " . $book->getCurrentServerURL());
|
$log->logLine("getCurrentServerURL: " . $book->getCurrentServerURL());
|
||||||
$log->logLine("getCurrentPageURL..: " . $book->getCurrentPageURL());
|
$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->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->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"));
|
$book->setDescription(_("Some articles saved on my wallabag"));
|
||||||
|
Loading…
Reference in New Issue
Block a user