summaryrefslogtreecommitdiff
path: root/app/views/helpers/javascript_vars.phtml
blob: 58cb3c5ac8297344583be98bdf2f9922929bc3f5 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
<?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');
	}