$subop = $_GET["subop"];
- if ($subop == "edit") {
+/* if ($subop == "old_edit") {
$feed_id = $_GET["id"];
<a class=\"button\" href=\"javascript:addFeed()\">Add feed</a></td></tr>
</table>";
- }
+ } */
if ($subop == "editSave") {
$feed_title = pg_escape_string($_GET["t"]);
print "<p><table width=\"100%\" class=\"prefFeedList\" id=\"prefFeedList\">";
print "<tr class=\"title\">
- <td> </td><td>Select</td><td>Title</td><td>Link</td><td>Last Updated</td></tr>";
+ <td> </td><td>Select</td><td width=\"40%\">Title</td>
+ <td width=\"40%\">Link</td><td>Last Updated</td></tr>";
$lnum = 0;
$class = ($lnum % 2) ? "even" : "odd";
$feed_id = $line["id"];
-
+
+ $edit_feed_id = $_GET["id"];
+
print "<tr class=\"$class\" id=\"FEEDR-$feed_id\">";
$icon_file = ICONS_DIR . "/$feed_id.ico";
}
print "<td align='center'>$feed_icon</td>";
- print "<td><input onclick='toggleSelectRow(this);'
+ if ($feed_id != $edit_feed_id || $subop != "edit" ) {
+
+ print "<td><input onclick='toggleSelectRow(this);'
type=\"checkbox\" id=\"FRCHK-".$line["id"]."\"></td>";
-
- print "<td><a href=\"javascript:editFeed($feed_id);\">" .
- $line["title"] . "</td>";
- print "<td><a href=\"javascript:editFeed($feed_id);\">" .
- $line["feed_url"] . "</td>";
+
+ print "<td><a href=\"javascript:editFeed($feed_id);\">" .
+ $line["title"] . "</td>";
+ print "<td><a href=\"javascript:editFeed($feed_id);\">" .
+ $line["feed_url"] . "</td>";
+ } else {
+
+ print "<td><input disabled=\"true\" type=\"checkbox\" id=\"FRCHK-".$line["id"]."\"></td>";
+
+ print "<td><input id=\"iedit_title\" value=\"".$line["title"]."\"></td>";
+ print "<td><input id=\"iedit_link\" value=\"".$line["feed_url"]."\"></td>";
+
+ }
print "<td>" . $line["last_updated"] . "</td>";
+
print "</tr>";
++$lnum;
print "</table>";
+ print "<p>";
+
+ if ($subop == "edit") {
+ print "Edit feed:
+ <a class=\"button\" href=\"javascript:feedEditCancel()\">Cancel</a>
+ <a class=\"button\" href=\"javascript:feedEditSave()\">Save</a>";
+ } else {
+
+// <a class=\"button\"
+// href=\"javascript:editSelectedFeed()\">Edit</a>
+
+// <a class=\"button\"
+// href=\"javascript:updateFeedList()\">Refresh</a>";
+
+ print "
+ Selection:
+ <a class=\"buttonWarn\"
+ href=\"javascript:removeSelectedFeeds()\">Remove</a>
+ <a class=\"button\"
+ href=\"javascript:readSelectedFeeds()\">Mark as read</a>
+ <a class=\"button\"
+ href=\"javascript:unreadSelectedFeeds()\">Mark as unread</a>";
+
+ }
+
}
pg_close($link);
}
-function feedEditSave(feed) {
+function feedEditSave() {
+
+ var feed = active_feed;
if (!xmlhttp_ready(xmlhttp)) {
printLockingError();
return
}
- notify("Saving feed.");
+ var link = document.getElementById("iedit_link").value;
+ var title = document.getElementById("iedit_title").value;
- var link = document.getElementById("fedit_link").value;
- var title = document.getElementById("fedit_title").value;
+// notify("Saving feed.");
if (link.length == 0) {
notify("Feed link cannot be blank.");
return;
}
+ active_feed = false;
+
xmlhttp.open("GET", "backend.php?op=pref-feeds&subop=editSave&id=" +
feed + "&l=" + param_escape(link) + "&t=" + param_escape(title) ,true);
xmlhttp.onreadystatechange=feedlist_callback;
<td id="prefContent" class="prefContent" valign="top" colspan="2">
<h2>Feed Configuration</h2>
-<!--
+ <div id="piggie"> </div>
+
<table class="prefAddFeed">
<td><input id="fadd_link"></td>
<td colspan="4" align="right">
<a class="button" href="javascript:addFeed()">Add feed</a></td></tr>
</table>
--->
- <div id="piggie"> </div>
-
+
<div id="feeds"> </div>
- <p>Selection:
+<!-- <p>Selection:
<a class="button"
href="javascript:editSelectedFeed()">Edit</a>
<a class="buttonWarn"
<a class="button"
href="javascript:unreadSelectedFeeds()">Mark as unread</a>
<a class="button"
- href="javascript:updateFeedList()">Refresh</a>
+ href="javascript:updateFeedList()">Refresh</a> -->
<hr>