diff --git a/inc/poche/Poche.class.php b/inc/poche/Poche.class.php index 5b8e235f1..f99281458 100755 --- a/inc/poche/Poche.class.php +++ b/inc/poche/Poche.class.php @@ -337,10 +337,23 @@ class Poche $this->messages->add('s', _('The tag has been successfully deleted')); Tools::redirect(); break; + + case 'reload_article' : + Tools::logm('reload article'); + $id = $_GET['id']; + $entry = $this->store->retrieveOneById($id, $this->user->getId()); + Tools::logm('reload url ' . $entry['url']); + $url = new Url(base64_encode($entry['url'])); + $this->action('add', $url); + break; + /* 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 */ case 'random': - $count = $this->store->getEntriesByViewCount($view, $this->user->getId()); - $id = rand(1,$count); + $id = 0; + while ($this->store->retrieveOneById($id,$this->user->getId()) == null) { + $count = $this->store->getEntriesByViewCount($view, $this->user->getId()); + $id = rand(1,$count); + } Tools::logm('get a random article'); Tools::redirect('?view=view&id=' . $id); //$this->displayView('view', $id); diff --git a/inc/poche/config.inc.default.php b/inc/poche/config.inc.default.php index a159e713c..aaaf12a66 100755 --- a/inc/poche/config.inc.default.php +++ b/inc/poche/config.inc.default.php @@ -62,6 +62,7 @@ @define ('SHOW_PRINTLINK', '1'); // display or not percent of read in article view. Affects only default theme. @define ('SHOW_READPERCENT', '1'); +@define ('RELOAD_ARTICLE', TRUE); @define ('ABS_PATH', 'assets/'); @define ('DEFAULT_THEME', 'baggy'); diff --git a/themes/baggy/css/main.css b/themes/baggy/css/main.css index 9356deda9..90d546fcd 100755 --- a/themes/baggy/css/main.css +++ b/themes/baggy/css/main.css @@ -737,7 +737,10 @@ a.add-to-wallabag-link-after:after { content: "\e80d"; } .icon-random:before { - content: "\e915"; + content: "\e915"; +} +.icon-reload:before { + content: "\ea2e"; } diff --git a/themes/baggy/view.twig b/themes/baggy/view.twig index 1afd9df6a..0a8380ded 100755 --- a/themes/baggy/view.twig +++ b/themes/baggy/view.twig @@ -19,6 +19,7 @@ {% if constant('FLATTR') == 1 %}{% if flattr.status == constant('FLATTRABLE') %}
  • {% trans "flattr" %}
  • {% elseif flattr.status == constant('FLATTRED') %}
  • {% trans "flattr" %} ({{ flattr.numFlattrs }})
  • {% endif %}{% endif %} {% if constant('CARROT') == 1 %}
  • Carrot
  • {% endif %} {% if constant('SHOW_PRINTLINK') == 1 %}
  • {% trans "Print" %}
  • {% endif %} + {% if constant('RELOAD_ARTICLE') == 1 %}
  • {% trans "Reload article" %}
  • {% endif %} {% if constant('EPUB') == 1 %}
  • EPUB
  • {% endif %} {% if constant('MOBI') == 1 %}
  • MOBI
  • {% endif %} {% if constant('PDF') == 1 %}
  • PDF
  • {% endif %} diff --git a/themes/default/css/style-default.css b/themes/default/css/style-default.css index 4406d48f4..666c4a28c 100755 --- a/themes/default/css/style-default.css +++ b/themes/default/css/style-default.css @@ -67,3 +67,6 @@ a.bad-display span { a.print span { background-image: url('../img/default/print.png'); } +a.reload span { + background-image: url('../img/default/reload.png'); +} diff --git a/themes/default/img/default/reload.png b/themes/default/img/default/reload.png new file mode 100644 index 000000000..4c0528e73 Binary files /dev/null and b/themes/default/img/default/reload.png differ diff --git a/themes/default/view.twig b/themes/default/view.twig index 8f3a26c3d..be8bf99e6 100755 --- a/themes/default/view.twig +++ b/themes/default/view.twig @@ -18,6 +18,7 @@ {% if constant('FLATTR') == 1 %}{% if flattr.status == constant('FLATTRABLE') %}
  • {% trans "flattr" %}
  • {% elseif flattr.status == constant('FLATTRED') %}
  • {% trans "flattr" %}{{ flattr.numFlattrs }}
  • {% endif %}{% endif %} {% if constant('CARROT') == 1 %}
  • {% trans "carrot" %}
  • {% endif %} {% if constant('SHOW_PRINTLINK') == 1 %}
  • {% trans "Print" %}
  • {% endif %} + {% if constant('RELOAD_ARTICLE') == 1 %}
  • {% trans "Reload article" %}
  • {% endif %}} {% if constant('EPUB') == 1 %}
  • EPUB
  • {% endif %} {% if constant('MOBI') == 1 %}
  • MOBI
  • {% endif %} {% if constant('PDF') == 1 %}
  • PDF
  • {% endif %}