From 5ea5310ab450035143e2f5637f9fa69773f7879b Mon Sep 17 00:00:00 2001 From: Thomas Citharel Date: Sun, 14 Dec 2014 15:17:39 +0100 Subject: [PATCH] enable showing or not for epub/mobi/pdf export buttons --- inc/poche/config.inc.default.php | 6 ++++++ themes/baggy/home.twig | 18 +++++++++--------- themes/baggy/view.twig | 6 +++--- themes/default/home.twig | 18 +++++++++--------- themes/default/view.twig | 4 +++- 5 files changed, 30 insertions(+), 22 deletions(-) diff --git a/inc/poche/config.inc.default.php b/inc/poche/config.inc.default.php index 3eaee3a3..a159e713 100755 --- a/inc/poche/config.inc.default.php +++ b/inc/poche/config.inc.default.php @@ -52,6 +52,12 @@ @define ('FLATTRABLE', '1'); @define ('FLATTRED', '2'); @define ('CARROT', FALSE); + +// ebook +@define ('EPUB', TRUE); +@define ('MOBI', FALSE); +@define ('PDF', FALSE); + // display or not print link in article view @define ('SHOW_PRINTLINK', '1'); // display or not percent of read in article view. Affects only default theme. diff --git a/themes/baggy/home.twig b/themes/baggy/home.twig index 426ead1d..abebe455 100755 --- a/themes/baggy/home.twig +++ b/themes/baggy/home.twig @@ -61,17 +61,17 @@ {% if searchterm is defined %}{% trans "Tag these results as" %} {{ searchterm }}{% endif %}
{% if tag %} - {% trans "Download as ePub3" %} - {% trans "Download as Mobi" %} - {% trans "Download as PDF" %} + {% if constant('EPUB') == 1 %}{% trans "Download as ePub3" %}{% endif %} + {% if constant('MOBI') == 1 %}{% trans "Download as Mobi" %}{% endif %} + {% if constant('PDF') == 1 %}{% trans "Download as PDF" %}{% endif %} {% elseif searchterm is defined %} - {% trans "Download as ePub3" %} - {% trans "Download as Mobi" %} - {% trans "Download as PDF" %} + {% if constant('EPUB') == 1 %}{% trans "Download as ePub3" %}{% endif %} + {% if constant('MOBI') == 1 %}{% trans "Download as Mobi" %}{% endif %} + {% if constant('PDF') == 1 %}{% trans "Download as PDF" %}{% endif %} {% else %} - {% trans "Download as ePub3" %} - {% trans "Download as Mobi" %} - {% trans "Download as PDF" %} + {% if constant('EPUB') == 1 %}{% trans "Download as ePub3" %}{% endif %} + {% if constant('MOBI') == 1 %}{% trans "Download as Mobi" %}{% endif %} + {% if constant('PDF') == 1 %}{% trans "Download as PDF" %}{% endif %} {% endif %} {% endif %} {% endblock %} diff --git a/themes/baggy/view.twig b/themes/baggy/view.twig index dd274327..1afd9df6 100755 --- a/themes/baggy/view.twig +++ b/themes/baggy/view.twig @@ -19,9 +19,9 @@ {% 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 %} -
  • EPUB
  • -
  • MOBI
  • -
  • PDF
  • + {% if constant('EPUB') == 1 %}
  • EPUB
  • {% endif %} + {% if constant('MOBI') == 1 %}
  • MOBI
  • {% endif %} + {% if constant('PDF') == 1 %}
  • PDF
  • {% endif %}
  • {% trans "Does this article appear wrong?" %}
  • diff --git a/themes/default/home.twig b/themes/default/home.twig index 59615691..c5db5802 100755 --- a/themes/default/home.twig +++ b/themes/default/home.twig @@ -61,17 +61,17 @@ {% if searchterm is defined %}{% trans "Tag these results as" %} {{ searchterm }}{% endif %}
    {% if tag %} - {% trans "Download as ePub3" %} - {% trans "Download as Mobi" %} - {% trans "Download as PDF" %} + {% if constant('EPUB') == 1 %}{% trans "Download as ePub3" %}{% endif %} + {% if constant('MOBI') == 1 %}{% trans "Download as Mobi" %}{% endif %} + {% if constant('PDF') == 1 %}{% trans "Download as PDF" %}{% endif %} {% elseif searchterm is defined %} - {% trans "Download as ePub3" %} - {% trans "Download as Mobi" %} - {% trans "Download as PDF" %} + {% if constant('EPUB') == 1 %}{% trans "Download as ePub3" %}{% endif %} + {% if constant('MOBI') == 1 %}{% trans "Download as Mobi" %}{% endif %} + {% if constant('PDF') == 1 %}{% trans "Download as PDF" %}{% endif %} {% else %} - {% trans "Download as ePub3" %} - {% trans "Download as Mobi" %} - {% trans "Download as PDF" %} + {% if constant('EPUB') == 1 %}{% trans "Download as ePub3" %}{% endif %} + {% if constant('MOBI') == 1 %}{% trans "Download as Mobi" %}{% endif %} + {% if constant('PDF') == 1 %}{% trans "Download as PDF" %}{% endif %} {% endif %} {% endif %} diff --git a/themes/default/view.twig b/themes/default/view.twig index 181e1284..8f3a26c3 100755 --- a/themes/default/view.twig +++ b/themes/default/view.twig @@ -18,7 +18,9 @@ {% 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 %} -
  • EPUB
  • + {% if constant('EPUB') == 1 %}
  • EPUB
  • {% endif %} + {% if constant('MOBI') == 1 %}
  • MOBI
  • {% endif %} + {% if constant('PDF') == 1 %}
  • PDF
  • {% endif %}
  • {% trans "Does this article appear wrong?" %}
  • {% if constant('SHOW_READPERCENT') == 1 %}
  • 0%
  • {% endif %} -- 2.41.0