]> git.wh0rd.org - tt-rss.git/blame - classes/pref/feeds.php
add special link to cancel current search
[tt-rss.git] / classes / pref / feeds.php
CommitLineData
afcfe6ca 1<?php
369dbc19 2class Pref_Feeds extends Handler_Protected {
8484ce22
AD
3
4 function csrf_ignore($method) {
f6cd767b 5 $csrf_ignored = array("index", "getfeedtree", "add", "editcats", "editfeed",
bc6fa236 6 "savefeedorder", "uploadicon", "feedswitherrors", "inactivefeeds");
8484ce22
AD
7
8 return array_search($method, $csrf_ignored) !== false;
9 }
10
afcfe6ca
AD
11 function batch_edit_cbox($elem, $label = false) {
12 print "<input type=\"checkbox\" title=\"".__("Check to enable field")."\"
13 onchange=\"dijit.byId('feedEditDlg').toggleField(this, '$elem', '$label')\">";
14 }
15
16 function renamecat() {
17 $title = db_escape_string($_REQUEST['title']);
18 $id = db_escape_string($_REQUEST['id']);
19
20 if ($title) {
21 db_query($this->link, "UPDATE ttrss_feed_categories SET
22 title = '$title' WHERE id = '$id' AND owner_uid = " . $_SESSION["uid"]);
23 }
24 return;
25 }
26
2a060a94 27 private function get_category_items($cat_id) {
6e0ee833
AD
28
29 if ($_REQUEST['mode'] != 2)
30 $search = $_SESSION["prefs_feed_search"];
31 else
32 $search = "";
17c755f0
AD
33
34 if ($search) $search_qpart = " AND LOWER(title) LIKE LOWER('%$search%')";
35
f393dc6f 36 $show_empty_cats = $_REQUEST['mode'] != 2 && !$search &&
fbf85cf6 37 get_pref($this->link, '_PREFS_SHOW_EMPTY_CATS');
2a060a94
AD
38
39 $items = array();
40
2ecd2df5 41 $result = db_query($this->link, "SELECT id, title, collapsed FROM ttrss_feed_categories
2a060a94
AD
42 WHERE owner_uid = " . $_SESSION["uid"] . " AND parent_cat = '$cat_id' ORDER BY order_id, title");
43
44 while ($line = db_fetch_assoc($result)) {
45
46 $cat = array();
47 $cat['id'] = 'CAT:' . $line['id'];
2ecd2df5 48 $cat['bare_id'] = (int)$line['id'];
2a060a94
AD
49 $cat['name'] = $line['title'];
50 $cat['items'] = array();
51 $cat['checkbox'] = false;
2ecd2df5 52 $cat['hidden'] = sql_bool_to_bool($line['collapsed']);
2a060a94 53 $cat['type'] = 'category';
2ecd2df5 54 $cat['unread'] = 0;
2c5f231e 55 $cat['child_unread'] = 0;
2a060a94
AD
56
57 $cat['items'] = $this->get_category_items($line['id']);
58
59 $cat['param'] = T_sprintf('(%d feeds)', count($cat['items']));
60
61 if (count($cat['items']) > 0 || $show_empty_cats)
62 array_push($items, $cat);
63
64 }
65
66 $feed_result = db_query($this->link, "SELECT id, title, last_error,
67 ".SUBSTRING_FOR_DATE."(last_updated,1,19) AS last_updated
68 FROM ttrss_feeds
69 WHERE cat_id = '$cat_id' AND owner_uid = ".$_SESSION["uid"].
70 "$search_qpart ORDER BY order_id, title");
71
72 while ($feed_line = db_fetch_assoc($feed_result)) {
73 $feed = array();
74 $feed['id'] = 'FEED:' . $feed_line['id'];
2ecd2df5 75 $feed['bare_id'] = (int)$feed_line['id'];
2a060a94
AD
76 $feed['name'] = $feed_line['title'];
77 $feed['checkbox'] = false;
2ecd2df5 78 $feed['unread'] = 0;
2a060a94
AD
79 $feed['error'] = $feed_line['last_error'];
80 $feed['icon'] = getFeedIcon($feed_line['id']);
81 $feed['param'] = make_local_datetime($this->link,
82 $feed_line['last_updated'], true);
83
84 array_push($items, $feed);
85 }
86
87 return $items;
88 }
89
afcfe6ca
AD
90 function getfeedtree() {
91
6e0ee833
AD
92 if ($_REQUEST['mode'] != 2)
93 $search = $_SESSION["prefs_feed_search"];
94 else
95 $search = "";
afcfe6ca
AD
96
97 if ($search) $search_qpart = " AND LOWER(title) LIKE LOWER('%$search%')";
98
99 $root = array();
100 $root['id'] = 'root';
101 $root['name'] = __('Feeds');
102 $root['items'] = array();
103 $root['type'] = 'category';
104
2ecd2df5
AD
105 $enable_cats = get_pref($this->link, 'ENABLE_FEED_CATS');
106
107 if ($_REQUEST['mode'] == 2) {
108
109 if ($enable_cats) {
110 $cat_hidden = get_pref($this->link, "_COLLAPSED_SPECIAL");
111 $cat = $this->feedlist_init_cat(-1, $cat_hidden);
112 } else {
113 $cat['items'] = array();
114 }
115
5417fbd7 116 foreach (array(-4, -3, -1, -2, 0, -6) as $i) {
2ecd2df5
AD
117 array_push($cat['items'], $this->feedlist_init_feed($i));
118 }
119
120 if ($enable_cats) {
121 array_push($root['items'], $cat);
122 } else {
123 $root['items'] = array_merge($root['items'], $cat['items']);
124 }
afcfe6ca 125
2ecd2df5
AD
126 $result = db_query($this->link, "SELECT * FROM
127 ttrss_labels2 WHERE owner_uid = ".$_SESSION['uid']." ORDER by caption");
128
129 if (db_num_rows($result) > 0) {
130
131 if (get_pref($this->link, 'ENABLE_FEED_CATS')) {
132 $cat_hidden = get_pref($this->link, "_COLLAPSED_LABELS");
133 $cat = $this->feedlist_init_cat(-2, $cat_hidden);
134 } else {
135 $cat['items'] = array();
136 }
137
138 while ($line = db_fetch_assoc($result)) {
139
140 $label_id = -$line['id'] - 11;
141 $count = getFeedUnread($this->link, $label_id);
142
143 $feed = $this->feedlist_init_feed($label_id, false, $count);
144
145 $feed['fg_color'] = $line['fg_color'];
146 $feed['bg_color'] = $line['bg_color'];
147
148 array_push($cat['items'], $feed);
149 }
150
151 if ($enable_cats) {
152 array_push($root['items'], $cat);
153 } else {
154 $root['items'] = array_merge($root['items'], $cat['items']);
155 }
156 }
157 }
158
159 if ($enable_cats) {
f393dc6f 160 $show_empty_cats = $_REQUEST['mode'] != 2 && !$search &&
2ecd2df5
AD
161 get_pref($this->link, '_PREFS_SHOW_EMPTY_CATS');
162
163 $result = db_query($this->link, "SELECT id, title, collapsed FROM ttrss_feed_categories
2a060a94 164 WHERE owner_uid = " . $_SESSION["uid"] . " AND parent_cat IS NULL ORDER BY order_id, title");
afcfe6ca
AD
165
166 while ($line = db_fetch_assoc($result)) {
167 $cat = array();
168 $cat['id'] = 'CAT:' . $line['id'];
2ecd2df5 169 $cat['bare_id'] = (int)$line['id'];
afcfe6ca
AD
170 $cat['name'] = $line['title'];
171 $cat['items'] = array();
172 $cat['checkbox'] = false;
2ecd2df5 173 $cat['hidden'] = sql_bool_to_bool($line['collapsed']);
afcfe6ca 174 $cat['type'] = 'category';
2ecd2df5 175 $cat['unread'] = 0;
2c5f231e 176 $cat['child_unread'] = 0;
afcfe6ca 177
2a060a94 178 $cat['items'] = $this->get_category_items($line['id']);
afcfe6ca
AD
179
180 $cat['param'] = T_sprintf('(%d feeds)', count($cat['items']));
181
5b7bd238 182 if (count($cat['items']) > 0 || $show_empty_cats)
afcfe6ca
AD
183 array_push($root['items'], $cat);
184
185 $root['param'] += count($cat['items']);
186 }
187
188 /* Uncategorized is a special case */
189
190 $cat = array();
191 $cat['id'] = 'CAT:0';
192 $cat['bare_id'] = 0;
193 $cat['name'] = __("Uncategorized");
194 $cat['items'] = array();
2ecd2df5 195 $cat['hidden'] = get_pref($this->link, "_COLLAPSED_UNCAT");
afcfe6ca
AD
196 $cat['type'] = 'category';
197 $cat['checkbox'] = false;
2ecd2df5 198 $cat['unread'] = 0;
2c5f231e 199 $cat['child_unread'] = 0;
afcfe6ca
AD
200
201 $feed_result = db_query($this->link, "SELECT id, title,last_error,
202 ".SUBSTRING_FOR_DATE."(last_updated,1,19) AS last_updated
203 FROM ttrss_feeds
204 WHERE cat_id IS NULL AND owner_uid = ".$_SESSION["uid"].
205 "$search_qpart ORDER BY order_id, title");
206
207 while ($feed_line = db_fetch_assoc($feed_result)) {
208 $feed = array();
209 $feed['id'] = 'FEED:' . $feed_line['id'];
2ecd2df5 210 $feed['bare_id'] = (int)$feed_line['id'];
afcfe6ca
AD
211 $feed['name'] = $feed_line['title'];
212 $feed['checkbox'] = false;
213 $feed['error'] = $feed_line['last_error'];
214 $feed['icon'] = getFeedIcon($feed_line['id']);
215 $feed['param'] = make_local_datetime($this->link,
216 $feed_line['last_updated'], true);
2ecd2df5
AD
217 $feed['unread'] = 0;
218 $feed['type'] = 'feed';
afcfe6ca
AD
219
220 array_push($cat['items'], $feed);
221 }
222
223 $cat['param'] = T_sprintf('(%d feeds)', count($cat['items']));
224
5b7bd238 225 if (count($cat['items']) > 0 || $show_empty_cats)
afcfe6ca
AD
226 array_push($root['items'], $cat);
227
228 $root['param'] += count($cat['items']);
229 $root['param'] = T_sprintf('(%d feeds)', $root['param']);
230
231 } else {
232 $feed_result = db_query($this->link, "SELECT id, title, last_error,
233 ".SUBSTRING_FOR_DATE."(last_updated,1,19) AS last_updated
234 FROM ttrss_feeds
235 WHERE owner_uid = ".$_SESSION["uid"].
236 "$search_qpart ORDER BY order_id, title");
237
238 while ($feed_line = db_fetch_assoc($feed_result)) {
239 $feed = array();
240 $feed['id'] = 'FEED:' . $feed_line['id'];
2ecd2df5 241 $feed['bare_id'] = (int)$feed_line['id'];
afcfe6ca
AD
242 $feed['name'] = $feed_line['title'];
243 $feed['checkbox'] = false;
244 $feed['error'] = $feed_line['last_error'];
245 $feed['icon'] = getFeedIcon($feed_line['id']);
246 $feed['param'] = make_local_datetime($this->link,
247 $feed_line['last_updated'], true);
2ecd2df5
AD
248 $feed['unread'] = 0;
249 $feed['type'] = 'feed';
afcfe6ca
AD
250
251 array_push($root['items'], $feed);
252 }
253
254 $root['param'] = T_sprintf('(%d feeds)', count($root['items']));
afcfe6ca
AD
255 }
256
257 $fl = array();
258 $fl['identifier'] = 'id';
259 $fl['label'] = 'name';
2ecd2df5
AD
260
261 if ($_REQUEST['mode'] != 2) {
262 $fl['items'] = array($root);
263 } else {
264 $fl['items'] =& $root['items'];
265 }
afcfe6ca
AD
266
267 print json_encode($fl);
268 return;
269 }
270
271 function catsortreset() {
272 db_query($this->link, "UPDATE ttrss_feed_categories
273 SET order_id = 0 WHERE owner_uid = " . $_SESSION["uid"]);
274 return;
275 }
276
277 function feedsortreset() {
278 db_query($this->link, "UPDATE ttrss_feeds
279 SET order_id = 0 WHERE owner_uid = " . $_SESSION["uid"]);
280 return;
281 }
282
5b7bd238
AD
283 function togglehiddenfeedcats() {
284 set_pref($this->link, '_PREFS_SHOW_EMPTY_CATS',
285 (get_pref($this->link, '_PREFS_SHOW_EMPTY_CATS') ? 'false' : 'true'));
286 }
287
95ee44b3
AD
288 private function process_category_order(&$data_map, $item_id, $parent_id = false, $nest_level = 0) {
289 $debug = isset($_REQUEST["debug"]);
290
291 $prefix = "";
292 for ($i = 0; $i < $nest_level; $i++)
293 $prefix .= " ";
294
295 if ($debug) _debug("$prefix C: $item_id P: $parent_id");
296
297 $bare_item_id = substr($item_id, strpos($item_id, ':')+1);
2a060a94
AD
298
299 if ($item_id != 'root') {
300 if ($parent_id && $parent_id != 'root') {
301 $parent_bare_id = substr($parent_id, strpos($parent_id, ':')+1);
302 $parent_qpart = db_escape_string($parent_bare_id);
303 } else {
304 $parent_qpart = 'NULL';
305 }
306
307 db_query($this->link, "UPDATE ttrss_feed_categories
95ee44b3 308 SET parent_cat = $parent_qpart WHERE id = '$bare_item_id' AND
2a060a94
AD
309 owner_uid = " . $_SESSION["uid"]);
310 }
311
312 $order_id = 0;
313
314 $cat = $data_map[$item_id];
315
316 if ($cat && is_array($cat)) {
317 foreach ($cat as $item) {
318 $id = $item['_reference'];
319 $bare_id = substr($id, strpos($id, ':')+1);
320
95ee44b3 321 if ($debug) _debug("$prefix [$order_id] $id/$bare_id");
2a060a94
AD
322
323 if ($item['_reference']) {
324
325 if (strpos($id, "FEED") === 0) {
326
95ee44b3
AD
327 $cat_id = ($item_id != "root") ?
328 db_escape_string($bare_item_id) : "NULL";
329
2a060a94 330 db_query($this->link, "UPDATE ttrss_feeds
95ee44b3
AD
331 SET order_id = $order_id, cat_id = '$cat_id'
332 WHERE id = '$bare_id' AND
2a060a94
AD
333 owner_uid = " . $_SESSION["uid"]);
334
335 } else if (strpos($id, "CAT:") === 0) {
95ee44b3
AD
336 $this->process_category_order($data_map, $item['_reference'], $item_id,
337 $nest_level+1);
2a060a94
AD
338
339 if ($item_id != 'root') {
340 $parent_qpart = db_escape_string($bare_id);
341 } else {
342 $parent_qpart = 'NULL';
343 }
344
345 db_query($this->link, "UPDATE ttrss_feed_categories
346 SET order_id = '$order_id' WHERE id = '$bare_id' AND
347 owner_uid = " . $_SESSION["uid"]);
348 }
349 }
350
351 ++$order_id;
352 }
353 }
354 }
355
afcfe6ca
AD
356 function savefeedorder() {
357 $data = json_decode($_POST['payload'], true);
358
2a060a94
AD
359 #file_put_contents("/tmp/saveorder.json", $_POST['payload']);
360 #$data = json_decode(file_get_contents("/tmp/saveorder.json"), true);
a26f57e6 361
95ee44b3
AD
362 if (!is_array($data['items']))
363 $data['items'] = json_decode($data['items'], true);
364
365# print_r($data['items']);
2a060a94 366
afcfe6ca
AD
367 if (is_array($data) && is_array($data['items'])) {
368 $cat_order_id = 0;
369
370 $data_map = array();
2a060a94 371 $root_item = false;
afcfe6ca
AD
372
373 foreach ($data['items'] as $item) {
374
2a060a94 375# if ($item['id'] != 'root') {
afcfe6ca
AD
376 if (is_array($item['items'])) {
377 if (isset($item['items']['_reference'])) {
378 $data_map[$item['id']] = array($item['items']);
379 } else {
380 $data_map[$item['id']] =& $item['items'];
381 }
382 }
2a060a94
AD
383 if ($item['id'] == 'root') {
384 $root_item = $item['id'];
afcfe6ca
AD
385 }
386 }
387
d04f8c82 388 $this->process_category_order($data_map, $root_item);
2a060a94
AD
389
390 /* foreach ($data['items'][0]['items'] as $item) {
afcfe6ca
AD
391 $id = $item['_reference'];
392 $bare_id = substr($id, strpos($id, ':')+1);
393
394 ++$cat_order_id;
395
396 if ($bare_id > 0) {
397 db_query($this->link, "UPDATE ttrss_feed_categories
398 SET order_id = '$cat_order_id' WHERE id = '$bare_id' AND
399 owner_uid = " . $_SESSION["uid"]);
400 }
401
402 $feed_order_id = 0;
403
404 if (is_array($data_map[$id])) {
405 foreach ($data_map[$id] as $feed) {
406 $id = $feed['_reference'];
407 $feed_id = substr($id, strpos($id, ':')+1);
408
409 if ($bare_id != 0)
410 $cat_query = "cat_id = '$bare_id'";
411 else
412 $cat_query = "cat_id = NULL";
413
414 db_query($this->link, "UPDATE ttrss_feeds
415 SET order_id = '$feed_order_id',
416 $cat_query
417 WHERE id = '$feed_id' AND
418 owner_uid = " . $_SESSION["uid"]);
419
420 ++$feed_order_id;
421 }
422 }
2a060a94 423 } */
afcfe6ca
AD
424 }
425
426 return;
427 }
428
429 function removeicon() {
430 $feed_id = db_escape_string($_REQUEST["feed_id"]);
431
432 $result = db_query($this->link, "SELECT id FROM ttrss_feeds
433 WHERE id = '$feed_id' AND owner_uid = ". $_SESSION["uid"]);
434
435 if (db_num_rows($result) != 0) {
436 unlink(ICONS_DIR . "/$feed_id.ico");
437 }
438
439 return;
440 }
441
442 function uploadicon() {
443 $icon_file = $_FILES['icon_file']['tmp_name'];
444 $feed_id = db_escape_string($_REQUEST["feed_id"]);
445
446 if (is_file($icon_file) && $feed_id) {
447 if (filesize($icon_file) < 20000) {
448
449 $result = db_query($this->link, "SELECT id FROM ttrss_feeds
450 WHERE id = '$feed_id' AND owner_uid = ". $_SESSION["uid"]);
451
452 if (db_num_rows($result) != 0) {
453 unlink(ICONS_DIR . "/$feed_id.ico");
454 move_uploaded_file($icon_file, ICONS_DIR . "/$feed_id.ico");
455 $rc = 0;
456 } else {
457 $rc = 2;
458 }
459 } else {
460 $rc = 1;
461 }
462 } else {
463 $rc = 2;
464 }
465
466 print "<script type=\"text/javascript\">";
467 print "parent.uploadIconHandler($rc);";
468 print "</script>";
469 return;
470 }
471
472 function editfeed() {
473 global $purge_intervals;
474 global $update_intervals;
475 global $update_methods;
476
477 $feed_id = db_escape_string($_REQUEST["id"]);
478
479 $result = db_query($this->link,
480 "SELECT * FROM ttrss_feeds WHERE id = '$feed_id' AND
481 owner_uid = " . $_SESSION["uid"]);
482
483 $title = htmlspecialchars(db_fetch_result($result,
484 0, "title"));
485
486 print "<input dojoType=\"dijit.form.TextBox\" style=\"display : none\" name=\"id\" value=\"$feed_id\">";
487 print "<input dojoType=\"dijit.form.TextBox\" style=\"display : none\" name=\"op\" value=\"pref-feeds\">";
488 print "<input dojoType=\"dijit.form.TextBox\" style=\"display : none\" name=\"method\" value=\"editSave\">";
489
490 print "<div class=\"dlgSec\">".__("Feed")."</div>";
491 print "<div class=\"dlgSecCont\">";
492
493 /* Title */
494
495 print "<input dojoType=\"dijit.form.ValidationTextBox\" required=\"1\"
496 placeHolder=\"".__("Feed Title")."\"
497 style=\"font-size : 16px; width: 20em\" name=\"title\" value=\"$title\">";
498
499 /* Feed URL */
500
501 $feed_url = db_fetch_result($result, 0, "feed_url");
502 $feed_url = htmlspecialchars(db_fetch_result($result,
503 0, "feed_url"));
504
505 print "<hr/>";
506
507 print __('URL:') . " ";
508 print "<input dojoType=\"dijit.form.ValidationTextBox\" required=\"1\"
509 placeHolder=\"".__("Feed URL")."\"
510 regExp='^(http|https)://.*' style=\"width : 20em\"
511 name=\"feed_url\" value=\"$feed_url\">";
512
513 $last_error = db_fetch_result($result, 0, "last_error");
514
515 if ($last_error) {
516 print "&nbsp;<span title=\"".htmlspecialchars($last_error)."\"
517 class=\"feed_error\">(error)</span>";
518
519 }
520
521 /* Category */
522
523 if (get_pref($this->link, 'ENABLE_FEED_CATS')) {
524
525 $cat_id = db_fetch_result($result, 0, "cat_id");
526
527 print "<hr/>";
528
529 print __('Place in category:') . " ";
530
531 print_feed_cat_select($this->link, "cat_id", $cat_id,
532 'dojoType="dijit.form.Select"');
533 }
534
535 print "</div>";
536
537 print "<div class=\"dlgSec\">".__("Update")."</div>";
538 print "<div class=\"dlgSecCont\">";
539
540 /* Update Interval */
541
542 $update_interval = db_fetch_result($result, 0, "update_interval");
543
544 print_select_hash("update_interval", $update_interval, $update_intervals,
545 'dojoType="dijit.form.Select"');
546
547 /* Update method */
548
549 $update_method = db_fetch_result($result, 0, "update_method",
550 'dojoType="dijit.form.Select"');
551
552 print " " . __('using') . " ";
553 print_select_hash("update_method", $update_method, $update_methods,
554 'dojoType="dijit.form.Select"');
555
556 $purge_interval = db_fetch_result($result, 0, "purge_interval");
557
558
559 /* Purge intl */
560
561 print "<hr/>";
562 print __('Article purging:') . " ";
563
564 print_select_hash("purge_interval", $purge_interval, $purge_intervals,
565 'dojoType="dijit.form.Select" ' .
566 ((FORCE_ARTICLE_PURGE == 0) ? "" : 'disabled="1"'));
567
568 print "</div>";
569 print "<div class=\"dlgSec\">".__("Authentication")."</div>";
570 print "<div class=\"dlgSecCont\">";
571
572 $auth_login = htmlspecialchars(db_fetch_result($result, 0, "auth_login"));
573
574 print "<input dojoType=\"dijit.form.TextBox\" id=\"feedEditDlg_login\"
575 placeHolder=\"".__("Login")."\"
576 name=\"auth_login\" value=\"$auth_login\"><hr/>";
577
578 $auth_pass = htmlspecialchars(db_fetch_result($result, 0, "auth_pass"));
579
580 print "<input dojoType=\"dijit.form.TextBox\" type=\"password\" name=\"auth_pass\"
581 placeHolder=\"".__("Password")."\"
582 value=\"$auth_pass\">";
583
584 print "<div dojoType=\"dijit.Tooltip\" connectId=\"feedEditDlg_login\" position=\"below\">
585 ".__('<b>Hint:</b> you need to fill in your login information if your feed requires authentication, except for Twitter feeds.')."
586 </div>";
587
588 print "</div>";
589 print "<div class=\"dlgSec\">".__("Options")."</div>";
590 print "<div class=\"dlgSecCont\">";
591
592 $private = sql_bool_to_bool(db_fetch_result($result, 0, "private"));
593
594 if ($private) {
595 $checked = "checked=\"1\"";
596 } else {
597 $checked = "";
598 }
599
600 print "<input dojoType=\"dijit.form.CheckBox\" type=\"checkbox\" name=\"private\" id=\"private\"
601 $checked>&nbsp;<label for=\"private\">".__('Hide from Popular feeds')."</label>";
602
603 $rtl_content = sql_bool_to_bool(db_fetch_result($result, 0, "rtl_content"));
604
605 if ($rtl_content) {
606 $checked = "checked=\"1\"";
607 } else {
608 $checked = "";
609 }
610
611 print "<hr/><input dojoType=\"dijit.form.CheckBox\" type=\"checkbox\" id=\"rtl_content\" name=\"rtl_content\"
612 $checked>&nbsp;<label for=\"rtl_content\">".__('Right-to-left content')."</label>";
613
614 $include_in_digest = sql_bool_to_bool(db_fetch_result($result, 0, "include_in_digest"));
615
616 if ($include_in_digest) {
617 $checked = "checked=\"1\"";
618 } else {
619 $checked = "";
620 }
621
622 print "<hr/><input dojoType=\"dijit.form.CheckBox\" type=\"checkbox\" id=\"include_in_digest\"
623 name=\"include_in_digest\"
624 $checked>&nbsp;<label for=\"include_in_digest\">".__('Include in e-mail digest')."</label>";
625
626
627 $always_display_enclosures = sql_bool_to_bool(db_fetch_result($result, 0, "always_display_enclosures"));
628
629 if ($always_display_enclosures) {
630 $checked = "checked";
631 } else {
632 $checked = "";
633 }
634
635 print "<hr/><input dojoType=\"dijit.form.CheckBox\" type=\"checkbox\" id=\"always_display_enclosures\"
636 name=\"always_display_enclosures\"
637 $checked>&nbsp;<label for=\"always_display_enclosures\">".__('Always display image attachments')."</label>";
638
639
640 $cache_images = sql_bool_to_bool(db_fetch_result($result, 0, "cache_images"));
641
642 if ($cache_images) {
643 $checked = "checked=\"1\"";
644 } else {
645 $checked = "";
646 }
647
3c696512
AD
648 print "<hr/><input dojoType=\"dijit.form.CheckBox\" type=\"checkbox\" id=\"cache_images\"
649 name=\"cache_images\"
afcfe6ca 650 $checked>&nbsp;<label for=\"cache_images\">".
3c696512 651 __('Cache images locally')."</label>";
afcfe6ca
AD
652
653 $mark_unread_on_update = sql_bool_to_bool(db_fetch_result($result, 0, "mark_unread_on_update"));
654
655 if ($mark_unread_on_update) {
656 $checked = "checked";
657 } else {
658 $checked = "";
659 }
660
661 print "<hr/><input dojoType=\"dijit.form.CheckBox\" type=\"checkbox\" id=\"mark_unread_on_update\"
662 name=\"mark_unread_on_update\"
663 $checked>&nbsp;<label for=\"mark_unread_on_update\">".__('Mark updated articles as unread')."</label>";
664
665 $update_on_checksum_change = sql_bool_to_bool(db_fetch_result($result, 0, "update_on_checksum_change"));
666
667 if ($update_on_checksum_change) {
668 $checked = "checked";
669 } else {
670 $checked = "";
671 }
672
673 print "<hr/><input dojoType=\"dijit.form.CheckBox\" type=\"checkbox\" id=\"update_on_checksum_change\"
674 name=\"update_on_checksum_change\"
675 $checked>&nbsp;<label for=\"update_on_checksum_change\">".__('Mark posts as updated on content change')."</label>";
676
677 print "</div>";
678
679 /* Icon */
680
681 print "<div class=\"dlgSec\">".__("Icon")."</div>";
682 print "<div class=\"dlgSecCont\">";
683
684 print "<iframe name=\"icon_upload_iframe\"
685 style=\"width: 400px; height: 100px; display: none;\"></iframe>";
686
687 print "<form style='display : block' target=\"icon_upload_iframe\"
688 enctype=\"multipart/form-data\" method=\"POST\"
689 action=\"backend.php\">
690 <input id=\"icon_file\" size=\"10\" name=\"icon_file\" type=\"file\">
691 <input type=\"hidden\" name=\"op\" value=\"pref-feeds\">
692 <input type=\"hidden\" name=\"feed_id\" value=\"$feed_id\">
693 <input type=\"hidden\" name=\"method\" value=\"uploadicon\">
694 <button dojoType=\"dijit.form.Button\" onclick=\"return uploadFeedIcon();\"
695 type=\"submit\">".__('Replace')."</button>
696 <button dojoType=\"dijit.form.Button\" onclick=\"return removeFeedIcon($feed_id);\"
697 type=\"submit\">".__('Remove')."</button>
698 </form>";
699
700 print "</div>";
701
702 $title = htmlspecialchars($title, ENT_QUOTES);
703
704 print "<div class='dlgButtons'>
705 <div style=\"float : left\">
706 <button dojoType=\"dijit.form.Button\" onclick='return unsubscribeFeed($feed_id, \"$title\")'>".
707 __('Unsubscribe')."</button>";
708
709 if (PUBSUBHUBBUB_ENABLED) {
710 $pubsub_state = db_fetch_result($result, 0, "pubsub_state");
711 $pubsub_btn_disabled = ($pubsub_state == 2) ? "" : "disabled=\"1\"";
712
713 print "<button dojoType=\"dijit.form.Button\" id=\"pubsubReset_Btn\" $pubsub_btn_disabled
714 onclick='return resetPubSub($feed_id, \"$title\")'>".__('Resubscribe to push updates').
715 "</button>";
716 }
717
718 print "</div>";
719
720 print "<div dojoType=\"dijit.Tooltip\" connectId=\"pubsubReset_Btn\" position=\"below\">".
721 __('Resets PubSubHubbub subscription status for push-enabled feeds.')."</div>";
722
723 print "<button dojoType=\"dijit.form.Button\" onclick=\"return dijit.byId('feedEditDlg').execute()\">".__('Save')."</button>
724 <button dojoType=\"dijit.form.Button\" onclick=\"return dijit.byId('feedEditDlg').hide()\">".__('Cancel')."</button>
725 </div>";
726
727 return;
728 }
729
730 function editfeeds() {
731 global $purge_intervals;
732 global $update_intervals;
733 global $update_methods;
46da73c2 734
afcfe6ca
AD
735 $feed_ids = db_escape_string($_REQUEST["ids"]);
736
ca6a0741
AD
737 print "<div class=\"dialogNotice\">" . __("Enable the options you wish to apply using checkboxes on the right:") . "</div>";
738
afcfe6ca
AD
739 print "<input dojoType=\"dijit.form.TextBox\" style=\"display : none\" name=\"ids\" value=\"$feed_ids\">";
740 print "<input dojoType=\"dijit.form.TextBox\" style=\"display : none\" name=\"op\" value=\"pref-feeds\">";
741 print "<input dojoType=\"dijit.form.TextBox\" style=\"display : none\" name=\"method\" value=\"batchEditSave\">";
742
743 print "<div class=\"dlgSec\">".__("Feed")."</div>";
744 print "<div class=\"dlgSecCont\">";
745
746 /* Title */
747
748 print "<input dojoType=\"dijit.form.ValidationTextBox\"
749 disabled=\"1\" style=\"font-size : 16px; width : 20em;\" required=\"1\"
750 name=\"title\" value=\"$title\">";
751
752 $this->batch_edit_cbox("title");
753
754 /* Feed URL */
755
756 print "<br/>";
757
758 print __('URL:') . " ";
759 print "<input dojoType=\"dijit.form.ValidationTextBox\" disabled=\"1\"
760 required=\"1\" regExp='^(http|https)://.*' style=\"width : 20em\"
761 name=\"feed_url\" value=\"$feed_url\">";
762
763 $this->batch_edit_cbox("feed_url");
764
765 /* Category */
766
767 if (get_pref($this->link, 'ENABLE_FEED_CATS')) {
768
769 print "<br/>";
770
771 print __('Place in category:') . " ";
772
773 print_feed_cat_select($this->link, "cat_id", $cat_id,
774 'disabled="1" dojoType="dijit.form.Select"');
775
776 $this->batch_edit_cbox("cat_id");
777
778 }
779
780 print "</div>";
781
782 print "<div class=\"dlgSec\">".__("Update")."</div>";
783 print "<div class=\"dlgSecCont\">";
784
785 /* Update Interval */
786
787 print_select_hash("update_interval", $update_interval, $update_intervals,
788 'disabled="1" dojoType="dijit.form.Select"');
789
790 $this->batch_edit_cbox("update_interval");
791
792 /* Update method */
793
794 print " " . __('using') . " ";
795 print_select_hash("update_method", $update_method, $update_methods,
796 'disabled="1" dojoType="dijit.form.Select"');
797 $this->batch_edit_cbox("update_method");
798
799 /* Purge intl */
800
801 if (FORCE_ARTICLE_PURGE == 0) {
802
803 print "<br/>";
804
805 print __('Article purging:') . " ";
806
807 print_select_hash("purge_interval", $purge_interval, $purge_intervals,
808 'disabled="1" dojoType="dijit.form.Select"');
809
810 $this->batch_edit_cbox("purge_interval");
811 }
812
813 print "</div>";
814 print "<div class=\"dlgSec\">".__("Authentication")."</div>";
815 print "<div class=\"dlgSecCont\">";
816
817 print "<input dojoType=\"dijit.form.TextBox\"
818 placeHolder=\"".__("Login")."\" disabled=\"1\"
819 name=\"auth_login\" value=\"$auth_login\">";
820
821 $this->batch_edit_cbox("auth_login");
822
823 print "<br/><input dojoType=\"dijit.form.TextBox\" type=\"password\" name=\"auth_pass\"
824 placeHolder=\"".__("Password")."\" disabled=\"1\"
825 value=\"$auth_pass\">";
826
827 $this->batch_edit_cbox("auth_pass");
828
829 print "</div>";
830 print "<div class=\"dlgSec\">".__("Options")."</div>";
831 print "<div class=\"dlgSecCont\">";
832
833 print "<input disabled=\"1\" type=\"checkbox\" name=\"private\" id=\"private\"
834 dojoType=\"dijit.form.CheckBox\">&nbsp;<label id=\"private_l\" class='insensitive' for=\"private\">".__('Hide from Popular feeds')."</label>";
835
836 print "&nbsp;"; $this->batch_edit_cbox("private", "private_l");
837
838 print "<br/><input disabled=\"1\" type=\"checkbox\" id=\"rtl_content\" name=\"rtl_content\"
839 dojoType=\"dijit.form.CheckBox\">&nbsp;<label class='insensitive' id=\"rtl_content_l\" for=\"rtl_content\">".__('Right-to-left content')."</label>";
840
841 print "&nbsp;"; $this->batch_edit_cbox("rtl_content", "rtl_content_l");
842
843 print "<br/><input disabled=\"1\" type=\"checkbox\" id=\"include_in_digest\"
844 name=\"include_in_digest\"
845 dojoType=\"dijit.form.CheckBox\">&nbsp;<label id=\"include_in_digest_l\" class='insensitive' for=\"include_in_digest\">".__('Include in e-mail digest')."</label>";
846
847 print "&nbsp;"; $this->batch_edit_cbox("include_in_digest", "include_in_digest_l");
848
849 print "<br/><input disabled=\"1\" type=\"checkbox\" id=\"always_display_enclosures\"
850 name=\"always_display_enclosures\"
851 dojoType=\"dijit.form.CheckBox\">&nbsp;<label id=\"always_display_enclosures_l\" class='insensitive' for=\"always_display_enclosures\">".__('Always display image attachments')."</label>";
852
853 print "&nbsp;"; $this->batch_edit_cbox("always_display_enclosures", "always_display_enclosures_l");
854
3c696512
AD
855 print "<br/><input disabled=\"1\" type=\"checkbox\" id=\"cache_images\"
856 name=\"cache_images\"
857 dojoType=\"dijit.form.CheckBox\">&nbsp;<label class='insensitive' id=\"cache_images_l\"
858 for=\"cache_images\">".
859 __('Cache images locally')."</label>";
afcfe6ca 860
3c696512 861 print "&nbsp;"; $this->batch_edit_cbox("cache_images", "cache_images_l");
afcfe6ca
AD
862
863 print "<br/><input disabled=\"1\" type=\"checkbox\" id=\"mark_unread_on_update\"
864 name=\"mark_unread_on_update\"
865 dojoType=\"dijit.form.CheckBox\">&nbsp;<label id=\"mark_unread_on_update_l\" class='insensitive' for=\"mark_unread_on_update\">".__('Mark updated articles as unread')."</label>";
866
867 print "&nbsp;"; $this->batch_edit_cbox("mark_unread_on_update", "mark_unread_on_update_l");
868
869 print "<br/><input disabled=\"1\" type=\"checkbox\" id=\"update_on_checksum_change\"
870 name=\"update_on_checksum_change\"
871 dojoType=\"dijit.form.CheckBox\">&nbsp;<label id=\"update_on_checksum_change_l\" class='insensitive' for=\"update_on_checksum_change\">".__('Mark posts as updated on content change')."</label>";
872
873 print "&nbsp;"; $this->batch_edit_cbox("update_on_checksum_change", "update_on_checksum_change_l");
874
875 print "</div>";
876
877 print "<div class='dlgButtons'>
878 <button dojoType=\"dijit.form.Button\"
879 onclick=\"return dijit.byId('feedEditDlg').execute()\">".
880 __('Save')."</button>
881 <button dojoType=\"dijit.form.Button\"
882 onclick=\"return dijit.byId('feedEditDlg').hide()\">".
883 __('Cancel')."</button>
884 </div>";
885
886 return;
887 }
888
889 function batchEditSave() {
3a76e2a2 890 return $this->editsaveops(true);
afcfe6ca 891 }
46da73c2 892
afcfe6ca 893 function editSave() {
3a76e2a2 894 return $this->editsaveops(false);
afcfe6ca 895 }
46da73c2
AD
896
897 function editsaveops($batch) {
898
afcfe6ca
AD
899 $feed_title = db_escape_string(trim($_POST["title"]));
900 $feed_link = db_escape_string(trim($_POST["feed_url"]));
901 $upd_intl = (int) db_escape_string($_POST["update_interval"]);
902 $purge_intl = (int) db_escape_string($_POST["purge_interval"]);
903 $feed_id = (int) db_escape_string($_POST["id"]); /* editSave */
904 $feed_ids = db_escape_string($_POST["ids"]); /* batchEditSave */
905 $cat_id = (int) db_escape_string($_POST["cat_id"]);
906 $auth_login = db_escape_string(trim($_POST["auth_login"]));
907 $auth_pass = db_escape_string(trim($_POST["auth_pass"]));
908 $private = checkbox_to_sql_bool(db_escape_string($_POST["private"]));
909 $rtl_content = checkbox_to_sql_bool(db_escape_string($_POST["rtl_content"]));
910 $include_in_digest = checkbox_to_sql_bool(
911 db_escape_string($_POST["include_in_digest"]));
912 $cache_images = checkbox_to_sql_bool(
913 db_escape_string($_POST["cache_images"]));
914 $update_method = (int) db_escape_string($_POST["update_method"]);
915
916 $always_display_enclosures = checkbox_to_sql_bool(
917 db_escape_string($_POST["always_display_enclosures"]));
918
919 $mark_unread_on_update = checkbox_to_sql_bool(
920 db_escape_string($_POST["mark_unread_on_update"]));
921
922 $update_on_checksum_change = checkbox_to_sql_bool(
923 db_escape_string($_POST["update_on_checksum_change"]));
924
925 if (get_pref($this->link, 'ENABLE_FEED_CATS')) {
926 if ($cat_id && $cat_id != 0) {
927 $category_qpart = "cat_id = '$cat_id',";
928 $category_qpart_nocomma = "cat_id = '$cat_id'";
929 } else {
930 $category_qpart = 'cat_id = NULL,';
931 $category_qpart_nocomma = 'cat_id = NULL';
932 }
933 } else {
934 $category_qpart = "";
935 $category_qpart_nocomma = "";
936 }
937
3c696512 938 $cache_images_qpart = "cache_images = $cache_images,";
afcfe6ca 939
3a76e2a2 940 if (!$batch) {
afcfe6ca
AD
941
942 $result = db_query($this->link, "UPDATE ttrss_feeds SET
943 $category_qpart
944 title = '$feed_title', feed_url = '$feed_link',
945 update_interval = '$upd_intl',
946 purge_interval = '$purge_intl',
947 auth_login = '$auth_login',
948 auth_pass = '$auth_pass',
949 private = $private,
950 rtl_content = $rtl_content,
951 $cache_images_qpart
952 include_in_digest = $include_in_digest,
953 always_display_enclosures = $always_display_enclosures,
954 mark_unread_on_update = $mark_unread_on_update,
955 update_on_checksum_change = $update_on_checksum_change,
956 update_method = '$update_method'
957 WHERE id = '$feed_id' AND owner_uid = " . $_SESSION["uid"]);
958
3a76e2a2 959 } else {
afcfe6ca
AD
960 $feed_data = array();
961
962 foreach (array_keys($_POST) as $k) {
963 if ($k != "op" && $k != "method" && $k != "ids") {
964 $feed_data[$k] = $_POST[$k];
965 }
966 }
967
968 db_query($this->link, "BEGIN");
969
970 foreach (array_keys($feed_data) as $k) {
971
972 $qpart = "";
973
974 switch ($k) {
975 case "title":
976 $qpart = "title = '$feed_title'";
977 break;
978
979 case "feed_url":
980 $qpart = "feed_url = '$feed_link'";
981 break;
982
983 case "update_interval":
984 $qpart = "update_interval = '$upd_intl'";
985 break;
986
987 case "purge_interval":
988 $qpart = "purge_interval = '$purge_intl'";
989 break;
990
991 case "auth_login":
992 $qpart = "auth_login = '$auth_login'";
993 break;
994
995 case "auth_pass":
996 $qpart = "auth_pass = '$auth_pass'";
997 break;
998
999 case "private":
a498d18b 1000 $qpart = "private = $private";
afcfe6ca
AD
1001 break;
1002
1003 case "include_in_digest":
a498d18b 1004 $qpart = "include_in_digest = $include_in_digest";
afcfe6ca
AD
1005 break;
1006
1007 case "always_display_enclosures":
a498d18b 1008 $qpart = "always_display_enclosures = $always_display_enclosures";
afcfe6ca
AD
1009 break;
1010
1011 case "mark_unread_on_update":
a498d18b 1012 $qpart = "mark_unread_on_update = $mark_unread_on_update";
afcfe6ca
AD
1013 break;
1014
1015 case "update_on_checksum_change":
a498d18b 1016 $qpart = "update_on_checksum_change = $update_on_checksum_change";
afcfe6ca
AD
1017 break;
1018
1019 case "cache_images":
a498d18b 1020 $qpart = "cache_images = $cache_images";
afcfe6ca
AD
1021 break;
1022
1023 case "rtl_content":
a498d18b 1024 $qpart = "rtl_content = $rtl_content";
afcfe6ca
AD
1025 break;
1026
1027 case "update_method":
1028 $qpart = "update_method = '$update_method'";
1029 break;
1030
1031 case "cat_id":
1032 $qpart = $category_qpart_nocomma;
1033 break;
1034
1035 }
1036
1037 if ($qpart) {
1038 db_query($this->link,
1039 "UPDATE ttrss_feeds SET $qpart WHERE id IN ($feed_ids)
1040 AND owner_uid = " . $_SESSION["uid"]);
1041 print "<br/>";
1042 }
1043 }
1044
1045 db_query($this->link, "COMMIT");
1046 }
1047 return;
1048 }
1049
1050 function resetPubSub() {
1051
1052 $ids = db_escape_string($_REQUEST["ids"]);
1053
1054 db_query($this->link, "UPDATE ttrss_feeds SET pubsub_state = 0 WHERE id IN ($ids)
1055 AND owner_uid = " . $_SESSION["uid"]);
1056
1057 return;
1058 }
1059
1060 function remove() {
1061
1062 $ids = split(",", db_escape_string($_REQUEST["ids"]));
1063
1064 foreach ($ids as $id) {
1065 remove_feed($this->link, $id, $_SESSION["uid"]);
1066 }
1067
1068 return;
1069 }
1070
1071 function clear() {
1072 $id = db_escape_string($_REQUEST["id"]);
1073 clear_feed_articles($this->link, $id);
1074 }
1075
1076 function rescore() {
1077 $ids = split(",", db_escape_string($_REQUEST["ids"]));
1078
1079 foreach ($ids as $id) {
1080
1081 $filters = load_filters($this->link, $id, $_SESSION["uid"], 6);
1082
1083 $result = db_query($this->link, "SELECT
1084 title, content, link, ref_id, author,".
1085 SUBSTRING_FOR_DATE."(updated, 1, 19) AS updated
1086 FROM
1087 ttrss_user_entries, ttrss_entries
1088 WHERE ref_id = id AND feed_id = '$id' AND
1089 owner_uid = " .$_SESSION['uid']."
1090 ");
1091
1092 $scores = array();
1093
1094 while ($line = db_fetch_assoc($result)) {
1095
1096 $tags = get_article_tags($this->link, $line["ref_id"]);
1097
1098 $article_filters = get_article_filters($filters, $line['title'],
1099 $line['content'], $line['link'], strtotime($line['updated']),
1100 $line['author'], $tags);
1101
1102 $new_score = calculate_article_score($article_filters);
1103
1104 if (!$scores[$new_score]) $scores[$new_score] = array();
1105
1106 array_push($scores[$new_score], $line['ref_id']);
1107 }
1108
1109 foreach (array_keys($scores) as $s) {
1110 if ($s > 1000) {
1111 db_query($this->link, "UPDATE ttrss_user_entries SET score = '$s',
1112 marked = true WHERE
1113 ref_id IN (" . join(',', $scores[$s]) . ")");
1114 } else if ($s < -500) {
1115 db_query($this->link, "UPDATE ttrss_user_entries SET score = '$s',
1116 unread = false WHERE
1117 ref_id IN (" . join(',', $scores[$s]) . ")");
1118 } else {
1119 db_query($this->link, "UPDATE ttrss_user_entries SET score = '$s' WHERE
1120 ref_id IN (" . join(',', $scores[$s]) . ")");
1121 }
1122 }
1123 }
1124
1125 print __("All done.");
1126
1127 }
1128
1129 function rescoreAll() {
1130
1131 $result = db_query($this->link,
1132 "SELECT id FROM ttrss_feeds WHERE owner_uid = " . $_SESSION['uid']);
1133
1134 while ($feed_line = db_fetch_assoc($result)) {
1135
1136 $id = $feed_line["id"];
1137
1138 $filters = load_filters($this->link, $id, $_SESSION["uid"], 6);
1139
1140 $tmp_result = db_query($this->link, "SELECT
1141 title, content, link, ref_id, author,".
1142 SUBSTRING_FOR_DATE."(updated, 1, 19) AS updated
1143 FROM
1144 ttrss_user_entries, ttrss_entries
1145 WHERE ref_id = id AND feed_id = '$id' AND
1146 owner_uid = " .$_SESSION['uid']."
1147 ");
1148
1149 $scores = array();
1150
1151 while ($line = db_fetch_assoc($tmp_result)) {
1152
1153 $tags = get_article_tags($this->link, $line["ref_id"]);
1154
1155 $article_filters = get_article_filters($filters, $line['title'],
1156 $line['content'], $line['link'], strtotime($line['updated']),
1157 $line['author'], $tags);
1158
1159 $new_score = calculate_article_score($article_filters);
1160
1161 if (!$scores[$new_score]) $scores[$new_score] = array();
1162
1163 array_push($scores[$new_score], $line['ref_id']);
1164 }
1165
1166 foreach (array_keys($scores) as $s) {
1167 if ($s > 1000) {
1168 db_query($this->link, "UPDATE ttrss_user_entries SET score = '$s',
1169 marked = true WHERE
1170 ref_id IN (" . join(',', $scores[$s]) . ")");
1171 } else {
1172 db_query($this->link, "UPDATE ttrss_user_entries SET score = '$s' WHERE
1173 ref_id IN (" . join(',', $scores[$s]) . ")");
1174 }
1175 }
1176 }
1177
1178 print __("All done.");
1179
1180 }
1181
afcfe6ca
AD
1182 function categorize() {
1183 $ids = split(",", db_escape_string($_REQUEST["ids"]));
1184
1185 $cat_id = db_escape_string($_REQUEST["cat_id"]);
1186
1187 if ($cat_id == 0) {
1188 $cat_id_qpart = 'NULL';
1189 } else {
1190 $cat_id_qpart = "'$cat_id'";
1191 }
1192
1193 db_query($this->link, "BEGIN");
1194
1195 foreach ($ids as $id) {
1196
1197 db_query($this->link, "UPDATE ttrss_feeds SET cat_id = $cat_id_qpart
1198 WHERE id = '$id'
1199 AND owner_uid = " . $_SESSION["uid"]);
1200
1201 }
1202
1203 db_query($this->link, "COMMIT");
1204 }
1205
28537341
AD
1206 function removeCat() {
1207 $ids = split(",", db_escape_string($_REQUEST["ids"]));
1208 foreach ($ids as $id) {
1209 remove_feed_category($this->link, $id, $_SESSION["uid"]);
1210 }
1211 }
1212
1213 function addCat() {
1214 $feed_cat = db_escape_string(trim($_REQUEST["cat"]));
1215
1216 add_feed_category($this->link, $feed_cat);
1217 }
1218
afcfe6ca
AD
1219 function index() {
1220
1221 print "<div dojoType=\"dijit.layout.AccordionContainer\" region=\"center\">";
1222 print "<div id=\"pref-feeds-feeds\" dojoType=\"dijit.layout.AccordionPane\" title=\"".__('Feeds')."\">";
1223
1224 $result = db_query($this->link, "SELECT COUNT(id) AS num_errors
1225 FROM ttrss_feeds WHERE last_error != '' AND owner_uid = ".$_SESSION["uid"]);
1226
1227 $num_errors = db_fetch_result($result, 0, "num_errors");
1228
1229 if ($num_errors > 0) {
1230
1231 $error_button = "<button dojoType=\"dijit.form.Button\"
1232 onclick=\"showFeedsWithErrors()\" id=\"errorButton\">" .
1233 __("Feeds with errors") . "</button>";
1234 }
1235
1236 if (DB_TYPE == "pgsql") {
1237 $interval_qpart = "NOW() - INTERVAL '3 months'";
1238 } else {
1239 $interval_qpart = "DATE_SUB(NOW(), INTERVAL 3 MONTH)";
1240 }
1241
1242 $result = db_query($this->link, "SELECT COUNT(*) AS num_inactive FROM ttrss_feeds WHERE
1243 (SELECT MAX(updated) FROM ttrss_entries, ttrss_user_entries WHERE
1244 ttrss_entries.id = ref_id AND
1245 ttrss_user_entries.feed_id = ttrss_feeds.id) < $interval_qpart AND
1246 ttrss_feeds.owner_uid = ".$_SESSION["uid"]);
1247
1248 $num_inactive = db_fetch_result($result, 0, "num_inactive");
1249
1250 if ($num_inactive > 0) {
1251 $inactive_button = "<button dojoType=\"dijit.form.Button\"
1252 onclick=\"showInactiveFeeds()\">" .
1253 __("Inactive feeds") . "</button>";
1254 }
1255
1256 $feed_search = db_escape_string($_REQUEST["search"]);
1257
1258 if (array_key_exists("search", $_REQUEST)) {
1259 $_SESSION["prefs_feed_search"] = $feed_search;
1260 } else {
1261 $feed_search = $_SESSION["prefs_feed_search"];
1262 }
1263
1264 print '<div dojoType="dijit.layout.BorderContainer" gutters="false">';
1265
1266 print "<div region='top' dojoType=\"dijit.Toolbar\">"; #toolbar
1267
1268 print "<div style='float : right; padding-right : 4px;'>
1269 <input dojoType=\"dijit.form.TextBox\" id=\"feed_search\" size=\"20\" type=\"search\"
1270 value=\"$feed_search\">
1271 <button dojoType=\"dijit.form.Button\" onclick=\"updateFeedList()\">".
1272 __('Search')."</button>
1273 </div>";
1274
1275 print "<div dojoType=\"dijit.form.DropDownButton\">".
1276 "<span>" . __('Select')."</span>";
1277 print "<div dojoType=\"dijit.Menu\" style=\"display: none;\">";
1278 print "<div onclick=\"dijit.byId('feedTree').model.setAllChecked(true)\"
1279 dojoType=\"dijit.MenuItem\">".__('All')."</div>";
1280 print "<div onclick=\"dijit.byId('feedTree').model.setAllChecked(false)\"
1281 dojoType=\"dijit.MenuItem\">".__('None')."</div>";
1282 print "</div></div>";
1283
1284 print "<div dojoType=\"dijit.form.DropDownButton\">".
1285 "<span>" . __('Feeds')."</span>";
1286 print "<div dojoType=\"dijit.Menu\" style=\"display: none;\">";
1287 print "<div onclick=\"quickAddFeed()\"
1288 dojoType=\"dijit.MenuItem\">".__('Subscribe to feed')."</div>";
1289 print "<div onclick=\"editSelectedFeed()\"
1290 dojoType=\"dijit.MenuItem\">".__('Edit selected feeds')."</div>";
1291 print "<div onclick=\"resetFeedOrder()\"
1292 dojoType=\"dijit.MenuItem\">".__('Reset sort order')."</div>";
33f0fdd0
AD
1293 print "<div onclick=\"batchSubscribe()\"
1294 dojoType=\"dijit.MenuItem\">".__('Batch subscribe')."</div>";
afcfe6ca
AD
1295 print "</div></div>";
1296
1297 if (get_pref($this->link, 'ENABLE_FEED_CATS')) {
1298 print "<div dojoType=\"dijit.form.DropDownButton\">".
1299 "<span>" . __('Categories')."</span>";
1300 print "<div dojoType=\"dijit.Menu\" style=\"display: none;\">";
5ef071e0
AD
1301 print "<div onclick=\"createCategory()\"
1302 dojoType=\"dijit.MenuItem\">".__('Add category')."</div>";
5b7bd238
AD
1303 print "<div onclick=\"toggleHiddenFeedCats()\"
1304 dojoType=\"dijit.MenuItem\">".__('(Un)hide empty categories')."</div>";
afcfe6ca
AD
1305 print "<div onclick=\"resetCatOrder()\"
1306 dojoType=\"dijit.MenuItem\">".__('Reset sort order')."</div>";
fd26d5bf
AD
1307 print "<div onclick=\"removeSelectedCategories()\"
1308 dojoType=\"dijit.MenuItem\">".__('Remove selected')."</div>";
afcfe6ca
AD
1309 print "</div></div>";
1310
1311 }
1312
1313 print $error_button;
1314 print $inactive_button;
1315
1316 print "<button dojoType=\"dijit.form.Button\" onclick=\"removeSelectedFeeds()\">"
1317 .__('Unsubscribe')."</button dojoType=\"dijit.form.Button\"> ";
1318
1319 if (defined('_ENABLE_FEED_DEBUGGING')) {
1320
1321 print "<select id=\"feedActionChooser\" onchange=\"feedActionChange()\">
1322 <option value=\"facDefault\" selected>".__('More actions...')."</option>";
1323
1324 if (FORCE_ARTICLE_PURGE == 0) {
1325 print
1326 "<option value=\"facPurge\">".__('Manual purge')."</option>";
1327 }
1328
1329 print "
1330 <option value=\"facClear\">".__('Clear feed data')."</option>
1331 <option value=\"facRescore\">".__('Rescore articles')."</option>";
1332
1333 print "</select>";
1334
1335 }
1336
1337 print "</div>"; # toolbar
1338
1339 //print '</div>';
1340 print '<div dojoType="dijit.layout.ContentPane" region="center">';
1341
1342 print "<div id=\"feedlistLoading\">
1343 <img src='images/indicator_tiny.gif'>".
1344 __("Loading, please wait...")."</div>";
1345
1346 print "<div dojoType=\"fox.PrefFeedStore\" jsId=\"feedStore\"
1347 url=\"backend.php?op=pref-feeds&method=getfeedtree\">
1348 </div>
1349 <div dojoType=\"lib.CheckBoxStoreModel\" jsId=\"feedModel\" store=\"feedStore\"
1350 query=\"{id:'root'}\" rootId=\"root\" rootLabel=\"Feeds\"
1351 childrenAttrs=\"items\" checkboxStrict=\"false\" checkboxAll=\"false\">
1352 </div>
1353 <div dojoType=\"fox.PrefFeedTree\" id=\"feedTree\"
1354 dndController=\"dijit.tree.dndSource\"
1355 betweenThreshold=\"5\"
1356 model=\"feedModel\" openOnClick=\"false\">
1357 <script type=\"dojo/method\" event=\"onClick\" args=\"item\">
1358 var id = String(item.id);
1359 var bare_id = id.substr(id.indexOf(':')+1);
1360
1361 if (id.match('FEED:')) {
1362 editFeed(bare_id);
1363 } else if (id.match('CAT:')) {
1364 editCat(bare_id, item);
1365 }
1366 </script>
1367 <script type=\"dojo/method\" event=\"onLoad\" args=\"item\">
1368 Element.hide(\"feedlistLoading\");
1369 </script>
1370 </div>";
1371
ba5296a1
AD
1372# print "<div dojoType=\"dijit.Tooltip\" connectId=\"feedTree\" position=\"below\">
1373# ".__('<b>Hint:</b> you can drag feeds and categories around.')."
1374# </div>";
afcfe6ca
AD
1375
1376 print '</div>';
1377 print '</div>';
1378
1379 print "</div>"; # feeds pane
1380
566faa14 1381 print "<div dojoType=\"dijit.layout.AccordionPane\" title=\"".__('Import and export')."\">";
afcfe6ca 1382
a1159c01 1383 print "<h3>" . __("OPML") . "</h3>";
afcfe6ca 1384
566faa14 1385 print "<p>" . __("Using OPML you can export and import your feeds, filters, labels and Tiny Tiny RSS settings.") . " ";
afcfe6ca 1386
566faa14 1387 print __("Only main settings profile can be migrated using OPML.") . "</p>";
afcfe6ca 1388
55f34b81 1389 print "<iframe id=\"upload_iframe\"
afcfe6ca
AD
1390 name=\"upload_iframe\" onload=\"opmlImportComplete(this)\"
1391 style=\"width: 400px; height: 100px; display: none;\"></iframe>";
1392
1393 print "<form name=\"opml_form\" style='display : block' target=\"upload_iframe\"
1394 enctype=\"multipart/form-data\" method=\"POST\"
55f34b81 1395 action=\"backend.php\">
afcfe6ca
AD
1396 <input id=\"opml_file\" name=\"opml_file\" type=\"file\">&nbsp;
1397 <input type=\"hidden\" name=\"op\" value=\"dlg\">
c4c74732 1398 <input type=\"hidden\" name=\"method\" value=\"importOpml\">
afcfe6ca 1399 <button dojoType=\"dijit.form.Button\" onclick=\"return opmlImport();\" type=\"submit\">" .
a1159c01 1400 __('Import my OPML') . "</button>";
afcfe6ca 1401
a1159c01 1402 print "<hr>";
afcfe6ca
AD
1403
1404 print "<p>" . __('Filename:') .
1405 " <input type=\"text\" id=\"filename\" value=\"TinyTinyRSS.opml\" />&nbsp;" .
a1159c01 1406 __('Include settings') . "<input type=\"checkbox\" id=\"settings\" checked=\"1\"/>";
afcfe6ca 1407
a1159c01 1408 print "</p><button dojoType=\"dijit.form.Button\"
afcfe6ca 1409 onclick=\"gotoExportOpml(document.opml_form.filename.value, document.opml_form.settings.checked)\" >" .
a1159c01 1410 __('Export OPML') . "</button></p></form>";
afcfe6ca 1411
a1159c01 1412 print "<hr>";
afcfe6ca
AD
1413
1414 print "<p>".__('Your OPML can be published publicly and can be subscribed by anyone who knows the URL below.') . " ";
1415
566faa14 1416 print __("Published OPML does not include your Tiny Tiny RSS settings, feeds that require authentication or feeds hidden from Popular feeds.") . "</p>";
afcfe6ca
AD
1417
1418 print "<button dojoType=\"dijit.form.Button\" onclick=\"return displayDlg('pubOPMLUrl')\">".
a1159c01 1419 __('Display published OPML URL')."</button> ";
afcfe6ca 1420
55f34b81 1421
a1159c01 1422 print "<h3>" . __("Article archive") . "</h3>";
566faa14 1423
a1159c01 1424 print "<p>" . __("You can export and import your Starred and Archived articles for safekeeping or when migrating between tt-rss instances.") . "</p>";
566faa14
AD
1425
1426 print "<button dojoType=\"dijit.form.Button\" onclick=\"return exportData()\">".
1427 __('Export my data')."</button> ";
1428
a1159c01 1429 print "<hr>";
55f34b81
AD
1430
1431 print "<iframe id=\"data_upload_iframe\"
1432 name=\"data_upload_iframe\" onload=\"dataImportComplete(this)\"
1433 style=\"width: 400px; height: 100px; display: none;\"></iframe>";
1434
41f68571 1435 print "<form name=\"import_form\" style='display : block' target=\"data_upload_iframe\"
55f34b81
AD
1436 enctype=\"multipart/form-data\" method=\"POST\"
1437 action=\"backend.php\">
1438 <input id=\"export_file\" name=\"export_file\" type=\"file\">&nbsp;
1439 <input type=\"hidden\" name=\"op\" value=\"dlg\">
1440 <input type=\"hidden\" name=\"method\" value=\"dataimport\">
1441 <button dojoType=\"dijit.form.Button\" onclick=\"return importData();\" type=\"submit\">" .
1442 __('Import') . "</button>";
1443
1444
afcfe6ca
AD
1445 print "</div>"; # pane
1446
1447 if (strpos($_SERVER['HTTP_USER_AGENT'], "Firefox") !== false) {
1448
1449 print "<div dojoType=\"dijit.layout.AccordionPane\" title=\"".__('Firefox integration')."\">";
1450
1451 print "<p>" . __('This Tiny Tiny RSS site can be used as a Firefox Feed Reader by clicking the link below.') . "</p>";
1452
1453 print "<p>";
1454
1455 print "<button onclick='window.navigator.registerContentHandler(" .
1456 "\"application/vnd.mozilla.maybe.feed\", " .
1457 "\"" . add_feed_url() . "\", " . " \"Tiny Tiny RSS\")'>" .
1458 __('Click here to register this site as a feed reader.') .
1459 "</button>";
1460
1461 print "</p>";
1462
1463 print "</div>"; # pane
1464 }
1465
8361e724 1466 print "<div dojoType=\"dijit.layout.AccordionPane\" title=\"".__('Bookmarklets')."\">";
afcfe6ca
AD
1467
1468 print "<p>" . __("Drag the link below to your browser toolbar, open the feed you're interested in in your browser and click on the link to subscribe to it.") . "</p>";
1469
1470 $bm_subscribe_url = str_replace('%s', '', add_feed_url());
1471
b1e592d3 1472 $confirm_str = str_replace("'", "\'", __('Subscribe to %s in Tiny Tiny RSS?'));
afcfe6ca
AD
1473
1474 $bm_url = htmlspecialchars("javascript:{if(confirm('$confirm_str'.replace('%s',window.location.href)))window.location.href='$bm_subscribe_url'+window.location.href}");
1475
1476 print "<a href=\"$bm_url\" class='bookmarklet'>" . __('Subscribe in Tiny Tiny RSS'). "</a>";
1477
8361e724
AD
1478 print "<p>" . __("Use this bookmarklet to publish arbitrary pages using Tiny Tiny RSS") . "</p>";
1479
1480 $bm_url = htmlspecialchars("javascript:(function(){var d=document,w=window,e=w.getSelection,k=d.getSelection,x=d.selection,s=(e?e():(k)?k():(x?x.createRange().text:0)),f='".SELF_URL_PATH."/public.php?op=sharepopup',l=d.location,e=encodeURIComponent,g=f+'&title='+((e(s))?e(s):e(document.title))+'&url='+e(l.href);function a(){if(!w.open(g,'t','toolbar=0,resizable=0,scrollbars=1,status=1,width=500,height=200')){l.href=g;}}a();})()");
1481
1482 print "<a href=\"$bm_url\" class='bookmarklet'>" . __('Share with Tiny Tiny RSS'). "</a>";
1483
afcfe6ca
AD
1484 print "</div>"; #pane
1485
e95e7819 1486 print "<div dojoType=\"dijit.layout.AccordionPane\" title=\"".__('Published & shared articles / Generated feeds')."\">";
afcfe6ca
AD
1487
1488 print "<h3>" . __("Published articles and generated feeds") . "</h3>";
1489
1490 print "<p>".__('Published articles are exported as a public RSS feed and can be subscribed by anyone who knows the URL specified below.')."</p>";
1491
1492 $rss_url = '-2::' . htmlspecialchars(get_self_url_prefix() .
1493 "/public.php?op=rss&id=-2&view-mode=all_articles");;
1494
1495 print "<button dojoType=\"dijit.form.Button\" onclick=\"return displayDlg('generatedFeed', '$rss_url')\">".
1496 __('Display URL')."</button> ";
1497
1498 print "<button dojoType=\"dijit.form.Button\" onclick=\"return clearFeedAccessKeys()\">".
1499 __('Clear all generated URLs')."</button> ";
1500
1501 print "<h3>" . __("Articles shared by URL") . "</h3>";
1502
1503 print "<p>" . __("You can disable all articles shared by unique URLs here.") . "</p>";
1504
1505 print "<button dojoType=\"dijit.form.Button\" onclick=\"return clearArticleAccessKeys()\">".
1506 __('Unshare all articles')."</button> ";
1507
1508 print "</div>"; #pane
1509
afcfe6ca
AD
1510 print "</div>"; #container
1511
1512 }
2ecd2df5
AD
1513
1514 private function feedlist_init_cat($cat_id, $hidden = false) {
1515 $obj = array();
1516 $cat_id = (int) $cat_id;
1517
1518 if ($cat_id > 0) {
1519 $cat_unread = ccache_find($this->link, $cat_id, $_SESSION["uid"], true);
1520 } else if ($cat_id == 0 || $cat_id == -2) {
1521 $cat_unread = getCategoryUnread($this->link, $cat_id);
1522 }
1523
1524 $obj['id'] = 'CAT:' . $cat_id;
1525 $obj['items'] = array();
1526 $obj['name'] = getCategoryTitle($this->link, $cat_id);
1527 $obj['type'] = 'category';
1528 $obj['unread'] = (int) $cat_unread;
1529 $obj['hidden'] = $hidden;
1530 $obj['bare_id'] = $cat_id;
1531
1532 return $obj;
1533 }
1534
1535 private function feedlist_init_feed($feed_id, $title = false, $unread = false, $error = '', $updated = '') {
1536 $obj = array();
1537 $feed_id = (int) $feed_id;
1538
1539 if (!$title)
1540 $title = getFeedTitle($this->link, $feed_id, false);
1541
1542 if ($unread === false)
1543 $unread = getFeedUnread($this->link, $feed_id, false);
1544
1545 $obj['id'] = 'FEED:' . $feed_id;
1546 $obj['name'] = $title;
1547 $obj['unread'] = (int) $unread;
1548 $obj['type'] = 'feed';
1549 $obj['error'] = $error;
1550 $obj['updated'] = $updated;
1551 $obj['icon'] = getFeedIcon($feed_id);
1552 $obj['bare_id'] = $feed_id;
1553
1554 return $obj;
1555 }
1556
bc6fa236
AD
1557 function inactiveFeeds() {
1558
1559 if (DB_TYPE == "pgsql") {
1560 $interval_qpart = "NOW() - INTERVAL '3 months'";
1561 } else {
1562 $interval_qpart = "DATE_SUB(NOW(), INTERVAL 3 MONTH)";
1563 }
1564
1565 $result = db_query($this->link, "SELECT ttrss_feeds.title, ttrss_feeds.site_url,
1566 ttrss_feeds.feed_url, ttrss_feeds.id, MAX(updated) AS last_article
1567 FROM ttrss_feeds, ttrss_entries, ttrss_user_entries WHERE
1568 (SELECT MAX(updated) FROM ttrss_entries, ttrss_user_entries WHERE
1569 ttrss_entries.id = ref_id AND
1570 ttrss_user_entries.feed_id = ttrss_feeds.id) < $interval_qpart
1571 AND ttrss_feeds.owner_uid = ".$_SESSION["uid"]." AND
1572 ttrss_user_entries.feed_id = ttrss_feeds.id AND
1573 ttrss_entries.id = ref_id
1574 GROUP BY ttrss_feeds.title, ttrss_feeds.id, ttrss_feeds.site_url, ttrss_feeds.feed_url
1575 ORDER BY last_article");
1576
1577 print "<div class=\"dialogNotice\">" . __("These feeds have not been updated with new content for 3 months (oldest first):") . "</div>";
1578
1579 print "<div dojoType=\"dijit.Toolbar\">";
1580 print "<div dojoType=\"dijit.form.DropDownButton\">".
1581 "<span>" . __('Select')."</span>";
1582 print "<div dojoType=\"dijit.Menu\" style=\"display: none;\">";
1583 print "<div onclick=\"selectTableRows('prefInactiveFeedList', 'all')\"
1584 dojoType=\"dijit.MenuItem\">".__('All')."</div>";
1585 print "<div onclick=\"selectTableRows('prefInactiveFeedList', 'none')\"
1586 dojoType=\"dijit.MenuItem\">".__('None')."</div>";
1587 print "</div></div>";
1588 print "</div>"; #toolbar
1589
1590 print "<div class=\"inactiveFeedHolder\">";
1591
1592 print "<table width=\"100%\" cellspacing=\"0\" id=\"prefInactiveFeedList\">";
1593
1594 $lnum = 1;
1595
1596 while ($line = db_fetch_assoc($result)) {
1597
1598 $class = ($lnum % 2) ? "even" : "odd";
1599 $feed_id = $line["id"];
1600 $this_row_id = "id=\"FUPDD-$feed_id\"";
1601
1602 # class needed for selectTableRows()
1603 print "<tr class=\"placeholder\" $this_row_id>";
1604
1605 $edit_title = htmlspecialchars($line["title"]);
1606
1607 # id needed for selectTableRows()
1608 print "<td width='5%' align='center'><input
1609 onclick='toggleSelectRow2(this);' dojoType=\"dijit.form.CheckBox\"
1610 type=\"checkbox\" id=\"FUPDC-$feed_id\"></td>";
1611 print "<td>";
1612
1613 print "<a class=\"visibleLink\" href=\"#\" ".
1614 "title=\"".__("Click to edit feed")."\" ".
1615 "onclick=\"editFeed(".$line["id"].")\">".
1616 htmlspecialchars($line["title"])."</a>";
1617
1618 print "</td><td class=\"insensitive\" align='right'>";
1619 print make_local_datetime($this->link, $line['last_article'], false);
1620 print "</td>";
1621 print "</tr>";
1622
1623 ++$lnum;
1624 }
1625
1626 print "</table>";
1627 print "</div>";
1628
1629 print "<div class='dlgButtons'>";
1630 print "<div style='float : left'>";
1631 print "<button dojoType=\"dijit.form.Button\" onclick=\"dijit.byId('inactiveFeedsDlg').removeSelected()\">"
1632 .__('Unsubscribe from selected feeds')."</button> ";
1633 print "</div>";
1634
1635 print "<button dojoType=\"dijit.form.Button\" onclick=\"dijit.byId('inactiveFeedsDlg').hide()\">".
1636 __('Close this window')."</button>";
1637
1638 print "</div>";
1639
1640 }
1641
1642 function feedsWithErrors() {
1643 print "<div class=\"dialogNotice\">" . __("These feeds have not been updated because of errors:") . "</div>";
1644
1645 $result = db_query($this->link, "SELECT id,title,feed_url,last_error,site_url
1646 FROM ttrss_feeds WHERE last_error != '' AND owner_uid = ".$_SESSION["uid"]);
1647
1648 print "<div dojoType=\"dijit.Toolbar\">";
1649 print "<div dojoType=\"dijit.form.DropDownButton\">".
1650 "<span>" . __('Select')."</span>";
1651 print "<div dojoType=\"dijit.Menu\" style=\"display: none;\">";
1652 print "<div onclick=\"selectTableRows('prefErrorFeedList', 'all')\"
1653 dojoType=\"dijit.MenuItem\">".__('All')."</div>";
1654 print "<div onclick=\"selectTableRows('prefErrorFeedList', 'none')\"
1655 dojoType=\"dijit.MenuItem\">".__('None')."</div>";
1656 print "</div></div>";
1657 print "</div>"; #toolbar
1658
1659 print "<div class=\"inactiveFeedHolder\">";
1660
1661 print "<table width=\"100%\" cellspacing=\"0\" id=\"prefErrorFeedList\">";
1662
1663 $lnum = 1;
1664
1665 while ($line = db_fetch_assoc($result)) {
1666
1667 $class = ($lnum % 2) ? "even" : "odd";
1668 $feed_id = $line["id"];
1669 $this_row_id = "id=\"FERDD-$feed_id\"";
1670
1671 # class needed for selectTableRows()
1672 print "<tr class=\"placeholder\" $this_row_id>";
1673
1674 $edit_title = htmlspecialchars($line["title"]);
1675
1676 # id needed for selectTableRows()
1677 print "<td width='5%' align='center'><input
1678 onclick='toggleSelectRow2(this);' dojoType=\"dijit.form.CheckBox\"
1679 type=\"checkbox\" id=\"FERDC-$feed_id\"></td>";
1680 print "<td>";
1681
1682 print "<a class=\"visibleLink\" href=\"#\" ".
1683 "title=\"".__("Click to edit feed")."\" ".
1684 "onclick=\"editFeed(".$line["id"].")\">".
1685 htmlspecialchars($line["title"])."</a>: ";
1686
1687 print "<span class=\"insensitive\">";
1688 print htmlspecialchars($line["last_error"]);
1689 print "</span>";
1690
1691 print "</td>";
1692 print "</tr>";
1693
1694 ++$lnum;
1695 }
1696
1697 print "</table>";
1698 print "</div>";
1699
1700 print "<div class='dlgButtons'>";
1701 print "<div style='float : left'>";
1702 print "<button dojoType=\"dijit.form.Button\" onclick=\"dijit.byId('errorFeedsDlg').removeSelected()\">"
1703 .__('Unsubscribe from selected feeds')."</button> ";
1704 print "</div>";
1705
1706 print "<button dojoType=\"dijit.form.Button\" onclick=\"dijit.byId('errorFeedsDlg').hide()\">".
1707 __('Close this window')."</button>";
1708
1709 print "</div>";
1710 }
1711
afcfe6ca
AD
1712}
1713?>