diff options
author | Thomas Citharel <tcit@tcit.fr> | 2015-02-01 12:22:35 +0100 |
---|---|---|
committer | Thomas Citharel <tcit@tcit.fr> | 2015-02-01 12:22:35 +0100 |
commit | fae15c9f84394f905e5237a1afc10364aeb42dd0 (patch) | |
tree | 1715cb08f5b754f320c32c2612775fbe811b2d92 /inc/poche/Poche.class.php | |
parent | 3831c1525ccc512e27309f2cd531f0beff8dc430 (diff) | |
parent | 89637c2a1dcc114b17a8f7eef493b51315e1a6ac (diff) | |
download | wallabag-fae15c9f84394f905e5237a1afc10364aeb42dd0.tar.gz wallabag-fae15c9f84394f905e5237a1afc10364aeb42dd0.tar.zst wallabag-fae15c9f84394f905e5237a1afc10364aeb42dd0.zip |
Merge pull request #968 from wallabag/reloadarticle
added reload function
Diffstat (limited to 'inc/poche/Poche.class.php')
-rwxr-xr-x | inc/poche/Poche.class.php | 17 |
1 files changed, 15 insertions, 2 deletions
diff --git a/inc/poche/Poche.class.php b/inc/poche/Poche.class.php index 5b8e235f..f9928145 100755 --- a/inc/poche/Poche.class.php +++ b/inc/poche/Poche.class.php | |||
@@ -337,10 +337,23 @@ 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 | |||
340 | /* 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 */ | 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 */ |
341 | case 'random': | 351 | case 'random': |
342 | $count = $this->store->getEntriesByViewCount($view, $this->user->getId()); | 352 | $id = 0; |
343 | $id = rand(1,$count); | 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 | } | ||
344 | Tools::logm('get a random article'); | 357 | Tools::logm('get a random article'); |
345 | Tools::redirect('?view=view&id=' . $id); | 358 | Tools::redirect('?view=view&id=' . $id); |
346 | //$this->displayView('view', $id); | 359 | //$this->displayView('view', $id); |