javascript_vars.phtml 1.8 KB

12345678910111213141516171819202122232425262728293031323334353637383940
  1. <?php
  2. echo '"use strict";', "\n";
  3. $mark = $this->conf->markWhen ();
  4. echo 'var ',
  5. 'hide_posts=', ($this->conf->displayPosts () === 'yes' || Request::param ('output') === 'reader') ? 'false' : 'true',
  6. ',auto_mark_article=', $mark['article'] === 'yes' ? 'true' : 'false',
  7. ',auto_mark_site=', $mark['site'] === 'yes' ? 'true' : 'false',
  8. ',auto_mark_scroll=', $mark['scroll'] === 'yes' ? 'true' : 'false',
  9. ',auto_load_more=', $this->conf->autoLoadMore () === 'yes' ? 'true' : 'false',
  10. ',full_lazyload=', $this->conf->lazyload () === 'yes' && ($this->conf->displayPosts () === 'yes' || Request::param ('output') === 'reader') ? 'true' : 'false',
  11. ',does_lazyload=', $this->conf->lazyload() === 'yes' ? '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. "},\n";
  21. $mail = Session::param ('mail', 'null');
  22. if ($mail != 'null') {
  23. $mail = '"' . $mail . '"';
  24. }
  25. echo 'use_persona=', login_is_conf ($this->conf) ? 'true' : 'false',
  26. ',url_freshrss="', _url ('index', 'index'), '",',
  27. 'url_login="', _url ('index', 'login'), '",',
  28. 'url_logout="', _url ('index', 'logout'), '",',
  29. 'current_user_mail=', $mail, ",\n";
  30. echo 'load_shortcuts=', Request::controllerName () === 'index' && Request::actionName () === 'index' ? 'true' : 'false', ",\n";
  31. echo 'str_confirmation="', Translate::t('confirm_action'), '"', ",\n";
  32. echo 'auto_actualize_feeds=', Session::param('actualize_feeds', false) ? 'true' : 'false', ";\n";
  33. if (Session::param('actualize_feeds', false)) {
  34. Session::_param('actualize_feeds');
  35. }