From 8f70815592e1647e659e5005c508a5869a148b60 Mon Sep 17 00:00:00 2001 From: Andrew Dolgov Date: Tue, 20 Jan 2009 17:48:38 +0100 Subject: category editor: properly initialize inline editors --- modules/pref-feeds.php | 37 +++++++++++++++++++++++++++++++------ 1 file changed, 31 insertions(+), 6 deletions(-) (limited to 'modules/pref-feeds.php') diff --git a/modules/pref-feeds.php b/modules/pref-feeds.php index 8668c97ce..aae7ab453 100644 --- a/modules/pref-feeds.php +++ b/modules/pref-feeds.php @@ -933,11 +933,30 @@ $cat_title = db_escape_string(trim($_REQUEST["value"])); $cat_id = db_escape_string($_GET["cid"]); - - $result = db_query($link, "UPDATE ttrss_feed_categories SET - title = '$cat_title' WHERE id = '$cat_id' AND owner_uid = ".$_SESSION["uid"]); - print $_REQUEST["value"]; + db_query($link, "BEGIN"); + + $result = db_query($link, "SELECT title FROM ttrss_feed_categories + WHERE id = '$cat_id' AND owner_uid = ".$_SESSION["uid"]); + + if (db_num_rows($result) == 1) { + + $old_title = db_fetch_result($result, 0, "title"); + + if ($cat_title != "") { + $result = db_query($link, "UPDATE ttrss_feed_categories SET + title = '$cat_title' WHERE id = '$cat_id' AND + owner_uid = ".$_SESSION["uid"]); + + print $cat_title; + } else { + print $old_title; + } + } else { + print $_REQUEST["value"]; + } + + db_query($link, "COMMIT"); return; @@ -1370,8 +1389,14 @@ - - + "; + + if (FORCE_ARTICLE_PURGE == 0) { + print + ""; + } + + print " "; -- cgit v1.2.3