aboutsummaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
authortcit <tcit@tcit.fr>2014-05-15 15:42:36 +0200
committertcit <tcit@tcit.fr>2014-05-15 15:42:36 +0200
commitf3f0b11393dd7f11bc1e63df9488c3930c0bc06f (patch)
tree0ee0ee830ec195dba8c4d362ad6e50a9ea27be08
parentf2b6b4e23064c40cde9e2ad5327499589dee503b (diff)
downloadwallabag-f3f0b11393dd7f11bc1e63df9488c3930c0bc06f.tar.gz
wallabag-f3f0b11393dd7f11bc1e63df9488c3930c0bc06f.tar.zst
wallabag-f3f0b11393dd7f11bc1e63df9488c3930c0bc06f.zip
Better names for epub files and epub in all themes now
-rwxr-xr-xinc/poche/Poche.class.php15
-rwxr-xr-xthemes/baggy/config.twig5
-rwxr-xr-xthemes/courgette/_view.twig1
-rwxr-xr-xthemes/courgette/config.twig3
-rwxr-xr-xthemes/courgette/home.twig9
-rwxr-xr-xthemes/default/config.twig4
-rwxr-xr-xthemes/default/home.twig9
-rwxr-xr-xthemes/default/view.twig1
8 files changed, 38 insertions, 9 deletions
diff --git a/inc/poche/Poche.class.php b/inc/poche/Poche.class.php
index 99d2989b..bce7d651 100755
--- a/inc/poche/Poche.class.php
+++ b/inc/poche/Poche.class.php
@@ -1143,27 +1143,32 @@ class Poche
1143 $entry = $this->store->retrieveOneById($entryID, $this->user->getId()); 1143 $entry = $this->store->retrieveOneById($entryID, $this->user->getId());
1144 $entries = array($entry); 1144 $entries = array($entry);
1145 $bookTitle = $entry['title']; 1145 $bookTitle = $entry['title'];
1146 $bookFileName = substr($bookTitle, 0, 200);
1146 break; 1147 break;
1147 case 'all': 1148 case 'all':
1148 $entries = $this->store->retrieveAll($this->user->getId()); 1149 $entries = $this->store->retrieveAll($this->user->getId());
1149 $bookTitle = _('All my articles'); 1150 $bookTitle = sprintf(_('All my articles on '), date(_('d.m.y'))); #translatable because each country has it's own date format system
1151 $bookFileName = _('Allarticles') . date(_('dmY'));
1150 break; 1152 break;
1151 case 'tag': 1153 case 'tag':
1152 $tag = filter_var($_GET['tag'],FILTER_SANITIZE_STRING); 1154 $tag = filter_var($_GET['tag'],FILTER_SANITIZE_STRING);
1153 $tags_id = $this->store->retrieveAllTags($this->user->getId(),$tag); 1155 $tags_id = $this->store->retrieveAllTags($this->user->getId(),$tag);
1154 $tag_id = $tags_id[0]["id"]; // we take the first result, which is supposed to match perfectly. There must be a workaround. 1156 $tag_id = $tags_id[0]["id"]; // we take the first result, which is supposed to match perfectly. There must be a workaround.
1155 $entries = $this->store->retrieveEntriesByTag($tag_id,$this->user->getId()); 1157 $entries = $this->store->retrieveEntriesByTag($tag_id,$this->user->getId());
1156 $bookTitle = sprintf(_('Articles related to %s'),$tag); 1158 $bookTitle = sprintf(_('Articles tagged %s'),$tag);
1159 $bookFileName = substr(sprintf(_('Tag %s'),$tag), 0, 200);
1157 break; 1160 break;
1158 case 'category': 1161 case 'category':
1159 $category = filter_var($_GET['category'],FILTER_SANITIZE_STRING); 1162 $category = filter_var($_GET['category'],FILTER_SANITIZE_STRING);
1160 $entries = $this->store->getEntriesByView($category,$this->user->getId()); 1163 $entries = $this->store->getEntriesByView($category,$this->user->getId());
1161 $bookTitle = sprintf(_('All my articles in category %s'), $category); 1164 $bookTitle = sprintf(_('All articles in category %s'), $category);
1165 $bookFileName = substr(sprintf(_('Category %s'),$category), 0, 200);
1162 break; 1166 break;
1163 case 'search': 1167 case 'search':
1164 $search = filter_var($_GET['search'],FILTER_SANITIZE_STRING); 1168 $search = filter_var($_GET['search'],FILTER_SANITIZE_STRING);
1165 $entries = $this->store->search($search,$this->user->getId()); 1169 $entries = $this->store->search($search,$this->user->getId());
1166 $bookTitle = sprintf(_('All my articles for search %s'), $search); 1170 $bookTitle = sprintf(_('All articles for search %s'), $search);
1171 $bookFileName = substr(sprintf(_('Search %s'), $search), 0, 200);
1167 break; 1172 break;
1168 case 'default': 1173 case 'default':
1169 die(_('Uh, there is a problem while generating epub.')); 1174 die(_('Uh, there is a problem while generating epub.'));
@@ -1241,6 +1246,6 @@ class Poche
1241 //$book->addChapter("ePubLog", "ePubLog.html", $content_start . $epuplog . "\n</pre>" . $bookEnd); 1246 //$book->addChapter("ePubLog", "ePubLog.html", $content_start . $epuplog . "\n</pre>" . $bookEnd);
1242 } 1247 }
1243 $book->finalize(); 1248 $book->finalize();
1244 $zipData = $book->sendBook(_('wallabag\'s articles')); 1249 $zipData = $book->sendBook($bookFileName);
1245 } 1250 }
1246} 1251}
diff --git a/themes/baggy/config.twig b/themes/baggy/config.twig
index 1b8b8648..46735f07 100755
--- a/themes/baggy/config.twig
+++ b/themes/baggy/config.twig
@@ -125,8 +125,9 @@
125 <p><a href="?download" target="_blank">{% trans "Click here" %}</a> {% trans "to download your database." %}</p>{% endif %} 125 <p><a href="?download" target="_blank">{% trans "Click here" %}</a> {% trans "to download your database." %}</p>{% endif %}
126 <p><a href="?export" target="_blank">{% trans "Click here" %}</a> {% trans "to export your wallabag data." %}</p> 126 <p><a href="?export" target="_blank">{% trans "Click here" %}</a> {% trans "to export your wallabag data." %}</p>
127 127
128 <h2>Fancy a ebook ?</h2> 128 <h2>{% trans "Fancy an E-Book ?" %}</h2>
129 Click on <a href="./?epub&amp;method=all" title="Generate ePub">this link</a> to get all your articles in one ebook (ePub). 129 <p>{% trans "Click on <a href=\"./?epub&amp;method=all\" title=\"Generate ePub\">this link</a> to get all your articles in one ebook (ePub 3 format)." %}
130 <br>{% trans "This can <b>take a while</b> and can <b>even fail</b> if you have too many articles, depending on your server configuration." %}</p>
130 131
131 <h2>{% trans "Cache" %}</h2> 132 <h2>{% trans "Cache" %}</h2>
132 <p><a href="?empty-cache">{% trans "Click here" %}</a> {% trans "to delete cache." %}</p> 133 <p><a href="?empty-cache">{% trans "Click here" %}</a> {% trans "to delete cache." %}</p>
diff --git a/themes/courgette/_view.twig b/themes/courgette/_view.twig
index 9f9ea4f6..25479a3d 100755
--- a/themes/courgette/_view.twig
+++ b/themes/courgette/_view.twig
@@ -12,6 +12,7 @@
12 {% if constant('SHARE_MAIL') == 1 %}<li><a href="mailto:?subject={{ entry.title|url_encode }}&amp;body={{ entry.url|url_encode }}%20via%20@wallabagapp" class="tool email" title="{% trans "email" %}"><span>{% trans "email" %}</span></a></li>{% endif %} 12 {% if constant('SHARE_MAIL') == 1 %}<li><a href="mailto:?subject={{ entry.title|url_encode }}&amp;body={{ entry.url|url_encode }}%20via%20@wallabagapp" class="tool email" title="{% trans "email" %}"><span>{% trans "email" %}</span></a></li>{% endif %}
13 {% if constant('SHARE_SHAARLI') == 1 %}<li><a href="{{ constant('SHAARLI_URL') }}/index.php?post={{ entry.url|url_encode }}&amp;title={{ entry.title|url_encode }}" target="_blank" class="tool shaarli" title="{% trans "shaarli" %}"><span>{% trans "shaarli" %}</span></a></li>{% endif %} 13 {% if constant('SHARE_SHAARLI') == 1 %}<li><a href="{{ constant('SHAARLI_URL') }}/index.php?post={{ entry.url|url_encode }}&amp;title={{ entry.title|url_encode }}" target="_blank" class="tool shaarli" title="{% trans "shaarli" %}"><span>{% trans "shaarli" %}</span></a></li>{% endif %}
14 {% if constant('FLATTR') == 1 %}{% if flattr.status == constant('FLATTRABLE') %}<li class="flattrli"><a href="http://flattr.com/submit/auto?url={{ entry.url }}" class="tool flattr" target="_blank" title="{% trans "flattr" %}"><span>{% trans "flattr" %}</span></a></li>{% elseif flattr.status == constant('FLATTRED') %}<li><a href="{{ flattr.flattrItemURL }}" class="tool flattr" target="_blank" title="{% trans "flattr" %}"><span>{% trans "flattr" %}</span>{{ flattr.numflattrs }}</a></li>{% endif %}{% endif %} 14 {% if constant('FLATTR') == 1 %}{% if flattr.status == constant('FLATTRABLE') %}<li class="flattrli"><a href="http://flattr.com/submit/auto?url={{ entry.url }}" class="tool flattr" target="_blank" title="{% trans "flattr" %}"><span>{% trans "flattr" %}</span></a></li>{% elseif flattr.status == constant('FLATTRED') %}<li><a href="{{ flattr.flattrItemURL }}" class="tool flattr" target="_blank" title="{% trans "flattr" %}"><span>{% trans "flattr" %}</span>{{ flattr.numflattrs }}</a></li>{% endif %}{% endif %}
15 <li><a href="./?epub&amp;method=id&amp;id={{ entry.id|e }}" title="Generate epub file">EPUB</a></li>
15 <li><a href="mailto:hello@wallabag.org?subject=Wrong%20display%20in%20wallabag&amp;body={{ entry.url|url_encode }}" title="{% trans "this article appears wrong?" %}" class="tool bad-display"><span>{% trans "this article appears wrong?" %}</span></a></li> 16 <li><a href="mailto:hello@wallabag.org?subject=Wrong%20display%20in%20wallabag&amp;body={{ entry.url|url_encode }}" title="{% trans "this article appears wrong?" %}" class="tool bad-display"><span>{% trans "this article appears wrong?" %}</span></a></li>
16 </ul> 17 </ul>
17 </div> 18 </div>
diff --git a/themes/courgette/config.twig b/themes/courgette/config.twig
index a022d733..9ab58461 100755
--- a/themes/courgette/config.twig
+++ b/themes/courgette/config.twig
@@ -81,6 +81,9 @@
81 <h2>{% trans "Export your wallabag data" %}</h2> 81 <h2>{% trans "Export your wallabag data" %}</h2>
82 <p><a href="./?export" target="_blank">{% trans "Click here" %}</a> {% trans "to export your wallabag data." %}</p> 82 <p><a href="./?export" target="_blank">{% trans "Click here" %}</a> {% trans "to export your wallabag data." %}</p>
83 83
84 <h2>{% trans "Fancy an E-Book ?" %}</h2>
85 <p>{% trans "Click on <a href=\"./?epub&amp;method=all\" title=\"Generate ePub\">this link</a> to get all your articles in one ebook (ePub 3 format)." %}
86 <br>{% trans "This can <b>take a while</b> and can <b>even fail</b> if you have too many articles, depending on your server configuration." %}</p>
84 87
85 <h2>{% trans 'Add user' %}</h2> 88 <h2>{% trans 'Add user' %}</h2>
86 <p>{% trans 'Add a new user :' %}</p> 89 <p>{% trans 'Add a new user :' %}</p>
diff --git a/themes/courgette/home.twig b/themes/courgette/home.twig
index 6ba72d35..401f3f20 100755
--- a/themes/courgette/home.twig
+++ b/themes/courgette/home.twig
@@ -50,6 +50,13 @@
50 <p>{{ entry.content|striptags|slice(0, 300) }}...</p> 50 <p>{{ entry.content|striptags|slice(0, 300) }}...</p>
51 </div> 51 </div>
52 {% endfor %} 52 {% endfor %}
53 {% endif %} 53
54 {{ block('pager') }} 54 {{ block('pager') }}
55
56 {% if tag %}<a title="{% trans "Download the articles from this tag in an epub" %}" href="./?epub&amp;method=tag&amp;tag={{ tag.value }}">{% trans "Download the articles from this tag in an epub" %}</a>
57 {% elseif search_term is defined %}<a title="{% trans "Download the articles from this search in an epub" %}" href="./?epub&amp;method=search&amp;search={{ search_term }}">{% trans "Download the articles from this search in an epub" %}</a>
58 {% else %}<a title="{% trans "Download the articles from this category in an epub" %}" href="./?epub&amp;method=category&amp;category={{ view }}">{% trans "Download the articles from this category in an epub" %}</a>{% endif %}
59
60 {% endif %}
61
55{% endblock %} \ No newline at end of file 62{% endblock %} \ No newline at end of file
diff --git a/themes/default/config.twig b/themes/default/config.twig
index 5ed9d80f..160f6046 100755
--- a/themes/default/config.twig
+++ b/themes/default/config.twig
@@ -127,6 +127,10 @@
127 <h2>{% trans "Cache" %}</h2> 127 <h2>{% trans "Cache" %}</h2>
128 <p><a href="?empty-cache">{% trans "Click here" %}</a> {% trans "to delete cache." %}</p> 128 <p><a href="?empty-cache">{% trans "Click here" %}</a> {% trans "to delete cache." %}</p>
129 129
130 <h2>{% trans "Fancy an E-Book ?" %}</h2>
131 <p>{% trans "Click on <a href=\"./?epub&amp;method=all\" title=\"Generate ePub\">this link</a> to get all your articles in one ebook (ePub 3 format)." %}
132 <br>{% trans "This can <b>take a while</b> and can <b>even fail</b> if you have too many articles, depending on your server configuration." %}</p>
133
130 <h2>{% trans 'Add user' %}</h2> 134 <h2>{% trans 'Add user' %}</h2>
131 <p>{% trans 'Add a new user :' %}</p> 135 <p>{% trans 'Add a new user :' %}</p>
132 <form method="post" action="?newuser"> 136 <form method="post" action="?newuser">
diff --git a/themes/default/home.twig b/themes/default/home.twig
index d6cb98e8..e6c781f5 100755
--- a/themes/default/home.twig
+++ b/themes/default/home.twig
@@ -55,7 +55,14 @@
55 <p>{{ entry.content|striptags|slice(0, 300) }}...</p> 55 <p>{{ entry.content|striptags|slice(0, 300) }}...</p>
56 </div> 56 </div>
57 {% endfor %} 57 {% endfor %}
58 {% endif %} 58
59 {{ block('pager') }} 59 {{ block('pager') }}
60
60 {% if view == 'home' %}{% if nb_results > 1 %}<a title="{% trans "mark all the entries as read" %}" href="./?action=archive_all">{% trans "mark all the entries as read" %}</a>{% endif %}{% endif %} 61 {% if view == 'home' %}{% if nb_results > 1 %}<a title="{% trans "mark all the entries as read" %}" href="./?action=archive_all">{% trans "mark all the entries as read" %}</a>{% endif %}{% endif %}
62
63 {% if tag %}<a title="{% trans "Download the articles from this tag in an epub" %}" href="./?epub&amp;method=tag&amp;tag={{ tag.value }}">{% trans "Download the articles from this tag in an epub" %}</a>
64 {% elseif search_term is defined %}<a title="{% trans "Download the articles from this search in an epub" %}" href="./?epub&amp;method=search&amp;search={{ search_term }}">{% trans "Download the articles from this search in an epub" %}</a>
65 {% else %}<a title="{% trans "Download the articles from this category in an epub" %}" href="./?epub&amp;method=category&amp;category={{ view }}">{% trans "Download the articles from this category in an epub" %}</a>{% endif %}
66
67 {% endif %}
61{% endblock %} 68{% endblock %}
diff --git a/themes/default/view.twig b/themes/default/view.twig
index 983cc1cd..b7d48c00 100755
--- a/themes/default/view.twig
+++ b/themes/default/view.twig
@@ -15,6 +15,7 @@
15 {% if constant('SHARE_SHAARLI') == 1 %}<li><a href="{{ constant('SHAARLI_URL') }}/index.php?post={{ entry.url|url_encode }}&amp;title={{ entry.title|url_encode }}" target="_blank" class="tool shaarli" title="{% trans "shaarli" %}"><span>{% trans "shaarli" %}</span></a></li>{% endif %} 15 {% if constant('SHARE_SHAARLI') == 1 %}<li><a href="{{ constant('SHAARLI_URL') }}/index.php?post={{ entry.url|url_encode }}&amp;title={{ entry.title|url_encode }}" target="_blank" class="tool shaarli" title="{% trans "shaarli" %}"><span>{% trans "shaarli" %}</span></a></li>{% endif %}
16 {% if constant('FLATTR') == 1 %}{% if flattr.status == constant('FLATTRABLE') %}<li><a href="http://flattr.com/submit/auto?url={{ entry.url }}" class="tool flattr" target="_blank" title="{% trans "flattr" %}"><span>{% trans "flattr" %}</span></a></li>{% elseif flattr.status == constant('FLATTRED') %}<li><a href="{{ flattr.flattrItemURL }}" class="tool flattr" target="_blank" title="{% trans "flattr" %}"><span>{% trans "flattr" %}</span>{{ flattr.numflattrs }}</a></li>{% endif %}{% endif %} 16 {% if constant('FLATTR') == 1 %}{% if flattr.status == constant('FLATTRABLE') %}<li><a href="http://flattr.com/submit/auto?url={{ entry.url }}" class="tool flattr" target="_blank" title="{% trans "flattr" %}"><span>{% trans "flattr" %}</span></a></li>{% elseif flattr.status == constant('FLATTRED') %}<li><a href="{{ flattr.flattrItemURL }}" class="tool flattr" target="_blank" title="{% trans "flattr" %}"><span>{% trans "flattr" %}</span>{{ flattr.numflattrs }}</a></li>{% endif %}{% endif %}
17 {% if constant('SHOW_PRINTLINK') == 1 %}<li><a title="{% trans "Print" %}" class="tool print" href="javascript: window.print();"><span>{% trans "Print" %}</span></a></li>{% endif %} 17 {% if constant('SHOW_PRINTLINK') == 1 %}<li><a title="{% trans "Print" %}" class="tool print" href="javascript: window.print();"><span>{% trans "Print" %}</span></a></li>{% endif %}
18 <li><a href="./?epub&amp;method=id&amp;id={{ entry.id|e }}" title="Generate epub file">EPUB</a></li>
18 <li><a href="mailto:hello@wallabag.org?subject=Wrong%20display%20in%20wallabag&amp;body={{ entry.url|url_encode }}" title="{% trans "Does this article appear wrong?" %}" class="tool bad-display"><span>{% trans "Does this article appear wrong?" %}</span></a></li> 19 <li><a href="mailto:hello@wallabag.org?subject=Wrong%20display%20in%20wallabag&amp;body={{ entry.url|url_encode }}" title="{% trans "Does this article appear wrong?" %}" class="tool bad-display"><span>{% trans "Does this article appear wrong?" %}</span></a></li>
19 {% if constant('SHOW_READPERCENT') == 1 %}<li><div id="readLeftPercent">0%</div></li>{% endif %} 20 {% if constant('SHOW_READPERCENT') == 1 %}<li><div id="readLeftPercent">0%</div></li>{% endif %}
20 </ul> 21 </ul>