prefs.php 4.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166
  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 PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
  24. "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
  25. <html>
  26. <head>
  27. <title>Tiny Tiny RSS : <?php echo __("Preferences") ?></title>
  28. <meta name="viewport" content="initial-scale=1,width=device-width" />
  29. <script type="text/javascript">
  30. var __ttrss_version = "<?php echo VERSION ?>"
  31. </script>
  32. <?php if ($_SESSION["uid"]) {
  33. $theme = get_pref("USER_CSS_THEME", false, false);
  34. if ($theme && theme_valid("$theme")) {
  35. echo stylesheet_tag(get_theme_path($theme));
  36. } else {
  37. echo stylesheet_tag("css/default.css");
  38. }
  39. }
  40. ?>
  41. <?php print_user_stylesheet() ?>
  42. <link rel="shortcut icon" type="image/png" href="images/favicon.png"/>
  43. <link rel="icon" type="image/png" sizes="72x72" href="images/favicon-72px.png" />
  44. <script>
  45. dojoConfig = {
  46. async: true,
  47. cacheBust: "<?php echo get_scripts_timestamp(); ?>",
  48. packages: [
  49. { name: "lib", location: "../" },
  50. { name: "fox", location: "../../js" },
  51. ]
  52. };
  53. </script>
  54. <?php
  55. foreach (array("lib/prototype.js",
  56. "lib/scriptaculous/scriptaculous.js?load=effects,controls",
  57. "lib/dojo/dojo.js",
  58. "lib/dojo/tt-rss-layer.js",
  59. "js/common.js",
  60. "js/prefs.js",
  61. "errors.php?mode=js") as $jsfile) {
  62. echo javascript_tag($jsfile);
  63. } ?>
  64. <script type="text/javascript">
  65. require({cache:{}});
  66. </script>
  67. <script type="text/javascript">
  68. <?php
  69. foreach (PluginHost::getInstance()->get_plugins() as $n => $p) {
  70. if (method_exists($p, "get_prefs_js")) {
  71. echo "try {";
  72. echo JShrink\Minifier::minify($p->get_prefs_js());
  73. echo "} catch (e) {
  74. console.warn('failed to initialize plugin JS: $n');
  75. console.warn(e);
  76. }";
  77. }
  78. }
  79. init_js_translations();
  80. ?>
  81. </script>
  82. <meta http-equiv="Content-Type" content="text/html; charset=utf-8"/>
  83. </head>
  84. <body class="flat ttrss_main ttrss_prefs">
  85. <div id="notify" class="notify"></div>
  86. <div id="cmdline" style="display : none"></div>
  87. <div id="overlay">
  88. <div id="overlay_inner">
  89. <div class="insensitive"><?php echo __("Loading, please wait...") ?></div>
  90. <div dojoType="dijit.ProgressBar" places="0" style="width : 300px" id="loading_bar"
  91. progress="0" maximum="100">
  92. </div>
  93. <noscript><br/><?php print_error('Javascript is disabled. Please enable it.') ?></noscript>
  94. </div>
  95. </div>
  96. <div id="header" dojoType="dijit.layout.ContentPane" region="top">
  97. <!-- <a href='#' onclick="showHelp()"><?php echo __("Keyboard shortcuts") ?></a> | -->
  98. <a href="#" onclick="document.location.href = 'index.php'"><?php echo __('Exit preferences') ?></a>
  99. </div>
  100. <div id="main" dojoType="dijit.layout.BorderContainer">
  101. <div dojoType="dijit.layout.TabContainer" region="center" id="pref-tabs">
  102. <div id="genConfigTab" dojoType="dijit.layout.ContentPane"
  103. href="backend.php?op=pref-prefs"
  104. title="<?php echo __('Preferences') ?>"></div>
  105. <div id="feedConfigTab" dojoType="dijit.layout.ContentPane"
  106. href="backend.php?op=pref-feeds"
  107. title="<?php echo __('Feeds') ?>"></div>
  108. <div id="filterConfigTab" dojoType="dijit.layout.ContentPane"
  109. href="backend.php?op=pref-filters"
  110. title="<?php echo __('Filters') ?>"></div>
  111. <div id="labelConfigTab" dojoType="dijit.layout.ContentPane"
  112. href="backend.php?op=pref-labels"
  113. title="<?php echo __('Labels') ?>"></div>
  114. <?php if ($_SESSION["access_level"] >= 10) { ?>
  115. <div id="userConfigTab" dojoType="dijit.layout.ContentPane"
  116. href="backend.php?op=pref-users"
  117. title="<?php echo __('Users') ?>"></div>
  118. <div id="systemConfigTab" dojoType="dijit.layout.ContentPane"
  119. href="backend.php?op=pref-system"
  120. title="<?php echo __('System') ?>"></div>
  121. <?php } ?>
  122. <?php
  123. PluginHost::getInstance()->run_hooks(PluginHost::HOOK_PREFS_TABS,
  124. "hook_prefs_tabs", false);
  125. ?>
  126. </div>
  127. <div id="footer" dojoType="dijit.layout.ContentPane" region="bottom">
  128. <a class="insensitive" target="_blank" href="http://tt-rss.org/">
  129. Tiny Tiny RSS</a>
  130. <?php if (!defined('HIDE_VERSION')) { ?>
  131. v<?php echo VERSION ?>
  132. <?php } ?>
  133. &copy; 2005-<?php echo date('Y') ?>
  134. <a class="insensitive" target="_blank"
  135. href="http://fakecake.org/">Andrew Dolgov</a>
  136. </div> <!-- footer -->
  137. </div>
  138. </body>
  139. </html>