]>
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 | |
951906dc AD |
6 | print "<dlg id=\"$id\">"; |
7 | ||
b6a6e262 | 8 | if ($id == "importOpml") { |
951906dc AD |
9 | print "<title>".__('OPML Import')."</title>"; |
10 | print "<content><![CDATA["; | |
b6a6e262 AD |
11 | |
12 | print "<div class=\"prefFeedCatHolder\">"; | |
13 | ||
14 | $owner_uid = $_SESSION["uid"]; | |
15 | ||
16 | db_query($link, "BEGIN"); | |
17 | ||
18 | /* create Imported feeds category just in case */ | |
19 | ||
20 | $result = db_query($link, "SELECT id FROM | |
21 | ttrss_feed_categories WHERE title = 'Imported feeds' AND | |
22 | owner_uid = '$owner_uid' LIMIT 1"); | |
23 | ||
24 | if (db_num_rows($result) == 0) { | |
25 | db_query($link, "INSERT INTO ttrss_feed_categories | |
26 | (title,owner_uid) | |
27 | VALUES ('Imported feeds', '$owner_uid')"); | |
28 | } | |
29 | ||
30 | db_query($link, "COMMIT"); | |
31 | ||
32 | /* Handle OPML import by DOMXML/DOMDocument */ | |
33 | ||
34 | if (function_exists('domxml_open_file')) { | |
35 | print "<ul class='nomarks'>"; | |
36 | print "<li>".__("Importing using DOMXML.")."</li>"; | |
eef20159 | 37 | require_once "opml_domxml.php"; |
b6a6e262 AD |
38 | opml_import_domxml($link, $owner_uid); |
39 | print "</ul>"; | |
40 | } else if (PHP_VERSION >= 5) { | |
41 | print "<ul class='nomarks'>"; | |
42 | print "<li>".__("Importing using DOMDocument.")."</li>"; | |
eef20159 | 43 | require_once "opml_domdoc.php"; |
b6a6e262 AD |
44 | opml_import_domdoc($link, $owner_uid); |
45 | print "</ul>"; | |
46 | } else { | |
47 | print_error(__("DOMXML extension is not found. It is required for PHP versions below 5.")); | |
48 | } | |
49 | ||
50 | print "</div>"; | |
51 | ||
52 | print "<div align='center'>"; | |
53 | ||
f94ba975 AD |
54 | print "<button onclick=\"return opmlImportDone()\">". |
55 | __('Close this window')."</button>"; | |
b6a6e262 AD |
56 | |
57 | print "</div>"; | |
58 | ||
59 | print "<script type=\"text/javascript\">"; | |
c3b7b797 | 60 | print "parent.opmlImportHandler(this)"; |
b6a6e262 AD |
61 | print "</script>"; |
62 | ||
951906dc AD |
63 | print "</div>"; |
64 | print "]]></content>"; | |
b6a6e262 | 65 | |
951906dc | 66 | //return; |
b6a6e262 AD |
67 | } |
68 | ||
d9084cf2 AD |
69 | if ($id == "editPrefProfiles") { |
70 | ||
951906dc AD |
71 | print "<title>".__('Settings Profiles')."</title>"; |
72 | print "<content><![CDATA["; | |
d9084cf2 AD |
73 | |
74 | print "<div><input id=\"fadd_profile\" | |
75 | onkeypress=\"return filterCR(event, addPrefProfile)\" | |
76 | size=\"40\"> | |
77 | <button onclick=\"javascript:addPrefProfile()\">". | |
78 | __('Create profile')."</button></div>"; | |
79 | ||
80 | print "<p>"; | |
81 | ||
82 | $result = db_query($link, "SELECT title,id FROM ttrss_settings_profiles | |
47179c0e | 83 | WHERE owner_uid = ".$_SESSION["uid"]." ORDER BY title"); |
d9084cf2 AD |
84 | |
85 | print __('Select:')." | |
e69fb880 AD |
86 | <a href=\"#\" onclick=\"selectTableRows('prefFeedCatList', 'all')\">".__('All')."</a>, |
87 | <a href=\"#\" onclick=\"selectTableRows('prefFeedCatList', 'none')\">".__('None')."</a>"; | |
d9084cf2 AD |
88 | |
89 | print "<div class=\"prefFeedCatHolder\">"; | |
90 | ||
91 | print "<form id=\"profile_edit_form\" onsubmit=\"return false\">"; | |
92 | ||
93 | print "<table width=\"100%\" class=\"prefFeedCatList\" | |
94 | cellspacing=\"0\" id=\"prefFeedCatList\">"; | |
95 | ||
96 | print "<tr class=\"odd\" id=\"FCATR-0\">"; | |
97 | ||
98 | print "<td width='5%' align='center'><input | |
a998dbef | 99 | onclick='toggleSelectRow(this);' |
d9084cf2 AD |
100 | type=\"checkbox\" id=\"FCCHK-0\"></td>"; |
101 | ||
ac9dbf85 AD |
102 | if (!$_SESSION["profile"]) { |
103 | $is_active = __("(active)"); | |
104 | } else { | |
105 | $is_active = ""; | |
106 | } | |
107 | ||
d9084cf2 | 108 | print "<td><span id=\"FCATT-0\">" . |
ac9dbf85 | 109 | __("Default profile") . " $is_active</span></td>"; |
d9084cf2 AD |
110 | |
111 | print "</tr>"; | |
112 | ||
113 | $lnum = 1; | |
114 | ||
115 | while ($line = db_fetch_assoc($result)) { | |
116 | ||
117 | $class = ($lnum % 2) ? "even" : "odd"; | |
118 | ||
119 | $cat_id = $line["id"]; | |
120 | $this_row_id = "id=\"FCATR-$cat_id\""; | |
121 | ||
122 | print "<tr class=\"$class\" $this_row_id>"; | |
123 | ||
124 | $edit_title = htmlspecialchars($line["title"]); | |
125 | ||
126 | print "<td width='5%' align='center'><input | |
a998dbef | 127 | onclick='toggleSelectRow(this);' |
d9084cf2 AD |
128 | type=\"checkbox\" id=\"FCCHK-$cat_id\"></td>"; |
129 | ||
130 | if ($_SESSION["profile"] == $line["id"]) { | |
131 | $is_active = __("(active)"); | |
132 | } else { | |
133 | $is_active = ""; | |
134 | } | |
135 | ||
136 | print "<td><span id=\"FCATT-$cat_id\">" . | |
137 | $edit_title . "</span> $is_active</td>"; | |
138 | ||
139 | print "</tr>"; | |
140 | ||
141 | ++$lnum; | |
142 | } | |
143 | ||
144 | print "</table>"; | |
145 | print "</form>"; | |
146 | print "</div>"; | |
147 | ||
148 | print "<div class='dlgButtons'> | |
149 | <div style='float : left'> | |
150 | <button onclick=\"return removeSelectedPrefProfiles()\">". | |
151 | __('Remove')."</button> | |
8ab4da5f AD |
152 | <button onclick=\"return activatePrefProfile()\">". |
153 | __('Activate')."</button> | |
d9084cf2 AD |
154 | </div>"; |
155 | ||
8ab4da5f AD |
156 | print "<button onclick=\"return closeInfoBox()\">". |
157 | __('Close this window')."</button>"; | |
d9084cf2 | 158 | |
951906dc AD |
159 | print "</div>"; |
160 | print "]]></content>"; | |
d9084cf2 | 161 | |
951906dc | 162 | //return; |
d9084cf2 AD |
163 | } |
164 | ||
c8640eda MK |
165 | if ($id == "pubOPMLUrl") { |
166 | ||
951906dc AD |
167 | print "<title>".__('Public OPML URL')."</title>"; |
168 | print "<content><![CDATA["; | |
f29033f8 | 169 | |
c8640eda MK |
170 | $url_path = opml_publish_url($link); |
171 | ||
172 | print __("Your Public OPML URL is:"); | |
173 | ||
174 | print "<div class=\"tagCloudContainer\">"; | |
175 | print "<a id='pub_opml_url' href='$url_path' target='_blank'>$url_path</a>"; | |
176 | print "</div>"; | |
177 | ||
178 | print "<div align='center'>"; | |
179 | ||
18606807 | 180 | print "<button dojoType=\"dijit.form.Button\" onclick=\"return opmlRegenKey()\">". |
c8640eda MK |
181 | __('Generate new URL')."</button> "; |
182 | ||
18606807 | 183 | print "<button dojoType=\"dijit.form.Button\" onclick=\"return closeInfoBox()\">". |
a918f5f9 | 184 | __('Close this window')."</button>"; |
cf9dc032 | 185 | |
951906dc AD |
186 | print "</div>"; |
187 | print "]]></content>"; | |
cf9dc032 | 188 | |
951906dc | 189 | //return; |
cf9dc032 AD |
190 | } |
191 | ||
ef16ae37 AD |
192 | if ($id == "explainError") { |
193 | ||
951906dc AD |
194 | print "<title>".__('Notice')."</title>"; |
195 | print "<content><![CDATA["; | |
ef16ae37 | 196 | |
73495fd1 AD |
197 | print "<div class=\"errorExplained\">"; |
198 | ||
ef16ae37 | 199 | if ($param == 1) { |
73495fd1 | 200 | 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 | 201 | |
1ea20897 | 202 | $stamp = (int) file_get_contents(LOCK_DIRECTORY . "/update_daemon.stamp"); |
f6854e44 AD |
203 | |
204 | print "<p>" . __("Last update:") . " " . date("Y.m.d, G:i", $stamp); | |
205 | ||
ef16ae37 AD |
206 | } |
207 | ||
d9fa39f1 | 208 | if ($param == 2) { |
73495fd1 | 209 | $msg = check_for_update($link); |
4d1d0a45 AD |
210 | |
211 | if (!$msg) { | |
73495fd1 | 212 | 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 |
213 | } else { |
214 | print $msg; | |
215 | } | |
d9fa39f1 AD |
216 | |
217 | } | |
218 | ||
8e00ae9b | 219 | if ($param == 3) { |
73495fd1 | 220 | 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 | 221 | |
1ea20897 | 222 | $stamp = (int) file_get_contents(LOCK_DIRECTORY . "/update_daemon.stamp"); |
f6854e44 AD |
223 | |
224 | print "<p>" . __("Last update:") . " " . date("Y.m.d, G:i", $stamp); | |
225 | ||
8e00ae9b AD |
226 | } |
227 | ||
ef16ae37 | 228 | print "</div>"; |
73495fd1 | 229 | |
ef16ae37 AD |
230 | print "<div align='center'>"; |
231 | ||
a918f5f9 AD |
232 | print "<button onclick=\"return closeInfoBox()\"". |
233 | __('Close this window')."</button>"; | |
ef16ae37 | 234 | |
951906dc AD |
235 | print "</div>"; |
236 | print "]]></content>"; | |
ef16ae37 | 237 | |
951906dc | 238 | //return; |
ef16ae37 AD |
239 | } |
240 | ||
ef8be8ea AD |
241 | if ($id == "quickAddFeed") { |
242 | ||
11b9d0be AD |
243 | print "<input dojoType=\"dijit.form.TextBox\" style=\"display : none\" name=\"op\" value=\"rpc\">"; |
244 | print "<input dojoType=\"dijit.form.TextBox\" style=\"display : none\" name=\"subop\" value=\"addfeed\">"; | |
ef8be8ea | 245 | |
ecace165 AD |
246 | print "<div class=\"dlgSec\">".__("Feed")."</div>"; |
247 | print "<div class=\"dlgSecCont\">"; | |
248 | ||
11b9d0be AD |
249 | print "<input style=\"font-size : 16px; width : 20em;\" |
250 | placeHolder=\"".__("Feed URL")."\" | |
251 | dojoType=\"dijit.form.ValidationTextBox\" required=\"1\" name=\"feed\" id=\"feedDlg_feedUrl\">"; | |
ecace165 AD |
252 | |
253 | print "<br/>"; | |
254 | ||
ef8be8ea | 255 | if (get_pref($link, 'ENABLE_FEED_CATS')) { |
ecace165 | 256 | print __('Place in category:') . " "; |
11b9d0be | 257 | print_feed_cat_select($link, "cat", false, 'dojoType="dijit.form.Select"'); |
ef8be8ea AD |
258 | } |
259 | ||
ecace165 AD |
260 | print "</div>"; |
261 | ||
11b9d0be | 262 | print '<div id="feedDlg_feedsContainer" style="display : none"> |
5eeb3874 CW |
263 | |
264 | <div class="dlgSec">' . __('Available feeds') . '</div> | |
11b9d0be AD |
265 | <div class="dlgSecCont">'. |
266 | '<select id="feedDlg_feedContainerSelect" | |
267 | dojoType="dijit.form.Select" size="3"> | |
268 | <script type="dojo/method" event="onChange" args="value"> | |
269 | dijit.byId("feedDlg_feedUrl").attr("value", value); | |
270 | </script> | |
271 | </select>'. | |
272 | '</div></div>'; | |
273 | ||
274 | print "<div id='feedDlg_loginContainer' style='display : none'> | |
ecace165 AD |
275 | |
276 | <div class=\"dlgSec\">".__("Authentication")."</div> | |
277 | <div class=\"dlgSecCont\">". | |
278 | ||
11b9d0be AD |
279 | " <input dojoType=\"dijit.form.TextBox\" name='login'\" |
280 | placeHolder=\"".__("Login")."\" | |
281 | style=\"width : 10em;\"> ". | |
282 | " <input | |
283 | placeHolder=\"".__("Password")."\" | |
284 | dojoType=\"dijit.form.TextBox\" type='password' | |
285 | style=\"width : 10em;\" name='pass'\"> | |
ecace165 AD |
286 | </div></div>"; |
287 | ||
288 | ||
11b9d0be AD |
289 | print "<div style=\"clear : both\"> |
290 | <input type=\"checkbox\" dojoType=\"dijit.form.CheckBox\" id=\"feedDlg_loginCheck\" | |
291 | onclick='checkboxToggleElement(this, \"feedDlg_loginContainer\")'> | |
292 | <label for=\"feedDlg_loginCheck\">". | |
ecace165 | 293 | __('This feed requires authentication.')."</div>"; |
f27de515 | 294 | |
ef8be8ea AD |
295 | print "</form>"; |
296 | ||
ecace165 | 297 | print "<div class=\"dlgButtons\"> |
11b9d0be AD |
298 | <button dojoType=\"dijit.form.Button\" onclick=\"return dijit.byId('feedAddDlg').execute()\">".__('Subscribe')."</button> |
299 | <button dojoType=\"dijit.form.Button\" onclick=\"return feedBrowser()\">".__('More feeds')."</button> | |
300 | <button dojoType=\"dijit.form.Button\" onclick=\"return dijit.byId('feedAddDlg').hide()\">".__('Cancel')."</button> | |
301 | </div>"; | |
951906dc AD |
302 | |
303 | //return; | |
ef8be8ea AD |
304 | } |
305 | ||
ef88b1cc AD |
306 | if ($id == "feedBrowser") { |
307 | ||
ef88b1cc AD |
308 | $browser_search = db_escape_string($_REQUEST["search"]); |
309 | ||
11b9d0be AD |
310 | # print "<form onsubmit='return false;' display='inline' |
311 | # name='feed_browser' id='feed_browser'>"; | |
ef88b1cc | 312 | |
11b9d0be AD |
313 | print "<input dojoType=\"dijit.form.TextBox\" style=\"display : none\" name=\"op\" value=\"rpc\">"; |
314 | print "<input dojoType=\"dijit.form.TextBox\" style=\"display : none\" name=\"subop\" value=\"updateFeedBrowser\">"; | |
ef88b1cc | 315 | |
a8328019 | 316 | print "<div dojoType=\"dijit.Toolbar\"> |
ef88b1cc AD |
317 | <div style='float : right'> |
318 | <img style='display : none' | |
883fee8d AD |
319 | id='feed_browser_spinner' src='". |
320 | theme_image($link, 'images/indicator_white.gif')."'> | |
11b9d0be AD |
321 | <input name=\"search\" dojoType=\"dijit.form.TextBox\" size=\"20\" type=\"search\" |
322 | onchange=\"dijit.byId('feedBrowserDlg').update()\" value=\"$browser_search\"> | |
323 | <button dojoType=\"dijit.form.Button\" onclick=\"dijit.byId('feedBrowserDlg').update()\">".__('Search')."</button> | |
ef88b1cc AD |
324 | </div>"; |
325 | ||
11b9d0be | 326 | print " <select name=\"mode\" dojoType=\"dijit.form.Select\" onchange=\"dijit.byId('feedBrowserDlg').update()\"> |
ef88b1cc AD |
327 | <option value='1'>" . __('Popular feeds') . "</option> |
328 | <option value='2'>" . __('Feed archive') . "</option> | |
329 | </select> "; | |
330 | ||
331 | print __("limit:"); | |
332 | ||
11b9d0be | 333 | print " <select dojoType=\"dijit.form.Select\" name=\"limit\" onchange=\"dijit.byId('feedBrowserDlg').update()\">"; |
ef88b1cc AD |
334 | |
335 | foreach (array(25, 50, 100, 200) as $l) { | |
11b9d0be AD |
336 | $issel = ($l == $limit) ? "selected=\"1\"" : ""; |
337 | print "<option $issel value=\"$l\">$l</option>"; | |
ef88b1cc AD |
338 | } |
339 | ||
340 | print "</select> "; | |
341 | ||
a8328019 | 342 | print "</div>"; |
ef88b1cc AD |
343 | |
344 | $owner_uid = $_SESSION["uid"]; | |
345 | ||
346 | print "<ul class='browseFeedList' id='browseFeedList'>"; | |
347 | print_feed_browser($link, $search, 25); | |
348 | print "</ul>"; | |
349 | ||
350 | print "<div align='center'> | |
11b9d0be AD |
351 | <button dojoType=\"dijit.form.Button\" onclick=\"dijit.byId('feedBrowserDlg').execute()\">".__('Subscribe')."</button> |
352 | <button dojoType=\"dijit.form.Button\" style='display : none' id='feed_archive_remove' onclick=\"dijit.byId('feedBrowserDlg').removeFromArchive()\">".__('Remove')."</button> | |
353 | <button dojoType=\"dijit.form.Button\" onclick=\"dijit.byId('feedBrowserDlg').hide()\" >".__('Cancel')."</button></div>"; | |
ef88b1cc | 354 | |
ef88b1cc AD |
355 | } |
356 | ||
ef8be8ea AD |
357 | if ($id == "search") { |
358 | ||
951906dc AD |
359 | print "<title>".__('Search')."</title>"; |
360 | print "<content><![CDATA["; | |
ef8be8ea | 361 | |
e6312f6c | 362 | print "<form id='search_form' onsubmit='return false'>"; |
ef8be8ea | 363 | |
b4e75b2a | 364 | #$active_feed_id = db_escape_string($_REQUEST["param"]); |
ef8be8ea | 365 | |
2d1b7139 | 366 | $params = explode(":", db_escape_string($_REQUEST["param"]), 2); |
ef8be8ea AD |
367 | |
368 | $active_feed_id = sprintf("%d", $params[0]); | |
2d1b7139 | 369 | $is_cat = (bool) $params[1]; |
ef8be8ea | 370 | |
de85cac2 | 371 | print "<div class=\"dlgSec\">".__('Look for')."</div>"; |
5bac8c29 AD |
372 | |
373 | print "<div class=\"dlgSecCont\">"; | |
374 | ||
e4f7f8df | 375 | if (!SPHINX_ENABLE) { |
5bac8c29 | 376 | |
e4f7f8df AD |
377 | print "<input onkeypress=\"return filterCR(event, search)\" |
378 | name=\"query\" size=\"20\" type=\"search\" value=''>"; | |
5bac8c29 | 379 | |
e4f7f8df | 380 | print " " . __('match on')." "; |
5bac8c29 | 381 | |
e4f7f8df AD |
382 | $search_fields = array( |
383 | "title" => __("Title"), | |
384 | "content" => __("Content"), | |
385 | "both" => __("Title or content")); | |
386 | ||
387 | print_select_hash("match_on", 3, $search_fields); | |
388 | } else { | |
389 | print "<input onkeypress=\"return filterCR(event, search)\" | |
390 | name=\"query\" size=\"50\" type=\"search\" value=''>"; | |
391 | } | |
5bac8c29 AD |
392 | |
393 | ||
394 | print "<br/>".__('Limit search to:')." "; | |
ef8be8ea AD |
395 | |
396 | print "<select name=\"search_mode\"> | |
cc17c205 | 397 | <option value=\"all_feeds\">".__('All feeds')."</option>"; |
ef8be8ea AD |
398 | |
399 | $feed_title = getFeedTitle($link, $active_feed_id); | |
400 | ||
401 | if (!$is_cat) { | |
402 | $feed_cat_title = getFeedCatTitle($link, $active_feed_id); | |
403 | } else { | |
404 | $feed_cat_title = getCategoryTitle($link, $active_feed_id); | |
405 | } | |
406 | ||
407 | if ($active_feed_id && !$is_cat) { | |
cc17c205 | 408 | print "<option selected value=\"this_feed\">$feed_title</option>"; |
ef8be8ea | 409 | } else { |
cc17c205 | 410 | print "<option disabled>".__('This feed')."</option>"; |
ef8be8ea AD |
411 | } |
412 | ||
413 | if ($is_cat) { | |
414 | $cat_preselected = "selected"; | |
415 | } | |
416 | ||
417 | if (get_pref($link, 'ENABLE_FEED_CATS') && ($active_feed_id > 0 || $is_cat)) { | |
cc17c205 | 418 | print "<option $cat_preselected value=\"this_cat\">$feed_cat_title</option>"; |
ef8be8ea | 419 | } else { |
c4b0f96c | 420 | //print "<option disabled>".__('This category')."</option>"; |
ef8be8ea AD |
421 | } |
422 | ||
5bac8c29 | 423 | print "</select>"; |
ef8be8ea | 424 | |
5bac8c29 | 425 | print "</div>"; |
ef8be8ea AD |
426 | |
427 | print "</form>"; | |
428 | ||
5bac8c29 | 429 | print "<div class=\"dlgButtons\"> |
d60009cd | 430 | <button onclick=\"javascript:search()\">".__('Search')."</button> |
55132a45 | 431 | <button onclick=\"javascript:closeInfoBox(true)\">".__('Cancel')."</button> |
ad491d75 | 432 | </div>"; |
ef8be8ea | 433 | |
951906dc | 434 | print "]]></content>"; |
ef8be8ea | 435 | |
951906dc | 436 | //return; |
5e6f933a | 437 | |
ef8be8ea AD |
438 | } |
439 | ||
ef8be8ea AD |
440 | if ($id == "quickAddFilter") { |
441 | ||
b4e75b2a | 442 | $active_feed_id = db_escape_string($_REQUEST["param"]); |
ef8be8ea | 443 | |
d90868d7 AD |
444 | print "<input dojoType=\"dijit.form.TextBox\" style=\"display : none\" name=\"op\" value=\"pref-filters\">"; |
445 | print "<input dojoType=\"dijit.form.TextBox\" style=\"display : none\" name=\"quiet\" value=\"1\">"; | |
446 | print "<input dojoType=\"dijit.form.TextBox\" style=\"display : none\" name=\"subop\" value=\"add\">"; | |
ef8be8ea AD |
447 | |
448 | $result = db_query($link, "SELECT id,description | |
449 | FROM ttrss_filter_types ORDER BY description"); | |
450 | ||
451 | $filter_types = array(); | |
452 | ||
453 | while ($line = db_fetch_assoc($result)) { | |
454 | //array_push($filter_types, $line["description"]); | |
89cb787e | 455 | $filter_types[$line["id"]] = __($line["description"]); |
ef8be8ea AD |
456 | } |
457 | ||
10fa6615 AD |
458 | print "<div class=\"dlgSec\">".__("Match")."</div>"; |
459 | ||
460 | print "<div class=\"dlgSecCont\">"; | |
461 | ||
d90868d7 | 462 | print "<span id=\"filterDlg_dateModBox\" style=\"display : none\">"; |
44d0e774 AD |
463 | |
464 | $filter_params = array( | |
465 | "before" => __("before"), | |
466 | "after" => __("after")); | |
467 | ||
d90868d7 AD |
468 | print_select_hash("filter_date_modifier", "before", |
469 | $filter_params, 'dojoType="dijit.form.Select"'); | |
44d0e774 AD |
470 | |
471 | print " </span>"; | |
d0da85c2 | 472 | |
d90868d7 AD |
473 | print "<input dojoType=\"dijit.form.ValidationTextBox\" |
474 | required=\"true\" id=\"filterDlg_regExp\" | |
475 | style=\"font-size : 16px\" | |
476 | name=\"reg_exp\" value=\"$reg_exp\"/>"; | |
10fa6615 | 477 | |
d90868d7 | 478 | print "<span id=\"filterDlg_dateChkBox\" style=\"display : none\">"; |
a918f5f9 AD |
479 | print " <button onclick=\"return filterDlgCheckDate()\">". |
480 | __('Check it')."</button>"; | |
d0da85c2 AD |
481 | print "</span>"; |
482 | ||
d90868d7 | 483 | print "<br/>" . __("on field") . " "; |
d0da85c2 | 484 | print_select_hash("filter_type", 1, $filter_types, |
d90868d7 | 485 | 'onchange="filterDlgCheckType(this)" dojoType="dijit.form.Select"'); |
10fa6615 AD |
486 | |
487 | print "<br/>"; | |
488 | ||
489 | print __("in") . " "; | |
d90868d7 AD |
490 | print_feed_select($link, "feed_id", $active_feed_id, |
491 | 'dojoType="dijit.form.FilteringSelect"'); | |
10fa6615 AD |
492 | |
493 | print "</div>"; | |
494 | ||
ecace165 | 495 | print "<div class=\"dlgSec\">".__("Perform Action")."</div>"; |
10fa6615 AD |
496 | |
497 | print "<div class=\"dlgSecCont\">"; | |
498 | ||
d90868d7 | 499 | print "<select name=\"action_id\" dojoType=\"dijit.form.Select\" |
10fa6615 AD |
500 | onchange=\"filterDlgCheckAction(this)\">"; |
501 | ||
502 | $result = db_query($link, "SELECT id,description FROM ttrss_filter_actions | |
503 | ORDER BY name"); | |
504 | ||
505 | while ($line = db_fetch_assoc($result)) { | |
506 | printf("<option value='%d'>%s</option>", $line["id"], __($line["description"])); | |
507 | } | |
508 | ||
509 | print "</select>"; | |
510 | ||
d90868d7 | 511 | print "<span id=\"filterDlg_paramBox\" style=\"display : none\">"; |
143a4973 | 512 | print " " . __("with parameters:") . " "; |
d90868d7 AD |
513 | print "<input dojoType=\"dijit.form.TextBox\" |
514 | id=\"filterDlg_actionParam\" | |
515 | name=\"action_param\">"; | |
6427a306 | 516 | |
d90868d7 AD |
517 | print_label_select($link, "action_param_label", $action_param, |
518 | 'id="filterDlg_actionParamLabel" dojoType="dijit.form.Select"'); | |
6427a306 | 519 | |
143a4973 | 520 | print "</span>"; |
10fa6615 | 521 | |
143a4973 | 522 | print " "; // tiny layout hack |
10fa6615 AD |
523 | |
524 | print "</div>"; | |
525 | ||
526 | print "<div class=\"dlgSec\">".__("Options")."</div>"; | |
527 | print "<div class=\"dlgSecCont\">"; | |
528 | ||
d90868d7 | 529 | print "<input dojoType=\"dijit.form.CheckBox\" type=\"checkbox\" name=\"enabled\" id=\"enabled\" checked=\"1\"> |
10fa6615 AD |
530 | <label for=\"enabled\">".__('Enabled')."</label><br/>"; |
531 | ||
d90868d7 | 532 | print "<input dojoType=\"dijit.form.CheckBox\" type=\"checkbox\" name=\"inverse\" id=\"inverse\"> |
10fa6615 AD |
533 | <label for=\"inverse\">".__('Inverse match')."</label>"; |
534 | ||
535 | print "</div>"; | |
ef8be8ea | 536 | |
10fa6615 | 537 | print "<div class=\"dlgButtons\">"; |
ef8be8ea | 538 | |
c33f56f3 | 539 | print "<button dojoType=\"dijit.form.Button\" onclick=\"return dijit.byId('filterEditDlg').execute()\">". |
ad491d75 | 540 | __('Create')."</button> "; |
ef8be8ea | 541 | |
c33f56f3 | 542 | print "<button dojoType=\"dijit.form.Button\" onclick=\"return dijit.byId('filterEditDlg').hide()\">". |
d90868d7 | 543 | __('Cancel')."</button>"; |
ef8be8ea | 544 | |
d90868d7 | 545 | print "</div>"; |
ef8be8ea | 546 | |
951906dc | 547 | //return; |
ef8be8ea AD |
548 | } |
549 | ||
a3656a41 AD |
550 | if ($id == "feedUpdateErrors") { |
551 | ||
f81b6815 | 552 | print "<title>".__('Feeds with update errors')."</title>"; |
951906dc | 553 | print "<content><![CDATA["; |
a3656a41 | 554 | |
cc17c205 | 555 | print __("These feeds have not been updated because of errors:"); |
a3656a41 AD |
556 | |
557 | $result = db_query($link, "SELECT id,title,feed_url,last_error | |
558 | FROM ttrss_feeds WHERE last_error != '' AND owner_uid = ".$_SESSION["uid"]); | |
559 | ||
e8dd519b | 560 | print "<ul class='feedErrorsList'>"; |
a3656a41 AD |
561 | |
562 | while ($line = db_fetch_assoc($result)) { | |
563 | print "<li><b>" . $line["title"] . "</b> (" . $line["feed_url"] . "): " . | |
564 | "<em>" . $line["last_error"] . "</em>"; | |
565 | } | |
566 | ||
567 | print "</ul>"; | |
a3656a41 AD |
568 | |
569 | print "<div align='center'>"; | |
570 | ||
f81b6815 AD |
571 | print "<button dojoType=\"dijit.form.Button\" |
572 | onclick=\"return closeInfoBox()\">". | |
a522a767 | 573 | __('Close this window')."</button>"; |
a3656a41 | 574 | |
951906dc | 575 | print "]]></content>"; |
a3656a41 | 576 | |
951906dc | 577 | //return; |
a3656a41 AD |
578 | } |
579 | ||
0b126ac2 AD |
580 | if ($id == "editArticleTags") { |
581 | ||
951906dc AD |
582 | print "<title>".__('Edit Tags')."</title>"; |
583 | print "<content><![CDATA["; | |
0b126ac2 | 584 | |
e6312f6c | 585 | print "<form id=\"tag_edit_form\" onsubmit='return false'>"; |
0b126ac2 | 586 | |
cc17c205 | 587 | print __("Tags for this article (separated by commas):")."<br>"; |
0b126ac2 AD |
588 | |
589 | $tags = get_article_tags($link, $param); | |
590 | ||
591 | $tags_str = join(", ", $tags); | |
592 | ||
d62a3b63 AD |
593 | print "<table width='100%'>"; |
594 | ||
595 | print "<tr><td colspan='2'><input type=\"hidden\" name=\"id\" value=\"$param\"></td></tr>"; | |
596 | ||
05fcdf52 AD |
597 | print "<tr><td colspan='2'><textarea rows='4' class='iedit' id='tags_str' |
598 | name='tags_str'>$tags_str</textarea> | |
599 | <div class=\"autocomplete\" id=\"tags_choices\" | |
600 | style=\"display:none\"></div> | |
601 | </td></tr>"; | |
d62a3b63 | 602 | |
d62a3b63 | 603 | print "</table>"; |
0b126ac2 AD |
604 | |
605 | print "</form>"; | |
606 | ||
607 | print "<div align='right'>"; | |
608 | ||
2ae69126 AD |
609 | print "<button onclick=\"return editTagsSave()\">".__('Save')."</button> "; |
610 | print "<button onclick=\"return closeInfoBox()\">".__('Cancel')."</button>"; | |
0b126ac2 | 611 | |
951906dc | 612 | print "]]></content>"; |
0b126ac2 | 613 | |
951906dc | 614 | //return; |
0b126ac2 AD |
615 | } |
616 | ||
0979b696 | 617 | if ($id == "printTagCloud") { |
951906dc AD |
618 | print "<title>".__('Tag Cloud')."</title>"; |
619 | print "<content><![CDATA["; | |
0979b696 | 620 | |
9c99281f AD |
621 | # print __("Showing most popular tags ")." (<a |
622 | # href='javascript:toggleTags(true)'>".__('more tags')."</a>):<br/>"; | |
0979b696 AD |
623 | |
624 | print "<div class=\"tagCloudContainer\">"; | |
625 | ||
626 | printTagCloud($link); | |
627 | ||
628 | print "</div>"; | |
629 | ||
630 | print "<div align='center'>"; | |
d60009cd AD |
631 | print "<button onclick=\"return closeInfoBox()\">". |
632 | __('Close this window')."</button>"; | |
0979b696 AD |
633 | print "</div>"; |
634 | ||
951906dc | 635 | print "]]></content>"; |
0979b696 | 636 | |
951906dc | 637 | //return; |
0979b696 AD |
638 | } |
639 | ||
31a53903 AD |
640 | if ($id == "emailArticle") { |
641 | ||
736e8977 | 642 | $secretkey = sha1(uniqid(rand(), true)); |
87b16a0a | 643 | |
31a53903 | 644 | $_SESSION['email_secretkey'] = $secretkey; |
87b16a0a | 645 | |
18606807 AD |
646 | print "<input dojoType=\"dijit.form.TextBox\" style=\"display : none\" name=\"secretkey\" value=\"$secretkey\">"; |
647 | print "<input dojoType=\"dijit.form.TextBox\" style=\"display : none\" name=\"op\" value=\"rpc\">"; | |
648 | print "<input dojoType=\"dijit.form.TextBox\" style=\"display : none\" name=\"subop\" value=\"sendEmail\">"; | |
87b16a0a | 649 | |
73fe13af | 650 | $result = db_query($link, "SELECT email, full_name FROM ttrss_users WHERE |
f72a7b66 AD |
651 | id = " . $_SESSION["uid"]); |
652 | ||
653 | $user_email = htmlspecialchars(db_fetch_result($result, 0, "email")); | |
73fe13af AD |
654 | $user_name = htmlspecialchars(db_fetch_result($result, 0, "full_name")); |
655 | ||
656 | if (!$user_name) $user_name = $_SESSION['name']; | |
f72a7b66 AD |
657 | |
658 | $_SESSION['email_replyto'] = $user_email; | |
659 | $_SESSION['email_fromname'] = $user_name; | |
660 | ||
31a53903 | 661 | require_once "lib/MiniTemplator.class.php"; |
87b16a0a | 662 | |
31a53903 AD |
663 | $tpl = new MiniTemplator; |
664 | $tpl_t = new MiniTemplator; | |
87b16a0a | 665 | |
31a53903 | 666 | $tpl->readTemplateFromFile("templates/email_article_template.txt"); |
6a1cd591 | 667 | |
f72a7b66 AD |
668 | $tpl->setVariable('USER_NAME', $_SESSION["name"]); |
669 | $tpl->setVariable('USER_EMAIL', $user_email); | |
670 | $tpl->setVariable('TTRSS_HOST', $_SERVER["HTTP_HOST"]); | |
31a53903 | 671 | |
f72a7b66 | 672 | // $tpl->addBlock('header'); |
31a53903 | 673 | |
f72a7b66 AD |
674 | $result = db_query($link, "SELECT link, content, title |
675 | FROM ttrss_user_entries, ttrss_entries WHERE id = ref_id AND | |
676 | id IN ($param) AND owner_uid = " . $_SESSION["uid"]); | |
31a53903 | 677 | |
f72a7b66 AD |
678 | if (db_num_rows($result) > 1) { |
679 | $subject = __("[Forwarded]") . " " . __("Multiple articles"); | |
680 | } | |
31a53903 | 681 | |
f72a7b66 | 682 | while ($line = db_fetch_assoc($result)) { |
31a53903 | 683 | |
f72a7b66 AD |
684 | if (!$subject) |
685 | $subject = __("[Forwarded]") . " " . htmlspecialchars($line["title"]); | |
31a53903 | 686 | |
f72a7b66 AD |
687 | $tpl->setVariable('ARTICLE_TITLE', strip_tags($line["title"])); |
688 | $tpl->setVariable('ARTICLE_URL', strip_tags($line["link"])); | |
31a53903 | 689 | |
f72a7b66 AD |
690 | $tpl->addBlock('article'); |
691 | } | |
31a53903 AD |
692 | |
693 | $tpl->addBlock('email'); | |
f72a7b66 | 694 | |
31a53903 AD |
695 | $content = ""; |
696 | $tpl->generateOutputToString($content); | |
697 | ||
698 | print "<table width='100%'><tr><td>"; | |
699 | ||
700 | print __('From:'); | |
701 | ||
702 | print "</td><td>"; | |
703 | ||
18606807 | 704 | print "<input dojoType=\"dijit.form.TextBox\" disabled=\"1\" style=\"width : 30em;\" |
31a53903 AD |
705 | value=\"$user_name <$user_email>\">"; |
706 | ||
707 | print "</td></tr><tr><td>"; | |
708 | ||
709 | print __('To:'); | |
710 | ||
711 | print "</td><td>"; | |
712 | ||
18606807 AD |
713 | print "<input dojoType=\"dijit.form.ValidationTextBox\" required=\"true\" |
714 | style=\"width : 30em;\" | |
715 | name=\"destination\" id=\"emailArticleDlg_destination\">"; | |
31a53903 | 716 | |
18606807 AD |
717 | print "<div class=\"autocomplete\" id=\"emailArticleDlg_dst_choices\" |
718 | style=\"z-index: 30; display : none\"></div>"; | |
31a53903 AD |
719 | |
720 | print "</td></tr><tr><td>"; | |
721 | ||
722 | print __('Subject:'); | |
723 | ||
724 | print "</td><td>"; | |
725 | ||
18606807 AD |
726 | print "<input dojoType=\"dijit.form.ValidationTextBox\" required=\"true\" |
727 | style=\"width : 30em;\" | |
31a53903 AD |
728 | name=\"subject\" value=\"$subject\" id=\"subject\">"; |
729 | ||
18606807 | 730 | print "</td></tr>"; |
31a53903 | 731 | |
18606807 | 732 | print "<tr><td colspan='2'><textarea dojoType=\"dijit.form.SimpleTextarea\" style='font-size : 12px; width : 100%' rows=\"20\" |
31a53903 | 733 | name='content'>$content</textarea>"; |
87b16a0a | 734 | |
18606807 | 735 | print "</td></tr></table>"; |
87b16a0a | 736 | |
31a53903 | 737 | print "<div class='dlgButtons'>"; |
18606807 AD |
738 | print "<button dojoType=\"dijit.form.Button\" onclick=\"dijit.byId('emailArticleDlg').execute()\">".__('Send e-mail')."</button> "; |
739 | print "<button dojoType=\"dijit.form.Button\" onclick=\"dijit.byId('emailArticleDlg').hide()\">".__('Cancel')."</button>"; | |
740 | print "</div>"; | |
87b16a0a | 741 | |
951906dc | 742 | //return; |
31a53903 | 743 | } |
87b16a0a | 744 | |
8801fb01 AD |
745 | if ($id == "generatedFeed") { |
746 | ||
951906dc AD |
747 | print "<title>".__('View as RSS')."</title>"; |
748 | print "<content><![CDATA["; | |
8801fb01 AD |
749 | |
750 | $params = explode(":", $param, 3); | |
751 | $feed_id = db_escape_string($params[0]); | |
752 | $is_cat = (bool) $params[1]; | |
753 | ||
754 | $key = get_feed_access_key($link, $feed_id, $is_cat); | |
755 | ||
756 | $url_path = htmlspecialchars($params[2]) . "&key=" . $key; | |
757 | ||
758 | print __("You can view this feed as RSS using the following URL:"); | |
759 | ||
760 | print "<div class=\"tagCloudContainer\">"; | |
761 | print "<a id='gen_feed_url' href='$url_path' target='_blank'>$url_path</a>"; | |
762 | print "</div>"; | |
763 | ||
764 | print "<div align='center'>"; | |
765 | ||
18606807 | 766 | print "<button dojoType=\"dijit.form.Button\" onclick=\"return genUrlChangeKey('$feed_id', '$is_cat')\">". |
8801fb01 AD |
767 | __('Generate new URL')."</button> "; |
768 | ||
18606807 | 769 | print "<button dojoType=\"dijit.form.Button\" onclick=\"return closeInfoBox()\">". |
a918f5f9 | 770 | __('Close this window')."</button>"; |
8801fb01 | 771 | |
951906dc AD |
772 | print "</div>"; |
773 | print "]]></content>"; | |
8801fb01 | 774 | |
951906dc | 775 | //return; |
8801fb01 AD |
776 | } |
777 | ||
951906dc | 778 | print "</dlg>"; |
ef8be8ea AD |
779 | } |
780 | ?> |