javascript_vars.phtml 2.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263
  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. 'close_dropdown:"', $s['close_dropdown'], '"',
  30. "},\n";
  31. if (Minz_Request::param ('output') === 'global') {
  32. echo "iconClose='", FreshRSS_Themes::icon('close'), "',\n";
  33. }
  34. $authType = Minz_Configuration::authType();
  35. if ($authType === 'persona') {
  36. // If user is disconnected, current_user_mail MUST be null
  37. $mail = Minz_Session::param ('mail', false);
  38. if ($mail) {
  39. echo 'current_user_mail="' . $mail . '",';
  40. } else {
  41. echo 'current_user_mail=null,';
  42. }
  43. }
  44. echo 'authType="', $authType, '",',
  45. 'url_freshrss="', _url ('index', 'index'), '",',
  46. 'url_login="', _url ('index', 'login'), '",',
  47. 'url_logout="', _url ('index', 'logout'), '",';
  48. echo 'str_confirmation_default="', _t('confirm_action'), '"', ",\n";
  49. echo 'str_notif_title_articles="', _t('notif_title_new_articles'), '"', ",\n";
  50. echo 'str_notif_body_articles="', _t('notif_body_new_articles'), '"', ",\n";
  51. echo 'str_category_empty="', _t('category_empty'), '"', ",\n";
  52. echo 'html5_notif_timeout=', $this->conf->html5_notif_timeout,",\n";
  53. $autoActualise = Minz_Session::param('actualize_feeds', false);
  54. echo 'auto_actualize_feeds=', $autoActualise ? 'true' : 'false', ";\n";