prefs.php 5.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168
  1. <?php
  2. if (file_exists("install") && !file_exists("config.php")) {
  3. header("Location: install/");
  4. }
  5. set_include_path(dirname(__FILE__) ."/include" . PATH_SEPARATOR .
  6. get_include_path());
  7. if (!file_exists("config.php")) {
  8. print "<b>Fatal Error</b>: You forgot to copy
  9. <b>config.php-dist</b> to <b>config.php</b> and edit it.\n";
  10. exit;
  11. }
  12. require_once "autoload.php";
  13. require_once "sessions.php";
  14. require_once "functions.php";
  15. require_once "sanity_check.php";
  16. require_once "version.php";
  17. require_once "config.php";
  18. require_once "db-prefs.php";
  19. if (!init_plugins()) return;
  20. login_sequence();
  21. header('Content-Type: text/html; charset=utf-8');
  22. ?>
  23. <!DOCTYPE html>
  24. <html>
  25. <head>
  26. <title>Tiny Tiny RSS : <?php echo __("Preferences") ?></title>
  27. <meta name="viewport" content="initial-scale=1,width=device-width" />
  28. <script type="text/javascript">
  29. var __ttrss_version = "<?php echo VERSION ?>"
  30. </script>
  31. <?php if ($_SESSION["uid"]) {
  32. $theme = get_pref("USER_CSS_THEME", false, false);
  33. if ($theme && theme_exists("$theme")) {
  34. echo stylesheet_tag(get_theme_path($theme), 'theme_css');
  35. } else {
  36. echo stylesheet_tag("css/default.css", 'theme_css');
  37. }
  38. }
  39. ?>
  40. <?php print_user_stylesheet() ?>
  41. <link rel="shortcut icon" type="image/png" href="images/favicon.png"/>
  42. <link rel="icon" type="image/png" sizes="72x72" href="images/favicon-72px.png" />
  43. <script>
  44. dojoConfig = {
  45. async: true,
  46. cacheBust: "<?php echo get_scripts_timestamp(); ?>",
  47. packages: [
  48. { name: "lib", location: "../" },
  49. { name: "fox", location: "../../js" },
  50. ]
  51. };
  52. </script>
  53. <?php
  54. foreach (array("lib/prototype.js",
  55. "lib/scriptaculous/scriptaculous.js?load=effects,controls",
  56. "lib/dojo/dojo.js",
  57. "lib/dojo/tt-rss-layer.js",
  58. "js/common.js",
  59. "js/prefs.js",
  60. "errors.php?mode=js") as $jsfile) {
  61. echo javascript_tag($jsfile);
  62. } ?>
  63. <script type="text/javascript">
  64. require({cache:{}});
  65. </script>
  66. <script type="text/javascript">
  67. <?php
  68. foreach (PluginHost::getInstance()->get_plugins() as $n => $p) {
  69. if (method_exists($p, "get_prefs_js")) {
  70. $script = $p->get_prefs_js();
  71. if ($script) {
  72. echo "try {
  73. $script
  74. } catch (e) {
  75. console.warn('failed to initialize plugin JS: $n', e);
  76. }";
  77. }
  78. }
  79. }
  80. init_js_translations();
  81. ?>
  82. </script>
  83. <meta http-equiv="Content-Type" content="text/html; charset=utf-8"/>
  84. </head>
  85. <body class="flat ttrss_main ttrss_prefs">
  86. <div id="notify" class="notify"></div>
  87. <div id="cmdline" style="display : none"></div>
  88. <div id="overlay">
  89. <div id="overlay_inner">
  90. <?php echo __("Loading, please wait...") ?>
  91. <div dojoType="dijit.ProgressBar" places="0" style="width : 300px" id="loading_bar"
  92. progress="0" maximum="100">
  93. </div>
  94. <noscript><br/><?php print_error('Javascript is disabled. Please enable it.') ?></noscript>
  95. </div>
  96. </div>
  97. <div id="header">
  98. <!-- <a href='#' onclick="showHelp()"><?php echo __("Keyboard shortcuts") ?></a> | -->
  99. <a href="#" onclick="document.location.href = 'index.php'"><?php echo __('Exit preferences') ?></a>
  100. </div>
  101. <div id="main" dojoType="dijit.layout.BorderContainer">
  102. <div dojoType="dijit.layout.TabContainer" region="center" id="pref-tabs">
  103. <div id="genConfigTab" dojoType="dijit.layout.ContentPane"
  104. href="backend.php?op=pref-prefs"
  105. title="<i class='material-icons'>settings</i> <?php echo __('Preferences') ?>"></div>
  106. <div id="feedConfigTab" dojoType="dijit.layout.ContentPane"
  107. href="backend.php?op=pref-feeds"
  108. title="<i class='material-icons'>rss_feed</i> <?php echo __('Feeds') ?>"></div>
  109. <div id="filterConfigTab" dojoType="dijit.layout.ContentPane"
  110. style="padding : 0px"
  111. href="backend.php?op=pref-filters"
  112. title="<i class='material-icons'>filter_list1</i> <?php echo __('Filters') ?>"></div>
  113. <div id="labelConfigTab" dojoType="dijit.layout.ContentPane"
  114. style="padding : 0px"
  115. href="backend.php?op=pref-labels"
  116. title="<i class='material-icons'>label_outline1</i> <?php echo __('Labels') ?>"></div>
  117. <?php if ($_SESSION["access_level"] >= 10) { ?>
  118. <div id="userConfigTab" dojoType="dijit.layout.ContentPane"
  119. style="padding : 0px"
  120. href="backend.php?op=pref-users"
  121. title="<i class='material-icons'>person</i> <?php echo __('Users') ?>"></div>
  122. <div id="systemConfigTab" dojoType="dijit.layout.ContentPane"
  123. href="backend.php?op=pref-system"
  124. title="<i class='material-icons'>info_outline</i> <?php echo __('System') ?>"></div>
  125. <?php } ?>
  126. <?php
  127. PluginHost::getInstance()->run_hooks(PluginHost::HOOK_PREFS_TABS,
  128. "hook_prefs_tabs", false);
  129. ?>
  130. </div>
  131. <div id="footer" dojoType="dijit.layout.ContentPane" region="bottom">
  132. <a class="text-muted" target="_blank" href="http://tt-rss.org/">
  133. Tiny Tiny RSS</a>
  134. <?php if (!defined('HIDE_VERSION')) { ?>
  135. v<?php echo VERSION ?>
  136. <?php } ?>
  137. &copy; 2005-<?php echo date('Y') ?>
  138. <a class="text-muted" target="_blank"
  139. href="http://fakecake.org/">Andrew Dolgov</a>
  140. </div> <!-- footer -->
  141. </div>
  142. </body>
  143. </html>