]> git.wh0rd.org - tt-rss.git/blob - tt-rss.php
add feed browser prompt to main UI
[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 header('Content-Type: text/html; charset=utf-8');
20
21 ?>
22 <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
23 "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
24 <html>
25 <head>
26 <title>Tiny Tiny RSS</title>
27
28 <link rel="stylesheet" type="text/css" href="tt-rss.css?<?php echo $dt_add ?>"/>
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?<?php echo $dt_add ?>">
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 rel="stylesheet" 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 <script type="text/javascript" src="scriptaculous/scriptaculous.js?load=effects,dragdrop,controls"></script>
46 <script type="text/javascript" charset="utf-8" src="localized_js.php?<?php echo $dt_add ?>"></script>
47 <script type="text/javascript" charset="utf-8" src="tt-rss.js?<?php echo $dt_add ?>"></script>
48 <script type="text/javascript" charset="utf-8" src="functions.js?<?php echo $dt_add ?>"></script>
49 <script type="text/javascript" charset="utf-8" src="feedlist.js?<?php echo $dt_add ?>"></script>
50 <script type="text/javascript" charset="utf-8" src="viewfeed.js?<?php echo $dt_add ?>"></script>
51
52 <meta http-equiv="Content-Type" content="text/html; charset=utf-8"/>
53
54 <script type="text/javascript">
55 //<![CDATA[
56 if (navigator.userAgent.match("Opera")) {
57 document.write('<link rel="stylesheet" type="text/css" href="opera.css">');
58 }
59 if (navigator.userAgent.match("Gecko") && !navigator.userAgent.match("KHTML")) {
60 document.write('<link rel="stylesheet" type="text/css" href="gecko.css">');
61 }
62 window.onresize=resize_headlines;
63 //]]>
64 </script>
65 </head>
66
67 <body id="ttrssMain">
68
69 <div id="overlay" style="display : block">
70 <div id="overlay_inner">
71 <?php echo __("Loading, please wait...") ?>
72
73 <div id="l_progress_o">
74 <div id="l_progress_i"></div>
75 </div>
76
77 <noscript>
78 <div class="error"><?php echo
79 __("Your browser doesn't support Javascript, which is required
80 for this application to function properly. Please check your
81 browser settings.") ?></div>
82 </noscript>
83 </div>
84 </div>
85
86 <div id="hotkey_help_overlay" style="display : none" onclick="Element.hide(this)">
87 <?php rounded_table_start("hho"); ?>
88 <?php include "help/3.php" ?>
89 <?php rounded_table_end(); ?>
90 </div>
91
92 <div id="notify" class="notify"><span id="notify_body">&nbsp;</span></div>
93
94 <div id="fatal_error"><div id="fatal_error_inner">
95 <h1>Fatal Error</h1>
96 <div id="fatal_error_msg">Unknown Error</div>
97 </div></div>
98
99 <div id="dialog_overlay" style="display : none"> </div>
100
101 <script type="text/javascript">
102 if (document.addEventListener) {
103 document.addEventListener("DOMContentLoaded", init, null);
104 }
105 window.onload = init;
106 </script>
107
108 <ul id="debug_output" style='display : none'><li>&nbsp;</li></ul>
109
110 <div id="infoBoxShadow"><div id="infoBox">&nbsp;</div></div>
111
112 <div id="header">
113 <div class="topLinks">
114 <?php if (!SINGLE_USER_MODE) { ?>
115 <?php echo __('Hello,') ?> <b><?php echo $_SESSION["name"] ?></b> |
116 <?php } ?>
117 <a href="prefs.php"><?php echo __('Preferences') ?></a>
118
119 <?php if (defined('FEEDBACK_URL') && FEEDBACK_URL) { ?>
120 | <a target="_blank" class="feedback" href="<?php echo FEEDBACK_URL ?>">
121 <?php echo __('Comments?') ?></a>
122 <?php } ?>
123
124 <?php if (!SINGLE_USER_MODE) { ?>
125 | <a href="logout.php"><?php echo __('Logout') ?></a>
126 <?php } ?>
127
128 <img id="newVersionIcon" style="display:none;" onclick="javascript:explainError(2)"
129 src="images/new_version.png" title="New version is available!"
130 alt="new_version_icon"/>
131 </div>
132 <img src="<?php echo $theme_image_path ?>images/ttrss_logo.png" alt="Tiny Tiny RSS"/>
133 </div>
134
135 <div id="feeds-holder">
136 <div id="dispSwitch">
137 <a id="dispSwitchPrompt"
138 href="javascript:toggleTags()"><?php echo __("tag cloud") ?></a>
139 <br/>
140 <a id="feedBrowserPrompt" href="prefs.php?tab=feedBrowser"
141 title="<?php echo __('More feeds...') ?>">+</a>
142 </div>
143 <div id="feeds-frame">&nbsp;</div>
144 </div>
145
146 <div id="toolbar">
147
148 <div style="float : right">
149 <select id="quickMenuChooser" onchange="quickMenuChange()">
150 <option value="qmcDefault" selected="selected"><?php echo __('Actions...') ?></option>
151 <option value="qmcSearch"><?php echo __('Search') ?></option>
152 <!-- <option value="qmcPrefs"><?php echo __('Preferences') ?></option> -->
153 <option disabled="disabled">--------</option>
154 <option style="color : #5050aa" disabled="disabled"><?php echo __('Feed actions:') ?></option>
155 <option value="qmcAddFeed"><?php echo __('&nbsp;&nbsp;Subscribe to feed') ?></option>
156 <option value="qmcEditFeed"><?php echo __('&nbsp;&nbsp;Edit this feed') ?></option>
157 <!-- <option value="qmcClearFeed"><?php echo __('&nbsp;&nbsp;Clear articles') ?></option> -->
158 <option value="qmcRescoreFeed"><?php echo __('&nbsp;&nbsp;Rescore feed') ?></option>
159 <option value="qmcRemoveFeed"><?php echo __('&nbsp;&nbsp;Unsubscribe') ?></option>
160 <option disabled="disabled">--------</option>
161 <option style="color : #5050aa" disabled="disabled"><?php echo __('All feeds:') ?></option>
162 <option value="qmcCatchupAll"><?php echo __('&nbsp;&nbsp;Mark as read') ?></option>
163 <option value="qmcShowOnlyUnread"><?php echo __('&nbsp;&nbsp;(Un)hide read feeds') ?></option>
164 <option disabled="disabled">--------</option>
165 <option style="color : #5050aa" disabled="disabled"><?php echo __('Other actions:') ?></option>
166
167 <option value="qmcAddLabel"><?php echo __('&nbsp;&nbsp;Create label') ?></option>
168 <option value="qmcAddFilter"><?php echo __('&nbsp;&nbsp;Create filter') ?></option>
169 <option value="qmcResetUI"><?php echo __('&nbsp;&nbsp;Reset UI layout') ?></option>
170 <option value="qmcResetCats"><?php echo __('&nbsp;&nbsp;Reset category order') ?></option>
171
172 <option value="qmcHKhelp"><?php echo __('&nbsp;&nbsp;Keyboard shortcuts') ?></option>
173 </select>
174 </div>
175
176 <form id="main_toolbar_form" action="" onsubmit='return false'>
177
178 <input type="submit" value="&lt;&lt;"
179 id="collapse_feeds_btn" onclick="collapse_feedlist()" class="button"
180 title="<?php echo __('Collapse feedlist') ?>" style="display : none"/>
181
182 <input type="submit" value="<?php echo __("Toggle Feedlist") ?>"
183 id="toggle_feeds_btn" class="button"
184 onclick="toggle_feedlist()" style="display : none"/>
185
186 &nbsp;
187
188 <?php if (get_pref($link, 'ENABLE_SEARCH_TOOLBAR')) { ?>
189
190 <?php echo __('Search:') ?>
191 <input name="query" type="text"
192 onkeypress="return filterCR(event, viewCurrentFeed)"
193 onblur="javascript:enableHotkeys();" onfocus="javascript:disableHotkeys();"/>
194
195 <?php } ?>
196
197 <select name="view_mode" onchange="viewModeChanged()">
198 <option selected="selected" value="adaptive"><?php echo __('Adaptive') ?></option>
199 <option value="all_articles"><?php echo __('All Articles') ?></option>
200 <option value="marked"><?php echo __('Starred') ?></option>
201 <option value="unread"><?php echo __('Unread') ?></option>
202 <!-- <option value="noscores"><?php echo __('Ignore Scoring') ?></option> -->
203 <option value="updated"><?php echo __('Updated') ?></option>
204 </select>
205
206 <?php echo __('Order:') ?>
207
208 <select name="order_by" onchange="viewModeChanged()">
209 <option selected="selected" value="default"><?php echo __('Default') ?></option>
210 <option value="date"><?php echo __('Date') ?></option>
211 <option value="title"><?php echo __('Title') ?></option>
212 <option value="score"><?php echo __('Score') ?></option>
213 </select>
214
215
216 <?php echo __('Limit:') ?>
217 <?php
218 $limits = array(15 => 15, 30 => 30, 60 => 60, 0 => "All");
219
220 $def_art_limit = get_pref($link, 'DEFAULT_ARTICLE_LIMIT');
221
222 if ($def_art_limit >= 0 && !array_key_exists($def_art_limit, $limits)) {
223 $limits[$def_art_limit] = $def_art_limit;
224 }
225
226 asort($limits);
227
228 if (!$def_art_limit) {
229 $def_art_limit = 30;
230 }
231
232 print_select_hash("limit", $def_art_limit, $limits,
233 'onchange="viewLimitChanged()"');
234
235 ?>
236
237 &nbsp;
238
239 <input class="button" type="submit"
240 onclick="return viewCurrentFeed('ForceUpdate')"
241 value="<?php echo __('Update') ?>"/>
242
243 </form>
244
245 <!-- &nbsp;<input class="button" type="submit"
246 onclick="quickMenuGo('qmcSearch')" value="Search (tmp)"> -->
247
248 <!-- <input class="button" type="submit"
249 onclick="catchupCurrentFeed()" value="Mark as read"> -->
250
251 </div>
252
253 <?php if (!get_pref($link, 'COMBINED_DISPLAY_MODE')) { ?>
254 <div id="headlines-frame" class="headlines_normal">
255 <div class="whiteBox"><?php echo __('No feed selected.') ?></div></div>
256 <div id="content-frame">
257 <div id="resize-grabber"
258 onmouseover="enable_resize(true)" onmouseout="enable_resize(false)"
259 title="<?php echo __('Drag me to resize panels') ?>">
260 <img src="images/resize_handle_horiz.png" id="resize-handle"
261 onmouseover="enable_resize(true)" onmouseout="enable_resize(false)"
262 alt=""/>
263 </div>
264 <div id="content-insert">&nbsp;</div>
265 <!-- <div class="whiteBox">&nbsp;</div> --> </div>
266 <?php } else { ?>
267 <div id="headlines-frame" class="headlines_cdm">
268 <div class="whiteBox"><?php echo __('No feed selected.') ?></div></div>
269 <?php } ?>
270
271 <div id="footer">
272 <?php if (defined('_DEBUG_USER_SWITCH')) { ?>
273 <select id="userSwitch" onchange="userSwitch()">
274 <?php
275 foreach (array('admin', 'fox', 'test') as $u) {
276 $op_sel = ($u == $_SESSION["name"]) ? "selected" : "";
277 print "<option $op_sel>$u</option>";
278 }
279 ?>
280 </select>
281 <?php } ?>
282 <a href="http://tt-rss.org/">Tiny Tiny RSS</a>
283 <?php if (!defined('HIDE_VERSION')) { ?>
284 v<?php echo VERSION ?>
285 <?php } ?>
286 &copy; 2005&ndash;2009 <a href="http://bah.org.ru/">Andrew Dolgov</a>
287 </div>
288
289 <?php db_close($link); ?>
290
291 <script type="text/javascript">
292 /* for IE */
293 function statechange() {
294 if (document.readyState == "interactive") init();
295 }
296
297 if (document.readyState) {
298 if (document.readyState == "interactive" || document.readyState == "complete") {
299 init();
300 } else {
301 document.onreadystatechange = statechange;
302 }
303 }
304 </script>
305
306 </body>
307 </html>