1
0
Fork 0
mirror of https://github.com/YunoHost-Apps/freshrss_ynh.git synced 2024-09-03 18:36:33 +02:00
freshrss_ynh/sources/app/views/helpers/javascript_vars.phtml

62 lines
2.3 KiB
PHTML
Raw Normal View History

2014-07-23 15:52:50 +02:00
<?php
echo '"use strict";', "\n";
$mark = $this->conf->mark_when;
echo 'var ',
2014-09-27 10:10:43 +02:00
'help_url="', FRESHRSS_WIKI, '"',
',hide_posts=', ($this->conf->display_posts || Minz_Request::param('output') === 'reader') ? 'false' : 'true',
2014-07-23 15:52:50 +02:00
',display_order="', Minz_Request::param('order', $this->conf->sort_order), '"',
',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',
',does_lazyload=', $this->conf->lazyload ? 'true' : 'false',
',sticky_post=', $this->conf->sticky_post ? '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'], '",',
'first_entry:"', $s['first_entry'], '",',
'last_entry:"', $s['last_entry'], '",',
'collapse_entry:"', $s['collapse_entry'], '",',
'load_more:"', $s['load_more'], '",',
'auto_share:"', $s['auto_share'], '",',
2014-09-27 10:10:43 +02:00
'focus_search:"', $s['focus_search'], '",',
'user_filter:"', $s['user_filter'], '",',
'help:"', $s['help'], '"',
2014-07-23 15:52:50 +02:00
"},\n";
if (Minz_Request::param ('output') === 'global') {
echo "iconClose='", FreshRSS_Themes::icon('close'), "',\n";
}
$authType = Minz_Configuration::authType();
if ($authType === 'persona') {
// If user is disconnected, current_user_mail MUST be null
$mail = Minz_Session::param ('mail', false);
if ($mail) {
echo 'current_user_mail="' . $mail . '",';
} else {
echo 'current_user_mail=null,';
}
}
echo 'authType="', $authType, '",',
'url_freshrss="', _url ('index', 'index'), '",',
'url_login="', _url ('index', 'login'), '",',
'url_logout="', _url ('index', 'logout'), '",';
2014-09-27 10:10:43 +02:00
echo 'str_confirmation_default="', Minz_Translate::t('confirm_action'), '"', ",\n";
2014-09-21 12:12:35 +02:00
echo 'str_notif_title_articles="', Minz_Translate::t('notif_title_new_articles'), '"', ",\n";
echo 'str_notif_body_articles="', Minz_Translate::t('notif_body_new_articles'), '"', ",\n";
2014-09-27 10:10:43 +02:00
echo 'html5_notif_timeout=', $this->conf->html5_notif_timeout,",\n";
2014-07-23 15:52:50 +02:00
$autoActualise = Minz_Session::param('actualize_feeds', false);
echo 'auto_actualize_feeds=', $autoActualise ? 'true' : 'false', ";\n";