diff options
Diffstat (limited to 'inc/poche')
-rwxr-xr-x | inc/poche/Poche.class.php | 21 | ||||
-rwxr-xr-x | inc/poche/Routing.class.php | 2 | ||||
-rw-r--r-- | inc/poche/WallabagEBooks.class.php | 3 | ||||
-rwxr-xr-x | inc/poche/config.inc.default.php | 1 |
4 files changed, 26 insertions, 1 deletions
diff --git a/inc/poche/Poche.class.php b/inc/poche/Poche.class.php index 81a18c86..f9928145 100755 --- a/inc/poche/Poche.class.php +++ b/inc/poche/Poche.class.php | |||
@@ -337,6 +337,27 @@ class Poche | |||
337 | $this->messages->add('s', _('The tag has been successfully deleted')); | 337 | $this->messages->add('s', _('The tag has been successfully deleted')); |
338 | Tools::redirect(); | 338 | Tools::redirect(); |
339 | break; | 339 | break; |
340 | |||
341 | case 'reload_article' : | ||
342 | Tools::logm('reload article'); | ||
343 | $id = $_GET['id']; | ||
344 | $entry = $this->store->retrieveOneById($id, $this->user->getId()); | ||
345 | Tools::logm('reload url ' . $entry['url']); | ||
346 | $url = new Url(base64_encode($entry['url'])); | ||
347 | $this->action('add', $url); | ||
348 | break; | ||
349 | |||
350 | /* For some unknown reason I can't get displayView() to work here (it redirects to home view afterwards). So here's a dirty fix which redirects directly to URL */ | ||
351 | case 'random': | ||
352 | $id = 0; | ||
353 | while ($this->store->retrieveOneById($id,$this->user->getId()) == null) { | ||
354 | $count = $this->store->getEntriesByViewCount($view, $this->user->getId()); | ||
355 | $id = rand(1,$count); | ||
356 | } | ||
357 | Tools::logm('get a random article'); | ||
358 | Tools::redirect('?view=view&id=' . $id); | ||
359 | //$this->displayView('view', $id); | ||
360 | break; | ||
340 | default: | 361 | default: |
341 | break; | 362 | break; |
342 | } | 363 | } |
diff --git a/inc/poche/Routing.class.php b/inc/poche/Routing.class.php index be06a433..a8d00b89 100755 --- a/inc/poche/Routing.class.php +++ b/inc/poche/Routing.class.php | |||
@@ -116,7 +116,7 @@ class Routing | |||
116 | // update password | 116 | // update password |
117 | $this->wallabag->updatePassword($_POST['password'], $_POST['password_repeat']); | 117 | $this->wallabag->updatePassword($_POST['password'], $_POST['password_repeat']); |
118 | } elseif (isset($_GET['newuser'])) { | 118 | } elseif (isset($_GET['newuser'])) { |
119 | $this->wallabag->createNewUser($_POST['newusername'], $_POST['password4newuser']); | 119 | $this->wallabag->createNewUser($_POST['newusername'], $_POST['password4newuser'], $_POST['newuseremail']); |
120 | } elseif (isset($_GET['deluser'])) { | 120 | } elseif (isset($_GET['deluser'])) { |
121 | $this->wallabag->deleteUser($_POST['password4deletinguser']); | 121 | $this->wallabag->deleteUser($_POST['password4deletinguser']); |
122 | } elseif (isset($_GET['epub'])) { | 122 | } elseif (isset($_GET['epub'])) { |
diff --git a/inc/poche/WallabagEBooks.class.php b/inc/poche/WallabagEBooks.class.php index d31939a1..55831571 100644 --- a/inc/poche/WallabagEBooks.class.php +++ b/inc/poche/WallabagEBooks.class.php | |||
@@ -202,6 +202,9 @@ class WallabagMobi extends WallabagEBooks | |||
202 | } | 202 | } |
203 | $mobi->setContentProvider($content); | 203 | $mobi->setContentProvider($content); |
204 | 204 | ||
205 | // the browser inside Kindle Devices doesn't likes special caracters either, we limit to A-z/0-9 | ||
206 | $this->bookFileName = preg_replace('/[^A-Za-z0-9\-]/', '', $this->bookFileName); | ||
207 | |||
205 | // we offer file to download | 208 | // we offer file to download |
206 | $mobi->download($this->bookFileName.'.mobi'); | 209 | $mobi->download($this->bookFileName.'.mobi'); |
207 | Tools::logm('Mobi file produced'); | 210 | Tools::logm('Mobi file produced'); |
diff --git a/inc/poche/config.inc.default.php b/inc/poche/config.inc.default.php index a159e713..aaaf12a6 100755 --- a/inc/poche/config.inc.default.php +++ b/inc/poche/config.inc.default.php | |||
@@ -62,6 +62,7 @@ | |||
62 | @define ('SHOW_PRINTLINK', '1'); | 62 | @define ('SHOW_PRINTLINK', '1'); |
63 | // display or not percent of read in article view. Affects only default theme. | 63 | // display or not percent of read in article view. Affects only default theme. |
64 | @define ('SHOW_READPERCENT', '1'); | 64 | @define ('SHOW_READPERCENT', '1'); |
65 | @define ('RELOAD_ARTICLE', TRUE); | ||
65 | @define ('ABS_PATH', 'assets/'); | 66 | @define ('ABS_PATH', 'assets/'); |
66 | 67 | ||
67 | @define ('DEFAULT_THEME', 'baggy'); | 68 | @define ('DEFAULT_THEME', 'baggy'); |