diff options
author | Thomas Citharel <tcit@tcit.fr> | 2015-03-02 00:15:49 +0100 |
---|---|---|
committer | Thomas Citharel <tcit@tcit.fr> | 2015-03-02 00:15:49 +0100 |
commit | 059a3380341c439e1debb4921bbf023a3b424a4b (patch) | |
tree | facfca653c08cca2cef72feb095b43b3cba80fcb /inc/poche/Poche.class.php | |
parent | b692691d7ddc1fa0e1ef1f7888dfd65f70677e27 (diff) | |
download | wallabag-059a3380341c439e1debb4921bbf023a3b424a4b.tar.gz wallabag-059a3380341c439e1debb4921bbf023a3b424a4b.tar.zst wallabag-059a3380341c439e1debb4921bbf023a3b424a4b.zip |
implement #1123
Diffstat (limited to 'inc/poche/Poche.class.php')
-rwxr-xr-x | inc/poche/Poche.class.php | 26 |
1 files changed, 23 insertions, 3 deletions
diff --git a/inc/poche/Poche.class.php b/inc/poche/Poche.class.php index 30d42c61..18e1d051 100755 --- a/inc/poche/Poche.class.php +++ b/inc/poche/Poche.class.php | |||
@@ -310,11 +310,16 @@ class Poche | |||
310 | if ( Tools::isAjaxRequest() ) { | 310 | if ( Tools::isAjaxRequest() ) { |
311 | echo 1; | 311 | echo 1; |
312 | exit; | 312 | exit; |
313 | } | 313 | } else { |
314 | else { | ||
315 | Tools::redirect(); | 314 | Tools::redirect(); |
316 | } | 315 | } |
317 | break; | 316 | break; |
317 | case 'archive_and_next' : | ||
318 | $nextid = $this->store->getNextArticle($id, $this->user->getId()); | ||
319 | $this->store->archiveById($id, $this->user->getId()); | ||
320 | Tools::logm('archive link #' . $id); | ||
321 | Tools::redirect('?view=view&id=' . $nextid); | ||
322 | break; | ||
318 | case 'archive_all' : | 323 | case 'archive_all' : |
319 | $this->store->archiveAll($this->user->getId()); | 324 | $this->store->archiveAll($this->user->getId()); |
320 | Tools::logm('archive all links'); | 325 | Tools::logm('archive all links'); |
@@ -516,6 +521,20 @@ class Poche | |||
516 | $flattr->checkItem($entry['url'], $entry['id']); | 521 | $flattr->checkItem($entry['url'], $entry['id']); |
517 | } | 522 | } |
518 | 523 | ||
524 | # previous and next | ||
525 | $previous = FALSE; | ||
526 | $previous_id = $this->store->getPreviousArticle($id, $this->user->getId()); | ||
527 | $next = FALSE; | ||
528 | $next_id = $this->store->getNextArticle($id, $this->user->getId()); | ||
529 | |||
530 | if ($this->store->retrieveOneById($previous_id, $this->user->getId())) { | ||
531 | $previous = TRUE; | ||
532 | } | ||
533 | if ($this->store->retrieveOneById($next_id, $this->user->getId())) { | ||
534 | $next = TRUE; | ||
535 | } | ||
536 | $navigate = $arrayName = array('previous' => $previous, 'previousid' => $previous_id, 'next' => $next, 'nextid' => $next_id); | ||
537 | |||
519 | # tags | 538 | # tags |
520 | $tags = $this->store->retrieveTagsByEntry($entry['id']); | 539 | $tags = $this->store->retrieveTagsByEntry($entry['id']); |
521 | 540 | ||
@@ -523,7 +542,8 @@ class Poche | |||
523 | 'entry' => $entry, | 542 | 'entry' => $entry, |
524 | 'content' => $content, | 543 | 'content' => $content, |
525 | 'flattr' => $flattr, | 544 | 'flattr' => $flattr, |
526 | 'tags' => $tags | 545 | 'tags' => $tags, |
546 | 'navigate' => $navigate | ||
527 | ); | 547 | ); |
528 | } | 548 | } |
529 | else { | 549 | else { |