misc prefs interface cleanups

This commit is contained in:
Andrew Dolgov 2005-11-23 15:25:42 +01:00
parent 17095c5a0e
commit 3b0feb9b7f
2 changed files with 498 additions and 478 deletions

View File

@ -1134,6 +1134,8 @@
ttrss_feeds WHERE owner_uid = '".$_SESSION["uid"]."' ttrss_feeds WHERE owner_uid = '".$_SESSION["uid"]."'
ORDER by $feeds_sort,title"); ORDER by $feeds_sort,title");
if (db_num_rows($result) != 0) {
print "<div id=\"infoBoxShadow\"><div id=\"infoBox\">PLACEHOLDER</div></div>"; print "<div id=\"infoBoxShadow\"><div id=\"infoBox\">PLACEHOLDER</div></div>";
print "<p><table width=\"100%\" class=\"prefFeedList\" id=\"prefFeedList\">"; print "<p><table width=\"100%\" class=\"prefFeedList\" id=\"prefFeedList\">";
@ -1264,13 +1266,13 @@
print "<select id=\"iedit_fcat\">"; print "<select id=\"iedit_fcat\">";
print "<option id=\"0\">Uncategorized</option>"; 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 $tmp_result = db_query($link, "SELECT id,title FROM ttrss_feed_categories
WHERE owner_uid = ".$_SESSION["uid"]." ORDER BY title"); WHERE owner_uid = ".$_SESSION["uid"]." ORDER BY title");
if (db_num_rows($tmp_result) > 0) {
print "<option disabled>--------</option>";
}
while ($tmp_line = db_fetch_assoc($tmp_result)) { while ($tmp_line = db_fetch_assoc($tmp_result)) {
if ($tmp_line["id"] == $line["cat_id"]) { if ($tmp_line["id"] == $line["cat_id"]) {
$is_selected = "selected"; $is_selected = "selected";
@ -1302,10 +1304,6 @@
++$lnum; ++$lnum;
} }
if ($lnum == 0) {
print "<tr><td colspan=\"5\" align=\"center\">No feeds defined.</td></tr>";
}
print "</table>"; print "</table>";
print "<p>"; print "<p>";
@ -1332,19 +1330,25 @@
<input type=\"submit\" class=\"button\" <input type=\"submit\" class=\"button\"
onclick=\"javascript:readSelectedFeeds()\" value=\"Mark as read\"> onclick=\"javascript:readSelectedFeeds()\" value=\"Mark as read\">
<input type=\"submit\" class=\"button\" <input type=\"submit\" class=\"button\"
onclick=\"javascript:unreadSelectedFeeds()\" value=\"Mark as unread\">&nbsp;"; onclick=\"javascript:unreadSelectedFeeds()\"
value=\"Mark as unread\">&nbsp;";
} }
print " print "
All feeds: All feeds: <input type=\"submit\"
<input type=\"submit\" class=\"button\" onclick=\"gotoExportOpml()\"
class=\"button\" onclick=\"gotoExportOpml()\" value=\"Export OPML\">"; value=\"Export OPML\">";
}
} else {
print "<p>No feeds defined.</p>";
} }
print "<h3>Edit Categories</h3>";
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,6 +1360,8 @@
WHERE owner_uid = ".$_SESSION["uid"]." WHERE owner_uid = ".$_SESSION["uid"]."
ORDER BY title"); ORDER BY title");
if (db_num_rows($result) != 0) {
print "<p><table width=\"100%\" class=\"prefFeedCatList\" id=\"prefFeedCatList\">"; print "<p><table width=\"100%\" class=\"prefFeedCatList\" id=\"prefFeedCatList\">";
print "<tr class=\"title\"> print "<tr class=\"title\">
<td width=\"10%\">Select</td><td width=\"80%\">Title</td> <td width=\"10%\">Select</td><td width=\"80%\">Title</td>
@ -1407,10 +1413,6 @@
++$lnum; ++$lnum;
} }
if ($lnum == 0) {
print "<tr><td colspan=\"5\" align=\"center\">No categories defined.</td></tr>";
}
print "</table>"; print "</table>";
print "<p>"; print "<p>";
@ -1429,6 +1431,11 @@
onclick=\"javascript:editSelectedFeedCat()\" value=\"Edit\"> onclick=\"javascript:editSelectedFeedCat()\" value=\"Edit\">
<input type=\"submit\" class=\"button\" <input type=\"submit\" class=\"button\"
onclick=\"javascript:removeSelectedFeedCats()\" value=\"Remove\">"; onclick=\"javascript:removeSelectedFeedCats()\" value=\"Remove\">";
}
} else {
print "<p>No feed categories defined.</p>";
} }
} }
@ -1551,6 +1558,8 @@
ttrss_filters.owner_uid = ".$_SESSION["uid"]." ttrss_filters.owner_uid = ".$_SESSION["uid"]."
ORDER by reg_exp"); ORDER by reg_exp");
if (db_num_rows($result) != 0) {
print "<p><table width=\"100%\" class=\"prefFilterList\" id=\"prefFilterList\">"; print "<p><table width=\"100%\" class=\"prefFilterList\" id=\"prefFilterList\">";
print "<tr class=\"title\"> print "<tr class=\"title\">
@ -1680,6 +1689,12 @@
<input type=\"submit\" class=\"button\" <input type=\"submit\" class=\"button\"
onclick=\"javascript:removeSelectedFilters()\" value=\"Remove\">"; onclick=\"javascript:removeSelectedFilters()\" value=\"Remove\">";
} }
} else {
print "<p>No filters defined.</p>";
}
} }
if ($op == "pref-labels") { if ($op == "pref-labels") {
@ -1740,6 +1755,8 @@
owner_uid = ".$_SESSION["uid"]." owner_uid = ".$_SESSION["uid"]."
ORDER by description"); ORDER by description");
if (db_num_rows($result) != 0) {
print "<p><table width=\"100%\" class=\"prefLabelList\" id=\"prefLabelList\">"; print "<p><table width=\"100%\" class=\"prefLabelList\" id=\"prefLabelList\">";
print "<tr class=\"title\"> print "<tr class=\"title\">
@ -1831,6 +1848,9 @@
<input type=\"submit\" class=\"button\" <input type=\"submit\" class=\"button\"
onclick=\"javascript:removeSelectedLabels()\" value=\"Remove\">"; onclick=\"javascript:removeSelectedLabels()\" value=\"Remove\">";
} }
} else {
print "<p>No labels defined.</p>";
}
} }
if ($op == "error") { if ($op == "error") {