javascript_vars.phtml 1.7 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344
  1. <?php
  2. echo '"use strict";', "\n";
  3. $mark = $this->conf->mark_when;
  4. echo 'var ',
  5. 'hide_posts=', ($this->conf->display_posts || Minz_Request::param('output') === 'reader') ? 'false' : 'true',
  6. ',auto_mark_article=', $mark['article'] ? 'true' : 'false',
  7. ',auto_mark_site=', $mark['site'] ? 'true' : 'false',
  8. ',auto_mark_scroll=', $mark['scroll'] ? 'true' : 'false',
  9. ',auto_load_more=', $this->conf->auto_load_more ? 'true' : 'false',
  10. ',full_lazyload=', $this->conf->lazyload && ($this->conf->display_posts || Minz_Request::param('output') === 'reader') ? 'true' : 'false',
  11. ',does_lazyload=', $this->conf->lazyload ? 'true' : 'false';
  12. $s = $this->conf->shortcuts;
  13. echo ',shortcuts={',
  14. 'mark_read:"', $s['mark_read'], '",',
  15. 'mark_favorite:"', $s['mark_favorite'], '",',
  16. 'go_website:"', $s['go_website'], '",',
  17. 'prev_entry:"', $s['prev_entry'], '",',
  18. 'next_entry:"', $s['next_entry'], '",',
  19. 'collapse_entry:"', $s['collapse_entry'], '",',
  20. 'load_more:"', $s['load_more'], '",',
  21. 'auto_share:"', $s['auto_share'], '"',
  22. "},\n";
  23. if (Minz_Request::param ('output') === 'global') {
  24. echo "iconClose='", FreshRSS_Themes::icon('close'), "',\n";
  25. }
  26. $authType = Minz_Configuration::authType();
  27. if ($authType === 'persona') {
  28. echo 'current_user_mail="' . Minz_Session::param ('mail', '') . '",';
  29. }
  30. echo 'authType="', $authType, '",',
  31. 'url_freshrss="', _url ('index', 'index'), '",',
  32. 'url_login="', _url ('index', 'login'), '",',
  33. 'url_logout="', _url ('index', 'logout'), '",';
  34. echo 'str_confirmation="', Minz_Translate::t('confirm_action'), '"', ",\n";
  35. $autoActualise = Minz_Session::param('actualize_feeds', false);
  36. echo 'auto_actualize_feeds=', $autoActualise ? 'true' : 'false', ";\n";