javascript_vars.phtml 2.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354
  1. <?php
  2. $mark = FreshRSS_Context::$user_conf->mark_when;
  3. $mail = Minz_Session::param('mail', false);
  4. $s = FreshRSS_Context::$user_conf->shortcuts;
  5. echo htmlspecialchars(json_encode(array(
  6. 'context' => array(
  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. 'sticky_post' => !!FreshRSS_Context::isStickyPostEnabled(),
  17. 'html5_notif_timeout' => FreshRSS_Context::$user_conf->html5_notif_timeout,
  18. 'auth_type' => FreshRSS_Context::$system_conf->auth_type,
  19. 'current_user_mail' => $mail ? ('"' . $mail . '"') : null,
  20. 'current_view' => Minz_Request::actionName(),
  21. ),
  22. 'shortcuts' => array(
  23. 'mark_read' => @$s['mark_read'],
  24. 'mark_favorite' => @$s['mark_favorite'],
  25. 'go_website' => @$s['go_website'],
  26. 'prev_entry' => @$s['prev_entry'],
  27. 'next_entry' => @$s['next_entry'],
  28. 'first_entry' => @$s['first_entry'],
  29. 'last_entry' => @$s['last_entry'],
  30. 'collapse_entry' => @$s['collapse_entry'],
  31. 'load_more' => @$s['load_more'],
  32. 'auto_share' => @$s['auto_share'],
  33. 'focus_search' => @$s['focus_search'],
  34. 'user_filter' => @$s['user_filter'],
  35. 'help' => @$s['help'],
  36. 'close_dropdown' => @$s['close_dropdown'],
  37. ),
  38. 'url' => array(
  39. 'index' => _url('index', 'index'),
  40. 'login' => Minz_Url::display(array('c' => 'auth', 'a' => 'login'), 'php'),
  41. 'logout' => Minz_Url::display(array('c' => 'auth', 'a' => 'logout'), 'php'),
  42. 'help' => FRESHRSS_WIKI,
  43. ),
  44. 'i18n' => array(
  45. 'confirmation_default' => _t('gen.js.confirm_action'),
  46. 'notif_title_articles' => _t('gen.js.feedback.title_new_articles'),
  47. 'notif_body_articles' => _t('gen.js.feedback.body_new_articles'),
  48. 'notif_request_failed' => _t('gen.js.feedback.request_failed'),
  49. 'category_empty' => _t('gen.js.category_empty'),
  50. ),
  51. 'icons' => array(
  52. 'close' => _i('close'),
  53. ),
  54. ), JSON_UNESCAPED_UNICODE), ENT_NOQUOTES);