]>
Commit | Line | Data |
---|---|---|
ef8be8ea AD |
1 | <?php |
2 | function module_popup_dialog($link) { | |
b4e75b2a AD |
3 | $id = $_REQUEST["id"]; |
4 | $param = db_escape_string($_REQUEST["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 | ||
73495fd1 AD |
11 | print "<div class=\"errorExplained\">"; |
12 | ||
ef16ae37 | 13 | if ($param == 1) { |
73495fd1 | 14 | print __("Update daemon is enabled in configuration, but daemon process is not running, which prevents all feeds from updating. Please start the daemon process or contact instance owner."); |
f6854e44 AD |
15 | |
16 | $stamp = (int)read_stampfile("update_daemon.stamp"); | |
17 | ||
18 | print "<p>" . __("Last update:") . " " . date("Y.m.d, G:i", $stamp); | |
19 | ||
ef16ae37 AD |
20 | } |
21 | ||
d9fa39f1 | 22 | if ($param == 2) { |
73495fd1 | 23 | $msg = check_for_update($link); |
4d1d0a45 AD |
24 | |
25 | if (!$msg) { | |
73495fd1 | 26 | print __("You are running the latest version of Tiny Tiny RSS. The fact that you are seeing this dialog is probably a bug."); |
4d1d0a45 AD |
27 | } else { |
28 | print $msg; | |
29 | } | |
d9fa39f1 AD |
30 | |
31 | } | |
32 | ||
8e00ae9b | 33 | if ($param == 3) { |
73495fd1 | 34 | print __("Update daemon is taking too long to perform a feed update. This could indicate a problem like crash or a hang. Please check the daemon process or contact instance owner."); |
f6854e44 AD |
35 | |
36 | $stamp = (int)read_stampfile("update_daemon.stamp"); | |
37 | ||
38 | print "<p>" . __("Last update:") . " " . date("Y.m.d, G:i", $stamp); | |
39 | ||
8e00ae9b AD |
40 | } |
41 | ||
ef16ae37 | 42 | print "</div>"; |
73495fd1 | 43 | |
ef16ae37 AD |
44 | print "<div align='center'>"; |
45 | ||
73495fd1 AD |
46 | print "<input class=\"button\" |
47 | type=\"submit\" onclick=\"return visitOfficialSite()\" | |
48 | value=\"".__('Visit official site')."\"> "; | |
49 | ||
ef16ae37 AD |
50 | print "<input class=\"button\" |
51 | type=\"submit\" onclick=\"return closeInfoBox()\" | |
cc17c205 | 52 | value=\"".__('Close this window')."\">"; |
ef16ae37 | 53 | |
73495fd1 | 54 | print "</div></div>"; |
ef16ae37 | 55 | |
5e6f933a | 56 | return; |
ef16ae37 AD |
57 | } |
58 | ||
ef8be8ea AD |
59 | if ($id == "quickAddFeed") { |
60 | ||
ecace165 | 61 | print "<div id=\"infoBoxTitle\">".__('Subscribe to Feed')."</div>"; |
ef8be8ea AD |
62 | print "<div class=\"infoBoxContents\">"; |
63 | ||
e6312f6c | 64 | print "<form id='feed_add_form' onsubmit='return false'>"; |
ef8be8ea AD |
65 | |
66 | print "<input type=\"hidden\" name=\"op\" value=\"pref-feeds\">"; | |
ef8be8ea | 67 | print "<input type=\"hidden\" name=\"subop\" value=\"add\">"; |
442d77f1 | 68 | print "<input type=\"hidden\" name=\"from\" value=\"tt-rss\">"; |
ef8be8ea | 69 | |
ecace165 AD |
70 | print "<div class=\"dlgSec\">".__("Feed")."</div>"; |
71 | print "<div class=\"dlgSecCont\">"; | |
72 | ||
73 | print __("URL:") . " "; | |
74 | ||
f88c7814 | 75 | print "<input size=\"40\" |
18ab3d7a | 76 | onkeypress=\"return filterCR(event, subscribeToFeed)\" |
f88c7814 | 77 | name=\"feed_url\"></td></tr>"; |
ecace165 AD |
78 | |
79 | print "<br/>"; | |
80 | ||
ef8be8ea | 81 | if (get_pref($link, 'ENABLE_FEED_CATS')) { |
ecace165 | 82 | print __('Place in category:') . " "; |
ef8be8ea | 83 | print_feed_cat_select($link, "cat_id"); |
ef8be8ea AD |
84 | } |
85 | ||
ecace165 AD |
86 | print "</div>"; |
87 | ||
b9073cd9 | 88 | print "<div id='fadd_login_container' style='display:none'> |
ecace165 AD |
89 | |
90 | <div class=\"dlgSec\">".__("Authentication")."</div> | |
91 | <div class=\"dlgSecCont\">". | |
92 | ||
93 | __('Login:') . " <input name='auth_login' size=\"20\" | |
ecace165 AD |
94 | onkeypress=\"return filterCR(event, subscribeToFeed)\"> ". |
95 | __('Password:') . "<input type='password' | |
96 | name='auth_pass' size=\"20\" | |
ecace165 AD |
97 | onkeypress=\"return filterCR(event, subscribeToFeed)\"> |
98 | </div></div>"; | |
99 | ||
100 | ||
101 | print "<div style=\"clear : both\"> | |
102 | <input type=\"checkbox\" id=\"fadd_login_check\" | |
103 | onclick='checkboxToggleElement(this, \"fadd_login_container\")'> | |
104 | <label for=\"fadd_login_check\">". | |
105 | __('This feed requires authentication.')."</div>"; | |
f27de515 | 106 | |
ef8be8ea AD |
107 | print "</form>"; |
108 | ||
ecace165 | 109 | print "<div class=\"dlgButtons\"> |
f88c7814 AD |
110 | <button class=\"button\" id=\"fadd_submit_btn\" |
111 | onclick=\"return subscribeToFeed()\">".__('Subscribe')."</button> | |
112 | <button onclick=\"return browseFeeds()\">".__('More feeds')."</button> | |
113 | <button onclick=\"return closeInfoBox()\">".__('Cancel')."</button></div>"; | |
ecace165 | 114 | |
5e6f933a | 115 | return; |
ef8be8ea AD |
116 | } |
117 | ||
118 | if ($id == "search") { | |
119 | ||
cc17c205 | 120 | print "<div id=\"infoBoxTitle\">".__('Search')."</div>"; |
ef8be8ea AD |
121 | print "<div class=\"infoBoxContents\">"; |
122 | ||
e6312f6c | 123 | print "<form id='search_form' onsubmit='return false'>"; |
ef8be8ea | 124 | |
b4e75b2a | 125 | #$active_feed_id = db_escape_string($_REQUEST["param"]); |
ef8be8ea | 126 | |
b4e75b2a | 127 | $params = split(":", db_escape_string($_REQUEST["param"])); |
ef8be8ea AD |
128 | |
129 | $active_feed_id = sprintf("%d", $params[0]); | |
130 | $is_cat = $params[1] == "true"; | |
131 | ||
de85cac2 | 132 | print "<div class=\"dlgSec\">".__('Look for')."</div>"; |
5bac8c29 AD |
133 | |
134 | print "<div class=\"dlgSecCont\">"; | |
135 | ||
ad491d75 | 136 | print "<input name=\"query\" size=\"20\" type=\"search\" value=''>"; |
5bac8c29 | 137 | |
b1710666 | 138 | print " " . __('match on')." "; |
5bac8c29 AD |
139 | |
140 | $search_fields = array( | |
141 | "title" => __("Title"), | |
142 | "content" => __("Content"), | |
143 | "both" => __("Title or content")); | |
144 | ||
145 | print_select_hash("match_on", 3, $search_fields); | |
146 | ||
147 | ||
148 | print "<br/>".__('Limit search to:')." "; | |
ef8be8ea AD |
149 | |
150 | print "<select name=\"search_mode\"> | |
cc17c205 | 151 | <option value=\"all_feeds\">".__('All feeds')."</option>"; |
ef8be8ea AD |
152 | |
153 | $feed_title = getFeedTitle($link, $active_feed_id); | |
154 | ||
155 | if (!$is_cat) { | |
156 | $feed_cat_title = getFeedCatTitle($link, $active_feed_id); | |
157 | } else { | |
158 | $feed_cat_title = getCategoryTitle($link, $active_feed_id); | |
159 | } | |
160 | ||
161 | if ($active_feed_id && !$is_cat) { | |
cc17c205 | 162 | print "<option selected value=\"this_feed\">$feed_title</option>"; |
ef8be8ea | 163 | } else { |
cc17c205 | 164 | print "<option disabled>".__('This feed')."</option>"; |
ef8be8ea AD |
165 | } |
166 | ||
167 | if ($is_cat) { | |
168 | $cat_preselected = "selected"; | |
169 | } | |
170 | ||
171 | if (get_pref($link, 'ENABLE_FEED_CATS') && ($active_feed_id > 0 || $is_cat)) { | |
cc17c205 | 172 | print "<option $cat_preselected value=\"this_cat\">$feed_cat_title</option>"; |
ef8be8ea | 173 | } else { |
c4b0f96c | 174 | //print "<option disabled>".__('This category')."</option>"; |
ef8be8ea AD |
175 | } |
176 | ||
5bac8c29 | 177 | print "</select>"; |
ef8be8ea | 178 | |
5bac8c29 | 179 | print "</div>"; |
ef8be8ea AD |
180 | |
181 | print "</form>"; | |
182 | ||
5bac8c29 | 183 | print "<div class=\"dlgButtons\"> |
ad491d75 AD |
184 | <button disabled='true' onclick=\"javascript:search()\">".__('Search')."</button> |
185 | <button onclick=\"javascript:searchCancel()\">".__('Cancel')."</button> | |
186 | </div>"; | |
ef8be8ea AD |
187 | |
188 | print "</div>"; | |
189 | ||
5e6f933a AD |
190 | return; |
191 | ||
ef8be8ea AD |
192 | } |
193 | ||
ef8be8ea AD |
194 | if ($id == "quickAddFilter") { |
195 | ||
b4e75b2a | 196 | $active_feed_id = db_escape_string($_REQUEST["param"]); |
ef8be8ea | 197 | |
ecace165 | 198 | print "<div id=\"infoBoxTitle\">".__('Create Filter')."</div>"; |
ef8be8ea AD |
199 | print "<div class=\"infoBoxContents\">"; |
200 | ||
e6312f6c | 201 | print "<form id=\"filter_add_form\" onsubmit='return false'>"; |
ef8be8ea AD |
202 | |
203 | print "<input type=\"hidden\" name=\"op\" value=\"pref-filters\">"; | |
204 | print "<input type=\"hidden\" name=\"quiet\" value=\"1\">"; | |
205 | print "<input type=\"hidden\" name=\"subop\" value=\"add\">"; | |
ef8be8ea AD |
206 | |
207 | $result = db_query($link, "SELECT id,description | |
208 | FROM ttrss_filter_types ORDER BY description"); | |
209 | ||
210 | $filter_types = array(); | |
211 | ||
212 | while ($line = db_fetch_assoc($result)) { | |
213 | //array_push($filter_types, $line["description"]); | |
89cb787e | 214 | $filter_types[$line["id"]] = __($line["description"]); |
ef8be8ea AD |
215 | } |
216 | ||
10fa6615 AD |
217 | print "<div class=\"dlgSec\">".__("Match")."</div>"; |
218 | ||
219 | print "<div class=\"dlgSecCont\">"; | |
220 | ||
d0da85c2 | 221 | print "<span id=\"filter_dlg_date_mod_box\" style=\"display : none\">"; |
6e278744 | 222 | print __("Date") . " "; |
44d0e774 AD |
223 | |
224 | $filter_params = array( | |
225 | "before" => __("before"), | |
226 | "after" => __("after")); | |
227 | ||
228 | print_select_hash("filter_date_modifier", "before", $filter_params); | |
229 | ||
230 | print " </span>"; | |
d0da85c2 | 231 | |
8df90057 | 232 | print "<input onkeypress=\"return filterCR(event, createFilter)\" |
ad491d75 | 233 | name=\"reg_exp\" size=\"30\" value=\"$reg_exp\">"; |
10fa6615 | 234 | |
6e278744 | 235 | print "<span id=\"filter_dlg_date_chk_box\" style=\"display : none\">"; |
d0da85c2 AD |
236 | print " <input class=\"button\" |
237 | type=\"submit\" onclick=\"return filterDlgCheckDate()\" | |
6e278744 | 238 | value=\"".__('Check it')."\">"; |
d0da85c2 AD |
239 | print "</span>"; |
240 | ||
241 | print "<br/> " . __("on field") . " "; | |
242 | print_select_hash("filter_type", 1, $filter_types, | |
243 | 'onchange="filterDlgCheckType(this)"'); | |
10fa6615 AD |
244 | |
245 | print "<br/>"; | |
246 | ||
247 | print __("in") . " "; | |
248 | print_feed_select($link, "feed_id", $active_feed_id); | |
249 | ||
250 | print "</div>"; | |
251 | ||
ecace165 | 252 | print "<div class=\"dlgSec\">".__("Perform Action")."</div>"; |
10fa6615 AD |
253 | |
254 | print "<div class=\"dlgSecCont\">"; | |
255 | ||
256 | print "<select name=\"action_id\" | |
257 | onchange=\"filterDlgCheckAction(this)\">"; | |
258 | ||
259 | $result = db_query($link, "SELECT id,description FROM ttrss_filter_actions | |
260 | ORDER BY name"); | |
261 | ||
262 | while ($line = db_fetch_assoc($result)) { | |
263 | printf("<option value='%d'>%s</option>", $line["id"], __($line["description"])); | |
264 | } | |
265 | ||
266 | print "</select>"; | |
267 | ||
143a4973 AD |
268 | print "<span id=\"filter_dlg_param_box\" style=\"display : none\">"; |
269 | print " " . __("with parameters:") . " "; | |
270 | print "<input size=\"20\" | |
074bf20c | 271 | onkeypress=\"return filterCR(event, createFilter)\" |
143a4973 | 272 | name=\"action_param\">"; |
6427a306 AD |
273 | |
274 | print_label_select($link, "action_param_label", $action_param); | |
275 | ||
143a4973 | 276 | print "</span>"; |
10fa6615 | 277 | |
143a4973 | 278 | print " "; // tiny layout hack |
10fa6615 AD |
279 | |
280 | print "</div>"; | |
281 | ||
282 | print "<div class=\"dlgSec\">".__("Options")."</div>"; | |
283 | print "<div class=\"dlgSecCont\">"; | |
284 | ||
ecace165 AD |
285 | print "<div style=\"line-height : 100%\">"; |
286 | ||
10fa6615 AD |
287 | print "<input type=\"checkbox\" name=\"enabled\" id=\"enabled\" checked=\"1\"> |
288 | <label for=\"enabled\">".__('Enabled')."</label><br/>"; | |
289 | ||
290 | print "<input type=\"checkbox\" name=\"inverse\" id=\"inverse\"> | |
291 | <label for=\"inverse\">".__('Inverse match')."</label>"; | |
292 | ||
293 | print "</div>"; | |
ecace165 | 294 | print "</div>"; |
10fa6615 | 295 | |
ef8be8ea AD |
296 | print "</form>"; |
297 | ||
10fa6615 | 298 | print "<div class=\"dlgButtons\">"; |
ef8be8ea | 299 | |
ad491d75 AD |
300 | print "<button onclick=\"return createFilter()\">". |
301 | __('Create')."</button> "; | |
ef8be8ea | 302 | |
ad491d75 AD |
303 | print "<button onclick=\"return closeInfoBox()\">".__('Cancel'). |
304 | "</button>"; | |
ef8be8ea AD |
305 | |
306 | print "</div>"; | |
307 | ||
308 | // print "</td></tr></table>"; | |
309 | ||
5e6f933a | 310 | return; |
ef8be8ea AD |
311 | } |
312 | ||
a3656a41 AD |
313 | if ($id == "feedUpdateErrors") { |
314 | ||
cc17c205 | 315 | print "<div id=\"infoBoxTitle\">".__('Update Errors')."</div>"; |
a3656a41 AD |
316 | print "<div class=\"infoBoxContents\">"; |
317 | ||
cc17c205 | 318 | print __("These feeds have not been updated because of errors:"); |
a3656a41 AD |
319 | |
320 | $result = db_query($link, "SELECT id,title,feed_url,last_error | |
321 | FROM ttrss_feeds WHERE last_error != '' AND owner_uid = ".$_SESSION["uid"]); | |
322 | ||
e8dd519b | 323 | print "<ul class='feedErrorsList'>"; |
a3656a41 AD |
324 | |
325 | while ($line = db_fetch_assoc($result)) { | |
326 | print "<li><b>" . $line["title"] . "</b> (" . $line["feed_url"] . "): " . | |
327 | "<em>" . $line["last_error"] . "</em>"; | |
328 | } | |
329 | ||
330 | print "</ul>"; | |
a3656a41 AD |
331 | |
332 | print "<div align='center'>"; | |
333 | ||
334 | print "<input class=\"button\" | |
335 | type=\"submit\" onclick=\"return closeInfoBox()\" | |
cc17c205 | 336 | value=\"".__('Close')."\">"; |
a3656a41 AD |
337 | |
338 | print "</div>"; | |
339 | ||
aa330b93 | 340 | return; |
a3656a41 AD |
341 | } |
342 | ||
0b126ac2 AD |
343 | if ($id == "editArticleTags") { |
344 | ||
cc17c205 | 345 | print "<div id=\"infoBoxTitle\">".__('Edit Tags')."</div>"; |
0b126ac2 AD |
346 | print "<div class=\"infoBoxContents\">"; |
347 | ||
e6312f6c | 348 | print "<form id=\"tag_edit_form\" onsubmit='return false'>"; |
0b126ac2 | 349 | |
cc17c205 | 350 | print __("Tags for this article (separated by commas):")."<br>"; |
0b126ac2 AD |
351 | |
352 | $tags = get_article_tags($link, $param); | |
353 | ||
354 | $tags_str = join(", ", $tags); | |
355 | ||
d62a3b63 AD |
356 | print "<table width='100%'>"; |
357 | ||
358 | print "<tr><td colspan='2'><input type=\"hidden\" name=\"id\" value=\"$param\"></td></tr>"; | |
359 | ||
05fcdf52 AD |
360 | print "<tr><td colspan='2'><textarea rows='4' class='iedit' id='tags_str' |
361 | name='tags_str'>$tags_str</textarea> | |
362 | <div class=\"autocomplete\" id=\"tags_choices\" | |
363 | style=\"display:none\"></div> | |
364 | </td></tr>"; | |
d62a3b63 | 365 | |
05fcdf52 | 366 | /* print "<tr><td>".__('Add existing tag:')."</td>"; |
0b126ac2 | 367 | |
d62a3b63 AD |
368 | $result = db_query($link, "SELECT DISTINCT tag_name FROM ttrss_tags |
369 | WHERE owner_uid = '".$_SESSION["uid"]."' ORDER BY tag_name"); | |
370 | ||
371 | $found_tags = array(); | |
372 | ||
373 | array_push($found_tags, ''); | |
374 | ||
375 | while ($line = db_fetch_assoc($result)) { | |
e4609ea9 | 376 | array_push($found_tags, truncate_string($line["tag_name"], 20)); |
d62a3b63 AD |
377 | } |
378 | ||
379 | print "<td align='right'>"; | |
380 | ||
381 | print_select("found_tags", '', $found_tags, "onchange=\"javascript:editTagsInsert()\""); | |
382 | ||
05fcdf52 | 383 | print "</td>"; |
d62a3b63 | 384 | |
05fcdf52 | 385 | print "</tr>"; */ |
d62a3b63 AD |
386 | |
387 | print "</table>"; | |
0b126ac2 AD |
388 | |
389 | print "</form>"; | |
390 | ||
391 | print "<div align='right'>"; | |
392 | ||
393 | print "<input class=\"button\" | |
394 | type=\"submit\" onclick=\"return editTagsSave()\" | |
cc17c205 | 395 | value=\"".__('Save')."\"> "; |
0b126ac2 AD |
396 | |
397 | print "<input class=\"button\" | |
398 | type=\"submit\" onclick=\"return closeInfoBox()\" | |
cc17c205 | 399 | value=\"".__('Cancel')."\">"; |
0b126ac2 AD |
400 | |
401 | ||
402 | print "</div>"; | |
403 | ||
5e6f933a | 404 | return; |
0b126ac2 AD |
405 | } |
406 | ||
0979b696 | 407 | if ($id == "printTagCloud") { |
27258a90 | 408 | print "<div id=\"infoBoxTitle\">".__('Tag cloud')."</div>"; |
0979b696 AD |
409 | print "<div class=\"infoBoxContents\">"; |
410 | ||
dcac082b | 411 | print __("Showing most popular tags ")." (<a |
326469fc | 412 | href='javascript:toggleTags(true)'>".__('more tags')."</a>):<br/>"; |
0979b696 AD |
413 | |
414 | print "<div class=\"tagCloudContainer\">"; | |
415 | ||
416 | printTagCloud($link); | |
417 | ||
418 | print "</div>"; | |
419 | ||
420 | print "<div align='center'>"; | |
421 | print "<input class=\"button\" | |
422 | type=\"submit\" onclick=\"return closeInfoBox()\" | |
3076c7b8 | 423 | value=\"".__('Close this window')."\">"; |
0979b696 AD |
424 | print "</div>"; |
425 | ||
426 | print "</div>"; | |
427 | ||
428 | return; | |
429 | } | |
430 | ||
51f6f917 | 431 | /* if ($id == "offlineDownload") { |
87b16a0a AD |
432 | print "<div id=\"infoBoxTitle\">".__('Download articles')."</div>"; |
433 | print "<div class=\"infoBoxContents\">"; | |
434 | ||
435 | print "<form name='download_ops_form' id='download_ops_form'>"; | |
436 | ||
437 | print "<div class=\"dlgSec\">".__("Download")."</div>"; | |
438 | ||
439 | print "<div class=\"dlgSecCont\">"; | |
440 | ||
441 | $amount = array( | |
442 | 50 => 50, | |
443 | 100 => 100, | |
fe8f2f0c AD |
444 | 250 => 250, |
445 | 500 => 500); | |
87b16a0a AD |
446 | |
447 | print_select_hash("amount", 50, $amount); | |
448 | ||
6a2034f9 | 449 | print " " . __("latest articles for offline reading."); |
87b16a0a | 450 | |
6a1cd591 AD |
451 | print "<br/>"; |
452 | ||
453 | print "<input checked='yes' type='checkbox' name='unread_only' id='unread_only'>"; | |
454 | print "<label for='unread_only'>".__('Only include unread articles')."</label>"; | |
455 | ||
87b16a0a AD |
456 | print "</div>"; |
457 | ||
458 | print "</form>"; | |
459 | ||
460 | print "<div class=\"dlgButtons\"> | |
6a2034f9 AD |
461 | <input class=\"button\" |
462 | type=\"submit\" onclick=\"return initiate_offline_download(0, this)\" value=\"".__('Download')."\"> | |
87b16a0a AD |
463 | <input class=\"button\" |
464 | type=\"submit\" onclick=\"return closeInfoBox()\" | |
465 | value=\"".__('Cancel')."\"></div>"; | |
466 | ||
467 | print "</div>"; | |
468 | ||
469 | return; | |
51f6f917 | 470 | } */ |
87b16a0a AD |
471 | |
472 | ||
5e6f933a AD |
473 | print "<div id='infoBoxTitle'>Internal Error</div> |
474 | <div id='infoBoxContents'> | |
475 | <p>Unknown dialog <b>$id</b></p> | |
476 | </div></div>"; | |
477 | ||
ef8be8ea AD |
478 | } |
479 | ?> |