main.phtml 1.5 KB

1234567891011121314151617181920212223242526272829303132
  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. "},";
  20. $mail = Session::param ('mail', 'null');
  21. if ($mail != 'null') {
  22. $mail = '"' . $mail . '"';
  23. }
  24. echo 'use_persona=', login_is_conf ($this->conf) ? 'true' : 'false',
  25. ',url_freshrss="', _url ('index', 'index'), '",',
  26. 'url_login="', _url ('index', 'login'), '",',
  27. 'url_logout="', _url ('index', 'logout'), '",',
  28. 'current_user_mail=', $mail, ",\n";
  29. echo 'load_shortcuts=', Request::controllerName () === 'index' && Request::actionName () === 'index' ? 'true' : 'false', ";\n";