misc prefs interface cleanups
This commit is contained in:
parent
17095c5a0e
commit
3b0feb9b7f
848
backend.php
848
backend.php
|
@ -1134,217 +1134,221 @@
|
||||||
ttrss_feeds WHERE owner_uid = '".$_SESSION["uid"]."'
|
ttrss_feeds WHERE owner_uid = '".$_SESSION["uid"]."'
|
||||||
ORDER by $feeds_sort,title");
|
ORDER by $feeds_sort,title");
|
||||||
|
|
||||||
print "<div id=\"infoBoxShadow\"><div id=\"infoBox\">PLACEHOLDER</div></div>";
|
if (db_num_rows($result) != 0) {
|
||||||
|
|
||||||
print "<p><table width=\"100%\" class=\"prefFeedList\" id=\"prefFeedList\">";
|
print "<div id=\"infoBoxShadow\"><div id=\"infoBox\">PLACEHOLDER</div></div>";
|
||||||
print "<tr class=\"title\">
|
|
||||||
<td> </td>
|
|
||||||
<td>Select</td>
|
|
||||||
<td width=\"20%\">
|
|
||||||
<a href=\"javascript:updateFeedList('title')\">Title</a></td>
|
|
||||||
<td width=\"20%\">
|
|
||||||
<a href=\"javascript:updateFeedList('feed_url')\">Link</a>
|
|
||||||
</td>";
|
|
||||||
|
|
||||||
if (get_pref($link, 'ENABLE_FEED_CATS')) {
|
print "<p><table width=\"100%\" class=\"prefFeedList\" id=\"prefFeedList\">";
|
||||||
print "<td width=\"10%\">
|
print "<tr class=\"title\">
|
||||||
<a href=\"javascript:updateFeedList('category')\">Category</a></td>";
|
<td> </td>
|
||||||
}
|
<td>Select</td>
|
||||||
|
<td width=\"20%\">
|
||||||
|
<a href=\"javascript:updateFeedList('title')\">Title</a></td>
|
||||||
|
<td width=\"20%\">
|
||||||
|
<a href=\"javascript:updateFeedList('feed_url')\">Link</a>
|
||||||
|
</td>";
|
||||||
|
|
||||||
print "
|
if (get_pref($link, 'ENABLE_FEED_CATS')) {
|
||||||
<td width=\"10%\">
|
print "<td width=\"10%\">
|
||||||
<a href=\"javascript:updateFeedList('update_interval')\">Update Interval</a>
|
<a href=\"javascript:updateFeedList('category')\">Category</a></td>";
|
||||||
</td>
|
|
||||||
<td width=\"10%\">
|
|
||||||
<a href=\"javascript:updateFeedList('purge_interval')\">Purge Days</a>
|
|
||||||
</td>
|
|
||||||
<td>
|
|
||||||
<a href=\"javascript:updateFeedList('last_updated')\">Last updated</a>
|
|
||||||
</td>
|
|
||||||
</tr>";
|
|
||||||
|
|
||||||
$lnum = 0;
|
|
||||||
|
|
||||||
while ($line = db_fetch_assoc($result)) {
|
|
||||||
|
|
||||||
$class = ($lnum % 2) ? "even" : "odd";
|
|
||||||
|
|
||||||
$feed_id = $line["id"];
|
|
||||||
|
|
||||||
$edit_feed_id = $_GET["id"];
|
|
||||||
|
|
||||||
if ($subop == "edit" && $feed_id != $edit_feed_id) {
|
|
||||||
$class .= "Grayed";
|
|
||||||
}
|
}
|
||||||
|
|
||||||
print "<tr class=\"$class\" id=\"FEEDR-$feed_id\">";
|
print "
|
||||||
|
<td width=\"10%\">
|
||||||
|
<a href=\"javascript:updateFeedList('update_interval')\">Update Interval</a>
|
||||||
|
</td>
|
||||||
|
<td width=\"10%\">
|
||||||
|
<a href=\"javascript:updateFeedList('purge_interval')\">Purge Days</a>
|
||||||
|
</td>
|
||||||
|
<td>
|
||||||
|
<a href=\"javascript:updateFeedList('last_updated')\">Last updated</a>
|
||||||
|
</td>
|
||||||
|
</tr>";
|
||||||
|
|
||||||
$icon_file = ICONS_DIR . "/$feed_id.ico";
|
$lnum = 0;
|
||||||
|
|
||||||
if (file_exists($icon_file) && filesize($icon_file) > 0) {
|
while ($line = db_fetch_assoc($result)) {
|
||||||
$feed_icon = "<img width=\"16\" height=\"16\"
|
|
||||||
src=\"" . ICONS_URL . "/$feed_id.ico\">";
|
|
||||||
} else {
|
|
||||||
$feed_icon = " ";
|
|
||||||
}
|
|
||||||
print "<td align='center'>$feed_icon</td>";
|
|
||||||
|
|
||||||
$edit_title = htmlspecialchars(db_unescape_string($line["title"]));
|
$class = ($lnum % 2) ? "even" : "odd";
|
||||||
$edit_link = htmlspecialchars(db_unescape_string($line["feed_url"]));
|
|
||||||
$edit_cat = htmlspecialchars(db_unescape_string($line["category"]));
|
|
||||||
|
|
||||||
if (!$edit_cat) $edit_cat = "Uncategorized";
|
$feed_id = $line["id"];
|
||||||
|
|
||||||
if (!$edit_feed_id || $subop != "edit") {
|
$edit_feed_id = $_GET["id"];
|
||||||
|
|
||||||
print "<td><input onclick='toggleSelectRow(this);'
|
if ($subop == "edit" && $feed_id != $edit_feed_id) {
|
||||||
type=\"checkbox\" id=\"FRCHK-".$line["id"]."\"></td>";
|
$class .= "Grayed";
|
||||||
|
}
|
||||||
|
|
||||||
print "<td><a href=\"javascript:editFeed($feed_id);\">" .
|
print "<tr class=\"$class\" id=\"FEEDR-$feed_id\">";
|
||||||
$edit_title . "</a></td>";
|
|
||||||
|
|
||||||
print "<td><a href=\"javascript:editFeed($feed_id);\">" .
|
$icon_file = ICONS_DIR . "/$feed_id.ico";
|
||||||
$edit_link . "</a></td>";
|
|
||||||
|
if (file_exists($icon_file) && filesize($icon_file) > 0) {
|
||||||
|
$feed_icon = "<img width=\"16\" height=\"16\"
|
||||||
|
src=\"" . ICONS_URL . "/$feed_id.ico\">";
|
||||||
|
} else {
|
||||||
|
$feed_icon = " ";
|
||||||
|
}
|
||||||
|
print "<td align='center'>$feed_icon</td>";
|
||||||
|
|
||||||
|
$edit_title = htmlspecialchars(db_unescape_string($line["title"]));
|
||||||
|
$edit_link = htmlspecialchars(db_unescape_string($line["feed_url"]));
|
||||||
|
$edit_cat = htmlspecialchars(db_unescape_string($line["category"]));
|
||||||
|
|
||||||
|
if (!$edit_cat) $edit_cat = "Uncategorized";
|
||||||
|
|
||||||
|
if (!$edit_feed_id || $subop != "edit") {
|
||||||
|
|
||||||
|
print "<td><input onclick='toggleSelectRow(this);'
|
||||||
|
type=\"checkbox\" id=\"FRCHK-".$line["id"]."\"></td>";
|
||||||
|
|
||||||
if (get_pref($link, 'ENABLE_FEED_CATS')) {
|
|
||||||
print "<td><a href=\"javascript:editFeed($feed_id);\">" .
|
print "<td><a href=\"javascript:editFeed($feed_id);\">" .
|
||||||
$edit_cat . "</a></td>";
|
$edit_title . "</a></td>";
|
||||||
}
|
|
||||||
|
|
||||||
if ($line["update_interval"] == "0")
|
print "<td><a href=\"javascript:editFeed($feed_id);\">" .
|
||||||
$line["update_interval"] = "Default";
|
$edit_link . "</a></td>";
|
||||||
|
|
||||||
print "<td><a href=\"javascript:editFeed($feed_id);\">" .
|
if (get_pref($link, 'ENABLE_FEED_CATS')) {
|
||||||
$line["update_interval"] . "</a></td>";
|
print "<td><a href=\"javascript:editFeed($feed_id);\">" .
|
||||||
|
$edit_cat . "</a></td>";
|
||||||
if ($line["purge_interval"] == "0")
|
|
||||||
$line["purge_interval"] = "Default";
|
|
||||||
|
|
||||||
if ($line["purge_interval"] < 0)
|
|
||||||
$line["purge_interval"] = "Disabled";
|
|
||||||
|
|
||||||
print "<td><a href=\"javascript:editFeed($feed_id);\">" .
|
|
||||||
$line["purge_interval"] . "</a></td>";
|
|
||||||
|
|
||||||
} else if ($feed_id != $edit_feed_id) {
|
|
||||||
|
|
||||||
print "<td><input disabled=\"true\" type=\"checkbox\"
|
|
||||||
id=\"FRCHK-".$line["id"]."\"></td>";
|
|
||||||
|
|
||||||
print "<td>$edit_title</td>";
|
|
||||||
print "<td>$edit_link</td>";
|
|
||||||
|
|
||||||
if (get_pref($link, 'ENABLE_FEED_CATS')) {
|
|
||||||
print "<td>$edit_cat</td>";
|
|
||||||
}
|
|
||||||
|
|
||||||
if ($line["update_interval"] == "0")
|
|
||||||
$line["update_interval"] = "Default";
|
|
||||||
|
|
||||||
print "<td>" . $line["update_interval"] . "</td>";
|
|
||||||
|
|
||||||
if ($line["purge_interval"] == "0")
|
|
||||||
$line["purge_interval"] = "Default";
|
|
||||||
|
|
||||||
if ($line["purge_interval"] < 0)
|
|
||||||
$line["purge_interval"] = "Disabled";
|
|
||||||
|
|
||||||
print "<td>" . $line["purge_interval"] . "</td>";
|
|
||||||
|
|
||||||
} else {
|
|
||||||
|
|
||||||
print "<td><input disabled=\"true\" type=\"checkbox\" checked></td>";
|
|
||||||
|
|
||||||
print "<td><input id=\"iedit_title\" value=\"$edit_title\"></td>";
|
|
||||||
print "<td><input id=\"iedit_link\" value=\"$edit_link\"></td>";
|
|
||||||
|
|
||||||
if (get_pref($link, 'ENABLE_FEED_CATS')) {
|
|
||||||
|
|
||||||
print "<td>";
|
|
||||||
print "<select id=\"iedit_fcat\">";
|
|
||||||
print "<option id=\"0\">Uncategorized</option>";
|
|
||||||
|
|
||||||
if (db_num_rows($result) > 0) {
|
|
||||||
print "<option disabled>--------</option>";
|
|
||||||
}
|
}
|
||||||
|
|
||||||
$tmp_result = db_query($link, "SELECT id,title FROM ttrss_feed_categories
|
if ($line["update_interval"] == "0")
|
||||||
WHERE owner_uid = ".$_SESSION["uid"]." ORDER BY title");
|
$line["update_interval"] = "Default";
|
||||||
|
|
||||||
while ($tmp_line = db_fetch_assoc($tmp_result)) {
|
print "<td><a href=\"javascript:editFeed($feed_id);\">" .
|
||||||
if ($tmp_line["id"] == $line["cat_id"]) {
|
$line["update_interval"] . "</a></td>";
|
||||||
$is_selected = "selected";
|
|
||||||
} else {
|
if ($line["purge_interval"] == "0")
|
||||||
$is_selected = "";
|
$line["purge_interval"] = "Default";
|
||||||
|
|
||||||
|
if ($line["purge_interval"] < 0)
|
||||||
|
$line["purge_interval"] = "Disabled";
|
||||||
|
|
||||||
|
print "<td><a href=\"javascript:editFeed($feed_id);\">" .
|
||||||
|
$line["purge_interval"] . "</a></td>";
|
||||||
|
|
||||||
|
} else if ($feed_id != $edit_feed_id) {
|
||||||
|
|
||||||
|
print "<td><input disabled=\"true\" type=\"checkbox\"
|
||||||
|
id=\"FRCHK-".$line["id"]."\"></td>";
|
||||||
|
|
||||||
|
print "<td>$edit_title</td>";
|
||||||
|
print "<td>$edit_link</td>";
|
||||||
|
|
||||||
|
if (get_pref($link, 'ENABLE_FEED_CATS')) {
|
||||||
|
print "<td>$edit_cat</td>";
|
||||||
|
}
|
||||||
|
|
||||||
|
if ($line["update_interval"] == "0")
|
||||||
|
$line["update_interval"] = "Default";
|
||||||
|
|
||||||
|
print "<td>" . $line["update_interval"] . "</td>";
|
||||||
|
|
||||||
|
if ($line["purge_interval"] == "0")
|
||||||
|
$line["purge_interval"] = "Default";
|
||||||
|
|
||||||
|
if ($line["purge_interval"] < 0)
|
||||||
|
$line["purge_interval"] = "Disabled";
|
||||||
|
|
||||||
|
print "<td>" . $line["purge_interval"] . "</td>";
|
||||||
|
|
||||||
|
} else {
|
||||||
|
|
||||||
|
print "<td><input disabled=\"true\" type=\"checkbox\" checked></td>";
|
||||||
|
|
||||||
|
print "<td><input id=\"iedit_title\" value=\"$edit_title\"></td>";
|
||||||
|
print "<td><input id=\"iedit_link\" value=\"$edit_link\"></td>";
|
||||||
|
|
||||||
|
if (get_pref($link, 'ENABLE_FEED_CATS')) {
|
||||||
|
|
||||||
|
print "<td>";
|
||||||
|
print "<select id=\"iedit_fcat\">";
|
||||||
|
print "<option id=\"0\">Uncategorized</option>";
|
||||||
|
|
||||||
|
$tmp_result = db_query($link, "SELECT id,title FROM ttrss_feed_categories
|
||||||
|
WHERE owner_uid = ".$_SESSION["uid"]." ORDER BY title");
|
||||||
|
|
||||||
|
if (db_num_rows($tmp_result) > 0) {
|
||||||
|
print "<option disabled>--------</option>";
|
||||||
}
|
}
|
||||||
printf("<option $is_selected id='%d'>%s</option>",
|
|
||||||
$tmp_line["id"], $tmp_line["title"]);
|
while ($tmp_line = db_fetch_assoc($tmp_result)) {
|
||||||
|
if ($tmp_line["id"] == $line["cat_id"]) {
|
||||||
|
$is_selected = "selected";
|
||||||
|
} else {
|
||||||
|
$is_selected = "";
|
||||||
|
}
|
||||||
|
printf("<option $is_selected id='%d'>%s</option>",
|
||||||
|
$tmp_line["id"], $tmp_line["title"]);
|
||||||
|
}
|
||||||
|
|
||||||
|
print "</select></td>";
|
||||||
|
print "</td>";
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
print "</select></td>";
|
print "<td><input id=\"iedit_updintl\"
|
||||||
print "</td>";
|
value=\"".$line["update_interval"]."\"></td>";
|
||||||
|
print "<td><input id=\"iedit_purgintl\"
|
||||||
|
value=\"".$line["purge_interval"]."\"></td>";
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
print "<td><input id=\"iedit_updintl\"
|
if (!$line["last_updated"]) $line["last_updated"] = "Never";
|
||||||
value=\"".$line["update_interval"]."\"></td>";
|
|
||||||
print "<td><input id=\"iedit_purgintl\"
|
|
||||||
value=\"".$line["purge_interval"]."\"></td>";
|
|
||||||
|
|
||||||
|
print "<td>" . $line["last_updated"] . "</td>";
|
||||||
|
|
||||||
|
print "</tr>";
|
||||||
|
|
||||||
|
++$lnum;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!$line["last_updated"]) $line["last_updated"] = "Never";
|
print "</table>";
|
||||||
|
|
||||||
print "<td>" . $line["last_updated"] . "</td>";
|
print "<p>";
|
||||||
|
|
||||||
print "</tr>";
|
if ($subop == "edit") {
|
||||||
|
print "Edit feed:
|
||||||
++$lnum;
|
<input type=\"submit\" class=\"button\"
|
||||||
}
|
onclick=\"javascript:feedEditCancel()\" value=\"Cancel\">
|
||||||
|
<input type=\"submit\" class=\"button\"
|
||||||
if ($lnum == 0) {
|
onclick=\"javascript:feedEditSave()\" value=\"Save\">";
|
||||||
print "<tr><td colspan=\"5\" align=\"center\">No feeds defined.</td></tr>";
|
|
||||||
}
|
|
||||||
|
|
||||||
print "</table>";
|
|
||||||
|
|
||||||
print "<p>";
|
|
||||||
|
|
||||||
if ($subop == "edit") {
|
|
||||||
print "Edit feed:
|
|
||||||
<input type=\"submit\" class=\"button\"
|
|
||||||
onclick=\"javascript:feedEditCancel()\" value=\"Cancel\">
|
|
||||||
<input type=\"submit\" class=\"button\"
|
|
||||||
onclick=\"javascript:feedEditSave()\" value=\"Save\">";
|
|
||||||
} else {
|
} else {
|
||||||
|
|
||||||
print "
|
|
||||||
Selection:
|
|
||||||
<input type=\"submit\" class=\"button\"
|
|
||||||
onclick=\"javascript:selectedFeedDetails()\" value=\"Details\">
|
|
||||||
<input type=\"submit\" class=\"button\"
|
|
||||||
onclick=\"javascript:editSelectedFeed()\" value=\"Edit\">
|
|
||||||
<input type=\"submit\" class=\"button\"
|
|
||||||
onclick=\"javascript:removeSelectedFeeds()\" value=\"Remove\">";
|
|
||||||
|
|
||||||
if (get_pref($link, 'ENABLE_PREFS_CATCHUP_UNCATCHUP')) {
|
|
||||||
print "
|
print "
|
||||||
|
Selection:
|
||||||
<input type=\"submit\" class=\"button\"
|
<input type=\"submit\" class=\"button\"
|
||||||
onclick=\"javascript:readSelectedFeeds()\" value=\"Mark as read\">
|
onclick=\"javascript:selectedFeedDetails()\" value=\"Details\">
|
||||||
<input type=\"submit\" class=\"button\"
|
<input type=\"submit\" class=\"button\"
|
||||||
onclick=\"javascript:unreadSelectedFeeds()\" value=\"Mark as unread\"> ";
|
onclick=\"javascript:editSelectedFeed()\" value=\"Edit\">
|
||||||
}
|
<input type=\"submit\" class=\"button\"
|
||||||
print "
|
onclick=\"javascript:removeSelectedFeeds()\" value=\"Remove\">";
|
||||||
All feeds:
|
|
||||||
<input type=\"submit\"
|
|
||||||
class=\"button\" onclick=\"gotoExportOpml()\" value=\"Export OPML\">";
|
|
||||||
|
|
||||||
}
|
if (get_pref($link, 'ENABLE_PREFS_CATCHUP_UNCATCHUP')) {
|
||||||
|
print "
|
||||||
|
<input type=\"submit\" class=\"button\"
|
||||||
|
onclick=\"javascript:readSelectedFeeds()\" value=\"Mark as read\">
|
||||||
|
<input type=\"submit\" class=\"button\"
|
||||||
|
onclick=\"javascript:unreadSelectedFeeds()\"
|
||||||
|
value=\"Mark as unread\"> ";
|
||||||
|
}
|
||||||
|
|
||||||
print "<h3>Edit Categories</h3>";
|
print "
|
||||||
|
All feeds: <input type=\"submit\"
|
||||||
|
class=\"button\" onclick=\"gotoExportOpml()\"
|
||||||
|
value=\"Export OPML\">";
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
|
||||||
|
print "<p>No feeds defined.</p>";
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
if (get_pref($link, 'ENABLE_FEED_CATS')) {
|
if (get_pref($link, 'ENABLE_FEED_CATS')) {
|
||||||
|
|
||||||
|
print "<h3>Edit Categories</h3>";
|
||||||
|
|
||||||
// print "<h3>Categories</h3>";
|
// print "<h3>Categories</h3>";
|
||||||
|
|
||||||
print "<div class=\"prefGenericAddBox\">
|
print "<div class=\"prefGenericAddBox\">
|
||||||
|
@ -1356,80 +1360,83 @@
|
||||||
WHERE owner_uid = ".$_SESSION["uid"]."
|
WHERE owner_uid = ".$_SESSION["uid"]."
|
||||||
ORDER BY title");
|
ORDER BY title");
|
||||||
|
|
||||||
print "<p><table width=\"100%\" class=\"prefFeedCatList\" id=\"prefFeedCatList\">";
|
if (db_num_rows($result) != 0) {
|
||||||
print "<tr class=\"title\">
|
|
||||||
<td width=\"10%\">Select</td><td width=\"80%\">Title</td>
|
|
||||||
</tr>";
|
|
||||||
|
|
||||||
$lnum = 0;
|
print "<p><table width=\"100%\" class=\"prefFeedCatList\" id=\"prefFeedCatList\">";
|
||||||
|
print "<tr class=\"title\">
|
||||||
|
<td width=\"10%\">Select</td><td width=\"80%\">Title</td>
|
||||||
|
</tr>";
|
||||||
|
|
||||||
while ($line = db_fetch_assoc($result)) {
|
$lnum = 0;
|
||||||
|
|
||||||
$class = ($lnum % 2) ? "even" : "odd";
|
while ($line = db_fetch_assoc($result)) {
|
||||||
|
|
||||||
$cat_id = $line["id"];
|
$class = ($lnum % 2) ? "even" : "odd";
|
||||||
|
|
||||||
$edit_cat_id = $_GET["id"];
|
$cat_id = $line["id"];
|
||||||
|
|
||||||
if ($subop == "editCat" && $cat_id != $edit_cat_id) {
|
$edit_cat_id = $_GET["id"];
|
||||||
$class .= "Grayed";
|
|
||||||
|
if ($subop == "editCat" && $cat_id != $edit_cat_id) {
|
||||||
|
$class .= "Grayed";
|
||||||
|
}
|
||||||
|
|
||||||
|
print "<tr class=\"$class\" id=\"FCATR-$cat_id\">";
|
||||||
|
|
||||||
|
$edit_title = htmlspecialchars(db_unescape_string($line["title"]));
|
||||||
|
|
||||||
|
if (!$edit_cat_id || $subop != "editCat") {
|
||||||
|
|
||||||
|
print "<td><input onclick='toggleSelectRow(this);'
|
||||||
|
type=\"checkbox\" id=\"FCCHK-".$line["id"]."\"></td>";
|
||||||
|
|
||||||
|
print "<td><a href=\"javascript:editFeedCat($cat_id);\">" .
|
||||||
|
$edit_title . "</a></td>";
|
||||||
|
|
||||||
|
} else if ($cat_id != $edit_cat_id) {
|
||||||
|
|
||||||
|
print "<td><input disabled=\"true\" type=\"checkbox\"
|
||||||
|
id=\"FRCHK-".$line["id"]."\"></td>";
|
||||||
|
|
||||||
|
print "<td>$edit_title</td>";
|
||||||
|
|
||||||
|
} else {
|
||||||
|
|
||||||
|
print "<td><input disabled=\"true\" type=\"checkbox\" checked></td>";
|
||||||
|
|
||||||
|
print "<td><input id=\"iedit_title\" value=\"$edit_title\"></td>";
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
print "</tr>";
|
||||||
|
|
||||||
|
++$lnum;
|
||||||
}
|
}
|
||||||
|
|
||||||
print "<tr class=\"$class\" id=\"FCATR-$cat_id\">";
|
print "</table>";
|
||||||
|
|
||||||
$edit_title = htmlspecialchars(db_unescape_string($line["title"]));
|
print "<p>";
|
||||||
|
|
||||||
if (!$edit_cat_id || $subop != "editCat") {
|
if ($subop == "editCat") {
|
||||||
|
print "Edit category:
|
||||||
|
<input type=\"submit\" class=\"button\"
|
||||||
|
onclick=\"javascript:feedCatEditCancel()\" value=\"Cancel\">
|
||||||
|
<input type=\"submit\" class=\"button\"
|
||||||
|
onclick=\"javascript:feedCatEditSave()\" value=\"Save\">";
|
||||||
|
} else {
|
||||||
|
|
||||||
print "<td><input onclick='toggleSelectRow(this);'
|
print "
|
||||||
type=\"checkbox\" id=\"FCCHK-".$line["id"]."\"></td>";
|
Selection:
|
||||||
|
<input type=\"submit\" class=\"button\"
|
||||||
print "<td><a href=\"javascript:editFeedCat($cat_id);\">" .
|
onclick=\"javascript:editSelectedFeedCat()\" value=\"Edit\">
|
||||||
$edit_title . "</a></td>";
|
<input type=\"submit\" class=\"button\"
|
||||||
|
onclick=\"javascript:removeSelectedFeedCats()\" value=\"Remove\">";
|
||||||
} else if ($cat_id != $edit_cat_id) {
|
|
||||||
|
|
||||||
print "<td><input disabled=\"true\" type=\"checkbox\"
|
|
||||||
id=\"FRCHK-".$line["id"]."\"></td>";
|
|
||||||
|
|
||||||
print "<td>$edit_title</td>";
|
|
||||||
|
|
||||||
} else {
|
|
||||||
|
|
||||||
print "<td><input disabled=\"true\" type=\"checkbox\" checked></td>";
|
|
||||||
|
|
||||||
print "<td><input id=\"iedit_title\" value=\"$edit_title\"></td>";
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
print "</tr>";
|
} else {
|
||||||
|
print "<p>No feed categories defined.</p>";
|
||||||
++$lnum;
|
}
|
||||||
}
|
|
||||||
|
|
||||||
if ($lnum == 0) {
|
|
||||||
print "<tr><td colspan=\"5\" align=\"center\">No categories defined.</td></tr>";
|
|
||||||
}
|
|
||||||
|
|
||||||
print "</table>";
|
|
||||||
|
|
||||||
print "<p>";
|
|
||||||
|
|
||||||
if ($subop == "editCat") {
|
|
||||||
print "Edit category:
|
|
||||||
<input type=\"submit\" class=\"button\"
|
|
||||||
onclick=\"javascript:feedCatEditCancel()\" value=\"Cancel\">
|
|
||||||
<input type=\"submit\" class=\"button\"
|
|
||||||
onclick=\"javascript:feedCatEditSave()\" value=\"Save\">";
|
|
||||||
} else {
|
|
||||||
|
|
||||||
print "
|
|
||||||
Selection:
|
|
||||||
<input type=\"submit\" class=\"button\"
|
|
||||||
onclick=\"javascript:editSelectedFeedCat()\" value=\"Edit\">
|
|
||||||
<input type=\"submit\" class=\"button\"
|
|
||||||
onclick=\"javascript:removeSelectedFeedCats()\" value=\"Remove\">";
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
print "<h3>Import OPML</h3>
|
print "<h3>Import OPML</h3>
|
||||||
|
@ -1551,134 +1558,142 @@
|
||||||
ttrss_filters.owner_uid = ".$_SESSION["uid"]."
|
ttrss_filters.owner_uid = ".$_SESSION["uid"]."
|
||||||
ORDER by reg_exp");
|
ORDER by reg_exp");
|
||||||
|
|
||||||
print "<p><table width=\"100%\" class=\"prefFilterList\" id=\"prefFilterList\">";
|
if (db_num_rows($result) != 0) {
|
||||||
|
|
||||||
print "<tr class=\"title\">
|
print "<p><table width=\"100%\" class=\"prefFilterList\" id=\"prefFilterList\">";
|
||||||
<td width=\"5%\">Select</td><td width=\"30%\">Filter expression</td>
|
|
||||||
<td width=\"30%\">Feed</td><td width=\"10%\">Match</td>
|
|
||||||
<td width=\"30%\">Description</td></tr>";
|
|
||||||
|
|
||||||
$lnum = 0;
|
print "<tr class=\"title\">
|
||||||
|
<td width=\"5%\">Select</td><td width=\"30%\">Filter expression</td>
|
||||||
|
<td width=\"30%\">Feed</td><td width=\"10%\">Match</td>
|
||||||
|
<td width=\"30%\">Description</td></tr>";
|
||||||
|
|
||||||
while ($line = db_fetch_assoc($result)) {
|
$lnum = 0;
|
||||||
|
|
||||||
$class = ($lnum % 2) ? "even" : "odd";
|
while ($line = db_fetch_assoc($result)) {
|
||||||
|
|
||||||
$filter_id = $line["id"];
|
$class = ($lnum % 2) ? "even" : "odd";
|
||||||
$edit_filter_id = $_GET["id"];
|
|
||||||
|
|
||||||
if ($subop == "edit" && $filter_id != $edit_filter_id) {
|
$filter_id = $line["id"];
|
||||||
$class .= "Grayed";
|
$edit_filter_id = $_GET["id"];
|
||||||
|
|
||||||
|
if ($subop == "edit" && $filter_id != $edit_filter_id) {
|
||||||
|
$class .= "Grayed";
|
||||||
|
}
|
||||||
|
|
||||||
|
print "<tr class=\"$class\" id=\"FILRR-$filter_id\">";
|
||||||
|
|
||||||
|
$line["regexp"] = htmlspecialchars($line["reg_exp"]);
|
||||||
|
$line["description"] = htmlspecialchars($line["description"]);
|
||||||
|
|
||||||
|
if (!$line["feed_title"]) $line["feed_title"] = "All feeds";
|
||||||
|
|
||||||
|
if (!$edit_filter_id || $subop != "edit") {
|
||||||
|
|
||||||
|
if (!$line["description"]) $line["description"] = "[No description]";
|
||||||
|
|
||||||
|
print "<td><input onclick='toggleSelectRow(this);'
|
||||||
|
type=\"checkbox\" id=\"FICHK-".$line["id"]."\"></td>";
|
||||||
|
|
||||||
|
print "<td><a href=\"javascript:editFilter($filter_id);\">" .
|
||||||
|
$line["reg_exp"] . "</td>";
|
||||||
|
|
||||||
|
print "<td><a href=\"javascript:editFilter($filter_id);\">" .
|
||||||
|
$line["feed_title"] . "</td>";
|
||||||
|
|
||||||
|
print "<td><a href=\"javascript:editFilter($filter_id);\">" .
|
||||||
|
$line["filter_type_descr"] . "</td>";
|
||||||
|
|
||||||
|
print "<td><a href=\"javascript:editFilter($filter_id);\">" .
|
||||||
|
$line["description"] . "</td>";
|
||||||
|
|
||||||
|
} else if ($filter_id != $edit_filter_id) {
|
||||||
|
|
||||||
|
if (!$line["description"]) $line["description"] = "[No description]";
|
||||||
|
|
||||||
|
print "<td><input disabled=\"true\" type=\"checkbox\"
|
||||||
|
id=\"FICHK-".$line["id"]."\"></td>";
|
||||||
|
|
||||||
|
print "<td>".$line["reg_exp"]."</td>";
|
||||||
|
print "<td>".$line["feed_title"]."</td>";
|
||||||
|
print "<td>".$line["filter_type_descr"]."</td>";
|
||||||
|
print "<td>".$line["description"]."</td>";
|
||||||
|
|
||||||
|
} else {
|
||||||
|
|
||||||
|
print "<td><input disabled=\"true\" type=\"checkbox\" checked></td>";
|
||||||
|
|
||||||
|
print "<td><input id=\"iedit_regexp\" value=\"".$line["reg_exp"].
|
||||||
|
"\"></td>";
|
||||||
|
|
||||||
|
print "<td>";
|
||||||
|
|
||||||
|
print "<select id=\"iedit_feed\">";
|
||||||
|
|
||||||
|
print "<option id=\"0\">All feeds</option>";
|
||||||
|
|
||||||
|
if (db_num_rows($result) > 0) {
|
||||||
|
print "<option disabled>--------</option>";
|
||||||
|
}
|
||||||
|
|
||||||
|
$tmp_result = db_query($link, "SELECT id,title FROM ttrss_feeds
|
||||||
|
WHERE owner_uid = ".$_SESSION["uid"]." ORDER BY title");
|
||||||
|
|
||||||
|
while ($tmp_line = db_fetch_assoc($tmp_result)) {
|
||||||
|
if ($tmp_line["id"] == $line["feed_id"]) {
|
||||||
|
$is_selected = "selected";
|
||||||
|
} else {
|
||||||
|
$is_selected = "";
|
||||||
|
}
|
||||||
|
printf("<option $is_selected id='%d'>%s</option>",
|
||||||
|
$tmp_line["id"], $tmp_line["title"]);
|
||||||
|
}
|
||||||
|
|
||||||
|
print "</select></td>";
|
||||||
|
|
||||||
|
print "<td>";
|
||||||
|
print_select("iedit_match", $line["filter_type_descr"], $filter_types);
|
||||||
|
print "</td>";
|
||||||
|
|
||||||
|
print "<td><input id=\"iedit_descr\" value=\"".$line["description"].
|
||||||
|
"\"></td>";
|
||||||
|
|
||||||
|
print "</td>";
|
||||||
|
}
|
||||||
|
|
||||||
|
print "</tr>";
|
||||||
|
|
||||||
|
++$lnum;
|
||||||
}
|
}
|
||||||
|
|
||||||
print "<tr class=\"$class\" id=\"FILRR-$filter_id\">";
|
if ($lnum == 0) {
|
||||||
|
print "<tr><td colspan=\"4\" align=\"center\">No filters defined.</td></tr>";
|
||||||
|
}
|
||||||
|
|
||||||
$line["regexp"] = htmlspecialchars($line["reg_exp"]);
|
print "</table>";
|
||||||
$line["description"] = htmlspecialchars($line["description"]);
|
|
||||||
|
|
||||||
if (!$line["feed_title"]) $line["feed_title"] = "All feeds";
|
print "<p>";
|
||||||
|
|
||||||
if (!$edit_filter_id || $subop != "edit") {
|
if ($subop == "edit") {
|
||||||
|
print "Edit feed:
|
||||||
if (!$line["description"]) $line["description"] = "[No description]";
|
<input type=\"submit\" class=\"button\"
|
||||||
|
onclick=\"javascript:filterEditCancel()\" value=\"Cancel\">
|
||||||
print "<td><input onclick='toggleSelectRow(this);'
|
<input type=\"submit\" class=\"button\"
|
||||||
type=\"checkbox\" id=\"FICHK-".$line["id"]."\"></td>";
|
onclick=\"javascript:filterEditSave()\" value=\"Save\">";
|
||||||
|
|
||||||
print "<td><a href=\"javascript:editFilter($filter_id);\">" .
|
|
||||||
$line["reg_exp"] . "</td>";
|
|
||||||
|
|
||||||
print "<td><a href=\"javascript:editFilter($filter_id);\">" .
|
|
||||||
$line["feed_title"] . "</td>";
|
|
||||||
|
|
||||||
print "<td><a href=\"javascript:editFilter($filter_id);\">" .
|
|
||||||
$line["filter_type_descr"] . "</td>";
|
|
||||||
|
|
||||||
print "<td><a href=\"javascript:editFilter($filter_id);\">" .
|
|
||||||
$line["description"] . "</td>";
|
|
||||||
|
|
||||||
} else if ($filter_id != $edit_filter_id) {
|
|
||||||
|
|
||||||
if (!$line["description"]) $line["description"] = "[No description]";
|
|
||||||
|
|
||||||
print "<td><input disabled=\"true\" type=\"checkbox\"
|
|
||||||
id=\"FICHK-".$line["id"]."\"></td>";
|
|
||||||
|
|
||||||
print "<td>".$line["reg_exp"]."</td>";
|
|
||||||
print "<td>".$line["feed_title"]."</td>";
|
|
||||||
print "<td>".$line["filter_type_descr"]."</td>";
|
|
||||||
print "<td>".$line["description"]."</td>";
|
|
||||||
|
|
||||||
} else {
|
} else {
|
||||||
|
|
||||||
print "<td><input disabled=\"true\" type=\"checkbox\" checked></td>";
|
print "
|
||||||
|
Selection:
|
||||||
print "<td><input id=\"iedit_regexp\" value=\"".$line["reg_exp"].
|
<input type=\"submit\" class=\"button\"
|
||||||
"\"></td>";
|
onclick=\"javascript:editSelectedFilter()\" value=\"Edit\">
|
||||||
|
<input type=\"submit\" class=\"button\"
|
||||||
print "<td>";
|
onclick=\"javascript:removeSelectedFilters()\" value=\"Remove\">";
|
||||||
|
|
||||||
print "<select id=\"iedit_feed\">";
|
|
||||||
|
|
||||||
print "<option id=\"0\">All feeds</option>";
|
|
||||||
|
|
||||||
if (db_num_rows($result) > 0) {
|
|
||||||
print "<option disabled>--------</option>";
|
|
||||||
}
|
|
||||||
|
|
||||||
$tmp_result = db_query($link, "SELECT id,title FROM ttrss_feeds
|
|
||||||
WHERE owner_uid = ".$_SESSION["uid"]." ORDER BY title");
|
|
||||||
|
|
||||||
while ($tmp_line = db_fetch_assoc($tmp_result)) {
|
|
||||||
if ($tmp_line["id"] == $line["feed_id"]) {
|
|
||||||
$is_selected = "selected";
|
|
||||||
} else {
|
|
||||||
$is_selected = "";
|
|
||||||
}
|
|
||||||
printf("<option $is_selected id='%d'>%s</option>",
|
|
||||||
$tmp_line["id"], $tmp_line["title"]);
|
|
||||||
}
|
|
||||||
|
|
||||||
print "</select></td>";
|
|
||||||
|
|
||||||
print "<td>";
|
|
||||||
print_select("iedit_match", $line["filter_type_descr"], $filter_types);
|
|
||||||
print "</td>";
|
|
||||||
|
|
||||||
print "<td><input id=\"iedit_descr\" value=\"".$line["description"].
|
|
||||||
"\"></td>";
|
|
||||||
|
|
||||||
print "</td>";
|
|
||||||
}
|
}
|
||||||
|
|
||||||
print "</tr>";
|
|
||||||
|
|
||||||
++$lnum;
|
|
||||||
}
|
|
||||||
|
|
||||||
if ($lnum == 0) {
|
|
||||||
print "<tr><td colspan=\"4\" align=\"center\">No filters defined.</td></tr>";
|
|
||||||
}
|
|
||||||
|
|
||||||
print "</table>";
|
|
||||||
|
|
||||||
print "<p>";
|
|
||||||
|
|
||||||
if ($subop == "edit") {
|
|
||||||
print "Edit feed:
|
|
||||||
<input type=\"submit\" class=\"button\"
|
|
||||||
onclick=\"javascript:filterEditCancel()\" value=\"Cancel\">
|
|
||||||
<input type=\"submit\" class=\"button\"
|
|
||||||
onclick=\"javascript:filterEditSave()\" value=\"Save\">";
|
|
||||||
|
|
||||||
} else {
|
} else {
|
||||||
|
|
||||||
print "
|
print "<p>No filters defined.</p>";
|
||||||
Selection:
|
|
||||||
<input type=\"submit\" class=\"button\"
|
|
||||||
onclick=\"javascript:editSelectedFilter()\" value=\"Edit\">
|
|
||||||
<input type=\"submit\" class=\"button\"
|
|
||||||
onclick=\"javascript:removeSelectedFilters()\" value=\"Remove\">";
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1740,96 +1755,101 @@
|
||||||
owner_uid = ".$_SESSION["uid"]."
|
owner_uid = ".$_SESSION["uid"]."
|
||||||
ORDER by description");
|
ORDER by description");
|
||||||
|
|
||||||
print "<p><table width=\"100%\" class=\"prefLabelList\" id=\"prefLabelList\">";
|
if (db_num_rows($result) != 0) {
|
||||||
|
|
||||||
print "<tr class=\"title\">
|
print "<p><table width=\"100%\" class=\"prefLabelList\" id=\"prefLabelList\">";
|
||||||
<td width=\"5%\">Select</td><td width=\"40%\">SQL expression
|
|
||||||
<a class=\"helpLink\" href=\"javascript:popupHelp(1)\">(?)</a>
|
|
||||||
</td>
|
|
||||||
<td width=\"40%\">Caption</td></tr>";
|
|
||||||
|
|
||||||
$lnum = 0;
|
print "<tr class=\"title\">
|
||||||
|
<td width=\"5%\">Select</td><td width=\"40%\">SQL expression
|
||||||
|
<a class=\"helpLink\" href=\"javascript:popupHelp(1)\">(?)</a>
|
||||||
|
</td>
|
||||||
|
<td width=\"40%\">Caption</td></tr>";
|
||||||
|
|
||||||
while ($line = db_fetch_assoc($result)) {
|
$lnum = 0;
|
||||||
|
|
||||||
$class = ($lnum % 2) ? "even" : "odd";
|
while ($line = db_fetch_assoc($result)) {
|
||||||
|
|
||||||
$label_id = $line["id"];
|
$class = ($lnum % 2) ? "even" : "odd";
|
||||||
$edit_label_id = $_GET["id"];
|
|
||||||
|
|
||||||
if ($subop == "edit" && $label_id != $edit_label_id) {
|
$label_id = $line["id"];
|
||||||
$class .= "Grayed";
|
$edit_label_id = $_GET["id"];
|
||||||
|
|
||||||
|
if ($subop == "edit" && $label_id != $edit_label_id) {
|
||||||
|
$class .= "Grayed";
|
||||||
|
}
|
||||||
|
|
||||||
|
print "<tr class=\"$class\" id=\"LILRR-$label_id\">";
|
||||||
|
|
||||||
|
$line["sql_exp"] = htmlspecialchars($line["sql_exp"]);
|
||||||
|
$line["description"] = htmlspecialchars($line["description"]);
|
||||||
|
|
||||||
|
if (!$edit_label_id || $subop != "edit") {
|
||||||
|
|
||||||
|
if (!$line["description"]) $line["description"] = "[No caption]";
|
||||||
|
|
||||||
|
print "<td><input onclick='toggleSelectRow(this);'
|
||||||
|
type=\"checkbox\" id=\"LICHK-".$line["id"]."\"></td>";
|
||||||
|
|
||||||
|
print "<td><a href=\"javascript:editLabel($label_id);\">" .
|
||||||
|
$line["sql_exp"] . "</td>";
|
||||||
|
|
||||||
|
print "<td><a href=\"javascript:editLabel($label_id);\">" .
|
||||||
|
$line["description"] . "</td>";
|
||||||
|
|
||||||
|
} else if ($label_id != $edit_label_id) {
|
||||||
|
|
||||||
|
if (!$line["description"]) $line["description"] = "[No description]";
|
||||||
|
|
||||||
|
print "<td><input disabled=\"true\" type=\"checkbox\"
|
||||||
|
id=\"LICHK-".$line["id"]."\"></td>";
|
||||||
|
|
||||||
|
print "<td>".$line["sql_exp"]."</td>";
|
||||||
|
print "<td>".$line["description"]."</td>";
|
||||||
|
|
||||||
|
} else {
|
||||||
|
|
||||||
|
print "<td><input disabled=\"true\" type=\"checkbox\" checked></td>";
|
||||||
|
|
||||||
|
print "<td><input id=\"iedit_expr\" value=\"".$line["sql_exp"].
|
||||||
|
"\"></td>";
|
||||||
|
|
||||||
|
print "<td><input id=\"iedit_descr\" value=\"".$line["description"].
|
||||||
|
"\"></td>";
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
print "</tr>";
|
||||||
|
|
||||||
|
++$lnum;
|
||||||
}
|
}
|
||||||
|
|
||||||
print "<tr class=\"$class\" id=\"LILRR-$label_id\">";
|
if ($lnum == 0) {
|
||||||
|
print "<tr><td colspan=\"4\" align=\"center\">No labels defined.</td></tr>";
|
||||||
|
}
|
||||||
|
|
||||||
$line["sql_exp"] = htmlspecialchars($line["sql_exp"]);
|
print "</table>";
|
||||||
$line["description"] = htmlspecialchars($line["description"]);
|
|
||||||
|
|
||||||
if (!$edit_label_id || $subop != "edit") {
|
print "<p>";
|
||||||
|
|
||||||
if (!$line["description"]) $line["description"] = "[No caption]";
|
if ($subop == "edit") {
|
||||||
|
print "Edit label:
|
||||||
print "<td><input onclick='toggleSelectRow(this);'
|
<input type=\"submit\" class=\"button\"
|
||||||
type=\"checkbox\" id=\"LICHK-".$line["id"]."\"></td>";
|
onclick=\"javascript:labelEditCancel()\" value=\"Cancel\">
|
||||||
|
<input type=\"submit\" class=\"button\"
|
||||||
print "<td><a href=\"javascript:editLabel($label_id);\">" .
|
onclick=\"javascript:labelEditSave()\" value=\"Save\">";
|
||||||
$line["sql_exp"] . "</td>";
|
|
||||||
|
|
||||||
print "<td><a href=\"javascript:editLabel($label_id);\">" .
|
|
||||||
$line["description"] . "</td>";
|
|
||||||
|
|
||||||
} else if ($label_id != $edit_label_id) {
|
|
||||||
|
|
||||||
if (!$line["description"]) $line["description"] = "[No description]";
|
|
||||||
|
|
||||||
print "<td><input disabled=\"true\" type=\"checkbox\"
|
|
||||||
id=\"LICHK-".$line["id"]."\"></td>";
|
|
||||||
|
|
||||||
print "<td>".$line["sql_exp"]."</td>";
|
|
||||||
print "<td>".$line["description"]."</td>";
|
|
||||||
|
|
||||||
} else {
|
} else {
|
||||||
|
|
||||||
print "<td><input disabled=\"true\" type=\"checkbox\" checked></td>";
|
print "
|
||||||
|
Selection:
|
||||||
print "<td><input id=\"iedit_expr\" value=\"".$line["sql_exp"].
|
<input type=\"submit\" class=\"button\"
|
||||||
"\"></td>";
|
onclick=\"javascript:editSelectedLabel()\" value=\"Edit\">
|
||||||
|
<input type=\"submit\" class=\"button\"
|
||||||
print "<td><input id=\"iedit_descr\" value=\"".$line["description"].
|
onclick=\"javascript:removeSelectedLabels()\" value=\"Remove\">";
|
||||||
"\"></td>";
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
print "</tr>";
|
|
||||||
|
|
||||||
++$lnum;
|
|
||||||
}
|
|
||||||
|
|
||||||
if ($lnum == 0) {
|
|
||||||
print "<tr><td colspan=\"4\" align=\"center\">No labels defined.</td></tr>";
|
|
||||||
}
|
|
||||||
|
|
||||||
print "</table>";
|
|
||||||
|
|
||||||
print "<p>";
|
|
||||||
|
|
||||||
if ($subop == "edit") {
|
|
||||||
print "Edit label:
|
|
||||||
<input type=\"submit\" class=\"button\"
|
|
||||||
onclick=\"javascript:labelEditCancel()\" value=\"Cancel\">
|
|
||||||
<input type=\"submit\" class=\"button\"
|
|
||||||
onclick=\"javascript:labelEditSave()\" value=\"Save\">";
|
|
||||||
|
|
||||||
} else {
|
} else {
|
||||||
|
print "<p>No labels defined.</p>";
|
||||||
print "
|
|
||||||
Selection:
|
|
||||||
<input type=\"submit\" class=\"button\"
|
|
||||||
onclick=\"javascript:editSelectedLabel()\" value=\"Edit\">
|
|
||||||
<input type=\"submit\" class=\"button\"
|
|
||||||
onclick=\"javascript:removeSelectedLabels()\" value=\"Remove\">";
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -650,7 +650,7 @@
|
||||||
values ('$uid', 'Tiny Tiny RSS Dev. Feed',
|
values ('$uid', 'Tiny Tiny RSS Dev. Feed',
|
||||||
'http://bah.spb.su/darcsweb/darcsweb.cgi?r=tt-rss;a=rss')");
|
'http://bah.spb.su/darcsweb/darcsweb.cgi?r=tt-rss;a=rss')");
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
function logout_user() {
|
function logout_user() {
|
||||||
session_destroy();
|
session_destroy();
|
||||||
|
|
Loading…
Reference in New Issue