}
- if ($op == "pref-feeds") {
-
- $subop = $_GET["subop"];
+ if ($op == "pref-rpc") {
- if ($subop == "edit") {
- print "<p>[Edit feed placeholder]</p>";
- }
+ $subop = $_GET["subop"];
if ($subop == "unread") {
$ids = split(",", $_GET["ids"]);
foreach ($ids as $id) {
pg_query("UPDATE ttrss_entries SET unread = true WHERE feed_id = '$id'");
}
+
+ print "Marked selected feeds as read.";
}
if ($subop == "read") {
foreach ($ids as $id) {
pg_query("UPDATE ttrss_entries SET unread = false WHERE feed_id = '$id'");
}
+
+ print "Marked selected feeds as unread.";
+
+ }
+
+ }
+
+ if ($op == "pref-feeds") {
+
+ $subop = $_GET["subop"];
+
+ if ($subop == "edit") {
+ print "<p>[Edit feed placeholder]</p>";
}
if ($subop == "remove") {
}
}
-function update_feeds() {
+function notify_callback() {
+ var container = document.getElementById('notify');
+ if (xmlhttp.readyState == 4) {
+ container.innerHTML=xmlhttp.responseText;
+ }
+}
+
+function updateFeedList() {
document.getElementById("feeds").innerHTML = "Loading feeds, please wait...";
notify("Marking selected feeds as read...");
- xmlhttp.open("GET", "backend.php?op=pref-feeds&subop=unread&ids="+
+ xmlhttp.open("GET", "backend.php?op=pref-rpc&subop=unread&ids="+
param_escape(sel_rows.toString()), true);
- xmlhttp.onreadystatechange=feedlist_callback;
+ xmlhttp.onreadystatechange=notify_callback;
xmlhttp.send(null);
} else {
notify("Marking selected feeds as unread...");
- xmlhttp.open("GET", "backend.php?op=pref-feeds&subop=unread&ids="+
+ xmlhttp.open("GET", "backend.php?op=pref-rpc&subop=unread&ids="+
param_escape(sel_rows.toString()), true);
- xmlhttp.onreadystatechange=feedlist_callback;
+ xmlhttp.onreadystatechange=notify_callback;
xmlhttp.send(null);
} else {
function init() {
- update_feeds();
+ updateFeedList();
notify("");
href="javascript:readSelectedFeeds()">Mark as read</a>
<a class="button"
href="javascript:unreadSelectedFeeds()">Mark as unread</a>
+ <a class="button"
+ href="javascript:updateFeedList()">Refresh</a>
<hr>