]> git.wh0rd.org - tt-rss.git/blob - tt-rss.php
tweak hello/prefs/logout linkbar (refs #163)
[tt-rss.git] / tt-rss.php
1 <?php
2 error_reporting(E_ERROR | E_WARNING | E_PARSE);
3
4 require_once "functions.php";
5 require_once "sessions.php";
6 require_once "sanity_check.php";
7 require_once "version.php";
8 require_once "config.php";
9 require_once "db-prefs.php";
10
11 $link = db_connect(DB_HOST, DB_USER, DB_PASS, DB_NAME);
12
13 login_sequence($link);
14
15 $dt_add = get_script_dt_add();
16
17 no_cache_incantation();
18
19 ?>
20 <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
21 "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
22 <html>
23 <head>
24 <title>Tiny Tiny RSS</title>
25
26 <link rel="stylesheet" type="text/css" href="tt-rss.css">
27
28 <?php $user_theme = $_SESSION["theme"];
29 if ($user_theme) { ?>
30 <link rel="stylesheet" type="text/css" href="themes/<?php echo $user_theme ?>/theme.css">
31 <?php } ?>
32
33 <?php if ($user_theme) { $theme_image_path = "themes/$user_theme/"; } ?>
34
35 <?php $user_css_url = get_pref($link, 'USER_STYLESHEET_URL'); ?>
36 <?php if ($user_css_url) { ?>
37 <link rel="stylesheet" type="text/css" href="<?php echo $user_css_url ?>"/>
38 <?php } ?>
39
40 <!--[if lt IE 7]>
41 <script type="text/javascript" src="pngfix.js"></script>
42 <link rel="stylesheet" type="text/css" href="ie6.css">
43 <![endif]-->
44
45 <!--[if IE 7]>
46 <link rel="stylesheet" type="text/css" href="ie7.css">
47 <![endif]-->
48
49 <link rel="shortcut icon" type="image/png" href="images/favicon.png">
50
51 <script type="text/javascript" src="prototype.js"></script>
52 <script type="text/javascript" src="scriptaculous/scriptaculous.js?load=effects,dragdrop,controls"></script>
53 <script type="text/javascript" src="localized_js.php?<?php echo $dt_add ?>"></script>
54 <script type="text/javascript" src="tt-rss.js?<?php echo $dt_add ?>"></script>
55 <script type="text/javascript" src="functions.js?<?php echo $dt_add ?>"></script>
56 <script type="text/javascript" src="feedlist.js?<?php echo $dt_add ?>"></script>
57 <script type="text/javascript" src="viewfeed.js?<?php echo $dt_add ?>"></script>
58
59 <meta http-equiv="Content-Type" content="text/html; charset=utf-8">
60
61 <script type="text/javascript">
62 if (navigator.userAgent.match("Opera")) {
63 document.write('<link rel="stylesheet" type="text/css" href="opera.css">');
64 }
65 if (navigator.userAgent.match("Gecko") && !navigator.userAgent.match("KHTML")) {
66 document.write('<link rel="stylesheet" type="text/css" href="gecko.css">');
67 }
68 </script>
69 </head>
70
71 <body onresize="resize_headlines()">
72
73 <div id="overlay">
74 <div id="overlay_inner">
75 <p><?php echo __("Loading, please wait...") ?></p>
76 <noscript>
77 <div class="error"><?php echo
78 __("Your browser doesn't support Javascript, which is required
79 for this application to function properly. Please check your
80 browser settings.") ?></div>
81 </noscript>
82 </div>
83 </div>
84
85 <div id="notify" class="notify"><span id="notify_body">&nbsp;</span></div>
86
87 <div id="fatal_error"><div id="fatal_error_inner">
88 <h1>Fatal Error</h1>
89 <div id="fatal_error_msg">Unknown Error</div>
90 </div></div>
91
92 <div id="dialog_overlay"> </div>
93
94 <script type="text/javascript">
95 if (document.addEventListener) {
96 document.addEventListener("DOMContentLoaded", init, null);
97 }
98 window.onload = init;
99 </script>
100
101 <ul id="debug_output"></ul>
102
103 <div id="infoBoxShadow"><div id="infoBox">&nbsp;</div></div>
104
105 <div id="header">
106 <div class="topLinks">
107 <?php if (!SINGLE_USER_MODE) { ?>
108 <?php echo __('Hello,') ?> <b><?php echo $_SESSION["name"] ?></b> |
109 <?php } ?>
110 <a href="prefs.php"><?php echo __('Preferences') ?></a>
111
112 <?php if (!SINGLE_USER_MODE) { ?>
113 | <a href="logout.php"><?php echo __('Logout') ?></a>
114 <?php } ?>
115
116 <img id="newVersionIcon" style="display:none;" onclick="javascript:explainError(2)"
117 src="images/new_version.png" title="New version is available!"
118 alt="new_version_icon">
119 </div>
120 <img src="<?php echo $theme_image_path ?>images/ttrss_logo.png" alt="Tiny Tiny RSS"/>
121 </div>
122
123 <div id="feeds-holder">
124 <div id="dispSwitch">
125 <a id="dispSwitchPrompt"
126 href="javascript:toggleTags()"><?php echo __("tag cloud") ?></a>
127 </div>
128 <div id="feeds-frame">&nbsp;</div>
129 </div>
130
131 <div id="toolbar">
132
133 <div style="float : right">
134 <select id="quickMenuChooser" onchange="quickMenuChange()">
135 <option value="qmcDefault" selected><?php echo __('Actions...') ?></option>
136 <option value="qmcSearch"><?php echo __('Search') ?></option>
137 <!-- <option value="qmcPrefs"><?php echo __('Preferences') ?></option> -->
138 <option disabled>--------</option>
139 <option style="color : #5050aa" disabled><?php echo __('Feed actions:') ?></option>
140 <option value="qmcAddFeed"><?php echo __('&nbsp;&nbsp;Subscribe to feed') ?></option>
141 <option value="qmcEditFeed"><?php echo __('&nbsp;&nbsp;Edit this feed') ?></option>
142 <!-- <option value="qmcClearFeed"><?php echo __('&nbsp;&nbsp;Clear articles') ?></option> -->
143 <option value="qmcRemoveFeed"><?php echo __('&nbsp;&nbsp;Unsubscribe') ?></option>
144 <option disabled>--------</option>
145 <option style="color : #5050aa" disabled><?php echo __('All feeds:') ?></option>
146 <option value="qmcCatchupAll"><?php echo __('&nbsp;&nbsp;Mark as read') ?></option>
147 <option value="qmcShowOnlyUnread"><?php echo __('&nbsp;&nbsp;(Un)hide read feeds') ?></option>
148 <option disabled>--------</option>
149 <option style="color : #5050aa" disabled><?php echo __('Other actions:') ?></option>
150 <option value="qmcAddFilter"><?php echo __('&nbsp;&nbsp;Create filter') ?></option>
151 </select>
152 </div>
153
154 <form id="main_toolbar_form" onsubmit='return false'>
155
156 <?php if (get_pref($link, 'ENABLE_SEARCH_TOOLBAR')) { ?>
157
158 <?php echo __('Search:') ?>
159 <input name="query"
160 onKeyPress="return filterCR(event, viewCurrentFeed)"
161 onblur="javascript:enableHotkeys();" onfocus="javascript:disableHotkeys();">
162
163 <?php } ?>
164
165 <?php echo __('View:') ?>
166 <select name="view_mode" onchange="viewCurrentFeed(0, '')">
167 <option selected value="adaptive"><?php echo __('Adaptive') ?></option>
168 <option value="all_articles"><?php echo __('All Articles') ?></option>
169 <option value="marked"><?php echo __('Starred') ?></option>
170 <option value="unread"><?php echo __('Unread') ?></option>
171 </select>
172
173 <?php echo __('Limit:') ?>
174 <?php
175 $limits = array(15 => 15, 30 => 30, 60 => 60, 0 => "All");
176
177 $def_art_limit = get_pref($link, 'DEFAULT_ARTICLE_LIMIT');
178
179 if ($def_art_limit >= 0 && !array_key_exists($def_art_limit, $limits)) {
180 $limits[$def_art_limit] = $def_art_limit;
181 }
182
183 asort($limits);
184
185 if (!$def_art_limit) {
186 $def_art_limit = 30;
187 }
188
189 print_select_hash("limit", $def_art_limit, $limits,
190 'onchange="viewCurrentFeed(0, \'\')"');
191
192 ?>
193
194 &nbsp;
195
196 <input class="button" type="submit"
197 onclick="return viewCurrentFeed('ForceUpdate')"
198 value="<?php echo __('Update') ?>">
199
200 </form>
201
202 <!-- &nbsp;<input class="button" type="submit"
203 onclick="quickMenuGo('qmcSearch')" value="Search (tmp)"> -->
204
205 <!-- <input class="button" type="submit"
206 onclick="catchupCurrentFeed()" value="Mark as read"> -->
207
208 </div>
209
210 <?php if (!get_pref($link, 'COMBINED_DISPLAY_MODE')) { ?>
211 <div id="headlines-frame" class="headlines_normal">
212 <div class="whiteBox"><?php echo __('No feed selected.') ?></div></div>
213 <div id="content-frame"><div class="whiteBox">&nbsp;</div></div>
214 <?php } else { ?>
215 <div id="headlines-frame" class="headlines_cdm">
216 <div class="whiteBox"><?php echo __('No feed selected.') ?></div></div>
217 <?php } ?>
218
219 <div id="footer">
220 <?php if (defined('_DEBUG_USER_SWITCH')) { ?>
221 <select id="userSwitch" onchange="userSwitch()">
222 <?php
223 foreach (array('admin', 'fox', 'test') as $u) {
224 $op_sel = ($u == $_SESSION["name"]) ? "selected" : "";
225 print "<option $op_sel>$u</option>";
226 }
227 ?>
228 </select>
229 <?php } ?>
230 <a href="http://tt-rss.org/">Tiny Tiny RSS</a> v<?php echo VERSION ?> &copy; 2005-2007 <a href="http://bah.org.ru/">Andrew Dolgov</a>
231 </div>
232
233 <?php db_close($link); ?>
234
235 <script type="text/javascript">
236 /* for IE */
237 function statechange() {
238 if (document.readyState == "interactive") init();
239 }
240
241 if (document.readyState) {
242 if (document.readyState == "interactive" || document.readyState == "complete") {
243 init();
244 } else {
245 document.onreadystatechange = statechange;
246 }
247 }
248 </script>
249
250 </body>
251 </html>