]> git.wh0rd.org - tt-rss.git/blame - tt-rss.php
main toolbar: label tweak
[tt-rss.git] / tt-rss.php
CommitLineData
1d3a17c7 1<?php
d65981e2
AD
2 error_reporting(E_ERROR | E_WARNING | E_PARSE);
3
7ae65adf 4 require_once "functions.php";
1df0f48b 5 require_once "sessions.php";
66581886 6 require_once "sanity_check.php";
4062022e
AD
7 require_once "version.php";
8 require_once "config.php";
9 require_once "db-prefs.php";
da5d0d09 10
4062022e 11 $link = db_connect(DB_HOST, DB_USER, DB_PASS, DB_NAME);
c93f38c4 12
b8aa49bc 13 login_sequence($link);
ff485f1d 14
1b758780 15 $dt_add = get_script_dt_add();
53515ff1 16
dc56b3b7 17 no_cache_incantation();
1df0f48b 18
4062022e 19?>
6b4163cb
AD
20<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
21 "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
1cd17194
AD
22<html>
23<head>
24 <title>Tiny Tiny RSS</title>
da5d0d09 25
48d5f90a 26 <link rel="stylesheet" type="text/css" href="tt-rss.css?<?php echo $dt_add ?>">
430bf183 27
1d3a17c7 28 <?php $user_theme = $_SESSION["theme"];
503eb349 29 if ($user_theme) { ?>
48d5f90a 30 <link rel="stylesheet" type="text/css" href="themes/<?php echo $user_theme ?>/theme.css?<?php echo $dt_add ?>">
1d3a17c7 31 <?php } ?>
503eb349 32
1d3a17c7 33 <?php if ($user_theme) { $theme_image_path = "themes/$user_theme/"; } ?>
5d35cdcd 34
1d3a17c7
AD
35 <?php $user_css_url = get_pref($link, 'USER_STYLESHEET_URL'); ?>
36 <?php if ($user_css_url) { ?>
2e4afda7 37 <link rel="stylesheet" type="text/css" href="<?php echo $user_css_url ?>"/>
1d3a17c7 38 <?php } ?>
386d7b5b 39
c0266b88
AD
40 <link rel="shortcut icon" type="image/png" href="images/favicon.png">
41
a58069db 42 <script type="text/javascript" src="prototype.js"></script>
a7750ac6 43 <script type="text/javascript" src="scriptaculous/scriptaculous.js?load=effects,dragdrop,controls"></script>
709e7dc2 44 <script type="text/javascript" src="localized_js.php?<?php echo $dt_add ?>"></script>
1d3a17c7
AD
45 <script type="text/javascript" src="tt-rss.js?<?php echo $dt_add ?>"></script>
46 <script type="text/javascript" src="functions.js?<?php echo $dt_add ?>"></script>
6b4163cb
AD
47 <script type="text/javascript" src="feedlist.js?<?php echo $dt_add ?>"></script>
48 <script type="text/javascript" src="viewfeed.js?<?php echo $dt_add ?>"></script>
49
d76a3b03 50 <meta http-equiv="Content-Type" content="text/html; charset=utf-8">
362698ad
AD
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 }
6b9bf6c2
AD
56 if (navigator.userAgent.match("Gecko") && !navigator.userAgent.match("KHTML")) {
57 document.write('<link rel="stylesheet" type="text/css" href="gecko.css">');
58 }
362698ad 59 </script>
1cd17194
AD
60</head>
61
27f5a18f 62<body onresize="resize_headlines()" id="ttrssMain">
97dcd654 63
84916243
AD
64<div id="overlay">
65 <div id="overlay_inner">
730dbf19
AD
66 <?php echo __("Loading, please wait...") ?>
67
68 <div id="l_progress_o">
99509451 69 <div id="l_progress_i"></div>
730dbf19
AD
70 </div>
71
84916243 72 <noscript>
b76affe9 73 <div class="error"><?php echo
d1db26aa 74 __("Your browser doesn't support Javascript, which is required
84916243 75 for this application to function properly. Please check your
b76affe9 76 browser settings.") ?></div>
84916243
AD
77 </noscript>
78 </div>
79</div>
6b4163cb 80
0745839a 81<div id="hotkey_help_overlay" style="display : none" onclick="Element.hide(this)">
ec92c9d1 82 <?php rounded_table_start("hho"); ?>
4298481d 83 <?php include "help/3.php" ?>
ec92c9d1 84 <?php rounded_table_end(); ?>
4298481d
AD
85</div>
86
33b8cab4
AD
87<div id="notify" class="notify"><span id="notify_body">&nbsp;</span></div>
88
af106b0e
AD
89<div id="fatal_error"><div id="fatal_error_inner">
90 <h1>Fatal Error</h1>
462a192b 91 <div id="fatal_error_msg">Unknown Error</div>
af106b0e 92</div></div>
2055d4a6 93
569720c5 94<div id="dialog_overlay" style="display : none"> </div>
5ede560f 95
97dcd654
AD
96<script type="text/javascript">
97if (document.addEventListener) {
98 document.addEventListener("DOMContentLoaded", init, null);
99}
100window.onload = init;
101</script>
1cd17194 102
8836613c 103<ul id="debug_output" style='display : none'></ul>
0ee1d1a0 104
cea10627
AD
105<div id="infoBoxShadow"><div id="infoBox">&nbsp;</div></div>
106
c2625f8e 107<div id="header">
efae7595 108 <div class="topLinks">
c2625f8e 109 <?php if (!SINGLE_USER_MODE) { ?>
efae7595 110 <?php echo __('Hello,') ?> <b><?php echo $_SESSION["name"] ?></b> |
c2625f8e 111 <?php } ?>
efae7595
AD
112 <a href="prefs.php"><?php echo __('Preferences') ?></a>
113
be746c8e 114 <?php if (defined('FEEDBACK_URL')) { ?>
db499b67 115 | <a target="_blank" class="feedback" href="<?php echo FEEDBACK_URL ?>">
b5dabd1a 116 <?php echo __('Comments?') ?></a>
be746c8e 117 <?php } ?>
b5dabd1a 118
efae7595
AD
119 <?php if (!SINGLE_USER_MODE) { ?>
120 | <a href="logout.php"><?php echo __('Logout') ?></a>
121 <?php } ?>
122
b4507bc2 123 <img id="newVersionIcon" style="display:none;" onclick="javascript:explainError(2)"
d9fa39f1
AD
124 src="images/new_version.png" title="New version is available!"
125 alt="new_version_icon">
126 </div>
3f59e8cd 127 <img src="<?php echo $theme_image_path ?>images/ttrss_logo.png" alt="Tiny Tiny RSS"/>
c2625f8e 128</div>
caa4e57f 129
6b4163cb
AD
130<div id="feeds-holder">
131 <div id="dispSwitch">
709e7dc2 132 <a id="dispSwitchPrompt"
0979b696 133 href="javascript:toggleTags()"><?php echo __("tag cloud") ?></a>
6b4163cb 134 </div>
eb58af8d 135 <div id="feeds-frame">&nbsp;</div>
6b4163cb 136</div>
f69ea84d 137
6b4163cb 138<div id="toolbar">
5238347d 139
6b4163cb
AD
140 <div style="float : right">
141 <select id="quickMenuChooser" onchange="quickMenuChange()">
d1db26aa
AD
142 <option value="qmcDefault" selected><?php echo __('Actions...') ?></option>
143 <option value="qmcSearch"><?php echo __('Search') ?></option>
efae7595 144 <!-- <option value="qmcPrefs"><?php echo __('Preferences') ?></option> -->
6b4163cb 145 <option disabled>--------</option>
d1db26aa
AD
146 <option style="color : #5050aa" disabled><?php echo __('Feed actions:') ?></option>
147 <option value="qmcAddFeed"><?php echo __('&nbsp;&nbsp;Subscribe to feed') ?></option>
148 <option value="qmcEditFeed"><?php echo __('&nbsp;&nbsp;Edit this feed') ?></option>
c4a36709 149 <!-- <option value="qmcClearFeed"><?php echo __('&nbsp;&nbsp;Clear articles') ?></option> -->
9a85081a 150 <option value="qmcRescoreFeed"><?php echo __('&nbsp;&nbsp;Rescore feed') ?></option>
d1db26aa 151 <option value="qmcRemoveFeed"><?php echo __('&nbsp;&nbsp;Unsubscribe') ?></option>
6b4163cb 152 <option disabled>--------</option>
d1db26aa 153 <option style="color : #5050aa" disabled><?php echo __('All feeds:') ?></option>
d1db26aa
AD
154 <option value="qmcCatchupAll"><?php echo __('&nbsp;&nbsp;Mark as read') ?></option>
155 <option value="qmcShowOnlyUnread"><?php echo __('&nbsp;&nbsp;(Un)hide read feeds') ?></option>
6b4163cb 156 <option disabled>--------</option>
d1db26aa
AD
157 <option style="color : #5050aa" disabled><?php echo __('Other actions:') ?></option>
158 <option value="qmcAddFilter"><?php echo __('&nbsp;&nbsp;Create filter') ?></option>
d16a5159 159 <option value="qmcResetUI"><?php echo __('&nbsp;&nbsp;Reset UI layout') ?></option>
9d393c84 160 <option value="qmcResetCats"><?php echo __('&nbsp;&nbsp;Reset category order') ?></option>
d16a5159 161
238eff01 162 <option value="qmcHKhelp"><?php echo __('&nbsp;&nbsp;Keyboard shortcuts') ?></option>
6b4163cb
AD
163 </select>
164 </div>
5238347d 165
e6312f6c 166 <form id="main_toolbar_form" onsubmit='return false'>
5238347d 167
8389b150 168 <input type="submit" value="&lt;&lt;"
8a8f7c55 169 id="collapse_feeds_btn" onclick="collapse_feedlist()" class="button"
8389b150
AD
170 title="<?php echo __('Collapse feedlist') ?>" style="display : none">
171
172 <input type="submit" value="<?php echo __("Toggle Feedlist") ?>"
8a8f7c55 173 id="toggle_feeds_btn" class="button"
24c1e1c1
AD
174 onclick="toggle_feedlist()" style="display : none">
175
58daed52
AD
176 &nbsp;
177
feead173
AD
178 <?php if (get_pref($link, 'ENABLE_SEARCH_TOOLBAR')) { ?>
179
d1db26aa 180 <?php echo __('Search:') ?>
3dc8ee84 181 <input name="query" type="search"
6e6504bc 182 onKeyPress="return filterCR(event, viewCurrentFeed)"
b0005823 183 onblur="javascript:enableHotkeys();" onfocus="javascript:disableHotkeys();">
8551c73a 184
feead173
AD
185 <?php } ?>
186
3c2d7945 187 <select name="view_mode" onchange="viewModeChanged()">
d1db26aa
AD
188 <option selected value="adaptive"><?php echo __('Adaptive') ?></option>
189 <option value="all_articles"><?php echo __('All Articles') ?></option>
190 <option value="marked"><?php echo __('Starred') ?></option>
191 <option value="unread"><?php echo __('Unread') ?></option>
7b4d02a8 192 <!-- <option value="noscores"><?php echo __('Ignore Scoring') ?></option> -->
f0601b87 193 </select>
7b4d02a8 194
45c8c7a6 195 <?php echo __('Order:') ?>
7b4d02a8
AD
196
197 <select name="order_by" onchange="viewModeChanged()">
198 <option selected value="default"><?php echo __('Default') ?></option>
199 <option value="date"><?php echo __('Date') ?></option>
200 <option value="title"><?php echo __('Title') ?></option>
201 <option value="score"><?php echo __('Score') ?></option>
202 </select>
203
204
d1db26aa 205 <?php echo __('Limit:') ?>
1d3a17c7 206 <?php
86b682ce 207 $limits = array(15 => 15, 30 => 30, 60 => 60, 0 => "All");
f1b9a8ee 208
86b682ce 209 $def_art_limit = get_pref($link, 'DEFAULT_ARTICLE_LIMIT');
cb1083a1 210
86b682ce
AD
211 if ($def_art_limit >= 0 && !array_key_exists($def_art_limit, $limits)) {
212 $limits[$def_art_limit] = $def_art_limit;
213 }
1572afe5 214
86b682ce
AD
215 asort($limits);
216
217 if (!$def_art_limit) {
218 $def_art_limit = 30;
219 }
220
221 print_select_hash("limit", $def_art_limit, $limits,
3c2d7945 222 'onchange="viewLimitChanged()"');
86b682ce
AD
223
224 ?>
2df7a749
AD
225
226 &nbsp;
227
228 <input class="button" type="submit"
229 onclick="return viewCurrentFeed('ForceUpdate')"
d1db26aa 230 value="<?php echo __('Update') ?>">
2df7a749 231
86b682ce 232 </form>
1572afe5 233
86b682ce
AD
234 <!-- &nbsp;<input class="button" type="submit"
235 onclick="quickMenuGo('qmcSearch')" value="Search (tmp)"> -->
1572afe5 236
11befbb2
AD
237 <!-- <input class="button" type="submit"
238 onclick="catchupCurrentFeed()" value="Mark as read"> -->
f0601b87 239
6b4163cb
AD
240 </div>
241
80e4dc34 242<?php if (!get_pref($link, 'COMBINED_DISPLAY_MODE')) { ?>
b76affe9 243 <div id="headlines-frame" class="headlines_normal">
d1db26aa 244 <div class="whiteBox"><?php echo __('No feed selected.') ?></div></div>
17042fc0 245 <div id="content-frame">
91cdbe52 246 <div id="resize-grabber"
94047498 247 onmouseover="enable_resize(true)" onmouseout="enable_resize(false)"
17042fc0
AD
248 title="<?php echo __('Drag me to resize panels') ?>">
249 <img src="images/resize_handle_horiz.png" id="resize-handle"
250 onmouseover="enable_resize(true)" onmouseout="enable_resize(false)"
251 alt="">
252 </div>
253 <div id="content-insert">&nbsp;</div>
254 <!-- <div class="whiteBox">&nbsp;</div> --> </div>
80e4dc34 255<?php } else { ?>
b76affe9 256 <div id="headlines-frame" class="headlines_cdm">
d1db26aa 257 <div class="whiteBox"><?php echo __('No feed selected.') ?></div></div>
80e4dc34 258<?php } ?>
6b4163cb 259
c2625f8e 260<div id="footer">
461766f3
AD
261 <?php if (defined('_DEBUG_USER_SWITCH')) { ?>
262 <select id="userSwitch" onchange="userSwitch()">
263 <?php
264 foreach (array('admin', 'fox', 'test') as $u) {
265 $op_sel = ($u == $_SESSION["name"]) ? "selected" : "";
266 print "<option $op_sel>$u</option>";
267 }
268 ?>
269 </select>
aff31ecf 270 <?php } ?>
8865bdc0
AD
271 <a href="http://tt-rss.org/">Tiny Tiny RSS</a>
272 <?php if (!defined('HIDE_VERSION')) { ?>
273 v<?php echo VERSION ?>
274 <?php } ?>
275 &copy; 2005&ndash;2008 <a href="http://bah.org.ru/">Andrew Dolgov</a>
c2625f8e 276</div>
1cd17194 277
1d3a17c7 278<?php db_close($link); ?>
1cd17194 279
97dcd654
AD
280<script type="text/javascript">
281 /* for IE */
282 function statechange() {
283 if (document.readyState == "interactive") init();
284 }
285
286 if (document.readyState) {
287 if (document.readyState == "interactive" || document.readyState == "complete") {
288 init();
289 } else {
290 document.onreadystatechange = statechange;
291 }
292 }
293</script>
294
1cd17194
AD
295</body>
296</html>