]> git.wh0rd.org - tt-rss.git/blob - prefs.php
ajaxify password changer
[tt-rss.git] / prefs.php
1 <?php
2 require_once "functions.php";
3 require_once "sessions.php";
4 require_once "sanity_check.php";
5 require_once "version.php";
6 require_once "config.php";
7 require_once "db-prefs.php";
8
9 $link = db_connect(DB_HOST, DB_USER, DB_PASS, DB_NAME);
10
11 login_sequence($link);
12
13 $dt_add = get_script_dt_add();
14
15 no_cache_incantation();
16
17 ?>
18 <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
19 "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
20 <html>
21 <head>
22 <title>Tiny Tiny RSS : Preferences</title>
23 <link rel="stylesheet" href="tt-rss.css" type="text/css">
24
25 <?php $user_theme = $_SESSION["theme"];
26 if ($user_theme) { ?>
27 <link rel="stylesheet" type="text/css" href="themes/<?php echo $user_theme ?>/theme.css">
28 <?php } ?>
29
30 <?php if ($user_theme) { $theme_image_path = "themes/$user_theme/"; } ?>
31
32 <?php $user_css_url = get_pref($link, 'USER_STYLESHEET_URL'); ?>
33 <?php if ($user_css_url) { ?>
34 <link type="text/css" href="<?php echo $user_css_url ?>"/>
35 <?php } ?>
36
37 <link rel="shortcut icon" type="image/png" href="images/favicon.png">
38
39 <script type="text/javascript" src="prototype.js"></script>
40
41 <script type="text/javascript" src="functions.js?<?php echo $dt_add ?>"></script>
42 <script type="text/javascript" src="prefs.js?<?php echo $dt_add ?>"></script>
43
44 <div id="infoBoxShadow"><div id="infoBox">BAH</div></div>
45
46 <!--[if gte IE 5.5000]>
47 <script type="text/javascript" src="pngfix.js"></script>
48 <link rel="stylesheet" type="text/css" href="tt-rss-ie.css">
49 <![endif]-->
50 <meta http-equiv="Content-Type" content="text/html; charset=utf-8">
51
52 <script type="text/javascript">
53 if (navigator.userAgent.match("Opera")) {
54 document.write('<link rel="stylesheet" type="text/css" href="opera.css">');
55 }
56 if (navigator.userAgent.match("Gecko") && !navigator.userAgent.match("KHTML")) {
57 document.write('<link rel="stylesheet" type="text/css" href="gecko.css">');
58 }
59 </script>
60 </head>
61
62 <body>
63
64 <div id="piggie">&nbsp;</div>
65
66 <iframe id="backReqBox"></iframe>
67
68 <script type="text/javascript">
69 if (document.addEventListener) {
70 document.addEventListener("DOMContentLoaded", init, null);
71 }
72 window.onload = init;
73 </script>
74
75 <ul id="debug_output"></ul>
76
77 <div id="notify" class="notify"><span id="notify_body">&nbsp;</span></div>
78
79 <div id="fatal_error"><div id="fatal_error_inner">
80 <h1>Fatal Error</h1>
81 <div id="fatal_error_msg"><?php echo _('Unknown Error') ?></div>
82 </div></div>
83
84 <div id="prefHeader">
85 <?php if (!SINGLE_USER_MODE) { ?>
86 <div style="float : right">
87 <?php echo _('Hello,') ?> <b><?php echo $_SESSION["name"] ?></b>
88 (<a href="logout.php">Logout</a>)
89 </div>
90 <?php } ?>
91 <img src="<?php echo $theme_image_path ?>images/ttrss_logo.png" alt="Tiny Tiny RSS"/>
92 </div>
93
94 <div class="return">
95 <a href="#" onclick="gotoMain()">Exit preferences</a>
96 </div>
97
98 <div class="firstTab">&nbsp;</div>
99
100 <div id="genConfigTab" class="prefsTab"
101 onclick="selectTab('genConfig')"><?php echo _('Preferences') ?></div>
102 <div id="feedConfigTab" class="prefsTab"
103 onclick="selectTab('feedConfig')"><?php echo _('My Feeds') ?></div>
104 <?php if (ENABLE_FEED_BROWSER && !SINGLE_USER_MODE) { ?>
105 <div id="feedBrowserTab" class="prefsTab"
106 onclick="selectTab('feedBrowser')"><?php echo _('Other Feeds') ?></div>
107 <?php } ?>
108 <div id="filterConfigTab" class="prefsTab"
109 onclick="selectTab('filterConfig')"><?php echo _('Content Filtering') ?></div>
110 <?php if (get_pref($link, 'ENABLE_LABELS')) { ?>
111 <div id="labelConfigTab" class="prefsTab"
112 onclick="selectTab('labelConfig')"><?php echo _('Label Editor') ?></div>
113 <?php } ?>
114 <?php if ($_SESSION["access_level"] >= 10) { ?>
115 <div id="userConfigTab" class="prefsTab"
116 onclick="selectTab('userConfig')"><?php echo _('User Manager') ?></div>
117 <?php } ?>
118
119 <div id="prefContent">
120 <p><?php echo _('Loading, please wait...') ?></p>
121 <noscript>
122 <div class="error">
123 <?php echo _("Your browser doesn't support Javascript, which is required
124 for this application to function properly. Please check your
125 browser settings.") ?></div>
126 </noscript>
127 </div>
128
129 <div id="prefFooter">
130 <?php if (defined('_DEBUG_USER_SWITCH')) { ?>
131 <select id="userSwitch" onchange="userSwitch()">
132 <?php
133 foreach (array('admin', 'fox', 'test') as $u) {
134 $op_sel = ($u == $_SESSION["name"]) ? "selected" : "";
135 print "<option $op_sel>$u</option>";
136 }
137 ?>
138 </select>
139 <?php } ?>
140 <a href="http://tt-rss.spb.ru/">Tiny Tiny RSS</a> v<?php echo VERSION ?> &copy; 2005-2007 <a href="http://bah.org.ru/">Andrew Dolgov</a>
141 </div>
142
143 <?php db_close($link); ?>
144
145 <script type="text/javascript">
146 /* for IE */
147 function statechange() {
148 if (document.readyState == "interactive") init();
149 }
150
151 if (document.readyState) {
152 if (document.readyState == "interactive" || document.readyState == "complete") {
153 init();
154 } else {
155 document.onreadystatechange = statechange;
156 }
157 }
158 </script>
159
160 </body>
161 </html>