javascript_vars.phtml 2.4 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455
  1. <?php
  2. $mark = FreshRSS_Context::$user_conf->mark_when;
  3. $s = FreshRSS_Context::$user_conf->shortcuts;
  4. echo htmlspecialchars(json_encode(array(
  5. 'context' => array(
  6. 'anonymous' => !FreshRSS_Auth::hasAccess(),
  7. 'auto_remove_article' => !!FreshRSS_Context::isAutoRemoveAvailable(),
  8. 'hide_posts' => !(FreshRSS_Context::$user_conf->display_posts || Minz_Request::actionName() === 'reader'),
  9. 'display_order' => Minz_Request::param('order', FreshRSS_Context::$user_conf->sort_order),
  10. 'auto_mark_article' => !!$mark['article'],
  11. 'auto_mark_site' => !!$mark['site'],
  12. 'auto_mark_scroll' => !!$mark['scroll'],
  13. 'auto_load_more' => !!FreshRSS_Context::$user_conf->auto_load_more,
  14. 'auto_actualize_feeds' => !!Minz_Session::param('actualize_feeds', false),
  15. 'does_lazyload' => !!FreshRSS_Context::$user_conf->lazyload ,
  16. 'sides_close_article' => !!FreshRSS_Context::$user_conf->sides_close_article,
  17. 'sticky_post' => !!FreshRSS_Context::isStickyPostEnabled(),
  18. 'html5_notif_timeout' => FreshRSS_Context::$user_conf->html5_notif_timeout,
  19. 'auth_type' => FreshRSS_Context::$system_conf->auth_type,
  20. 'current_view' => Minz_Request::actionName(),
  21. 'csrf' => FreshRSS_Auth::csrfToken(),
  22. ),
  23. 'shortcuts' => array(
  24. 'mark_read' => @$s['mark_read'],
  25. 'mark_favorite' => @$s['mark_favorite'],
  26. 'go_website' => @$s['go_website'],
  27. 'prev_entry' => @$s['prev_entry'],
  28. 'next_entry' => @$s['next_entry'],
  29. 'first_entry' => @$s['first_entry'],
  30. 'last_entry' => @$s['last_entry'],
  31. 'collapse_entry' => @$s['collapse_entry'],
  32. 'load_more' => @$s['load_more'],
  33. 'auto_share' => @$s['auto_share'],
  34. 'focus_search' => @$s['focus_search'],
  35. 'user_filter' => @$s['user_filter'],
  36. 'help' => @$s['help'],
  37. 'close_dropdown' => @$s['close_dropdown'],
  38. ),
  39. 'url' => array(
  40. 'index' => _url('index', 'index'),
  41. 'login' => Minz_Url::display(array('c' => 'auth', 'a' => 'login'), 'php'),
  42. 'logout' => Minz_Url::display(array('c' => 'auth', 'a' => 'logout'), 'php'),
  43. 'help' => FRESHRSS_WIKI,
  44. ),
  45. 'i18n' => array(
  46. 'confirmation_default' => _t('gen.js.confirm_action'),
  47. 'notif_title_articles' => _t('gen.js.feedback.title_new_articles'),
  48. 'notif_body_articles' => _t('gen.js.feedback.body_new_articles'),
  49. 'notif_request_failed' => _t('gen.js.feedback.request_failed'),
  50. 'category_empty' => _t('gen.js.category_empty'),
  51. ),
  52. 'icons' => array(
  53. 'close' => _i('close'),
  54. ),
  55. ), JSON_UNESCAPED_UNICODE), ENT_NOQUOTES);