]> git.wh0rd.org - tt-rss.git/blob - tt-rss.php
rework actions
[tt-rss.git] / tt-rss.php
1 <?
2 session_start();
3
4 require_once "sanity_check.php";
5 require_once "version.php";
6 require_once "config.php";
7 require_once "db-prefs.php";
8 require_once "functions.php";
9
10 $link = db_connect(DB_HOST, DB_USER, DB_PASS, DB_NAME);
11
12 login_sequence($link);
13
14 ?>
15 <html>
16 <head>
17 <title>Tiny Tiny RSS</title>
18
19 <link rel="stylesheet" type="text/css" href="tt-rss.css">
20
21 <? $user_theme = $_SESSION["theme"];
22 if ($user_theme) { ?>
23 <link rel="stylesheet" type="text/css" href="themes/<?= $user_theme ?>/theme.css">
24 <? } ?>
25
26 <? $user_css_url = get_pref($link, 'USER_STYLESHEET_URL'); ?>
27 <? if ($user_css_url) { ?>
28 <link type="text/css" href="<?= $user_css_url ?>"/>
29 <? } ?>
30
31 <? if (get_pref($link, 'USE_COMPACT_STYLESHEET')) { ?>
32
33 <link rel="stylesheet" href="tt-rss_compact.css" type="text/css">
34
35 <? } else { ?>
36
37 <link title="Compact Stylesheet" rel="alternate stylesheet"
38 type="text/css" href="tt-rss_compact.css"/>
39
40 <? } ?>
41
42 <script type="text/javascript" src="functions.js"></script>
43 <script type="text/javascript" src="tt-rss.js"></script>
44 <!--[if gte IE 5.5000]>
45 <script type="text/javascript" src="pngfix.js"></script>
46 <link rel="stylesheet" type="text/css" href="tt-rss-ie.css">
47 <![endif]-->
48 <meta http-equiv="Content-Type" content="text/html; charset=utf-8">
49 </head>
50
51 <body onload="init()">
52
53 <table width="100%" height="100%" cellspacing="0" cellpadding="0" class="main">
54 <? if (get_pref($link, 'DISPLAY_HEADER')) { ?>
55 <tr>
56 <td colspan="2" class="headerBox">
57 <table cellspacing="0" cellpadding="0" width="100%"><tr>
58 <td rowspan="2" class="header" valign="middle">
59 <img src="images/ttrss_logo.png" alt="logo">
60 </td>
61 <td valign="top" class="notifyBox">
62 <div id="notify"><span id="notify_body">&nbsp;</span></div>
63 </td>
64
65 <div id="userDlgShadow"><div id="userDlg">&nbsp;</div></div>
66
67 </tr><tr><td class="welcomePrompt">
68 <? if (!SINGLE_USER_MODE) { ?>
69 Hello, <b><?= $_SESSION["name"] ?></b>
70 (<a href="logout.php">Logout</a>)
71 <? } ?>
72 </td>
73 </tr></table>
74 </td>
75 </tr>
76 <? } else { ?>
77 <tr>
78 <td class="small">
79 <div id="notify"><span id="notify_body">&nbsp;</span></div>
80 <div id="userDlgShadow"><div id="userDlg">&nbsp;</div></div>
81 </td><td class="welcomePrompt">
82 <? if (!SINGLE_USER_MODE) { ?>
83 Hello, <b><?= $_SESSION["name"] ?></b>
84 (<a href="logout.php">Logout</a>)
85 <? } ?>
86 </td></tr>
87 <? } ?>
88 <tr>
89 <? if (get_pref($link, 'COMBINED_DISPLAY_MODE'))
90 $feeds_rowspan = 2;
91 else
92 $feeds_rowspan = 3; ?>
93 <td valign="top" rowspan="<?= $feeds_rowspan ?>" class="feeds">
94 <table class="innerFeedTable"
95 cellspacing="0" cellpadding="0" height="100%" width="100%">
96 <tr><td>
97 <div id="dispSwitch">
98 <a id="dispSwitchPrompt" href="javascript:toggleTags()">display tags</a>
99 </div>
100 </td></tr>
101 <tr><td height="100%" width="100%" valign="top">
102
103 <? if (get_pref($link, 'DISPLAY_FEEDLIST_ACTIONS')) { ?>
104
105 <iframe frameborder="0"
106 src="backend.php?op=error&msg=Loading,%20please wait..."
107 id="feeds-frame" name="feeds-frame" class="feedsFrameWithActions"> </iframe>
108
109 <div align="center">
110
111 <select id="allFeedsChooser" onchange="allFeedsMenuChange()">
112 <option selected>All feeds...</option>
113 <option>Update</option>
114 <option>Mark as read</option>
115 <option>Show only unread</option>
116 </select>
117
118 </div>
119
120 <? } else { ?>
121
122 <iframe frameborder="0"
123 src="backend.php?op=error&msg=Loading,%20please wait..."
124 id="feeds-frame" name="feeds-frame" class="feedsFrame"> </iframe>
125
126 <? } ?>
127
128 </td></tr></table>
129
130 </td>
131 <td valign="top" class="headlinesToolbarBox">
132 <table width="100%" cellpadding="0" cellspacing="0">
133
134 <tr><td class="headlinesToolbar" id="headlinesToolbar">
135
136 <? if (get_pref($link, 'ENABLE_SEARCH_TOOLBAR')) { ?>
137
138 <input id="searchbox"
139 onblur="javascript:enableHotkeys()" onfocus="javascript:disableHotkeys()"
140 onchange="javascript:search()">
141 <select id="searchmodebox">
142 <option>This feed</option>
143 <option>All feeds</option>
144 </select>
145
146 <input type="submit"
147 class="button" onclick="javascript:search()" value="Search">
148
149 &nbsp;
150
151 <? } ?>
152
153 View:
154
155 <select id="viewbox" onchange="javascript:viewCurrentFeed(0, '')">
156 <option selected>Adaptive</option>
157 <option>All Articles</option>
158 <option>Starred</option>
159 <option>Unread</option>
160 </select>
161
162 &nbsp;Limit:
163
164 <select id="limitbox" onchange="javascript:viewCurrentFeed(0, '')">
165
166 <?
167 $limits = array(15 => 15, 30 => 30, 60 => 60);
168
169 $def_art_limit = get_pref($link, 'DEFAULT_ARTICLE_LIMIT');
170
171 if ($def_art_limit >= 0 && !array_key_exists($def_art_limit, $limits)) {
172 $limits[$def_art_limit] = $def_art_limit;
173 }
174
175 asort($limits);
176 array_push($limits, 0);
177
178 if (!$def_art_limit) {
179 $def_art_limit = 30;
180 }
181
182 foreach ($limits as $key) {
183 print "<option";
184 if ($key == $def_art_limit) { print " selected"; }
185 print ">";
186
187 if ($limits[$key] == 0) { print "All"; } else { print $limits[$key]; }
188
189 print "</option>";
190 } ?>
191
192 </select>
193
194 <!-- &nbsp;Selection:
195
196 <select id="headopbox">
197 <option id="hopToggleRead">Toggle (un)read</option>
198 </select>
199
200 <input class="button" type="submit" onclick="headopGo()" value="Go"> -->
201
202 &nbsp;Feed: <input class="button" type="submit"
203 onclick="javascript:viewCurrentFeed(0, 'ForceUpdate')" value="Update">
204
205 <input class="button" type="submit" id="btnMarkFeedAsRead"
206 onclick="javascript:viewCurrentFeed(0, 'MarkAllRead')" value="Mark as read">
207
208 </td>
209 <td align="right">
210 <select id="quickMenuChooser" onchange="quickMenuChange()">
211 <option id="qmcDefault" selected>Actions...</option>
212 <option id="qmcPrefs">Preferences</option>
213 <option id="qmcSearch">Search</option>
214 <option disabled>--------</option>
215 <option style="color : #5050aa" disabled>Feed actions:</option>
216 <option id="qmcAddFeed">&nbsp;&nbsp;Add new feed</option>
217 <option id="qmcRemoveFeed">&nbsp;&nbsp;Remove this feed</option>
218 <!-- <option>Edit this feed</option> -->
219 <option disabled>--------</option>
220 <option style="color : #5050aa" disabled>All feeds:</option>
221 <option id="qmcUpdateFeeds">&nbsp;&nbsp;Update</option>
222 <option id="qmcCatchupAll">&nbsp;&nbsp;Mark as read</option>
223 <option id="qmcShowOnlyUnread">&nbsp;&nbsp;Show only unread</option>
224 <option disabled>--------</option>
225 <option style="color : #5050aa" disabled>Other actions:</option>
226 <option id="qmcAddFilter">&nbsp;&nbsp;Add filter</option>
227 </select>
228 </td>
229 </tr>
230 </table>
231 </td>
232 </tr>
233 <? if (get_pref($link, 'COMBINED_DISPLAY_MODE')) { ?>
234 <tr>
235 <td id="headlines" class="headlines2" valign="top">
236 <iframe frameborder="0" name="headlines-frame"
237 id="headlines-frame" class="headlinesFrame"
238 src="backend.php?op=error&msg=No%20feed%20selected."></iframe>
239 </td>
240 </tr>
241 <? } else { ?>
242 <tr>
243 <td id="headlines" class="headlines" valign="top">
244 <iframe frameborder="0" name="headlines-frame"
245 id="headlines-frame" class="headlinesFrame"
246 src="backend.php?op=error&msg=No%20feed%20selected."></iframe>
247 </td>
248 </tr><tr>
249 <td class="content" id="content" valign="top">
250 <iframe frameborder="0" name="content-frame"
251 id="content-frame" class="contentFrame"> </iframe>
252 </td>
253 </tr>
254 <? } ?>
255 <? if (get_pref($link, 'DISPLAY_FOOTER')) { ?>
256 <tr>
257 <td colspan="2" class="footer">
258 <a href="http://tt-rss.spb.ru/">Tiny-Tiny RSS</a> v<?= VERSION ?> &copy; 2005 Andrew Dolgov
259 <? if (WEB_DEMO_MODE) { ?>
260 <br>Running in demo mode, some functionality is disabled.
261 <? } ?>
262 </td>
263 </td>
264 <? } ?>
265 </table>
266
267 <? db_close($link); ?>
268
269 </body>
270 </html>