From: Andrew Dolgov Date: Wed, 23 Nov 2005 14:25:42 +0000 (+0100) Subject: misc prefs interface cleanups X-Git-Tag: schema_feature_freeze_for_1.1~119 X-Git-Url: https://git.wh0rd.org/?a=commitdiff_plain;h=3b0feb9b7f962e5745d26f8e115fd897e77a54ac;p=tt-rss.git misc prefs interface cleanups --- diff --git a/backend.php b/backend.php index 87b4708b..ff3e2605 100644 --- a/backend.php +++ b/backend.php @@ -1134,302 +1134,309 @@ ttrss_feeds WHERE owner_uid = '".$_SESSION["uid"]."' ORDER by $feeds_sort,title"); - print "
PLACEHOLDER
"; - - print "

"; - print " - - - - "; - - if (get_pref($link, 'ENABLE_FEED_CATS')) { - print ""; - } - - print " - - - - "; - - $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 ""; - - $icon_file = ICONS_DIR . "/$feed_id.ico"; - - if (file_exists($icon_file) && filesize($icon_file) > 0) { - $feed_icon = ""; - } else { - $feed_icon = " "; - } - print ""; - - $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 ""; - - print ""; - - print ""; - - if (get_pref($link, 'ENABLE_FEED_CATS')) { - print ""; - } - - if ($line["update_interval"] == "0") - $line["update_interval"] = "Default"; - - print ""; - - if ($line["purge_interval"] == "0") - $line["purge_interval"] = "Default"; - - if ($line["purge_interval"] < 0) - $line["purge_interval"] = "Disabled"; - - print ""; - - } else if ($feed_id != $edit_feed_id) { - - print ""; - - print ""; - print ""; - - if (get_pref($link, 'ENABLE_FEED_CATS')) { - print ""; - } - - if ($line["update_interval"] == "0") - $line["update_interval"] = "Default"; + if (db_num_rows($result) != 0) { - print ""; - - if ($line["purge_interval"] == "0") - $line["purge_interval"] = "Default"; - - if ($line["purge_interval"] < 0) - $line["purge_interval"] = "Disabled"; - - print ""; - - } else { - - print ""; - - print ""; - print ""; - - if (get_pref($link, 'ENABLE_FEED_CATS')) { - - print ""; + } + + print "
 Select - Title - Link - - Category - Update Interval - - Purge Days - - Last updated -
$feed_icon" . - $edit_title . "" . - $edit_link . "" . - $edit_cat . "" . - $line["update_interval"] . "" . - $line["purge_interval"] . "$edit_title$edit_link$edit_cat" . $line["update_interval"] . "" . $line["purge_interval"] . ""; - print ""; + print " + + + + "; - print ""; - print ""; - - } - - print ""; - print ""; - + if (get_pref($link, 'ENABLE_FEED_CATS')) { + print ""; } - - if (!$line["last_updated"]) $line["last_updated"] = "Never"; - - print ""; - print ""; - - ++$lnum; - } - - if ($lnum == 0) { - print ""; - } - - print "
 Select + Title + Link + + Category" . $line["last_updated"] . "
No feeds defined.
"; - - print "

"; - - if ($subop == "edit") { - print "Edit feed:  - - "; - } else { - - print " - Selection:  - - - "; - - if (get_pref($link, 'ENABLE_PREFS_CATCHUP_UNCATCHUP')) { - print " - -  "; - } print " - All feeds: - "; - - } - - print "

Edit Categories

"; - - if (get_pref($link, 'ENABLE_FEED_CATS')) { - - // print "

Categories

"; - - print "
-  
"; - - $result = db_query($link, "SELECT title,id FROM ttrss_feed_categories - WHERE owner_uid = ".$_SESSION["uid"]." - ORDER BY title"); - - print "

"; - print " - - "; - + + + + "; + $lnum = 0; while ($line = db_fetch_assoc($result)) { $class = ($lnum % 2) ? "even" : "odd"; - $cat_id = $line["id"]; + $feed_id = $line["id"]; - $edit_cat_id = $_GET["id"]; + $edit_feed_id = $_GET["id"]; - if ($subop == "editCat" && $cat_id != $edit_cat_id) { + if ($subop == "edit" && $feed_id != $edit_feed_id) { $class .= "Grayed"; } - print ""; + print ""; + + $icon_file = ICONS_DIR . "/$feed_id.ico"; + + if (file_exists($icon_file) && filesize($icon_file) > 0) { + $feed_icon = ""; + } else { + $feed_icon = " "; + } + print ""; $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_id || $subop != "editCat") { + if (!$edit_cat) $edit_cat = "Uncategorized"; + + if (!$edit_feed_id || $subop != "edit") { print ""; + type=\"checkbox\" id=\"FRCHK-".$line["id"]."\">"; - print ""; + + print ""; - } else if ($cat_id != $edit_cat_id) { + if (get_pref($link, 'ENABLE_FEED_CATS')) { + print ""; + } + + if ($line["update_interval"] == "0") + $line["update_interval"] = "Default"; + + print ""; + + if ($line["purge_interval"] == "0") + $line["purge_interval"] = "Default"; + + if ($line["purge_interval"] < 0) + $line["purge_interval"] = "Disabled"; + + print ""; + + } else if ($feed_id != $edit_feed_id) { print ""; print ""; + print ""; + + if (get_pref($link, 'ENABLE_FEED_CATS')) { + print ""; + } + + if ($line["update_interval"] == "0") + $line["update_interval"] = "Default"; + + print ""; + + if ($line["purge_interval"] == "0") + $line["purge_interval"] = "Default"; + + if ($line["purge_interval"] < 0) + $line["purge_interval"] = "Disabled"; + + print ""; } else { print ""; print ""; + print ""; + + if (get_pref($link, 'ENABLE_FEED_CATS')) { + + print ""; + print ""; + + } + print ""; + print ""; + } + + if (!$line["last_updated"]) $line["last_updated"] = "Never"; + + print ""; print ""; ++$lnum; } - if ($lnum == 0) { - print ""; - } - print "
SelectTitle
+ Update Interval + + Purge Days + + Last updated +
$feed_icon" . + print "" . $edit_title . "" . + $edit_link . "" . + $edit_cat . "" . + $line["update_interval"] . "" . + $line["purge_interval"] . "$edit_title$edit_link$edit_cat" . $line["update_interval"] . "" . $line["purge_interval"] . ""; + print "" . $line["last_updated"] . "
No categories defined.
"; - + print "

"; - if ($subop == "editCat") { - print "Edit category:  + if ($subop == "edit") { + print "Edit feed:  + onclick=\"javascript:feedEditCancel()\" value=\"Cancel\"> "; - } else { + onclick=\"javascript:feedEditSave()\" value=\"Save\">"; + } else { print " Selection:  + onclick=\"javascript:selectedFeedDetails()\" value=\"Details\"> "; - } + onclick=\"javascript:editSelectedFeed()\" value=\"Edit\"> + "; + + if (get_pref($link, 'ENABLE_PREFS_CATCHUP_UNCATCHUP')) { + print " + +  "; + } + + print " + All feeds: "; + } + } else { + + print "

No feeds defined.

"; + + } + + if (get_pref($link, 'ENABLE_FEED_CATS')) { + + print "

Edit Categories

"; + + // print "

Categories

"; + + print "
+  
"; + + $result = db_query($link, "SELECT title,id FROM ttrss_feed_categories + WHERE owner_uid = ".$_SESSION["uid"]." + ORDER BY title"); + + if (db_num_rows($result) != 0) { + + print "

"; + print " + + "; + + $lnum = 0; + + while ($line = db_fetch_assoc($result)) { + + $class = ($lnum % 2) ? "even" : "odd"; + + $cat_id = $line["id"]; + + $edit_cat_id = $_GET["id"]; + + if ($subop == "editCat" && $cat_id != $edit_cat_id) { + $class .= "Grayed"; + } + + print ""; + + $edit_title = htmlspecialchars(db_unescape_string($line["title"])); + + if (!$edit_cat_id || $subop != "editCat") { + + print ""; + + print ""; + + } else if ($cat_id != $edit_cat_id) { + + print ""; + + print ""; + + } else { + + print ""; + + print ""; + + } + + print ""; + + ++$lnum; + } + + print "
SelectTitle
" . + $edit_title . "$edit_title
"; + + print "

"; + + if ($subop == "editCat") { + print "Edit category:  + + "; + } else { + + print " + Selection:  + + "; + + } + + } else { + print "

No feed categories defined.

"; + } } print "

Import OPML

@@ -1551,134 +1558,142 @@ ttrss_filters.owner_uid = ".$_SESSION["uid"]." ORDER by reg_exp"); - print "

"; + if (db_num_rows($result) != 0) { - print " - - - "; - - $lnum = 0; + print "

SelectFilter expressionFeedMatchDescription
"; + + print " + + + "; - while ($line = db_fetch_assoc($result)) { - - $class = ($lnum % 2) ? "even" : "odd"; - - $filter_id = $line["id"]; - $edit_filter_id = $_GET["id"]; - - if ($subop == "edit" && $filter_id != $edit_filter_id) { - $class .= "Grayed"; - } - - print ""; - - $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 ""; - - print ""; - - print ""; - - print ""; - - print ""; - - } else if ($filter_id != $edit_filter_id) { - - if (!$line["description"]) $line["description"] = "[No description]"; - - print ""; - - print ""; - print ""; - print ""; - print ""; - - } else { - - print ""; - - print ""; - - print ""; + + $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 ""; + + print ""; + + print ""; + + print ""; + + print ""; + + } else if ($filter_id != $edit_filter_id) { + + if (!$line["description"]) $line["description"] = "[No description]"; + + print ""; + + print ""; + print ""; + print ""; + print ""; + + } else { + + print ""; + + print ""; + + print ""; + + print ""; + + print ""; + + print ""; } - - print ""; - - print ""; - - print ""; - - print ""; + + print ""; + + ++$lnum; } - - print ""; - - ++$lnum; - } - - if ($lnum == 0) { - print ""; - } - - print "
SelectFilter expressionFeedMatchDescription
" . - $line["reg_exp"] . "" . - $line["feed_title"] . "" . - $line["filter_type_descr"] . "" . - $line["description"] . "".$line["reg_exp"]."".$line["feed_title"]."".$line["filter_type_descr"]."".$line["description"].""; - - print "
" . + $line["reg_exp"] . "" . + $line["feed_title"] . "" . + $line["filter_type_descr"] . "" . + $line["description"] . "".$line["reg_exp"]."".$line["feed_title"]."".$line["filter_type_descr"]."".$line["description"].""; + + print ""; + print_select("iedit_match", $line["filter_type_descr"], $filter_types); + print ""; - print_select("iedit_match", $line["filter_type_descr"], $filter_types); - print "
No filters defined.
"; - - print "

"; - - if ($subop == "edit") { - print "Edit feed: + + if ($lnum == 0) { + print "

No filters defined.
"; + + print "

"; + + if ($subop == "edit") { + print "Edit feed: + + "; + + } else { + + print " + Selection: + onclick=\"javascript:editSelectedFilter()\" value=\"Edit\"> "; - + onclick=\"javascript:removeSelectedFilters()\" value=\"Remove\">"; + } + } else { - print " - Selection: - - "; + print "

No filters defined.

"; + } } @@ -1740,96 +1755,101 @@ owner_uid = ".$_SESSION["uid"]." ORDER by description"); - print "

"; - - print " - - "; - - $lnum = 0; - - while ($line = db_fetch_assoc($result)) { - - $class = ($lnum % 2) ? "even" : "odd"; - - $label_id = $line["id"]; - $edit_label_id = $_GET["id"]; - - if ($subop == "edit" && $label_id != $edit_label_id) { - $class .= "Grayed"; - } - - print ""; - - $line["sql_exp"] = htmlspecialchars($line["sql_exp"]); - $line["description"] = htmlspecialchars($line["description"]); + if (db_num_rows($result) != 0) { - if (!$edit_label_id || $subop != "edit") { - - if (!$line["description"]) $line["description"] = "[No caption]"; - - print ""; - - print ""; - - print ""; - - } else if ($label_id != $edit_label_id) { - - if (!$line["description"]) $line["description"] = "[No description]"; - - print ""; - - print ""; - print ""; - - } else { - - print ""; - - print ""; - - print ""; + print "

SelectSQL expression - (?) - Caption
" . - $line["sql_exp"] . "" . - $line["description"] . "".$line["sql_exp"]."".$line["description"]."
"; + + print " + + "; + + $lnum = 0; + + while ($line = db_fetch_assoc($result)) { + + $class = ($lnum % 2) ? "even" : "odd"; + + $label_id = $line["id"]; + $edit_label_id = $_GET["id"]; + + if ($subop == "edit" && $label_id != $edit_label_id) { + $class .= "Grayed"; + } + + print ""; + + $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 ""; + + print ""; - } + print ""; + + } else if ($label_id != $edit_label_id) { + + if (!$line["description"]) $line["description"] = "[No description]"; + + print ""; + + print ""; + print ""; + + } else { + + print ""; + + print ""; + + print ""; + + } + - - print ""; - - ++$lnum; - } - - if ($lnum == 0) { - print ""; - } - - print "
SelectSQL expression + (?) + Caption
" . + $line["sql_exp"] . "" . + $line["description"] . "".$line["sql_exp"]."".$line["description"]."
No labels defined.
"; - - print "

"; - - if ($subop == "edit") { - print "Edit label: + print ""; + + ++$lnum; + } + + if ($lnum == 0) { + print "No labels defined."; + } + + print ""; + + print "

"; + + if ($subop == "edit") { + print "Edit label: + + "; + + } else { + + print " + Selection: + onclick=\"javascript:editSelectedLabel()\" value=\"Edit\"> "; - + onclick=\"javascript:removeSelectedLabels()\" value=\"Remove\">"; + } } else { - - print " - Selection: - - "; + print "

No labels defined.

"; } } diff --git a/functions.php b/functions.php index 4ba7da74..7ca9bb81 100644 --- a/functions.php +++ b/functions.php @@ -649,8 +649,8 @@ db_query($link, "insert into ttrss_feeds (owner_uid,title,feed_url) values ('$uid', 'Tiny Tiny RSS Dev. Feed', 'http://bah.spb.su/darcsweb/darcsweb.cgi?r=tt-rss;a=rss')"); - - } + + } function logout_user() { session_destroy();