summaryrefslogtreecommitdiff
path: root/app/views/helpers/javascript_vars.phtml
diff options
context:
space:
mode:
authorGravatar Marien Fressinaud <dev@marienfressinaud.fr> 2014-01-29 21:26:19 +0100
committerGravatar Marien Fressinaud <dev@marienfressinaud.fr> 2014-01-29 21:26:19 +0100
commit165eb57459a152b3cc6aa3fd15ca990c3d908829 (patch)
tree640ddacbc6eabc985646dd65b0578f369ea92321 /app/views/helpers/javascript_vars.phtml
parent75096e6a39fe5d34d3951991f296f616e62a9fd8 (diff)
parentc053825ff8f9792e692c101585481129b006937b (diff)
Sortie de la version 0.70.7.0
Diffstat (limited to 'app/views/helpers/javascript_vars.phtml')
-rw-r--r--app/views/helpers/javascript_vars.phtml81
1 files changed, 43 insertions, 38 deletions
diff --git a/app/views/helpers/javascript_vars.phtml b/app/views/helpers/javascript_vars.phtml
index 58cb3c5ac..0ecdc1bca 100644
--- a/app/views/helpers/javascript_vars.phtml
+++ b/app/views/helpers/javascript_vars.phtml
@@ -1,39 +1,44 @@
<?php
- echo '"use strict";', "\n";
- $mark = $this->conf->markWhen ();
- echo 'var ',
- 'hide_posts=', ($this->conf->displayPosts () === 'yes' || Request::param ('output') === 'reader') ? 'false' : 'true',
- ',auto_mark_article=', $mark['article'] === 'yes' ? 'true' : 'false',
- ',auto_mark_site=', $mark['site'] === 'yes' ? 'true' : 'false',
- ',auto_mark_scroll=', $mark['scroll'] === 'yes' ? 'true' : 'false',
- ',auto_load_more=', $this->conf->autoLoadMore () === 'yes' ? 'true' : 'false',
- ',full_lazyload=', $this->conf->lazyload () === 'yes' && ($this->conf->displayPosts () === 'yes' || Request::param ('output') === 'reader') ? 'true' : 'false',
- ',does_lazyload=', $this->conf->lazyload() === 'yes' ? 'true' : 'false';
-
- $s = $this->conf->shortcuts ();
- echo ',shortcuts={',
- 'mark_read:"', $s['mark_read'], '",',
- 'mark_favorite:"', $s['mark_favorite'], '",',
- 'go_website:"', $s['go_website'], '",',
- 'prev_entry:"', $s['prev_entry'], '",',
- 'next_entry:"', $s['next_entry'], '"',
- "},\n";
-
- $mail = Session::param ('mail', 'null');
- if ($mail != 'null') {
- $mail = '"' . $mail . '"';
- }
- echo 'use_persona=', login_is_conf ($this->conf) ? 'true' : 'false',
- ',url_freshrss="', _url ('index', 'index'), '",',
- 'url_login="', _url ('index', 'login'), '",',
- 'url_logout="', _url ('index', 'logout'), '",',
- 'current_user_mail=', $mail, ",\n";
-
- echo 'load_shortcuts=', Request::controllerName () === 'index' && Request::actionName () === 'index' ? 'true' : 'false', ",\n";
-
- echo 'str_confirmation="', Translate::t('confirm_action'), '"', ",\n";
-
- echo 'auto_actualize_feeds=', Session::param('actualize_feeds', false) ? 'true' : 'false', ";\n";
- if (Session::param('actualize_feeds', false)) {
- Session::_param('actualize_feeds');
- }
+
+echo '"use strict";', "\n";
+
+$mark = $this->conf->mark_when;
+echo 'var ',
+ 'hide_posts=', ($this->conf->display_posts || Minz_Request::param('output') === 'reader') ? 'false' : 'true',
+ ',auto_mark_article=', $mark['article'] ? 'true' : 'false',
+ ',auto_mark_site=', $mark['site'] ? 'true' : 'false',
+ ',auto_mark_scroll=', $mark['scroll'] ? 'true' : 'false',
+ ',auto_load_more=', $this->conf->auto_load_more ? 'true' : 'false',
+ ',full_lazyload=', $this->conf->lazyload && ($this->conf->display_posts || Minz_Request::param('output') === 'reader') ? 'true' : 'false',
+ ',does_lazyload=', $this->conf->lazyload ? 'true' : 'false';
+
+$s = $this->conf->shortcuts;
+echo ',shortcuts={',
+ 'mark_read:"', $s['mark_read'], '",',
+ 'mark_favorite:"', $s['mark_favorite'], '",',
+ 'go_website:"', $s['go_website'], '",',
+ 'prev_entry:"', $s['prev_entry'], '",',
+ 'next_entry:"', $s['next_entry'], '",',
+ 'collapse_entry:"', $s['collapse_entry'], '",',
+ 'load_more:"', $s['load_more'], '",',
+ 'auto_share:"', $s['auto_share'], '"',
+"},\n";
+
+if (Minz_Request::param ('output') === 'global') {
+ echo "iconClose='", FreshRSS_Themes::icon('close'), "',\n";
+}
+
+$authType = Minz_Configuration::authType();
+if ($authType === 'persona') {
+ echo 'current_user_mail="' . Minz_Session::param ('mail', '') . '",';
+}
+
+echo 'authType="', $authType, '",',
+ 'url_freshrss="', _url ('index', 'index'), '",',
+ 'url_login="', _url ('index', 'login'), '",',
+ 'url_logout="', _url ('index', 'logout'), '",';
+
+echo 'str_confirmation="', Minz_Translate::t('confirm_action'), '"', ",\n";
+
+$autoActualise = Minz_Session::param('actualize_feeds', false);
+echo 'auto_actualize_feeds=', $autoActualise ? 'true' : 'false', ";\n";