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