4
0

javascript_vars.phtml 2.2 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859
  1. <?php
  2. echo '"use strict";', "\n";
  3. $mark = $this->conf->mark_when;
  4. echo 'var ',
  5. 'help_url="', FRESHRSS_WIKI, '"',
  6. ',hide_posts=', ($this->conf->display_posts || Minz_Request::param('output') === 'reader') ? 'false' : 'true',
  7. ',display_order="', Minz_Request::param('order', $this->conf->sort_order), '"',
  8. ',auto_mark_article=', $mark['article'] ? 'true' : 'false',
  9. ',auto_mark_site=', $mark['site'] ? 'true' : 'false',
  10. ',auto_mark_scroll=', $mark['scroll'] ? 'true' : 'false',
  11. ',auto_load_more=', $this->conf->auto_load_more ? 'true' : 'false',
  12. ',does_lazyload=', $this->conf->lazyload ? 'true' : 'false',
  13. ',sticky_post=', $this->conf->sticky_post ? 'true' : 'false';
  14. $s = $this->conf->shortcuts;
  15. echo ',shortcuts={',
  16. 'mark_read:"', $s['mark_read'], '",',
  17. 'mark_favorite:"', $s['mark_favorite'], '",',
  18. 'go_website:"', $s['go_website'], '",',
  19. 'prev_entry:"', $s['prev_entry'], '",',
  20. 'next_entry:"', $s['next_entry'], '",',
  21. 'first_entry:"', $s['first_entry'], '",',
  22. 'last_entry:"', $s['last_entry'], '",',
  23. 'collapse_entry:"', $s['collapse_entry'], '",',
  24. 'load_more:"', $s['load_more'], '",',
  25. 'auto_share:"', $s['auto_share'], '",',
  26. 'focus_search:"', $s['focus_search'], '",',
  27. 'user_filter:"', $s['user_filter'], '",',
  28. 'help:"', $s['help'], '"',
  29. "},\n";
  30. if (Minz_Request::param ('output') === 'global') {
  31. echo "iconClose='", FreshRSS_Themes::icon('close'), "',\n";
  32. }
  33. $authType = Minz_Configuration::authType();
  34. if ($authType === 'persona') {
  35. // If user is disconnected, current_user_mail MUST be null
  36. $mail = Minz_Session::param ('mail', false);
  37. if ($mail) {
  38. echo 'current_user_mail="' . $mail . '",';
  39. } else {
  40. echo 'current_user_mail=null,';
  41. }
  42. }
  43. echo 'authType="', $authType, '",',
  44. 'url_freshrss="', _url ('index', 'index'), '",',
  45. 'url_login="', _url ('index', 'login'), '",',
  46. 'url_logout="', _url ('index', 'logout'), '",';
  47. echo 'str_confirmation="', Minz_Translate::t('confirm_action'), '"', ",\n";
  48. echo 'str_notif_title_articles="', Minz_Translate::t('notif_title_new_articles'), '"', ",\n";
  49. echo 'str_notif_body_articles="', Minz_Translate::t('notif_body_new_articles'), '"', ",\n";
  50. $autoActualise = Minz_Session::param('actualize_feeds', false);
  51. echo 'auto_actualize_feeds=', $autoActualise ? 'true' : 'false', ";\n";