javascript_vars.phtml 2.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960
  1. "use strict";
  2. <?php
  3. $mark = $this->conf->mark_when;
  4. $mail = Minz_Session::param ('mail', false);
  5. $auto_actualize = Minz_Session::param('actualize_feeds', false);
  6. $hide_posts = ($this->conf->display_posts ||
  7. Minz_Request::param('output') === 'reader');
  8. $s = $this->conf->shortcuts;
  9. echo 'var context={',
  10. 'hide_posts:', $hide_posts ? 'false' : 'true', ',',
  11. 'display_order:"', Minz_Request::param('order', $this->conf->sort_order), '",',
  12. 'auto_mark_article:', $mark['article'] ? 'true' : 'false', ',',
  13. 'auto_mark_site:', $mark['site'] ? 'true' : 'false', ',',
  14. 'auto_mark_scroll:', $mark['scroll'] ? 'true' : 'false', ',',
  15. 'auto_load_more:', $this->conf->auto_load_more ? 'true' : 'false', ',',
  16. 'auto_actualize_feeds:', $auto_actualize ? 'true' : 'false', ',',
  17. 'does_lazyload:', $this->conf->lazyload ? 'true' : 'false', ',',
  18. 'sticky_post:', $this->conf->sticky_post ? 'true' : 'false', ',',
  19. 'html5_notif_timeout:', $this->conf->html5_notif_timeout, ',',
  20. 'auth_type:"', Minz_Configuration::authType(), '",',
  21. 'current_user_mail:', $mail ? ('"' . $mail . '"') : 'null', ',',
  22. 'current_view:"', Minz_Request::param('output', 'normal'), '"',
  23. "},\n";
  24. echo 'shortcuts={',
  25. 'mark_read:"', $s['mark_read'], '",',
  26. 'mark_favorite:"', $s['mark_favorite'], '",',
  27. 'go_website:"', $s['go_website'], '",',
  28. 'prev_entry:"', $s['prev_entry'], '",',
  29. 'next_entry:"', $s['next_entry'], '",',
  30. 'first_entry:"', $s['first_entry'], '",',
  31. 'last_entry:"', $s['last_entry'], '",',
  32. 'collapse_entry:"', $s['collapse_entry'], '",',
  33. 'load_more:"', $s['load_more'], '",',
  34. 'auto_share:"', $s['auto_share'], '",',
  35. 'focus_search:"', $s['focus_search'], '",',
  36. 'user_filter:"', $s['user_filter'], '",',
  37. 'help:"', $s['help'], '",',
  38. 'close_dropdown:"', $s['close_dropdown'], '"',
  39. "},\n";
  40. echo 'url={',
  41. 'index:"', _url('index', 'index'), '",',
  42. 'login:"', _url('index', 'login'), '",',
  43. 'logout:"', _url('index', 'logout'), '",',
  44. 'help:"', FRESHRSS_WIKI, '"',
  45. "},\n";
  46. echo 'i18n={',
  47. 'confirmation_default:"', _t('confirm_action'), '",',
  48. 'notif_title_articles:"', _t('notif_title_new_articles'), '",',
  49. 'notif_body_articles:"', _t('notif_body_new_articles'), '",',
  50. 'category_empty:"', _t('category_empty'), '"',
  51. "},\n";
  52. echo 'icons={',
  53. 'close:\'', _i('close'), '\'',
  54. "}\n";