]>
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") { |
e1218480 AD |
9 | print "<div class=\"prefFeedOPMLHolder\">"; |
10 | header("Content-Type: text/html"); # required for iframe | |
b6a6e262 AD |
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 | |
1b24f331 | 24 | (title,owner_uid) |
b6a6e262 AD |
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>"; | |
eef20159 | 35 | require_once "opml_domxml.php"; |
b6a6e262 AD |
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>"; | |
eef20159 | 41 | require_once "opml_domdoc.php"; |
b6a6e262 AD |
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'>"; | |
1b24f331 | 51 | print "<button dojoType=\"dijit.form.Button\" |
e1218480 | 52 | onclick=\"dijit.byId('opmlImportDlg').hide()\">". |
f94ba975 | 53 | __('Close this window')."</button>"; |
b6a6e262 AD |
54 | print "</div>"; |
55 | ||
951906dc | 56 | print "</div>"; |
b6a6e262 | 57 | |
951906dc | 58 | //return; |
b6a6e262 AD |
59 | } |
60 | ||
d9084cf2 AD |
61 | if ($id == "editPrefProfiles") { |
62 | ||
22988692 AD |
63 | print "<div dojoType=\"dijit.Toolbar\">"; |
64 | ||
65 | # TODO: depends on selectTableRows() being broken for this list | |
66 | # print "<div dojoType=\"dijit.form.DropDownButton\">". | |
67 | # "<span>" . __('Select')."</span>"; | |
68 | # print "<div dojoType=\"dijit.Menu\" style=\"display: none;\">"; | |
1b24f331 | 69 | # print "<div onclick=\"selectTableRows('prefFeedProfileList', 'all')\" |
22988692 | 70 | # dojoType=\"dijit.MenuItem\">".__('All')."</div>"; |
1b24f331 | 71 | # print "<div onclick=\"selectTableRows('prefFeedProfileList', 'none')\" |
22988692 AD |
72 | # dojoType=\"dijit.MenuItem\">".__('None')."</div>"; |
73 | # print "</div></div>"; | |
74 | ||
75 | # print "<div style='float : right'>"; | |
76 | print "<input name=\"newprofile\" dojoType=\"dijit.form.ValidationTextBox\" | |
77 | required=\"1\"> | |
1b24f331 | 78 | <button dojoType=\"dijit.form.Button\" |
22988692 | 79 | onclick=\"dijit.byId('profileEditDlg').addProfile()\">". |
d9084cf2 AD |
80 | __('Create profile')."</button></div>"; |
81 | ||
22988692 AD |
82 | # print "</div>"; |
83 | ||
d9084cf2 AD |
84 | |
85 | $result = db_query($link, "SELECT title,id FROM ttrss_settings_profiles | |
47179c0e | 86 | WHERE owner_uid = ".$_SESSION["uid"]." ORDER BY title"); |
d9084cf2 | 87 | |
d9084cf2 AD |
88 | print "<div class=\"prefFeedCatHolder\">"; |
89 | ||
90 | print "<form id=\"profile_edit_form\" onsubmit=\"return false\">"; | |
91 | ||
1b24f331 | 92 | print "<table width=\"100%\" class=\"prefFeedProfileList\" |
22988692 | 93 | cellspacing=\"0\" id=\"prefFeedProfileList\">"; |
d9084cf2 | 94 | |
22988692 | 95 | print "<tr class=\"\" id=\"FCATR-0\">"; #odd |
d9084cf2 | 96 | |
1b24f331 AD |
97 | print "<td width='5%' align='center'><input |
98 | onclick='toggleSelectRow2(this);' | |
22988692 AD |
99 | dojoType=\"dijit.form.CheckBox\" |
100 | type=\"checkbox\"></td>"; | |
d9084cf2 | 101 | |
ac9dbf85 AD |
102 | if (!$_SESSION["profile"]) { |
103 | $is_active = __("(active)"); | |
104 | } else { | |
105 | $is_active = ""; | |
106 | } | |
107 | ||
1b24f331 | 108 | print "<td><span>" . |
ac9dbf85 | 109 | __("Default profile") . " $is_active</span></td>"; |
1b24f331 | 110 | |
d9084cf2 AD |
111 | print "</tr>"; |
112 | ||
113 | $lnum = 1; | |
1b24f331 | 114 | |
d9084cf2 | 115 | while ($line = db_fetch_assoc($result)) { |
1b24f331 | 116 | |
d9084cf2 | 117 | $class = ($lnum % 2) ? "even" : "odd"; |
1b24f331 | 118 | |
22988692 AD |
119 | $profile_id = $line["id"]; |
120 | $this_row_id = "id=\"FCATR-$profile_id\""; | |
1b24f331 | 121 | |
22988692 | 122 | print "<tr class=\"\" $this_row_id>"; |
1b24f331 | 123 | |
d9084cf2 | 124 | $edit_title = htmlspecialchars($line["title"]); |
1b24f331 AD |
125 | |
126 | print "<td width='5%' align='center'><input | |
127 | onclick='toggleSelectRow2(this);' | |
22988692 AD |
128 | dojoType=\"dijit.form.CheckBox\" |
129 | type=\"checkbox\"></td>"; | |
d9084cf2 AD |
130 | |
131 | if ($_SESSION["profile"] == $line["id"]) { | |
132 | $is_active = __("(active)"); | |
133 | } else { | |
134 | $is_active = ""; | |
135 | } | |
136 | ||
1b24f331 | 137 | print "<td><span dojoType=\"dijit.InlineEditBox\" |
22988692 AD |
138 | width=\"300px\" autoSave=\"false\" |
139 | profile-id=\"$profile_id\">" . $edit_title . | |
140 | "<script type=\"dojo/method\" event=\"onChange\" args=\"item\"> | |
141 | var elem = this; | |
142 | dojo.xhrPost({ | |
143 | url: 'backend.php', | |
144 | content: {op: 'rpc', subop: 'saveprofile', | |
145 | value: this.value, | |
146 | id: this.srcNodeRef.getAttribute('profile-id')}, | |
147 | load: function(response) { | |
148 | elem.attr('value', response); | |
149 | } | |
1b24f331 | 150 | }); |
22988692 AD |
151 | </script> |
152 | </span> $is_active</td>"; | |
1b24f331 | 153 | |
d9084cf2 | 154 | print "</tr>"; |
1b24f331 | 155 | |
d9084cf2 AD |
156 | ++$lnum; |
157 | } | |
158 | ||
159 | print "</table>"; | |
160 | print "</form>"; | |
161 | print "</div>"; | |
162 | ||
163 | print "<div class='dlgButtons'> | |
164 | <div style='float : left'> | |
22988692 AD |
165 | <button dojoType=\"dijit.form.Button\" onclick=\"dijit.byId('profileEditDlg').removeSelected()\">". |
166 | __('Remove selected profiles')."</button> | |
167 | <button dojoType=\"dijit.form.Button\" onclick=\"dijit.byId('profileEditDlg').activateProfile()\">". | |
168 | __('Activate profile')."</button> | |
d9084cf2 AD |
169 | </div>"; |
170 | ||
22988692 | 171 | print "<button dojoType=\"dijit.form.Button\" onclick=\"dijit.byId('profileEditDlg').hide()\">". |
8ab4da5f | 172 | __('Close this window')."</button>"; |
951906dc | 173 | print "</div>"; |
d9084cf2 | 174 | |
d9084cf2 AD |
175 | } |
176 | ||
c8640eda MK |
177 | if ($id == "pubOPMLUrl") { |
178 | ||
951906dc AD |
179 | print "<title>".__('Public OPML URL')."</title>"; |
180 | print "<content><![CDATA["; | |
f29033f8 | 181 | |
c8640eda MK |
182 | $url_path = opml_publish_url($link); |
183 | ||
184 | print __("Your Public OPML URL is:"); | |
185 | ||
186 | print "<div class=\"tagCloudContainer\">"; | |
187 | print "<a id='pub_opml_url' href='$url_path' target='_blank'>$url_path</a>"; | |
188 | print "</div>"; | |
189 | ||
190 | print "<div align='center'>"; | |
191 | ||
18606807 | 192 | print "<button dojoType=\"dijit.form.Button\" onclick=\"return opmlRegenKey()\">". |
c8640eda MK |
193 | __('Generate new URL')."</button> "; |
194 | ||
18606807 | 195 | print "<button dojoType=\"dijit.form.Button\" onclick=\"return closeInfoBox()\">". |
a918f5f9 | 196 | __('Close this window')."</button>"; |
cf9dc032 | 197 | |
951906dc AD |
198 | print "</div>"; |
199 | print "]]></content>"; | |
cf9dc032 | 200 | |
951906dc | 201 | //return; |
cf9dc032 AD |
202 | } |
203 | ||
ef16ae37 AD |
204 | if ($id == "explainError") { |
205 | ||
951906dc AD |
206 | print "<title>".__('Notice')."</title>"; |
207 | print "<content><![CDATA["; | |
ef16ae37 | 208 | |
73495fd1 AD |
209 | print "<div class=\"errorExplained\">"; |
210 | ||
ef16ae37 | 211 | if ($param == 1) { |
73495fd1 | 212 | 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 | 213 | |
1ea20897 | 214 | $stamp = (int) file_get_contents(LOCK_DIRECTORY . "/update_daemon.stamp"); |
f6854e44 | 215 | |
1b24f331 | 216 | print "<p>" . __("Last update:") . " " . date("Y.m.d, G:i", $stamp); |
f6854e44 | 217 | |
ef16ae37 AD |
218 | } |
219 | ||
8e00ae9b | 220 | if ($param == 3) { |
73495fd1 | 221 | 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 | 222 | |
1ea20897 | 223 | $stamp = (int) file_get_contents(LOCK_DIRECTORY . "/update_daemon.stamp"); |
f6854e44 | 224 | |
1b24f331 | 225 | print "<p>" . __("Last update:") . " " . date("Y.m.d, G:i", $stamp); |
f6854e44 | 226 | |
8e00ae9b AD |
227 | } |
228 | ||
ef16ae37 | 229 | print "</div>"; |
1b24f331 | 230 | |
ef16ae37 AD |
231 | print "<div align='center'>"; |
232 | ||
63855db1 | 233 | print "<button onclick=\"return closeInfoBox()\">". |
a918f5f9 | 234 | __('Close this window')."</button>"; |
ef16ae37 | 235 | |
951906dc AD |
236 | print "</div>"; |
237 | print "]]></content>"; | |
ef16ae37 | 238 | |
951906dc | 239 | //return; |
ef16ae37 AD |
240 | } |
241 | ||
ef8be8ea AD |
242 | if ($id == "quickAddFeed") { |
243 | ||
11b9d0be | 244 | print "<input dojoType=\"dijit.form.TextBox\" style=\"display : none\" name=\"op\" value=\"rpc\">"; |
1b24f331 | 245 | print "<input dojoType=\"dijit.form.TextBox\" style=\"display : none\" name=\"subop\" value=\"addfeed\">"; |
ef8be8ea | 246 | |
ecace165 AD |
247 | print "<div class=\"dlgSec\">".__("Feed")."</div>"; |
248 | print "<div class=\"dlgSecCont\">"; | |
249 | ||
11b9d0be AD |
250 | print "<input style=\"font-size : 16px; width : 20em;\" |
251 | placeHolder=\"".__("Feed URL")."\" | |
252 | dojoType=\"dijit.form.ValidationTextBox\" required=\"1\" name=\"feed\" id=\"feedDlg_feedUrl\">"; | |
ecace165 | 253 | |
bcf5ed46 | 254 | print "<hr/>"; |
ecace165 | 255 | |
ef8be8ea | 256 | if (get_pref($link, 'ENABLE_FEED_CATS')) { |
ecace165 | 257 | print __('Place in category:') . " "; |
1b24f331 | 258 | print_feed_cat_select($link, "cat", false, 'dojoType="dijit.form.Select"'); |
ef8be8ea AD |
259 | } |
260 | ||
ecace165 AD |
261 | print "</div>"; |
262 | ||
11b9d0be | 263 | print '<div id="feedDlg_feedsContainer" style="display : none"> |
5eeb3874 CW |
264 | |
265 | <div class="dlgSec">' . __('Available feeds') . '</div> | |
11b9d0be AD |
266 | <div class="dlgSecCont">'. |
267 | '<select id="feedDlg_feedContainerSelect" | |
268 | dojoType="dijit.form.Select" size="3"> | |
269 | <script type="dojo/method" event="onChange" args="value"> | |
270 | dijit.byId("feedDlg_feedUrl").attr("value", value); | |
271 | </script> | |
272 | </select>'. | |
273 | '</div></div>'; | |
274 | ||
275 | print "<div id='feedDlg_loginContainer' style='display : none'> | |
1b24f331 | 276 | |
ecace165 AD |
277 | <div class=\"dlgSec\">".__("Authentication")."</div> |
278 | <div class=\"dlgSecCont\">". | |
279 | ||
1b24f331 | 280 | " <input dojoType=\"dijit.form.TextBox\" name='login'\" |
11b9d0be AD |
281 | placeHolder=\"".__("Login")."\" |
282 | style=\"width : 10em;\"> ". | |
1b24f331 | 283 | " <input |
11b9d0be | 284 | placeHolder=\"".__("Password")."\" |
1b24f331 | 285 | dojoType=\"dijit.form.TextBox\" type='password' |
11b9d0be | 286 | style=\"width : 10em;\" name='pass'\"> |
ecace165 AD |
287 | </div></div>"; |
288 | ||
289 | ||
1b24f331 AD |
290 | print "<div style=\"clear : both\"> |
291 | <input type=\"checkbox\" dojoType=\"dijit.form.CheckBox\" id=\"feedDlg_loginCheck\" | |
11b9d0be AD |
292 | onclick='checkboxToggleElement(this, \"feedDlg_loginContainer\")'> |
293 | <label for=\"feedDlg_loginCheck\">". | |
ecace165 | 294 | __('This feed requires authentication.')."</div>"; |
f27de515 | 295 | |
ef8be8ea AD |
296 | print "</form>"; |
297 | ||
ecace165 | 298 | print "<div class=\"dlgButtons\"> |
11b9d0be AD |
299 | <button dojoType=\"dijit.form.Button\" onclick=\"return dijit.byId('feedAddDlg').execute()\">".__('Subscribe')."</button> |
300 | <button dojoType=\"dijit.form.Button\" onclick=\"return feedBrowser()\">".__('More feeds')."</button> | |
301 | <button dojoType=\"dijit.form.Button\" onclick=\"return dijit.byId('feedAddDlg').hide()\">".__('Cancel')."</button> | |
302 | </div>"; | |
951906dc AD |
303 | |
304 | //return; | |
ef8be8ea AD |
305 | } |
306 | ||
ef88b1cc AD |
307 | if ($id == "feedBrowser") { |
308 | ||
ef88b1cc | 309 | $browser_search = db_escape_string($_REQUEST["search"]); |
1b24f331 AD |
310 | |
311 | # print "<form onsubmit='return false;' display='inline' | |
11b9d0be | 312 | # name='feed_browser' id='feed_browser'>"; |
ef88b1cc | 313 | |
11b9d0be | 314 | print "<input dojoType=\"dijit.form.TextBox\" style=\"display : none\" name=\"op\" value=\"rpc\">"; |
1b24f331 | 315 | print "<input dojoType=\"dijit.form.TextBox\" style=\"display : none\" name=\"subop\" value=\"updateFeedBrowser\">"; |
ef88b1cc | 316 | |
a8328019 | 317 | print "<div dojoType=\"dijit.Toolbar\"> |
ef88b1cc | 318 | <div style='float : right'> |
1b24f331 | 319 | <img style='display : none' |
883fee8d AD |
320 | id='feed_browser_spinner' src='". |
321 | theme_image($link, 'images/indicator_white.gif')."'> | |
11b9d0be AD |
322 | <input name=\"search\" dojoType=\"dijit.form.TextBox\" size=\"20\" type=\"search\" |
323 | onchange=\"dijit.byId('feedBrowserDlg').update()\" value=\"$browser_search\"> | |
324 | <button dojoType=\"dijit.form.Button\" onclick=\"dijit.byId('feedBrowserDlg').update()\">".__('Search')."</button> | |
ef88b1cc AD |
325 | </div>"; |
326 | ||
11b9d0be | 327 | print " <select name=\"mode\" dojoType=\"dijit.form.Select\" onchange=\"dijit.byId('feedBrowserDlg').update()\"> |
ef88b1cc AD |
328 | <option value='1'>" . __('Popular feeds') . "</option> |
329 | <option value='2'>" . __('Feed archive') . "</option> | |
330 | </select> "; | |
331 | ||
332 | print __("limit:"); | |
333 | ||
11b9d0be | 334 | print " <select dojoType=\"dijit.form.Select\" name=\"limit\" onchange=\"dijit.byId('feedBrowserDlg').update()\">"; |
ef88b1cc AD |
335 | |
336 | foreach (array(25, 50, 100, 200) as $l) { | |
11b9d0be AD |
337 | $issel = ($l == $limit) ? "selected=\"1\"" : ""; |
338 | print "<option $issel value=\"$l\">$l</option>"; | |
ef88b1cc | 339 | } |
1b24f331 | 340 | |
ef88b1cc AD |
341 | print "</select> "; |
342 | ||
a8328019 | 343 | print "</div>"; |
ef88b1cc AD |
344 | |
345 | $owner_uid = $_SESSION["uid"]; | |
346 | ||
347 | print "<ul class='browseFeedList' id='browseFeedList'>"; | |
4a16bda3 | 348 | print make_feed_browser($link, $search, 25); |
ef88b1cc AD |
349 | print "</ul>"; |
350 | ||
351 | print "<div align='center'> | |
11b9d0be AD |
352 | <button dojoType=\"dijit.form.Button\" onclick=\"dijit.byId('feedBrowserDlg').execute()\">".__('Subscribe')."</button> |
353 | <button dojoType=\"dijit.form.Button\" style='display : none' id='feed_archive_remove' onclick=\"dijit.byId('feedBrowserDlg').removeFromArchive()\">".__('Remove')."</button> | |
354 | <button dojoType=\"dijit.form.Button\" onclick=\"dijit.byId('feedBrowserDlg').hide()\" >".__('Cancel')."</button></div>"; | |
ef88b1cc | 355 | |
ef88b1cc AD |
356 | } |
357 | ||
ef8be8ea AD |
358 | if ($id == "search") { |
359 | ||
2d1b7139 | 360 | $params = explode(":", db_escape_string($_REQUEST["param"]), 2); |
ef8be8ea AD |
361 | |
362 | $active_feed_id = sprintf("%d", $params[0]); | |
1b24f331 | 363 | $is_cat = $params[1] != "false"; |
ef8be8ea | 364 | |
de85cac2 | 365 | print "<div class=\"dlgSec\">".__('Look for')."</div>"; |
5bac8c29 AD |
366 | |
367 | print "<div class=\"dlgSecCont\">"; | |
368 | ||
a0ce6eb7 | 369 | if (!SPHINX_ENABLED) { |
5bac8c29 | 370 | |
1b24f331 | 371 | print "<input dojoType=\"dijit.form.ValidationTextBox\" |
a3042404 AD |
372 | style=\"font-size : 16px; width : 12em;\" |
373 | required=\"1\" name=\"query\" type=\"search\" value=''>"; | |
5bac8c29 | 374 | |
e4f7f8df | 375 | print " " . __('match on')." "; |
5bac8c29 | 376 | |
e4f7f8df AD |
377 | $search_fields = array( |
378 | "title" => __("Title"), | |
379 | "content" => __("Content"), | |
380 | "both" => __("Title or content")); | |
1b24f331 AD |
381 | |
382 | print_select_hash("match_on", 3, $search_fields, | |
383 | 'dojoType="dijit.form.Select"'); | |
e4f7f8df | 384 | } else { |
1b24f331 | 385 | print "<input dojoType=\"dijit.form.ValidationTextBox\" |
973fe3c6 AD |
386 | style=\"font-size : 16px; width : 20em;\" |
387 | required=\"1\" name=\"query\" type=\"search\" value=''>"; | |
e4f7f8df | 388 | } |
5bac8c29 AD |
389 | |
390 | ||
bcf5ed46 | 391 | print "<hr/>".__('Limit search to:')." "; |
1b24f331 | 392 | |
973fe3c6 | 393 | print "<select name=\"search_mode\" dojoType=\"dijit.form.Select\"> |
cc17c205 | 394 | <option value=\"all_feeds\">".__('All feeds')."</option>"; |
1b24f331 | 395 | |
ef8be8ea AD |
396 | $feed_title = getFeedTitle($link, $active_feed_id); |
397 | ||
398 | if (!$is_cat) { | |
399 | $feed_cat_title = getFeedCatTitle($link, $active_feed_id); | |
400 | } else { | |
401 | $feed_cat_title = getCategoryTitle($link, $active_feed_id); | |
402 | } | |
1b24f331 AD |
403 | |
404 | if ($active_feed_id && !$is_cat) { | |
973fe3c6 | 405 | print "<option selected=\"1\" value=\"this_feed\">$feed_title</option>"; |
ef8be8ea | 406 | } else { |
973fe3c6 | 407 | print "<option disabled=\"1\" value=\"false\">".__('This feed')."</option>"; |
ef8be8ea AD |
408 | } |
409 | ||
410 | if ($is_cat) { | |
973fe3c6 | 411 | $cat_preselected = "selected=\"1\""; |
ef8be8ea AD |
412 | } |
413 | ||
414 | if (get_pref($link, 'ENABLE_FEED_CATS') && ($active_feed_id > 0 || $is_cat)) { | |
cc17c205 | 415 | print "<option $cat_preselected value=\"this_cat\">$feed_cat_title</option>"; |
ef8be8ea | 416 | } else { |
c4b0f96c | 417 | //print "<option disabled>".__('This category')."</option>"; |
ef8be8ea AD |
418 | } |
419 | ||
1b24f331 | 420 | print "</select>"; |
ef8be8ea | 421 | |
5bac8c29 | 422 | print "</div>"; |
ef8be8ea | 423 | |
5bac8c29 | 424 | print "<div class=\"dlgButtons\"> |
973fe3c6 AD |
425 | <button dojoType=\"dijit.form.Button\" onclick=\"dijit.byId('searchDlg').execute()\">".__('Search')."</button> |
426 | <button dojoType=\"dijit.form.Button\" onclick=\"dijit.byId('searchDlg').hide()\">".__('Cancel')."</button> | |
ad491d75 | 427 | </div>"; |
ef8be8ea AD |
428 | } |
429 | ||
ef8be8ea AD |
430 | if ($id == "quickAddFilter") { |
431 | ||
b4e75b2a | 432 | $active_feed_id = db_escape_string($_REQUEST["param"]); |
ef8be8ea | 433 | |
d90868d7 AD |
434 | print "<input dojoType=\"dijit.form.TextBox\" style=\"display : none\" name=\"op\" value=\"pref-filters\">"; |
435 | print "<input dojoType=\"dijit.form.TextBox\" style=\"display : none\" name=\"quiet\" value=\"1\">"; | |
1b24f331 AD |
436 | print "<input dojoType=\"dijit.form.TextBox\" style=\"display : none\" name=\"subop\" value=\"add\">"; |
437 | ||
438 | $result = db_query($link, "SELECT id,description | |
ef8be8ea | 439 | FROM ttrss_filter_types ORDER BY description"); |
1b24f331 | 440 | |
ef8be8ea | 441 | $filter_types = array(); |
1b24f331 | 442 | |
ef8be8ea AD |
443 | while ($line = db_fetch_assoc($result)) { |
444 | //array_push($filter_types, $line["description"]); | |
89cb787e | 445 | $filter_types[$line["id"]] = __($line["description"]); |
ef8be8ea AD |
446 | } |
447 | ||
10fa6615 AD |
448 | print "<div class=\"dlgSec\">".__("Match")."</div>"; |
449 | ||
450 | print "<div class=\"dlgSecCont\">"; | |
451 | ||
d90868d7 | 452 | print "<span id=\"filterDlg_dateModBox\" style=\"display : none\">"; |
44d0e774 AD |
453 | |
454 | $filter_params = array( | |
455 | "before" => __("before"), | |
456 | "after" => __("after")); | |
457 | ||
1b24f331 | 458 | print_select_hash("filter_date_modifier", "before", |
d90868d7 | 459 | $filter_params, 'dojoType="dijit.form.Select"'); |
44d0e774 AD |
460 | |
461 | print " </span>"; | |
d0da85c2 | 462 | |
1b24f331 | 463 | print "<input dojoType=\"dijit.form.ValidationTextBox\" |
d90868d7 AD |
464 | required=\"true\" id=\"filterDlg_regExp\" |
465 | style=\"font-size : 16px\" | |
466 | name=\"reg_exp\" value=\"$reg_exp\"/>"; | |
10fa6615 | 467 | |
d90868d7 | 468 | print "<span id=\"filterDlg_dateChkBox\" style=\"display : none\">"; |
aaba2225 AD |
469 | print " <button dojoType=\"dijit.form.Button\" |
470 | onclick=\"return filterDlgCheckDate()\">". | |
a918f5f9 | 471 | __('Check it')."</button>"; |
d0da85c2 AD |
472 | print "</span>"; |
473 | ||
bcf5ed46 | 474 | print "<hr/>" . __("on field") . " "; |
d0da85c2 | 475 | print_select_hash("filter_type", 1, $filter_types, |
d90868d7 | 476 | 'onchange="filterDlgCheckType(this)" dojoType="dijit.form.Select"'); |
10fa6615 | 477 | |
bcf5ed46 | 478 | print "<hr/>"; |
10fa6615 AD |
479 | |
480 | print __("in") . " "; | |
1b24f331 | 481 | print_feed_select($link, "feed_id", $active_feed_id, |
d90868d7 | 482 | 'dojoType="dijit.form.FilteringSelect"'); |
10fa6615 AD |
483 | |
484 | print "</div>"; | |
485 | ||
ecace165 | 486 | print "<div class=\"dlgSec\">".__("Perform Action")."</div>"; |
10fa6615 AD |
487 | |
488 | print "<div class=\"dlgSecCont\">"; | |
489 | ||
d90868d7 | 490 | print "<select name=\"action_id\" dojoType=\"dijit.form.Select\" |
10fa6615 | 491 | onchange=\"filterDlgCheckAction(this)\">"; |
1b24f331 AD |
492 | |
493 | $result = db_query($link, "SELECT id,description FROM ttrss_filter_actions | |
10fa6615 AD |
494 | ORDER BY name"); |
495 | ||
496 | while ($line = db_fetch_assoc($result)) { | |
497 | printf("<option value='%d'>%s</option>", $line["id"], __($line["description"])); | |
498 | } | |
1b24f331 | 499 | |
10fa6615 AD |
500 | print "</select>"; |
501 | ||
d90868d7 | 502 | print "<span id=\"filterDlg_paramBox\" style=\"display : none\">"; |
143a4973 | 503 | print " " . __("with parameters:") . " "; |
d90868d7 AD |
504 | print "<input dojoType=\"dijit.form.TextBox\" |
505 | id=\"filterDlg_actionParam\" | |
506 | name=\"action_param\">"; | |
6427a306 | 507 | |
1b24f331 | 508 | print_label_select($link, "action_param_label", $action_param, |
d90868d7 | 509 | 'id="filterDlg_actionParamLabel" dojoType="dijit.form.Select"'); |
6427a306 | 510 | |
143a4973 | 511 | print "</span>"; |
10fa6615 | 512 | |
143a4973 | 513 | print " "; // tiny layout hack |
10fa6615 AD |
514 | |
515 | print "</div>"; | |
516 | ||
517 | print "<div class=\"dlgSec\">".__("Options")."</div>"; | |
518 | print "<div class=\"dlgSecCont\">"; | |
519 | ||
d90868d7 | 520 | print "<input dojoType=\"dijit.form.CheckBox\" type=\"checkbox\" name=\"enabled\" id=\"enabled\" checked=\"1\"> |
bcf5ed46 | 521 | <label for=\"enabled\">".__('Enabled')."</label><hr/>"; |
10fa6615 | 522 | |
d90868d7 | 523 | print "<input dojoType=\"dijit.form.CheckBox\" type=\"checkbox\" name=\"inverse\" id=\"inverse\"> |
10fa6615 AD |
524 | <label for=\"inverse\">".__('Inverse match')."</label>"; |
525 | ||
526 | print "</div>"; | |
ef8be8ea | 527 | |
10fa6615 | 528 | print "<div class=\"dlgButtons\">"; |
ef8be8ea | 529 | |
5593784a AD |
530 | print "<button dojoType=\"dijit.form.Button\" onclick=\"return dijit.byId('filterEditDlg').test()\">". |
531 | __('Test')."</button> "; | |
532 | ||
c33f56f3 | 533 | print "<button dojoType=\"dijit.form.Button\" onclick=\"return dijit.byId('filterEditDlg').execute()\">". |
ad491d75 | 534 | __('Create')."</button> "; |
ef8be8ea | 535 | |
c33f56f3 | 536 | print "<button dojoType=\"dijit.form.Button\" onclick=\"return dijit.byId('filterEditDlg').hide()\">". |
d90868d7 | 537 | __('Cancel')."</button>"; |
ef8be8ea | 538 | |
d90868d7 | 539 | print "</div>"; |
ef8be8ea | 540 | |
951906dc | 541 | //return; |
ef8be8ea AD |
542 | } |
543 | ||
8ffd2011 AD |
544 | if ($id == "inactiveFeeds") { |
545 | ||
546 | if (DB_TYPE == "pgsql") { | |
547 | $interval_qpart = "NOW() - INTERVAL '3 months'"; | |
548 | } else { | |
549 | $interval_qpart = "DATE_SUB(NOW(), INTERVAL 3 MONTH)"; | |
550 | } | |
551 | ||
552 | $result = db_query($link, "SELECT ttrss_feeds.title, ttrss_feeds.site_url, | |
553 | ttrss_feeds.feed_url, ttrss_feeds.id, MAX(updated) AS last_article | |
554 | FROM ttrss_feeds, ttrss_entries, ttrss_user_entries WHERE | |
555 | (SELECT MAX(updated) FROM ttrss_entries, ttrss_user_entries WHERE | |
556 | ttrss_entries.id = ref_id AND | |
557 | ttrss_user_entries.feed_id = ttrss_feeds.id) < $interval_qpart | |
558 | AND ttrss_feeds.owner_uid = ".$_SESSION["uid"]." AND | |
559 | ttrss_user_entries.feed_id = ttrss_feeds.id AND | |
560 | ttrss_entries.id = ref_id | |
561 | GROUP BY ttrss_feeds.title, ttrss_feeds.id, ttrss_feeds.site_url, ttrss_feeds.feed_url | |
562 | ORDER BY last_article"); | |
563 | ||
564 | print __("These feeds have not been updated with new content for 3 months (oldest first):"); | |
565 | ||
566 | print "<div class=\"inactiveFeedHolder\">"; | |
567 | ||
568 | print "<table width=\"100%\" cellspacing=\"0\" id=\"prefInactiveFeedList\">"; | |
569 | ||
570 | $lnum = 1; | |
571 | ||
572 | while ($line = db_fetch_assoc($result)) { | |
573 | ||
574 | $class = ($lnum % 2) ? "even" : "odd"; | |
575 | $feed_id = $line["id"]; | |
576 | $this_row_id = "id=\"FUPDD-$feed_id\""; | |
577 | ||
578 | print "<tr class=\"\" $this_row_id>"; | |
579 | ||
580 | $edit_title = htmlspecialchars($line["title"]); | |
581 | ||
582 | print "<td width='5%' align='center'><input | |
583 | onclick='toggleSelectRow2(this);' dojoType=\"dijit.form.CheckBox\" | |
584 | type=\"checkbox\"></td>"; | |
585 | print "<td>"; | |
586 | ||
e57e73ef AD |
587 | print "<a class=\"visibleLink\" href=\"#\" ". |
588 | "title=\"".__("Click to edit feed")."\" ". | |
589 | "onclick=\"editFeed(".$line["id"].")\">". | |
590 | htmlspecialchars($line["title"])."</a>"; | |
8ffd2011 AD |
591 | |
592 | print "</td><td class=\"insensitive\" align='right'>"; | |
e57e73ef | 593 | print make_local_datetime($link, $line['last_article'], false); |
8ffd2011 AD |
594 | print "</td>"; |
595 | print "</tr>"; | |
596 | ||
597 | ++$lnum; | |
598 | } | |
599 | ||
600 | print "</table>"; | |
601 | print "</div>"; | |
602 | ||
603 | print "<div class='dlgButtons'>"; | |
604 | print "<div style='float : left'>"; | |
605 | print "<button dojoType=\"dijit.form.Button\" onclick=\"dijit.byId('inactiveFeedsDlg').removeSelected()\">" | |
606 | .__('Unsubscribe from selected feeds')."</button> "; | |
607 | print "</div>"; | |
608 | ||
609 | print "<button dojoType=\"dijit.form.Button\" onclick=\"dijit.byId('inactiveFeedsDlg').hide()\">". | |
610 | __('Close this window')."</button>"; | |
611 | ||
612 | print "</div>"; | |
613 | ||
614 | } | |
615 | ||
e57e73ef | 616 | if ($id == "feedsWithErrors") { |
a3656a41 | 617 | |
e57e73ef AD |
618 | # print "<title>".__('Feeds with update errors')."</title>"; |
619 | # print "<content><![CDATA["; | |
a3656a41 | 620 | |
cc17c205 | 621 | print __("These feeds have not been updated because of errors:"); |
a3656a41 | 622 | |
a4cd9d58 | 623 | $result = db_query($link, "SELECT id,title,feed_url,last_error,site_url |
a3656a41 AD |
624 | FROM ttrss_feeds WHERE last_error != '' AND owner_uid = ".$_SESSION["uid"]); |
625 | ||
e57e73ef AD |
626 | print "<div class=\"inactiveFeedHolder\">"; |
627 | ||
628 | print "<table width=\"100%\" cellspacing=\"0\" id=\"prefErrorFeedList\">"; | |
629 | ||
630 | $lnum = 1; | |
a3656a41 AD |
631 | |
632 | while ($line = db_fetch_assoc($result)) { | |
e57e73ef AD |
633 | |
634 | $class = ($lnum % 2) ? "even" : "odd"; | |
635 | $feed_id = $line["id"]; | |
636 | $this_row_id = "id=\"FUPDD-$feed_id\""; | |
637 | ||
638 | print "<tr class=\"\" $this_row_id>"; | |
639 | ||
640 | $edit_title = htmlspecialchars($line["title"]); | |
641 | ||
642 | print "<td width='5%' align='center'><input | |
643 | onclick='toggleSelectRow2(this);' dojoType=\"dijit.form.CheckBox\" | |
644 | type=\"checkbox\"></td>"; | |
645 | print "<td>"; | |
646 | ||
647 | print "<a class=\"visibleLink\" href=\"#\" ". | |
648 | "title=\"".__("Click to edit feed")."\" ". | |
649 | "onclick=\"editFeed(".$line["id"].")\">". | |
650 | htmlspecialchars($line["title"])."</a>: "; | |
651 | ||
652 | print "<span class=\"insensitive\">"; | |
653 | print htmlspecialchars($line["last_error"]); | |
654 | print "</span>"; | |
655 | ||
656 | print "</td>"; | |
657 | print "</tr>"; | |
658 | ||
659 | ++$lnum; | |
a3656a41 AD |
660 | } |
661 | ||
e57e73ef AD |
662 | print "</table>"; |
663 | print "</div>"; | |
a3656a41 | 664 | |
e57e73ef AD |
665 | print "<div class='dlgButtons'>"; |
666 | print "<div style='float : left'>"; | |
667 | print "<button dojoType=\"dijit.form.Button\" onclick=\"dijit.byId('errorFeedsDlg').removeSelected()\">" | |
668 | .__('Unsubscribe from selected feeds')."</button> "; | |
669 | print "</div>"; | |
a3656a41 | 670 | |
e57e73ef | 671 | print "<button dojoType=\"dijit.form.Button\" onclick=\"dijit.byId('errorFeedsDlg').hide()\">". |
a522a767 | 672 | __('Close this window')."</button>"; |
a3656a41 | 673 | |
e57e73ef | 674 | print "</div>"; |
a3656a41 AD |
675 | } |
676 | ||
0b126ac2 AD |
677 | if ($id == "editArticleTags") { |
678 | ||
8386f861 | 679 | # print "<form id=\"tag_edit_form\" onsubmit='return false'>"; |
0b126ac2 | 680 | |
cc17c205 | 681 | print __("Tags for this article (separated by commas):")."<br>"; |
0b126ac2 AD |
682 | |
683 | $tags = get_article_tags($link, $param); | |
684 | ||
685 | $tags_str = join(", ", $tags); | |
686 | ||
8386f861 AD |
687 | print "<input dojoType=\"dijit.form.TextBox\" style=\"display : none\" name=\"id\" value=\"$param\">"; |
688 | print "<input dojoType=\"dijit.form.TextBox\" style=\"display : none\" name=\"op\" value=\"rpc\">"; | |
689 | print "<input dojoType=\"dijit.form.TextBox\" style=\"display : none\" name=\"subop\" value=\"setArticleTags\">"; | |
d62a3b63 | 690 | |
8386f861 | 691 | print "<table width='100%'><tr><td>"; |
d62a3b63 | 692 | |
8386f861 AD |
693 | print "<textarea dojoType=\"dijit.form.SimpleTextarea\" rows='4' |
694 | style='font-size : 12px; width : 100%' id=\"tags_str\" | |
05fcdf52 | 695 | name='tags_str'>$tags_str</textarea> |
1b24f331 AD |
696 | <div class=\"autocomplete\" id=\"tags_choices\" |
697 | style=\"display:none\"></div>"; | |
d62a3b63 | 698 | |
8386f861 | 699 | print "</td></tr></table>"; |
0b126ac2 | 700 | |
8386f861 | 701 | # print "</form>"; |
0b126ac2 | 702 | |
8386f861 | 703 | print "<div class='dlgButtons'>"; |
0b126ac2 | 704 | |
8386f861 AD |
705 | print "<button dojoType=\"dijit.form.Button\" |
706 | onclick=\"dijit.byId('editTagsDlg').execute()\">".__('Save')."</button> "; | |
707 | print "<button dojoType=\"dijit.form.Button\" | |
708 | onclick=\"dijit.byId('editTagsDlg').hide()\">".__('Cancel')."</button>"; | |
709 | print "</div>"; | |
0b126ac2 AD |
710 | |
711 | } | |
712 | ||
0979b696 | 713 | if ($id == "printTagCloud") { |
951906dc AD |
714 | print "<title>".__('Tag Cloud')."</title>"; |
715 | print "<content><![CDATA["; | |
0979b696 | 716 | |
1b24f331 AD |
717 | # print __("Showing most popular tags ")." (<a |
718 | # href='javascript:toggleTags(true)'>".__('more tags')."</a>):<br/>"; | |
0979b696 AD |
719 | |
720 | print "<div class=\"tagCloudContainer\">"; | |
721 | ||
722 | printTagCloud($link); | |
723 | ||
724 | print "</div>"; | |
725 | ||
726 | print "<div align='center'>"; | |
1b24f331 | 727 | print "<button dojoType=\"dijit.form.Button\" |
bec2ecd9 | 728 | onclick=\"return closeInfoBox()\">". |
d60009cd | 729 | __('Close this window')."</button>"; |
0979b696 AD |
730 | print "</div>"; |
731 | ||
951906dc | 732 | print "]]></content>"; |
0979b696 | 733 | |
951906dc | 734 | //return; |
0979b696 AD |
735 | } |
736 | ||
31a53903 AD |
737 | if ($id == "emailArticle") { |
738 | ||
736e8977 | 739 | $secretkey = sha1(uniqid(rand(), true)); |
87b16a0a | 740 | |
31a53903 | 741 | $_SESSION['email_secretkey'] = $secretkey; |
87b16a0a | 742 | |
18606807 AD |
743 | print "<input dojoType=\"dijit.form.TextBox\" style=\"display : none\" name=\"secretkey\" value=\"$secretkey\">"; |
744 | print "<input dojoType=\"dijit.form.TextBox\" style=\"display : none\" name=\"op\" value=\"rpc\">"; | |
1b24f331 | 745 | print "<input dojoType=\"dijit.form.TextBox\" style=\"display : none\" name=\"subop\" value=\"sendEmail\">"; |
87b16a0a | 746 | |
73fe13af | 747 | $result = db_query($link, "SELECT email, full_name FROM ttrss_users WHERE |
f72a7b66 AD |
748 | id = " . $_SESSION["uid"]); |
749 | ||
750 | $user_email = htmlspecialchars(db_fetch_result($result, 0, "email")); | |
73fe13af AD |
751 | $user_name = htmlspecialchars(db_fetch_result($result, 0, "full_name")); |
752 | ||
753 | if (!$user_name) $user_name = $_SESSION['name']; | |
f72a7b66 AD |
754 | |
755 | $_SESSION['email_replyto'] = $user_email; | |
756 | $_SESSION['email_fromname'] = $user_name; | |
757 | ||
31a53903 | 758 | require_once "lib/MiniTemplator.class.php"; |
87b16a0a | 759 | |
31a53903 AD |
760 | $tpl = new MiniTemplator; |
761 | $tpl_t = new MiniTemplator; | |
87b16a0a | 762 | |
31a53903 | 763 | $tpl->readTemplateFromFile("templates/email_article_template.txt"); |
6a1cd591 | 764 | |
f72a7b66 AD |
765 | $tpl->setVariable('USER_NAME', $_SESSION["name"]); |
766 | $tpl->setVariable('USER_EMAIL', $user_email); | |
767 | $tpl->setVariable('TTRSS_HOST', $_SERVER["HTTP_HOST"]); | |
31a53903 | 768 | |
f72a7b66 | 769 | // $tpl->addBlock('header'); |
31a53903 | 770 | |
f72a7b66 AD |
771 | $result = db_query($link, "SELECT link, content, title |
772 | FROM ttrss_user_entries, ttrss_entries WHERE id = ref_id AND | |
773 | id IN ($param) AND owner_uid = " . $_SESSION["uid"]); | |
31a53903 | 774 | |
f72a7b66 AD |
775 | if (db_num_rows($result) > 1) { |
776 | $subject = __("[Forwarded]") . " " . __("Multiple articles"); | |
777 | } | |
31a53903 | 778 | |
f72a7b66 | 779 | while ($line = db_fetch_assoc($result)) { |
31a53903 | 780 | |
f72a7b66 AD |
781 | if (!$subject) |
782 | $subject = __("[Forwarded]") . " " . htmlspecialchars($line["title"]); | |
31a53903 | 783 | |
f72a7b66 AD |
784 | $tpl->setVariable('ARTICLE_TITLE', strip_tags($line["title"])); |
785 | $tpl->setVariable('ARTICLE_URL', strip_tags($line["link"])); | |
31a53903 | 786 | |
f72a7b66 AD |
787 | $tpl->addBlock('article'); |
788 | } | |
31a53903 AD |
789 | |
790 | $tpl->addBlock('email'); | |
f72a7b66 | 791 | |
31a53903 AD |
792 | $content = ""; |
793 | $tpl->generateOutputToString($content); | |
794 | ||
795 | print "<table width='100%'><tr><td>"; | |
796 | ||
797 | print __('From:'); | |
798 | ||
799 | print "</td><td>"; | |
800 | ||
18606807 | 801 | print "<input dojoType=\"dijit.form.TextBox\" disabled=\"1\" style=\"width : 30em;\" |
31a53903 AD |
802 | value=\"$user_name <$user_email>\">"; |
803 | ||
804 | print "</td></tr><tr><td>"; | |
805 | ||
806 | print __('To:'); | |
807 | ||
808 | print "</td><td>"; | |
809 | ||
18606807 AD |
810 | print "<input dojoType=\"dijit.form.ValidationTextBox\" required=\"true\" |
811 | style=\"width : 30em;\" | |
812 | name=\"destination\" id=\"emailArticleDlg_destination\">"; | |
31a53903 | 813 | |
1b24f331 AD |
814 | print "<div class=\"autocomplete\" id=\"emailArticleDlg_dst_choices\" |
815 | style=\"z-index: 30; display : none\"></div>"; | |
31a53903 AD |
816 | |
817 | print "</td></tr><tr><td>"; | |
818 | ||
819 | print __('Subject:'); | |
820 | ||
821 | print "</td><td>"; | |
822 | ||
18606807 | 823 | print "<input dojoType=\"dijit.form.ValidationTextBox\" required=\"true\" |
1b24f331 | 824 | style=\"width : 30em;\" |
31a53903 AD |
825 | name=\"subject\" value=\"$subject\" id=\"subject\">"; |
826 | ||
18606807 | 827 | print "</td></tr>"; |
31a53903 | 828 | |
18606807 | 829 | print "<tr><td colspan='2'><textarea dojoType=\"dijit.form.SimpleTextarea\" style='font-size : 12px; width : 100%' rows=\"20\" |
31a53903 | 830 | name='content'>$content</textarea>"; |
87b16a0a | 831 | |
18606807 | 832 | print "</td></tr></table>"; |
87b16a0a | 833 | |
31a53903 | 834 | print "<div class='dlgButtons'>"; |
18606807 AD |
835 | print "<button dojoType=\"dijit.form.Button\" onclick=\"dijit.byId('emailArticleDlg').execute()\">".__('Send e-mail')."</button> "; |
836 | print "<button dojoType=\"dijit.form.Button\" onclick=\"dijit.byId('emailArticleDlg').hide()\">".__('Cancel')."</button>"; | |
837 | print "</div>"; | |
87b16a0a | 838 | |
951906dc | 839 | //return; |
31a53903 | 840 | } |
87b16a0a | 841 | |
8801fb01 AD |
842 | if ($id == "generatedFeed") { |
843 | ||
951906dc AD |
844 | print "<title>".__('View as RSS')."</title>"; |
845 | print "<content><![CDATA["; | |
1b24f331 | 846 | |
8801fb01 AD |
847 | $params = explode(":", $param, 3); |
848 | $feed_id = db_escape_string($params[0]); | |
849 | $is_cat = (bool) $params[1]; | |
850 | ||
851 | $key = get_feed_access_key($link, $feed_id, $is_cat); | |
852 | ||
853 | $url_path = htmlspecialchars($params[2]) . "&key=" . $key; | |
854 | ||
855 | print __("You can view this feed as RSS using the following URL:"); | |
856 | ||
857 | print "<div class=\"tagCloudContainer\">"; | |
858 | print "<a id='gen_feed_url' href='$url_path' target='_blank'>$url_path</a>"; | |
859 | print "</div>"; | |
860 | ||
861 | print "<div align='center'>"; | |
862 | ||
18606807 | 863 | print "<button dojoType=\"dijit.form.Button\" onclick=\"return genUrlChangeKey('$feed_id', '$is_cat')\">". |
8801fb01 AD |
864 | __('Generate new URL')."</button> "; |
865 | ||
18606807 | 866 | print "<button dojoType=\"dijit.form.Button\" onclick=\"return closeInfoBox()\">". |
a918f5f9 | 867 | __('Close this window')."</button>"; |
8801fb01 | 868 | |
951906dc AD |
869 | print "</div>"; |
870 | print "]]></content>"; | |
8801fb01 | 871 | |
951906dc | 872 | //return; |
8801fb01 AD |
873 | } |
874 | ||
63855db1 | 875 | if ($id == "newVersion") { |
e91ad1e9 AD |
876 | $version_data = check_for_update($link); |
877 | $version = $version_data['version']; | |
878 | $id = $version_data['version_id']; | |
63855db1 AD |
879 | |
880 | print "<div class='tagCloudContainer'>"; | |
881 | ||
1b24f331 | 882 | print T_sprintf("New version of Tiny Tiny RSS is available (%s).", |
e91ad1e9 | 883 | "<b>$version</b>"); |
63855db1 AD |
884 | |
885 | print "</div>"; | |
886 | ||
e91ad1e9 AD |
887 | $details = "http://tt-rss.org/redmine/versions/show/$id"; |
888 | $download = "http://tt-rss.org/#Download"; | |
889 | ||
63855db1 | 890 | print "<div style='text-align : center'>"; |
1b24f331 | 891 | print "<button dojoType=\"dijit.form.Button\" |
e91ad1e9 | 892 | onclick=\"return window.open('$details')\">".__("Details")."</button>"; |
1b24f331 | 893 | print "<button dojoType=\"dijit.form.Button\" |
e91ad1e9 | 894 | onclick=\"return window.open('$download')\">".__("Download")."</button>"; |
1b24f331 | 895 | print "<button dojoType=\"dijit.form.Button\" |
63855db1 AD |
896 | onclick=\"return dijit.byId('newVersionDlg').hide()\">". |
897 | __('Close this window')."</button>"; | |
898 | print "</div>"; | |
899 | ||
900 | } | |
901 | ||
88e4e597 AD |
902 | if ($id == "customizeCSS") { |
903 | ||
904 | $value = get_pref($link, "USER_STYLESHEET"); | |
905 | ||
5823f9fb AD |
906 | $value = str_replace("<br/>", "\n", $value); |
907 | ||
88e4e597 AD |
908 | print T_sprintf("You can override colors, fonts and layout of your currently selected theme with custom CSS declarations here. <a target=\"_blank\" class=\"visibleLink\" href=\"%s\">This file</a> can be used as a baseline.", "tt-rss.css"); |
909 | ||
910 | print "<input dojoType=\"dijit.form.TextBox\" style=\"display : none\" name=\"op\" value=\"rpc\">"; | |
911 | print "<input dojoType=\"dijit.form.TextBox\" style=\"display : none\" name=\"subop\" value=\"setpref\">"; | |
912 | print "<input dojoType=\"dijit.form.TextBox\" style=\"display : none\" name=\"key\" value=\"USER_STYLESHEET\">"; | |
913 | ||
741b6090 AD |
914 | print "<table width='100%'><tr><td>"; |
915 | print "<textarea dojoType=\"dijit.form.SimpleTextarea\" | |
88e4e597 AD |
916 | style='font-size : 12px; width : 100%; height: 200px;' |
917 | placeHolder='body#ttrssMain { font-size : 14px; };' | |
918 | name='value'>$value</textarea>"; | |
741b6090 | 919 | print "</td></tr></table>"; |
88e4e597 AD |
920 | |
921 | print "<div class='dlgButtons'>"; | |
922 | print "<button dojoType=\"dijit.form.Button\" | |
923 | onclick=\"dijit.byId('cssEditDlg').execute()\">".__('Save')."</button> "; | |
924 | print "<button dojoType=\"dijit.form.Button\" | |
925 | onclick=\"dijit.byId('cssEditDlg').hide()\">".__('Cancel')."</button>"; | |
926 | print "</div>"; | |
927 | ||
928 | } | |
929 | ||
741b6090 AD |
930 | if ($id == "editArticleNote") { |
931 | ||
932 | $result = db_query($link, "SELECT note FROM ttrss_user_entries WHERE | |
933 | ref_id = '$param' AND owner_uid = " . $_SESSION['uid']); | |
934 | ||
935 | $note = db_fetch_result($result, 0, "note"); | |
936 | ||
937 | print "<input dojoType=\"dijit.form.TextBox\" style=\"display : none\" name=\"id\" value=\"$param\">"; | |
938 | print "<input dojoType=\"dijit.form.TextBox\" style=\"display : none\" name=\"op\" value=\"rpc\">"; | |
939 | print "<input dojoType=\"dijit.form.TextBox\" style=\"display : none\" name=\"subop\" value=\"setNote\">"; | |
940 | ||
941 | print "<table width='100%'><tr><td>"; | |
942 | print "<textarea dojoType=\"dijit.form.SimpleTextarea\" | |
943 | style='font-size : 12px; width : 100%; height: 100px;' | |
944 | placeHolder='body#ttrssMain { font-size : 14px; };' | |
945 | name='note'>$note</textarea>"; | |
946 | print "</td></tr></table>"; | |
947 | ||
948 | print "<div class='dlgButtons'>"; | |
949 | print "<button dojoType=\"dijit.form.Button\" | |
950 | onclick=\"dijit.byId('editNoteDlg').execute()\">".__('Save')."</button> "; | |
951 | print "<button dojoType=\"dijit.form.Button\" | |
952 | onclick=\"dijit.byId('editNoteDlg').hide()\">".__('Cancel')."</button>"; | |
953 | print "</div>"; | |
954 | ||
955 | } | |
956 | ||
da497bab AD |
957 | if ($id == "about") { |
958 | print "<table width='100%'><tr><td align='center'>"; | |
959 | print "<img src=\"images/logo_big.png\">"; | |
960 | print "</td>"; | |
961 | print "<td width='70%'>"; | |
962 | ||
963 | print "<h1>Tiny Riny RSS</h1> | |
964 | <strong>Version ".VERSION."</strong> | |
965 | <p>Copyright © 2005-".date('Y')." | |
966 | <a target=\"_blank\" class=\"visibleLink\" | |
967 | href=\"http://fakecake.org/\">Andrew Dolgov</a> | |
968 | and other contributors.</p> | |
969 | <p class=\"insensitive\">Licensed under GNU GPL version 2.</p>"; | |
970 | ||
971 | print "<p class=\"insensitive\"> | |
972 | <a class=\"visibleLink\" target=\"_blank\" | |
973 | href=\"http://tt-rss.org/\">Official site</a> — | |
974 | <a href=\"http://tt-rss.org/redmine/wiki/tt-rss/Donate\" | |
975 | target=\"_blank\" class=\"visibleLink\"> | |
976 | Support the project.</a></p>"; | |
977 | ||
978 | print "</td></tr>"; | |
979 | print "</table>"; | |
980 | ||
981 | print "<div align='center'>"; | |
982 | print "<button dojoType=\"dijit.form.Button\" | |
983 | type=\"submit\">". | |
984 | __('Close this window')."</button>"; | |
985 | print "</div>"; | |
986 | } | |
741b6090 | 987 | |
1b24f331 | 988 | print "</dlg>"; |
ef8be8ea AD |
989 | } |
990 | ?> |