]>
Commit | Line | Data |
---|---|---|
ef8be8ea AD |
1 | <?php |
2 | function module_popup_dialog($link) { | |
3 | $id = $_GET["id"]; | |
0b126ac2 | 4 | $param = db_escape_string($_GET["param"]); |
ef8be8ea | 5 | |
ef16ae37 AD |
6 | if ($id == "explainError") { |
7 | ||
cc17c205 | 8 | print "<div id=\"infoBoxTitle\">".__('Notice')."</div>"; |
ef16ae37 AD |
9 | print "<div class=\"infoBoxContents\">"; |
10 | ||
11 | if ($param == 1) { | |
cc17c205 | 12 | print __("Update daemon is enabled in configuration, but daemon |
ef16ae37 AD |
13 | process is not running, which prevents all feeds from updating. Please |
14 | start the daemon process or contact instance owner."); | |
15 | } | |
16 | ||
d9fa39f1 | 17 | if ($param == 2) { |
4d1d0a45 AD |
18 | $msg = check_for_update($link, false); |
19 | ||
20 | if (!$msg) { | |
cc17c205 | 21 | print __("You are running the latest version of Tiny Tiny RSS. The |
4d1d0a45 AD |
22 | fact that you are seeing this dialog is probably a bug."); |
23 | } else { | |
24 | print $msg; | |
25 | } | |
d9fa39f1 AD |
26 | |
27 | } | |
28 | ||
8e00ae9b AD |
29 | if ($param == 3) { |
30 | print __("TT-RSS has detected that update daemon is taking too long to | |
31 | perform a feed update. This could indicate a problem like crash | |
32 | or a hang. Please check the daemon process or contact instance | |
33 | owner."); | |
34 | } | |
35 | ||
ef16ae37 AD |
36 | print "</div>"; |
37 | ||
38 | print "<div align='center'>"; | |
39 | ||
40 | print "<input class=\"button\" | |
41 | type=\"submit\" onclick=\"return closeInfoBox()\" | |
cc17c205 | 42 | value=\"".__('Close this window')."\">"; |
ef16ae37 AD |
43 | |
44 | print "</div>"; | |
45 | ||
5e6f933a | 46 | return; |
ef16ae37 AD |
47 | } |
48 | ||
ef8be8ea AD |
49 | if ($id == "quickAddFeed") { |
50 | ||
cc17c205 | 51 | print "<div id=\"infoBoxTitle\">".__('Subscribe to feed')."</div>"; |
ef8be8ea AD |
52 | print "<div class=\"infoBoxContents\">"; |
53 | ||
e6312f6c | 54 | print "<form id='feed_add_form' onsubmit='return false'>"; |
ef8be8ea AD |
55 | |
56 | print "<input type=\"hidden\" name=\"op\" value=\"pref-feeds\">"; | |
365f95dc | 57 | /* print "<input type=\"hidden\" name=\"quiet\" value=\"1\">"; */ |
ef8be8ea | 58 | print "<input type=\"hidden\" name=\"subop\" value=\"add\">"; |
442d77f1 | 59 | print "<input type=\"hidden\" name=\"from\" value=\"tt-rss\">"; |
ef8be8ea AD |
60 | |
61 | print "<table width='100%'> | |
62 | <tr><td>Feed URL:</td><td> | |
63 | <input class=\"iedit\" onblur=\"javascript:enableHotkeys()\" | |
5e6f933a | 64 | onkeypress=\"return filterCR(event, qaddFeed)\" |
ef8be8ea | 65 | onkeyup=\"toggleSubmitNotEmpty(this, 'fadd_submit_btn')\" |
b5015f72 | 66 | onchange=\"toggleSubmitNotEmpty(this, 'fadd_submit_btn')\" |
ef8be8ea AD |
67 | onfocus=\"javascript:disableHotkeys()\" name=\"feed_url\"></td></tr>"; |
68 | ||
69 | if (get_pref($link, 'ENABLE_FEED_CATS')) { | |
cc17c205 | 70 | print "<tr><td>".__('Category:')."</td><td>"; |
ef8be8ea AD |
71 | print_feed_cat_select($link, "cat_id"); |
72 | print "</td></tr>"; | |
73 | } | |
74 | ||
21f4756a AD |
75 | /* print "<tr><td colspan='2'><div class='insensitive'>"; |
76 | ||
77 | print __("Some feeds require authentication. If you subscribe to such | |
78 | feed, you will have to enter your login and password in Feed Editor"); | |
79 | ||
80 | print "</div></td></tr>"; */ | |
81 | ||
ef8be8ea | 82 | print "</table>"; |
f27de515 AD |
83 | |
84 | print "<div id='fadd_login_prompt'><br/> | |
85 | <a href='javascript:showBlockElement(\"fadd_login_container\", | |
86 | \"fadd_login_prompt\")'>Click here if this feed requires authentication.</a></div>"; | |
87 | ||
88 | print "<div id='fadd_login_container'> | |
89 | <table width='100%'> | |
90 | <tr><td>Login:</td><td><input name='auth_login' class='iedit'></td></tr> | |
91 | <tr><td>Password:</td><td><input type='password' | |
92 | name='auth_pass' class='iedit'></td></tr> | |
93 | </table> | |
94 | </div>"; | |
95 | ||
ef8be8ea AD |
96 | print "</form>"; |
97 | ||
98 | print "<div align='right'> | |
99 | <input class=\"button\" | |
100 | id=\"fadd_submit_btn\" disabled=\"true\" | |
5e6f933a | 101 | type=\"submit\" onclick=\"return qaddFeed()\" value=\"".__('Subscribe')."\"> |
ef8be8ea AD |
102 | <input class=\"button\" |
103 | type=\"submit\" onclick=\"return closeInfoBox()\" | |
cc17c205 | 104 | value=\"".__('Cancel')."\"></div>"; |
5e6f933a AD |
105 | |
106 | return; | |
ef8be8ea AD |
107 | } |
108 | ||
109 | if ($id == "search") { | |
110 | ||
cc17c205 | 111 | print "<div id=\"infoBoxTitle\">".__('Search')."</div>"; |
ef8be8ea AD |
112 | print "<div class=\"infoBoxContents\">"; |
113 | ||
e6312f6c | 114 | print "<form id='search_form' onsubmit='return false'>"; |
ef8be8ea AD |
115 | |
116 | #$active_feed_id = db_escape_string($_GET["param"]); | |
117 | ||
118 | $params = split(":", db_escape_string($_GET["param"])); | |
119 | ||
120 | $active_feed_id = sprintf("%d", $params[0]); | |
121 | $is_cat = $params[1] == "true"; | |
122 | ||
cc17c205 | 123 | print "<table width='100%'><tr><td>".__('Search:')."</td><td>"; |
ef8be8ea AD |
124 | |
125 | print "<input name=\"query\" class=\"iedit\" | |
126 | onkeypress=\"return filterCR(event, search)\" | |
b5015f72 | 127 | onchange=\"toggleSubmitNotEmpty(this, 'search_submit_btn')\" |
ef8be8ea AD |
128 | onkeyup=\"toggleSubmitNotEmpty(this, 'search_submit_btn')\" |
129 | value=\"\"> | |
130 | </td></tr>"; | |
131 | ||
cc17c205 | 132 | print "<tr><td>".__('Where:')."</td><td>"; |
ef8be8ea AD |
133 | |
134 | print "<select name=\"search_mode\"> | |
cc17c205 | 135 | <option value=\"all_feeds\">".__('All feeds')."</option>"; |
ef8be8ea AD |
136 | |
137 | $feed_title = getFeedTitle($link, $active_feed_id); | |
138 | ||
139 | if (!$is_cat) { | |
140 | $feed_cat_title = getFeedCatTitle($link, $active_feed_id); | |
141 | } else { | |
142 | $feed_cat_title = getCategoryTitle($link, $active_feed_id); | |
143 | } | |
144 | ||
145 | if ($active_feed_id && !$is_cat) { | |
cc17c205 | 146 | print "<option selected value=\"this_feed\">$feed_title</option>"; |
ef8be8ea | 147 | } else { |
cc17c205 | 148 | print "<option disabled>".__('This feed')."</option>"; |
ef8be8ea AD |
149 | } |
150 | ||
151 | if ($is_cat) { | |
152 | $cat_preselected = "selected"; | |
153 | } | |
154 | ||
155 | if (get_pref($link, 'ENABLE_FEED_CATS') && ($active_feed_id > 0 || $is_cat)) { | |
cc17c205 | 156 | print "<option $cat_preselected value=\"this_cat\">$feed_cat_title</option>"; |
ef8be8ea | 157 | } else { |
c4b0f96c | 158 | //print "<option disabled>".__('This category')."</option>"; |
ef8be8ea AD |
159 | } |
160 | ||
161 | print "</select></td></tr>"; | |
162 | ||
cc17c205 | 163 | print "<tr><td>".__('Match on:')."</td><td>"; |
ef8be8ea AD |
164 | |
165 | $search_fields = array( | |
cc17c205 AD |
166 | "title" => __("Title"), |
167 | "content" => __("Content"), | |
168 | "both" => __("Title or content")); | |
ef8be8ea AD |
169 | |
170 | print_select_hash("match_on", 3, $search_fields); | |
171 | ||
172 | print "</td></tr></table>"; | |
173 | ||
174 | print "</form>"; | |
175 | ||
176 | print "<div align=\"right\"> | |
177 | <input type=\"submit\" | |
178 | class=\"button\" onclick=\"javascript:search()\" | |
179 | id=\"search_submit_btn\" disabled=\"true\" | |
cc17c205 | 180 | value=\"".__('Search')."\"> |
ef8be8ea AD |
181 | <input class=\"button\" |
182 | type=\"submit\" onclick=\"javascript:searchCancel()\" | |
cc17c205 | 183 | value=\"".__('Cancel')."\"></div>"; |
ef8be8ea AD |
184 | |
185 | print "</div>"; | |
186 | ||
5e6f933a AD |
187 | return; |
188 | ||
ef8be8ea AD |
189 | } |
190 | ||
191 | if ($id == "quickAddLabel") { | |
cc17c205 | 192 | print "<div id=\"infoBoxTitle\">".__('Create label')."</div>"; |
ef8be8ea AD |
193 | print "<div class=\"infoBoxContents\">"; |
194 | ||
e6312f6c | 195 | print "<form id=\"label_edit_form\" onsubmit='return false'>"; |
ef8be8ea AD |
196 | |
197 | print "<input type=\"hidden\" name=\"op\" value=\"pref-labels\">"; | |
198 | print "<input type=\"hidden\" name=\"subop\" value=\"add\">"; | |
199 | ||
200 | print "<table width='100%'>"; | |
201 | ||
cc17c205 | 202 | print "<tr><td>".__('Caption:')."</td> |
ef8be8ea | 203 | <td><input onkeypress=\"return filterCR(event, addLabel)\" |
b5015f72 AD |
204 | onkeyup=\"toggleSubmitNotEmpty(this, 'infobox_submit')\" |
205 | onchange=\"toggleSubmitNotEmpty(this, 'infobox_submit')\" | |
206 | name=\"description\" class=\"iedit\">"; | |
ef8be8ea AD |
207 | |
208 | print "</td></tr>"; | |
209 | ||
210 | print "<tr><td colspan=\"2\"> | |
cc17c205 | 211 | <p>".__('SQL Expression:')."</p>"; |
ef8be8ea AD |
212 | |
213 | print "<textarea onkeyup=\"toggleSubmitNotEmpty(this, 'infobox_submit')\" | |
214 | rows=\"4\" name=\"sql_exp\" class=\"iedit\"></textarea>"; | |
215 | ||
216 | print "</td></tr></table>"; | |
217 | ||
218 | print "</form>"; | |
219 | ||
220 | print "<div style=\"display : none\" id=\"label_test_result\"></div>"; | |
221 | ||
222 | print "<div align='right'>"; | |
223 | ||
cc17c205 | 224 | print "<input type=\"submit\" onclick=\"labelTest()\" value=\"".__('Test')."\"> |
ef8be8ea AD |
225 | "; |
226 | ||
227 | print "<input type=\"submit\" | |
228 | id=\"infobox_submit\" | |
229 | disabled=\"true\" | |
230 | class=\"button\" onclick=\"return addLabel()\" | |
cc17c205 | 231 | value=\"".__('Create')."\"> "; |
ef8be8ea AD |
232 | |
233 | print "<input class=\"button\" | |
234 | type=\"submit\" onclick=\"return labelEditCancel()\" | |
cc17c205 | 235 | value=\"".__('Cancel')."\">"; |
5e6f933a AD |
236 | |
237 | return; | |
ef8be8ea AD |
238 | } |
239 | ||
240 | if ($id == "quickAddFilter") { | |
241 | ||
242 | $active_feed_id = db_escape_string($_GET["param"]); | |
243 | ||
cc17c205 | 244 | print "<div id=\"infoBoxTitle\">".__('Create filter')."</div>"; |
ef8be8ea AD |
245 | print "<div class=\"infoBoxContents\">"; |
246 | ||
e6312f6c | 247 | print "<form id=\"filter_add_form\" onsubmit='return false'>"; |
ef8be8ea AD |
248 | |
249 | print "<input type=\"hidden\" name=\"op\" value=\"pref-filters\">"; | |
250 | print "<input type=\"hidden\" name=\"quiet\" value=\"1\">"; | |
251 | print "<input type=\"hidden\" name=\"subop\" value=\"add\">"; | |
252 | ||
253 | // print "<div class=\"notice\"><b>Note:</b> filter will only apply to new articles.</div>"; | |
254 | ||
255 | $result = db_query($link, "SELECT id,description | |
256 | FROM ttrss_filter_types ORDER BY description"); | |
257 | ||
258 | $filter_types = array(); | |
259 | ||
260 | while ($line = db_fetch_assoc($result)) { | |
261 | //array_push($filter_types, $line["description"]); | |
262 | $filter_types[$line["id"]] = $line["description"]; | |
263 | } | |
264 | ||
265 | print "<table width='100%'>"; | |
266 | ||
cc17c205 | 267 | print "<tr><td>".__('Match:')."</td> |
ef8be8ea | 268 | <td><input onkeypress=\"return filterCR(event, qaddFilter)\" |
b5015f72 AD |
269 | onkeyup=\"toggleSubmitNotEmpty(this, 'infobox_submit')\" |
270 | onchange=\"toggleSubmitNotEmpty(this, 'infobox_submit')\" | |
8011ac36 AD |
271 | name=\"reg_exp\" class=\"iedit\">"; |
272 | ||
cc17c205 | 273 | print "</td></tr><tr><td>".__('On field:')."</td><td>"; |
8011ac36 AD |
274 | |
275 | print_select_hash("filter_type", 1, $filter_types, "class=\"_iedit\""); | |
ef8be8ea AD |
276 | |
277 | print "</td></tr>"; | |
cc17c205 | 278 | print "<tr><td>".__('Feed:')."</td><td colspan='2'>"; |
ef8be8ea AD |
279 | |
280 | print_feed_select($link, "feed_id", $active_feed_id); | |
281 | ||
282 | print "</td></tr>"; | |
283 | ||
cc17c205 | 284 | print "<tr><td>".__('Action:')."</td>"; |
ef8be8ea | 285 | |
073ca0e6 AD |
286 | print "<td colspan='2'><select name=\"action_id\" |
287 | onchange=\"filterDlgCheckAction(this)\">"; | |
ef8be8ea AD |
288 | |
289 | $result = db_query($link, "SELECT id,description FROM ttrss_filter_actions | |
290 | ORDER BY name"); | |
291 | ||
292 | while ($line = db_fetch_assoc($result)) { | |
293 | printf("<option value='%d'>%s</option>", $line["id"], $line["description"]); | |
294 | } | |
295 | ||
296 | print "</select>"; | |
297 | ||
073ca0e6 AD |
298 | print "</td></tr>"; |
299 | ||
cc17c205 | 300 | print "<tr><td>".__('Params:')."</td>"; |
073ca0e6 AD |
301 | |
302 | print "<td><input disabled class='iedit' name='action_param'></td></tr>"; | |
303 | ||
cc17c205 | 304 | print "<tr><td valign='top'>".__('Options:')."</td><td>"; |
3f2ff803 AD |
305 | |
306 | print "<input type=\"checkbox\" name=\"inverse\" id=\"inverse\"> | |
cc17c205 | 307 | <label for=\"inverse\">".__('Inverse match')."</label></td></tr>"; |
3f2ff803 | 308 | |
073ca0e6 | 309 | print "</table>"; |
ef8be8ea AD |
310 | |
311 | print "</form>"; | |
312 | ||
313 | print "<div align='right'>"; | |
314 | ||
315 | print "<input type=\"submit\" | |
316 | id=\"infobox_submit\" | |
5e6f933a | 317 | class=\"button\" onclick=\"return addFilter()\" |
cc17c205 | 318 | disabled=\"true\" value=\"".__('Create')."\"> "; |
ef8be8ea AD |
319 | |
320 | print "<input class=\"button\" | |
321 | type=\"submit\" onclick=\"return closeInfoBox()\" | |
cc17c205 | 322 | value=\"".__('Cancel')."\">"; |
ef8be8ea AD |
323 | |
324 | print "</div>"; | |
325 | ||
326 | // print "</td></tr></table>"; | |
327 | ||
5e6f933a | 328 | return; |
ef8be8ea AD |
329 | } |
330 | ||
a3656a41 AD |
331 | if ($id == "feedUpdateErrors") { |
332 | ||
cc17c205 | 333 | print "<div id=\"infoBoxTitle\">".__('Update Errors')."</div>"; |
a3656a41 AD |
334 | print "<div class=\"infoBoxContents\">"; |
335 | ||
cc17c205 | 336 | print __("These feeds have not been updated because of errors:"); |
a3656a41 AD |
337 | |
338 | $result = db_query($link, "SELECT id,title,feed_url,last_error | |
339 | FROM ttrss_feeds WHERE last_error != '' AND owner_uid = ".$_SESSION["uid"]); | |
340 | ||
e8dd519b | 341 | print "<ul class='feedErrorsList'>"; |
a3656a41 AD |
342 | |
343 | while ($line = db_fetch_assoc($result)) { | |
344 | print "<li><b>" . $line["title"] . "</b> (" . $line["feed_url"] . "): " . | |
345 | "<em>" . $line["last_error"] . "</em>"; | |
346 | } | |
347 | ||
348 | print "</ul>"; | |
349 | print "</div>"; | |
350 | ||
351 | print "<div align='center'>"; | |
352 | ||
353 | print "<input class=\"button\" | |
354 | type=\"submit\" onclick=\"return closeInfoBox()\" | |
cc17c205 | 355 | value=\"".__('Close')."\">"; |
a3656a41 AD |
356 | |
357 | print "</div>"; | |
358 | ||
aa330b93 | 359 | return; |
a3656a41 AD |
360 | } |
361 | ||
0b126ac2 AD |
362 | if ($id == "editArticleTags") { |
363 | ||
cc17c205 | 364 | print "<div id=\"infoBoxTitle\">".__('Edit Tags')."</div>"; |
0b126ac2 AD |
365 | print "<div class=\"infoBoxContents\">"; |
366 | ||
e6312f6c | 367 | print "<form id=\"tag_edit_form\" onsubmit='return false'>"; |
0b126ac2 | 368 | |
cc17c205 | 369 | print __("Tags for this article (separated by commas):")."<br>"; |
0b126ac2 AD |
370 | |
371 | $tags = get_article_tags($link, $param); | |
372 | ||
373 | $tags_str = join(", ", $tags); | |
374 | ||
d62a3b63 AD |
375 | print "<table width='100%'>"; |
376 | ||
377 | print "<tr><td colspan='2'><input type=\"hidden\" name=\"id\" value=\"$param\"></td></tr>"; | |
378 | ||
379 | print "<tr><td colspan='2'><textarea rows='4' class='iedit' name='tags_str'>$tags_str</textarea></td></tr>"; | |
380 | ||
cc17c205 | 381 | print "<tr><td>".__('Add existing tag:')."</td>"; |
0b126ac2 | 382 | |
d62a3b63 AD |
383 | $result = db_query($link, "SELECT DISTINCT tag_name FROM ttrss_tags |
384 | WHERE owner_uid = '".$_SESSION["uid"]."' ORDER BY tag_name"); | |
385 | ||
386 | $found_tags = array(); | |
387 | ||
388 | array_push($found_tags, ''); | |
389 | ||
390 | while ($line = db_fetch_assoc($result)) { | |
e4609ea9 | 391 | array_push($found_tags, truncate_string($line["tag_name"], 20)); |
d62a3b63 AD |
392 | } |
393 | ||
394 | print "<td align='right'>"; | |
395 | ||
396 | print_select("found_tags", '', $found_tags, "onchange=\"javascript:editTagsInsert()\""); | |
397 | ||
398 | print "</td>"; | |
399 | ||
400 | print "</tr>"; | |
401 | ||
402 | print "</table>"; | |
0b126ac2 AD |
403 | |
404 | print "</form>"; | |
405 | ||
406 | print "<div align='right'>"; | |
407 | ||
408 | print "<input class=\"button\" | |
409 | type=\"submit\" onclick=\"return editTagsSave()\" | |
cc17c205 | 410 | value=\"".__('Save')."\"> "; |
0b126ac2 AD |
411 | |
412 | print "<input class=\"button\" | |
413 | type=\"submit\" onclick=\"return closeInfoBox()\" | |
cc17c205 | 414 | value=\"".__('Cancel')."\">"; |
0b126ac2 AD |
415 | |
416 | ||
417 | print "</div>"; | |
418 | ||
5e6f933a | 419 | return; |
0b126ac2 AD |
420 | } |
421 | ||
0979b696 | 422 | if ($id == "printTagCloud") { |
27258a90 | 423 | print "<div id=\"infoBoxTitle\">".__('Tag cloud')."</div>"; |
0979b696 AD |
424 | print "<div class=\"infoBoxContents\">"; |
425 | ||
dcac082b | 426 | print __("Showing most popular tags ")." (<a |
27258a90 | 427 | href='javascript:toggleTags(true)'>".__('browse all')."</a>):<br/>"; |
0979b696 AD |
428 | |
429 | print "<div class=\"tagCloudContainer\">"; | |
430 | ||
431 | printTagCloud($link); | |
432 | ||
433 | print "</div>"; | |
434 | ||
435 | print "<div align='center'>"; | |
436 | print "<input class=\"button\" | |
437 | type=\"submit\" onclick=\"return closeInfoBox()\" | |
438 | value=\"".__('Close')."\">"; | |
439 | print "</div>"; | |
440 | ||
441 | print "</div>"; | |
442 | ||
443 | return; | |
444 | } | |
445 | ||
5e6f933a AD |
446 | print "<div id='infoBoxTitle'>Internal Error</div> |
447 | <div id='infoBoxContents'> | |
448 | <p>Unknown dialog <b>$id</b></p> | |
449 | </div></div>"; | |
450 | ||
ef8be8ea AD |
451 | } |
452 | ?> |