]> git.wh0rd.org - tt-rss.git/blob - prefs.php
Merge pull request #1 from gothfox/master
[tt-rss.git] / prefs.php
1 <?php
2 if (file_exists("install") && !file_exists("config.php")) {
3 header("Location: install/");
4 }
5
6 set_include_path(dirname(__FILE__) ."/include" . PATH_SEPARATOR .
7 get_include_path());
8
9 if (!file_exists("config.php")) {
10 print "<b>Fatal Error</b>: You forgot to copy
11 <b>config.php-dist</b> to <b>config.php</b> and edit it.\n";
12 exit;
13 }
14
15 require_once "autoload.php";
16 require_once "sessions.php";
17 require_once "functions.php";
18 require_once "sanity_check.php";
19 require_once "version.php";
20 require_once "config.php";
21 require_once "db-prefs.php";
22
23 if (!init_plugins()) return;
24
25 login_sequence();
26
27 header('Content-Type: text/html; charset=utf-8');
28 ?>
29 <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
30 "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
31 <html>
32 <head>
33 <title>Tiny Tiny RSS : <?php echo __("Preferences") ?></title>
34
35 <script type="text/javascript">
36 var __ttrss_version = "<?php echo VERSION ?>"
37 </script>
38
39 <?php echo stylesheet_tag("lib/dijit/themes/claro/claro.css"); ?>
40 <?php echo stylesheet_tag("css/layout.css"); ?>
41
42 <?php if ($_SESSION["uid"]) {
43 $theme = get_pref( "USER_CSS_THEME", $_SESSION["uid"], false);
44 if ($theme && file_exists("themes/$theme")) {
45 echo stylesheet_tag("themes/$theme");
46 } else {
47 echo stylesheet_tag("themes/default.css");
48 }
49 }
50 ?>
51
52 <?php print_user_stylesheet() ?>
53
54 <link rel="shortcut icon" type="image/png" href="images/favicon.png"/>
55 <link rel="icon" type="image/png" sizes="72x72" href="images/favicon-72px.png" />
56
57 <?php
58 foreach (array("lib/prototype.js",
59 "lib/scriptaculous/scriptaculous.js?load=effects,controls",
60 "lib/dojo/dojo.js",
61 "lib/dojo/tt-rss-layer.js",
62 "errors.php?mode=js") as $jsfile) {
63
64 echo javascript_tag($jsfile);
65
66 } ?>
67
68 <script type="text/javascript">
69 require({cache:{}});
70 <?php
71 require_once 'lib/jshrink/Minifier.php';
72
73 foreach (PluginHost::getInstance()->get_plugins() as $n => $p) {
74 if (method_exists($p, "get_prefs_js")) {
75 echo JShrink\Minifier::minify($p->get_prefs_js());
76 }
77 }
78
79 print get_minified_js(array("../lib/CheckBoxTree","functions", "deprecated", "prefs", "PrefFeedTree", "PrefFilterTree", "PrefLabelTree"));
80
81 init_js_translations();
82 ?>
83 </script>
84
85 <meta http-equiv="Content-Type" content="text/html; charset=utf-8"/>
86
87 <script type="text/javascript">
88 Event.observe(window, 'load', function() {
89 init();
90 });
91 </script>
92
93 </head>
94
95 <body id="ttrssPrefs" class="claro">
96
97 <div id="notify" class="notify"></div>
98 <div id="cmdline" style="display : none"></div>
99
100 <div id="overlay">
101 <div id="overlay_inner">
102 <div class="insensitive"><?php echo __("Loading, please wait...") ?></div>
103 <div dojoType="dijit.ProgressBar" places="0" style="width : 300px" id="loading_bar"
104 progress="0" maximum="100">
105 </div>
106 <noscript><br/><?php print_error('Javascript is disabled. Please enable it.') ?></noscript>
107 </div>
108 </div>
109
110 <div id="header" dojoType="dijit.layout.ContentPane" region="top">
111 <!-- <a href='#' onclick="showHelp()"><?php echo __("Keyboard shortcuts") ?></a> | -->
112 <a href="#" onclick="gotoMain()"><?php echo __('Exit preferences') ?></a>
113 </div>
114
115 <div id="main" dojoType="dijit.layout.BorderContainer">
116
117 <div dojoType="dijit.layout.TabContainer" region="center" id="pref-tabs">
118 <div id="genConfigTab" dojoType="dijit.layout.ContentPane"
119 href="backend.php?op=pref-prefs"
120 title="<?php echo __('Preferences') ?>"></div>
121 <div id="feedConfigTab" dojoType="dijit.layout.ContentPane"
122 href="backend.php?op=pref-feeds"
123 title="<?php echo __('Feeds') ?>"></div>
124 <div id="filterConfigTab" dojoType="dijit.layout.ContentPane"
125 href="backend.php?op=pref-filters"
126 title="<?php echo __('Filters') ?>"></div>
127 <div id="labelConfigTab" dojoType="dijit.layout.ContentPane"
128 href="backend.php?op=pref-labels"
129 title="<?php echo __('Labels') ?>"></div>
130 <?php if ($_SESSION["access_level"] >= 10) { ?>
131 <div id="userConfigTab" dojoType="dijit.layout.ContentPane"
132 href="backend.php?op=pref-users"
133 title="<?php echo __('Users') ?>"></div>
134 <div id="systemConfigTab" dojoType="dijit.layout.ContentPane"
135 href="backend.php?op=pref-system"
136 title="<?php echo __('System') ?>"></div>
137 <?php } ?>
138 <?php
139 PluginHost::getInstance()->run_hooks(PluginHost::HOOK_PREFS_TABS,
140 "hook_prefs_tabs", false);
141 ?>
142 </div>
143
144 <div id="footer" dojoType="dijit.layout.ContentPane" region="bottom">
145 <a class="insensitive" target="_blank" href="http://tt-rss.org/">
146 Tiny Tiny RSS</a>
147 <?php if (!defined('HIDE_VERSION')) { ?>
148 v<?php echo VERSION ?>
149 <?php } ?>
150 &copy; 2005-<?php echo date('Y') ?>
151 <a class="insensitive" target="_blank"
152 href="http://fakecake.org/">Andrew Dolgov</a>
153 </div> <!-- footer -->
154
155 </div>
156
157 </body>
158 </html>