]>
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 | |
b6a6e262 AD |
6 | if ($id == "importOpml") { |
7 | print "<div id=\"infoBoxTitle\">".__('OPML Import')."</div>"; | |
8 | print "<div class=\"infoBoxContents\">"; | |
9 | ||
10 | print "<div class=\"prefFeedCatHolder\">"; | |
11 | ||
12 | $owner_uid = $_SESSION["uid"]; | |
13 | ||
14 | db_query($link, "BEGIN"); | |
15 | ||
16 | /* create Imported feeds category just in case */ | |
17 | ||
18 | $result = db_query($link, "SELECT id FROM | |
19 | ttrss_feed_categories WHERE title = 'Imported feeds' AND | |
20 | owner_uid = '$owner_uid' LIMIT 1"); | |
21 | ||
22 | if (db_num_rows($result) == 0) { | |
23 | db_query($link, "INSERT INTO ttrss_feed_categories | |
24 | (title,owner_uid) | |
25 | VALUES ('Imported feeds', '$owner_uid')"); | |
26 | } | |
27 | ||
28 | db_query($link, "COMMIT"); | |
29 | ||
30 | /* Handle OPML import by DOMXML/DOMDocument */ | |
31 | ||
32 | if (function_exists('domxml_open_file')) { | |
33 | print "<ul class='nomarks'>"; | |
34 | print "<li>".__("Importing using DOMXML.")."</li>"; | |
35 | require_once "modules/opml_domxml.php"; | |
36 | opml_import_domxml($link, $owner_uid); | |
37 | print "</ul>"; | |
38 | } else if (PHP_VERSION >= 5) { | |
39 | print "<ul class='nomarks'>"; | |
40 | print "<li>".__("Importing using DOMDocument.")."</li>"; | |
41 | require_once "modules/opml_domdoc.php"; | |
42 | opml_import_domdoc($link, $owner_uid); | |
43 | print "</ul>"; | |
44 | } else { | |
45 | print_error(__("DOMXML extension is not found. It is required for PHP versions below 5.")); | |
46 | } | |
47 | ||
48 | print "</div>"; | |
49 | ||
50 | print "<div align='center'>"; | |
51 | ||
52 | print "<input class=\"button\" | |
53 | type=\"submit\" onclick=\"return opmlImportDone()\" | |
54 | value=\"".__('Close this window')."\">"; | |
55 | ||
56 | print "</div>"; | |
57 | ||
58 | print "<script type=\"text/javascript\">"; | |
59 | print "parent.opml_import_handler(this)"; | |
60 | print "</script>"; | |
61 | ||
62 | print "</div></div>"; | |
63 | ||
64 | return; | |
65 | } | |
66 | ||
d9084cf2 AD |
67 | if ($id == "editPrefProfiles") { |
68 | ||
69 | print "<div id=\"infoBoxTitle\">".__('Settings Profiles')."</div>"; | |
70 | print "<div class=\"infoBoxContents\">"; | |
71 | ||
72 | print "<div><input id=\"fadd_profile\" | |
73 | onkeypress=\"return filterCR(event, addPrefProfile)\" | |
74 | size=\"40\"> | |
75 | <button onclick=\"javascript:addPrefProfile()\">". | |
76 | __('Create profile')."</button></div>"; | |
77 | ||
78 | print "<p>"; | |
79 | ||
80 | $result = db_query($link, "SELECT title,id FROM ttrss_settings_profiles | |
47179c0e | 81 | WHERE owner_uid = ".$_SESSION["uid"]." ORDER BY title"); |
d9084cf2 AD |
82 | |
83 | print __('Select:')." | |
84 | <a href=\"javascript:selectPrefRows('fcat', true)\">".__('All')."</a>, | |
85 | <a href=\"javascript:selectPrefRows('fcat', false)\">".__('None')."</a>"; | |
86 | ||
87 | print "<div class=\"prefFeedCatHolder\">"; | |
88 | ||
89 | print "<form id=\"profile_edit_form\" onsubmit=\"return false\">"; | |
90 | ||
91 | print "<table width=\"100%\" class=\"prefFeedCatList\" | |
92 | cellspacing=\"0\" id=\"prefFeedCatList\">"; | |
93 | ||
94 | print "<tr class=\"odd\" id=\"FCATR-0\">"; | |
95 | ||
96 | print "<td width='5%' align='center'><input | |
97 | onclick='toggleSelectPrefRow(this, \"fcat\");' | |
98 | type=\"checkbox\" id=\"FCCHK-0\"></td>"; | |
99 | ||
ac9dbf85 AD |
100 | if (!$_SESSION["profile"]) { |
101 | $is_active = __("(active)"); | |
102 | } else { | |
103 | $is_active = ""; | |
104 | } | |
105 | ||
d9084cf2 | 106 | print "<td><span id=\"FCATT-0\">" . |
ac9dbf85 | 107 | __("Default profile") . " $is_active</span></td>"; |
d9084cf2 AD |
108 | |
109 | print "</tr>"; | |
110 | ||
111 | $lnum = 1; | |
112 | ||
113 | while ($line = db_fetch_assoc($result)) { | |
114 | ||
115 | $class = ($lnum % 2) ? "even" : "odd"; | |
116 | ||
117 | $cat_id = $line["id"]; | |
118 | $this_row_id = "id=\"FCATR-$cat_id\""; | |
119 | ||
120 | print "<tr class=\"$class\" $this_row_id>"; | |
121 | ||
122 | $edit_title = htmlspecialchars($line["title"]); | |
123 | ||
124 | print "<td width='5%' align='center'><input | |
125 | onclick='toggleSelectPrefRow(this, \"fcat\");' | |
126 | type=\"checkbox\" id=\"FCCHK-$cat_id\"></td>"; | |
127 | ||
128 | if ($_SESSION["profile"] == $line["id"]) { | |
129 | $is_active = __("(active)"); | |
130 | } else { | |
131 | $is_active = ""; | |
132 | } | |
133 | ||
134 | print "<td><span id=\"FCATT-$cat_id\">" . | |
135 | $edit_title . "</span> $is_active</td>"; | |
136 | ||
137 | print "</tr>"; | |
138 | ||
139 | ++$lnum; | |
140 | } | |
141 | ||
142 | print "</table>"; | |
143 | print "</form>"; | |
144 | print "</div>"; | |
145 | ||
146 | print "<div class='dlgButtons'> | |
147 | <div style='float : left'> | |
148 | <button onclick=\"return removeSelectedPrefProfiles()\">". | |
149 | __('Remove')."</button> | |
150 | <input class=\"button\" | |
151 | type=\"submit\" onclick=\"return activatePrefProfile()\" | |
152 | value=\"".__('Activate')."\"> | |
153 | </div>"; | |
154 | ||
155 | print "<input class=\"button\" | |
156 | type=\"submit\" onclick=\"return closeInfoBox()\" | |
157 | value=\"".__('Close this window')."\">"; | |
158 | ||
159 | print "</div></div>"; | |
160 | ||
161 | return; | |
162 | } | |
163 | ||
cf9dc032 AD |
164 | if ($id == "pubUrl") { |
165 | ||
166 | print "<div id=\"infoBoxTitle\">".__('Published Articles')."</div>"; | |
167 | print "<div class=\"infoBoxContents\">"; | |
168 | ||
169 | $url_path = article_publish_url($link); | |
170 | ||
171 | print __("Your Published articles feed URL is:"); | |
172 | ||
173 | print "<div class=\"tagCloudContainer\">"; | |
174 | print "<a id='pub_feed_url' href='$url_path' target='_blank'>$url_path</a>"; | |
175 | print "</div>"; | |
176 | ||
177 | print "<div align='center'>"; | |
178 | ||
179 | print "<button onclick=\"return pubRegenKey()\">". | |
180 | __('Generate new URL')."</button> "; | |
181 | ||
182 | print "<input class=\"button\" | |
183 | type=\"submit\" onclick=\"return closeInfoBox()\" | |
184 | value=\"".__('Close this window')."\">"; | |
185 | ||
186 | print "</div></div>"; | |
187 | ||
188 | return; | |
189 | } | |
190 | ||
ef16ae37 AD |
191 | if ($id == "explainError") { |
192 | ||
cc17c205 | 193 | print "<div id=\"infoBoxTitle\">".__('Notice')."</div>"; |
ef16ae37 AD |
194 | print "<div class=\"infoBoxContents\">"; |
195 | ||
73495fd1 AD |
196 | print "<div class=\"errorExplained\">"; |
197 | ||
ef16ae37 | 198 | if ($param == 1) { |
73495fd1 | 199 | 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 |
200 | |
201 | $stamp = (int)read_stampfile("update_daemon.stamp"); | |
202 | ||
203 | print "<p>" . __("Last update:") . " " . date("Y.m.d, G:i", $stamp); | |
204 | ||
ef16ae37 AD |
205 | } |
206 | ||
d9fa39f1 | 207 | if ($param == 2) { |
73495fd1 | 208 | $msg = check_for_update($link); |
4d1d0a45 AD |
209 | |
210 | if (!$msg) { | |
73495fd1 | 211 | 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 |
212 | } else { |
213 | print $msg; | |
214 | } | |
d9fa39f1 AD |
215 | |
216 | } | |
217 | ||
8e00ae9b | 218 | if ($param == 3) { |
73495fd1 | 219 | 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 |
220 | |
221 | $stamp = (int)read_stampfile("update_daemon.stamp"); | |
222 | ||
223 | print "<p>" . __("Last update:") . " " . date("Y.m.d, G:i", $stamp); | |
224 | ||
8e00ae9b AD |
225 | } |
226 | ||
ef16ae37 | 227 | print "</div>"; |
73495fd1 | 228 | |
ef16ae37 AD |
229 | print "<div align='center'>"; |
230 | ||
73495fd1 AD |
231 | print "<input class=\"button\" |
232 | type=\"submit\" onclick=\"return visitOfficialSite()\" | |
233 | value=\"".__('Visit official site')."\"> "; | |
234 | ||
ef16ae37 AD |
235 | print "<input class=\"button\" |
236 | type=\"submit\" onclick=\"return closeInfoBox()\" | |
cc17c205 | 237 | value=\"".__('Close this window')."\">"; |
ef16ae37 | 238 | |
73495fd1 | 239 | print "</div></div>"; |
ef16ae37 | 240 | |
5e6f933a | 241 | return; |
ef16ae37 AD |
242 | } |
243 | ||
ef8be8ea AD |
244 | if ($id == "quickAddFeed") { |
245 | ||
ecace165 | 246 | print "<div id=\"infoBoxTitle\">".__('Subscribe to Feed')."</div>"; |
ef8be8ea AD |
247 | print "<div class=\"infoBoxContents\">"; |
248 | ||
e6312f6c | 249 | print "<form id='feed_add_form' onsubmit='return false'>"; |
ef8be8ea | 250 | |
a5819bb3 AD |
251 | print "<input type=\"hidden\" name=\"op\" value=\"rpc\">"; |
252 | print "<input type=\"hidden\" name=\"subop\" value=\"addfeed\">"; | |
253 | //print "<input type=\"hidden\" name=\"from\" value=\"tt-rss\">"; | |
ef8be8ea | 254 | |
ecace165 AD |
255 | print "<div class=\"dlgSec\">".__("Feed")."</div>"; |
256 | print "<div class=\"dlgSecCont\">"; | |
257 | ||
258 | print __("URL:") . " "; | |
259 | ||
f88c7814 | 260 | print "<input size=\"40\" |
18ab3d7a | 261 | onkeypress=\"return filterCR(event, subscribeToFeed)\" |
a5819bb3 | 262 | name=\"feed\" id=\"feed_url\"></td></tr>"; |
ecace165 AD |
263 | |
264 | print "<br/>"; | |
265 | ||
ef8be8ea | 266 | if (get_pref($link, 'ENABLE_FEED_CATS')) { |
ecace165 | 267 | print __('Place in category:') . " "; |
a5819bb3 | 268 | print_feed_cat_select($link, "cat"); |
ef8be8ea AD |
269 | } |
270 | ||
ecace165 AD |
271 | print "</div>"; |
272 | ||
b9073cd9 | 273 | print "<div id='fadd_login_container' style='display:none'> |
ecace165 AD |
274 | |
275 | <div class=\"dlgSec\">".__("Authentication")."</div> | |
276 | <div class=\"dlgSecCont\">". | |
277 | ||
a5819bb3 | 278 | __('Login:') . " <input name='login' size=\"20\" |
ecace165 AD |
279 | onkeypress=\"return filterCR(event, subscribeToFeed)\"> ". |
280 | __('Password:') . "<input type='password' | |
a5819bb3 | 281 | name='pass' size=\"20\" |
ecace165 AD |
282 | onkeypress=\"return filterCR(event, subscribeToFeed)\"> |
283 | </div></div>"; | |
284 | ||
285 | ||
286 | print "<div style=\"clear : both\"> | |
287 | <input type=\"checkbox\" id=\"fadd_login_check\" | |
288 | onclick='checkboxToggleElement(this, \"fadd_login_container\")'> | |
289 | <label for=\"fadd_login_check\">". | |
290 | __('This feed requires authentication.')."</div>"; | |
f27de515 | 291 | |
ef8be8ea AD |
292 | print "</form>"; |
293 | ||
ecace165 | 294 | print "<div class=\"dlgButtons\"> |
f88c7814 AD |
295 | <button class=\"button\" id=\"fadd_submit_btn\" |
296 | onclick=\"return subscribeToFeed()\">".__('Subscribe')."</button> | |
297 | <button onclick=\"return browseFeeds()\">".__('More feeds')."</button> | |
298 | <button onclick=\"return closeInfoBox()\">".__('Cancel')."</button></div>"; | |
ecace165 | 299 | |
5e6f933a | 300 | return; |
ef8be8ea AD |
301 | } |
302 | ||
ef88b1cc AD |
303 | if ($id == "feedBrowser") { |
304 | ||
305 | print "<div id=\"infoBoxTitle\">".__('Feed Browser')."</div>"; | |
306 | ||
307 | print "<div class=\"infoBoxContents\">"; | |
308 | ||
309 | $browser_search = db_escape_string($_REQUEST["search"]); | |
310 | ||
311 | print "<form onsubmit='return false;' display='inline' | |
312 | name='feed_browser' id='feed_browser'>"; | |
313 | ||
314 | print "<input type=\"hidden\" name=\"op\" value=\"rpc\">"; | |
315 | print "<input type=\"hidden\" name=\"subop\" value=\"updateFeedBrowser\">"; | |
316 | ||
317 | print " | |
318 | <div style='float : right'> | |
319 | <img style='display : none' | |
320 | id='feed_browser_spinner' src='images/indicator_white.gif'> | |
321 | <input name=\"search\" size=\"20\" type=\"search\" | |
322 | onchange=\"javascript:updateFeedBrowser()\" value=\"$browser_search\"> | |
323 | <button onclick=\"javascript:updateFeedBrowser()\">".__('Search')."</button> | |
324 | </div>"; | |
325 | ||
326 | print " <select name=\"mode\" onchange=\"updateFeedBrowser()\"> | |
327 | <option value='1'>" . __('Popular feeds') . "</option> | |
328 | <option value='2'>" . __('Feed archive') . "</option> | |
329 | </select> "; | |
330 | ||
331 | print __("limit:"); | |
332 | ||
333 | print " <select name=\"limit\" onchange='updateFeedBrowser()'>"; | |
334 | ||
335 | foreach (array(25, 50, 100, 200) as $l) { | |
336 | $issel = ($l == $limit) ? "selected" : ""; | |
337 | print "<option $issel>$l</option>"; | |
338 | } | |
339 | ||
340 | print "</select> "; | |
341 | ||
342 | print "<p>"; | |
343 | ||
344 | $owner_uid = $_SESSION["uid"]; | |
345 | ||
d9084cf2 AD |
346 | /* print __('Select:')." |
347 | <a href=\"javascript:selectPrefRows('fbrowse', true)\">".__('All')."</a>, | |
348 | <a href=\"javascript:selectPrefRows('fbrowse', false)\">".__('None')."</a>"; */ | |
349 | ||
ef88b1cc AD |
350 | print "<ul class='browseFeedList' id='browseFeedList'>"; |
351 | print_feed_browser($link, $search, 25); | |
352 | print "</ul>"; | |
353 | ||
354 | print "<div align='center'> | |
355 | <button onclick=\"feedBrowserSubscribe()\">".__('Subscribe')."</button> | |
d9084cf2 | 356 | <button style='display : none' id='feed_archive_remove' onclick=\"feedArchiveRemove()\">".__('Remove')."</button> |
ef88b1cc AD |
357 | <button onclick=\"closeInfoBox()\" >".__('Cancel')."</button></div>"; |
358 | ||
359 | print "</div>"; | |
360 | return; | |
361 | } | |
362 | ||
ef8be8ea AD |
363 | if ($id == "search") { |
364 | ||
cc17c205 | 365 | print "<div id=\"infoBoxTitle\">".__('Search')."</div>"; |
ef8be8ea AD |
366 | print "<div class=\"infoBoxContents\">"; |
367 | ||
e6312f6c | 368 | print "<form id='search_form' onsubmit='return false'>"; |
ef8be8ea | 369 | |
b4e75b2a | 370 | #$active_feed_id = db_escape_string($_REQUEST["param"]); |
ef8be8ea | 371 | |
b4e75b2a | 372 | $params = split(":", db_escape_string($_REQUEST["param"])); |
ef8be8ea AD |
373 | |
374 | $active_feed_id = sprintf("%d", $params[0]); | |
375 | $is_cat = $params[1] == "true"; | |
376 | ||
de85cac2 | 377 | print "<div class=\"dlgSec\">".__('Look for')."</div>"; |
5bac8c29 AD |
378 | |
379 | print "<div class=\"dlgSecCont\">"; | |
380 | ||
ad491d75 | 381 | print "<input name=\"query\" size=\"20\" type=\"search\" value=''>"; |
5bac8c29 | 382 | |
b1710666 | 383 | print " " . __('match on')." "; |
5bac8c29 AD |
384 | |
385 | $search_fields = array( | |
386 | "title" => __("Title"), | |
387 | "content" => __("Content"), | |
388 | "both" => __("Title or content")); | |
389 | ||
390 | print_select_hash("match_on", 3, $search_fields); | |
391 | ||
392 | ||
393 | print "<br/>".__('Limit search to:')." "; | |
ef8be8ea AD |
394 | |
395 | print "<select name=\"search_mode\"> | |
cc17c205 | 396 | <option value=\"all_feeds\">".__('All feeds')."</option>"; |
ef8be8ea AD |
397 | |
398 | $feed_title = getFeedTitle($link, $active_feed_id); | |
399 | ||
400 | if (!$is_cat) { | |
401 | $feed_cat_title = getFeedCatTitle($link, $active_feed_id); | |
402 | } else { | |
403 | $feed_cat_title = getCategoryTitle($link, $active_feed_id); | |
404 | } | |
405 | ||
406 | if ($active_feed_id && !$is_cat) { | |
cc17c205 | 407 | print "<option selected value=\"this_feed\">$feed_title</option>"; |
ef8be8ea | 408 | } else { |
cc17c205 | 409 | print "<option disabled>".__('This feed')."</option>"; |
ef8be8ea AD |
410 | } |
411 | ||
412 | if ($is_cat) { | |
413 | $cat_preselected = "selected"; | |
414 | } | |
415 | ||
416 | if (get_pref($link, 'ENABLE_FEED_CATS') && ($active_feed_id > 0 || $is_cat)) { | |
cc17c205 | 417 | print "<option $cat_preselected value=\"this_cat\">$feed_cat_title</option>"; |
ef8be8ea | 418 | } else { |
c4b0f96c | 419 | //print "<option disabled>".__('This category')."</option>"; |
ef8be8ea AD |
420 | } |
421 | ||
5bac8c29 | 422 | print "</select>"; |
ef8be8ea | 423 | |
5bac8c29 | 424 | print "</div>"; |
ef8be8ea AD |
425 | |
426 | print "</form>"; | |
427 | ||
5bac8c29 | 428 | print "<div class=\"dlgButtons\"> |
d60009cd | 429 | <button onclick=\"javascript:search()\">".__('Search')."</button> |
ad491d75 AD |
430 | <button onclick=\"javascript:searchCancel()\">".__('Cancel')."</button> |
431 | </div>"; | |
ef8be8ea AD |
432 | |
433 | print "</div>"; | |
434 | ||
5e6f933a AD |
435 | return; |
436 | ||
ef8be8ea AD |
437 | } |
438 | ||
ef8be8ea AD |
439 | if ($id == "quickAddFilter") { |
440 | ||
b4e75b2a | 441 | $active_feed_id = db_escape_string($_REQUEST["param"]); |
ef8be8ea | 442 | |
ecace165 | 443 | print "<div id=\"infoBoxTitle\">".__('Create Filter')."</div>"; |
ef8be8ea AD |
444 | print "<div class=\"infoBoxContents\">"; |
445 | ||
e6312f6c | 446 | print "<form id=\"filter_add_form\" onsubmit='return false'>"; |
ef8be8ea AD |
447 | |
448 | print "<input type=\"hidden\" name=\"op\" value=\"pref-filters\">"; | |
449 | print "<input type=\"hidden\" name=\"quiet\" value=\"1\">"; | |
450 | print "<input type=\"hidden\" name=\"subop\" value=\"add\">"; | |
ef8be8ea AD |
451 | |
452 | $result = db_query($link, "SELECT id,description | |
453 | FROM ttrss_filter_types ORDER BY description"); | |
454 | ||
455 | $filter_types = array(); | |
456 | ||
457 | while ($line = db_fetch_assoc($result)) { | |
458 | //array_push($filter_types, $line["description"]); | |
89cb787e | 459 | $filter_types[$line["id"]] = __($line["description"]); |
ef8be8ea AD |
460 | } |
461 | ||
10fa6615 AD |
462 | print "<div class=\"dlgSec\">".__("Match")."</div>"; |
463 | ||
464 | print "<div class=\"dlgSecCont\">"; | |
465 | ||
d0da85c2 | 466 | print "<span id=\"filter_dlg_date_mod_box\" style=\"display : none\">"; |
6e278744 | 467 | print __("Date") . " "; |
44d0e774 AD |
468 | |
469 | $filter_params = array( | |
470 | "before" => __("before"), | |
471 | "after" => __("after")); | |
472 | ||
473 | print_select_hash("filter_date_modifier", "before", $filter_params); | |
474 | ||
475 | print " </span>"; | |
d0da85c2 | 476 | |
8df90057 | 477 | print "<input onkeypress=\"return filterCR(event, createFilter)\" |
ad491d75 | 478 | name=\"reg_exp\" size=\"30\" value=\"$reg_exp\">"; |
10fa6615 | 479 | |
6e278744 | 480 | print "<span id=\"filter_dlg_date_chk_box\" style=\"display : none\">"; |
d0da85c2 AD |
481 | print " <input class=\"button\" |
482 | type=\"submit\" onclick=\"return filterDlgCheckDate()\" | |
6e278744 | 483 | value=\"".__('Check it')."\">"; |
d0da85c2 AD |
484 | print "</span>"; |
485 | ||
486 | print "<br/> " . __("on field") . " "; | |
487 | print_select_hash("filter_type", 1, $filter_types, | |
488 | 'onchange="filterDlgCheckType(this)"'); | |
10fa6615 AD |
489 | |
490 | print "<br/>"; | |
491 | ||
492 | print __("in") . " "; | |
493 | print_feed_select($link, "feed_id", $active_feed_id); | |
494 | ||
495 | print "</div>"; | |
496 | ||
ecace165 | 497 | print "<div class=\"dlgSec\">".__("Perform Action")."</div>"; |
10fa6615 AD |
498 | |
499 | print "<div class=\"dlgSecCont\">"; | |
500 | ||
501 | print "<select name=\"action_id\" | |
502 | onchange=\"filterDlgCheckAction(this)\">"; | |
503 | ||
504 | $result = db_query($link, "SELECT id,description FROM ttrss_filter_actions | |
505 | ORDER BY name"); | |
506 | ||
507 | while ($line = db_fetch_assoc($result)) { | |
508 | printf("<option value='%d'>%s</option>", $line["id"], __($line["description"])); | |
509 | } | |
510 | ||
511 | print "</select>"; | |
512 | ||
143a4973 AD |
513 | print "<span id=\"filter_dlg_param_box\" style=\"display : none\">"; |
514 | print " " . __("with parameters:") . " "; | |
515 | print "<input size=\"20\" | |
074bf20c | 516 | onkeypress=\"return filterCR(event, createFilter)\" |
143a4973 | 517 | name=\"action_param\">"; |
6427a306 AD |
518 | |
519 | print_label_select($link, "action_param_label", $action_param); | |
520 | ||
143a4973 | 521 | print "</span>"; |
10fa6615 | 522 | |
143a4973 | 523 | print " "; // tiny layout hack |
10fa6615 AD |
524 | |
525 | print "</div>"; | |
526 | ||
527 | print "<div class=\"dlgSec\">".__("Options")."</div>"; | |
528 | print "<div class=\"dlgSecCont\">"; | |
529 | ||
ecace165 AD |
530 | print "<div style=\"line-height : 100%\">"; |
531 | ||
10fa6615 AD |
532 | print "<input type=\"checkbox\" name=\"enabled\" id=\"enabled\" checked=\"1\"> |
533 | <label for=\"enabled\">".__('Enabled')."</label><br/>"; | |
534 | ||
535 | print "<input type=\"checkbox\" name=\"inverse\" id=\"inverse\"> | |
536 | <label for=\"inverse\">".__('Inverse match')."</label>"; | |
537 | ||
538 | print "</div>"; | |
ecace165 | 539 | print "</div>"; |
10fa6615 | 540 | |
ef8be8ea AD |
541 | print "</form>"; |
542 | ||
10fa6615 | 543 | print "<div class=\"dlgButtons\">"; |
ef8be8ea | 544 | |
ad491d75 AD |
545 | print "<button onclick=\"return createFilter()\">". |
546 | __('Create')."</button> "; | |
ef8be8ea | 547 | |
ad491d75 AD |
548 | print "<button onclick=\"return closeInfoBox()\">".__('Cancel'). |
549 | "</button>"; | |
ef8be8ea AD |
550 | |
551 | print "</div>"; | |
552 | ||
553 | // print "</td></tr></table>"; | |
554 | ||
5e6f933a | 555 | return; |
ef8be8ea AD |
556 | } |
557 | ||
a3656a41 AD |
558 | if ($id == "feedUpdateErrors") { |
559 | ||
cc17c205 | 560 | print "<div id=\"infoBoxTitle\">".__('Update Errors')."</div>"; |
a3656a41 AD |
561 | print "<div class=\"infoBoxContents\">"; |
562 | ||
cc17c205 | 563 | print __("These feeds have not been updated because of errors:"); |
a3656a41 AD |
564 | |
565 | $result = db_query($link, "SELECT id,title,feed_url,last_error | |
566 | FROM ttrss_feeds WHERE last_error != '' AND owner_uid = ".$_SESSION["uid"]); | |
567 | ||
e8dd519b | 568 | print "<ul class='feedErrorsList'>"; |
a3656a41 AD |
569 | |
570 | while ($line = db_fetch_assoc($result)) { | |
571 | print "<li><b>" . $line["title"] . "</b> (" . $line["feed_url"] . "): " . | |
572 | "<em>" . $line["last_error"] . "</em>"; | |
573 | } | |
574 | ||
575 | print "</ul>"; | |
a3656a41 AD |
576 | |
577 | print "<div align='center'>"; | |
578 | ||
579 | print "<input class=\"button\" | |
580 | type=\"submit\" onclick=\"return closeInfoBox()\" | |
cc17c205 | 581 | value=\"".__('Close')."\">"; |
a3656a41 AD |
582 | |
583 | print "</div>"; | |
584 | ||
aa330b93 | 585 | return; |
a3656a41 AD |
586 | } |
587 | ||
0b126ac2 AD |
588 | if ($id == "editArticleTags") { |
589 | ||
cc17c205 | 590 | print "<div id=\"infoBoxTitle\">".__('Edit Tags')."</div>"; |
0b126ac2 AD |
591 | print "<div class=\"infoBoxContents\">"; |
592 | ||
e6312f6c | 593 | print "<form id=\"tag_edit_form\" onsubmit='return false'>"; |
0b126ac2 | 594 | |
cc17c205 | 595 | print __("Tags for this article (separated by commas):")."<br>"; |
0b126ac2 AD |
596 | |
597 | $tags = get_article_tags($link, $param); | |
598 | ||
599 | $tags_str = join(", ", $tags); | |
600 | ||
d62a3b63 AD |
601 | print "<table width='100%'>"; |
602 | ||
603 | print "<tr><td colspan='2'><input type=\"hidden\" name=\"id\" value=\"$param\"></td></tr>"; | |
604 | ||
05fcdf52 AD |
605 | print "<tr><td colspan='2'><textarea rows='4' class='iedit' id='tags_str' |
606 | name='tags_str'>$tags_str</textarea> | |
607 | <div class=\"autocomplete\" id=\"tags_choices\" | |
608 | style=\"display:none\"></div> | |
609 | </td></tr>"; | |
d62a3b63 | 610 | |
d62a3b63 | 611 | print "</table>"; |
0b126ac2 AD |
612 | |
613 | print "</form>"; | |
614 | ||
615 | print "<div align='right'>"; | |
616 | ||
2ae69126 AD |
617 | print "<button onclick=\"return editTagsSave()\">".__('Save')."</button> "; |
618 | print "<button onclick=\"return closeInfoBox()\">".__('Cancel')."</button>"; | |
0b126ac2 AD |
619 | |
620 | print "</div>"; | |
621 | ||
5e6f933a | 622 | return; |
0b126ac2 AD |
623 | } |
624 | ||
0979b696 | 625 | if ($id == "printTagCloud") { |
d60009cd | 626 | print "<div id=\"infoBoxTitle\">".__('Tag Cloud')."</div>"; |
0979b696 AD |
627 | print "<div class=\"infoBoxContents\">"; |
628 | ||
dcac082b | 629 | print __("Showing most popular tags ")." (<a |
326469fc | 630 | href='javascript:toggleTags(true)'>".__('more tags')."</a>):<br/>"; |
0979b696 AD |
631 | |
632 | print "<div class=\"tagCloudContainer\">"; | |
633 | ||
634 | printTagCloud($link); | |
635 | ||
636 | print "</div>"; | |
637 | ||
638 | print "<div align='center'>"; | |
d60009cd AD |
639 | print "<button onclick=\"return closeInfoBox()\">". |
640 | __('Close this window')."</button>"; | |
0979b696 AD |
641 | print "</div>"; |
642 | ||
643 | print "</div>"; | |
644 | ||
645 | return; | |
646 | } | |
647 | ||
51f6f917 | 648 | /* if ($id == "offlineDownload") { |
87b16a0a AD |
649 | print "<div id=\"infoBoxTitle\">".__('Download articles')."</div>"; |
650 | print "<div class=\"infoBoxContents\">"; | |
651 | ||
652 | print "<form name='download_ops_form' id='download_ops_form'>"; | |
653 | ||
654 | print "<div class=\"dlgSec\">".__("Download")."</div>"; | |
655 | ||
656 | print "<div class=\"dlgSecCont\">"; | |
657 | ||
658 | $amount = array( | |
659 | 50 => 50, | |
660 | 100 => 100, | |
fe8f2f0c AD |
661 | 250 => 250, |
662 | 500 => 500); | |
87b16a0a AD |
663 | |
664 | print_select_hash("amount", 50, $amount); | |
665 | ||
6a2034f9 | 666 | print " " . __("latest articles for offline reading."); |
87b16a0a | 667 | |
6a1cd591 AD |
668 | print "<br/>"; |
669 | ||
670 | print "<input checked='yes' type='checkbox' name='unread_only' id='unread_only'>"; | |
671 | print "<label for='unread_only'>".__('Only include unread articles')."</label>"; | |
672 | ||
87b16a0a AD |
673 | print "</div>"; |
674 | ||
675 | print "</form>"; | |
676 | ||
677 | print "<div class=\"dlgButtons\"> | |
6a2034f9 AD |
678 | <input class=\"button\" |
679 | type=\"submit\" onclick=\"return initiate_offline_download(0, this)\" value=\"".__('Download')."\"> | |
87b16a0a AD |
680 | <input class=\"button\" |
681 | type=\"submit\" onclick=\"return closeInfoBox()\" | |
682 | value=\"".__('Cancel')."\"></div>"; | |
683 | ||
684 | print "</div>"; | |
685 | ||
686 | return; | |
51f6f917 | 687 | } */ |
87b16a0a AD |
688 | |
689 | ||
5e6f933a AD |
690 | print "<div id='infoBoxTitle'>Internal Error</div> |
691 | <div id='infoBoxContents'> | |
692 | <p>Unknown dialog <b>$id</b></p> | |
693 | </div></div>"; | |
694 | ||
ef8be8ea AD |
695 | } |
696 | ?> |