prefs.php 4.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158
  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 "sessions.php";
  13. require_once "functions.php";
  14. require_once "sanity_check.php";
  15. require_once "version.php";
  16. require_once "config.php";
  17. require_once "db-prefs.php";
  18. $link = db_connect(DB_HOST, DB_USER, DB_PASS, DB_NAME);
  19. if (!init_connection($link)) return;
  20. login_sequence($link);
  21. no_cache_incantation();
  22. header('Content-Type: text/html; charset=utf-8');
  23. ?>
  24. <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
  25. "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
  26. <html>
  27. <head>
  28. <title>Tiny Tiny RSS : <?php echo __("Preferences") ?></title>
  29. <?php echo stylesheet_tag("lib/dijit/themes/claro/claro.css"); ?>
  30. <?php echo stylesheet_tag("tt-rss.css"); ?>
  31. <?php echo stylesheet_tag("prefs.css"); ?>
  32. <?php if ($_SESSION["uid"]) {
  33. $theme = get_pref($link, "USER_CSS_THEME", $_SESSION["uid"], false);
  34. if ($theme) {
  35. echo stylesheet_tag("themes/$theme");
  36. }
  37. }
  38. ?>
  39. <?php print_user_stylesheet($link) ?>
  40. <link rel="shortcut icon" type="image/png" href="images/favicon.png"/>
  41. <link rel="icon" type="image/png" sizes="72x72" href="images/favicon-72px.png" />
  42. <?php
  43. foreach (array("lib/prototype.js",
  44. "lib/scriptaculous/scriptaculous.js?load=effects,dragdrop,controls",
  45. "lib/dojo/dojo.js",
  46. "lib/dijit/dijit.js",
  47. "lib/CheckBoxTree.js",
  48. "lib/dojo/tt-rss-layer.js",
  49. "errors.php?mode=js") as $jsfile) {
  50. echo javascript_tag($jsfile);
  51. } ?>
  52. <script type="text/javascript">
  53. <?php
  54. require 'lib/jshrink/Minifier.php';
  55. global $pluginhost;
  56. foreach ($pluginhost->get_plugins() as $n => $p) {
  57. if (method_exists($p, "get_prefs_js")) {
  58. echo JShrink\Minifier::minify($p->get_prefs_js());
  59. }
  60. }
  61. print get_minified_js(array("functions", "deprecated", "prefs", "PrefFeedTree", "PrefFilterTree", "PrefLabelTree"));
  62. init_js_translations();
  63. ?>
  64. </script>
  65. <meta http-equiv="Content-Type" content="text/html; charset=utf-8"/>
  66. <script type="text/javascript">
  67. Event.observe(window, 'load', function() {
  68. init();
  69. });
  70. </script>
  71. </head>
  72. <body id="ttrssPrefs" class="claro">
  73. <div id="notify" class="notify"><span id="notify_body">&nbsp;</span></div>
  74. <div id="cmdline" style="display : none"></div>
  75. <div id="overlay">
  76. <div id="overlay_inner">
  77. <div class="insensitive"><?php echo __("Loading, please wait...") ?></div>
  78. <div dojoType="dijit.ProgressBar" places="0" style="width : 300px" id="loading_bar"
  79. progress="0" maximum="100">
  80. </div>
  81. <noscript><br/><?php print_error('Javascript is disabled. Please enable it.') ?></noscript>
  82. </div>
  83. </div>
  84. <div id="header" dojoType="dijit.layout.ContentPane" region="top">
  85. <!-- <a href='#' onclick="showHelp()"><?php echo __("Keyboard shortcuts") ?></a> | -->
  86. <a href="#" onclick="gotoMain()"><?php echo __('Exit preferences') ?></a>
  87. </div>
  88. <div id="main" dojoType="dijit.layout.BorderContainer">
  89. <div dojoType="dijit.layout.TabContainer" region="center" id="pref-tabs">
  90. <div id="genConfigTab" dojoType="dijit.layout.ContentPane"
  91. href="backend.php?op=pref-prefs"
  92. title="<?php echo __('Preferences') ?>"></div>
  93. <div id="feedConfigTab" dojoType="dijit.layout.ContentPane"
  94. href="backend.php?op=pref-feeds"
  95. title="<?php echo __('Feeds') ?>"></div>
  96. <div id="filterConfigTab" dojoType="dijit.layout.ContentPane"
  97. href="backend.php?op=pref-filters"
  98. title="<?php echo __('Filters') ?>"></div>
  99. <div id="labelConfigTab" dojoType="dijit.layout.ContentPane"
  100. href="backend.php?op=pref-labels"
  101. title="<?php echo __('Labels') ?>"></div>
  102. <?php if ($_SESSION["access_level"] >= 10) { ?>
  103. <div id="userConfigTab" dojoType="dijit.layout.ContentPane"
  104. href="backend.php?op=pref-users"
  105. title="<?php echo __('Users') ?>"></div>
  106. <?php } ?>
  107. <?php
  108. $pluginhost->run_hooks($pluginhost::HOOK_PREFS_TABS,
  109. "hook_prefs_tabs", false);
  110. ?>
  111. </div>
  112. <div id="footer" dojoType="dijit.layout.ContentPane" region="bottom">
  113. <a class="insensitive" target="_blank" href="http://tt-rss.org/">
  114. Tiny Tiny RSS</a>
  115. <?php if (!defined('HIDE_VERSION')) { ?>
  116. v<?php echo VERSION ?>
  117. <?php } ?>
  118. &copy; 2005-<?php echo date('Y') ?>
  119. <a class="insensitive" target="_blank"
  120. href="http://fakecake.org/">Andrew Dolgov</a>
  121. </div> <!-- footer -->
  122. </div>
  123. <?php db_close($link); ?>
  124. </body>
  125. </html>