From 5ddadb4c1eb2edcca5edc2eba3bb4c0907793c74 Mon Sep 17 00:00:00 2001 From: Andrew Dolgov Date: Sun, 11 Dec 2005 05:55:37 +0100 Subject: [PATCH] implement save in feed_cat editor (closes #6) --- backend.php | 8 ++++++++ prefs.js | 22 ++++++++++++++++++++++ 2 files changed, 30 insertions(+) diff --git a/backend.php b/backend.php index 4f4ac12e..6d1f4368 100644 --- a/backend.php +++ b/backend.php @@ -1415,6 +1415,14 @@ update_interval = '$upd_intl', purge_interval = '$purge_intl' WHERE id = '$feed_id' AND owner_uid = " . $_SESSION["uid"]); + } + + if ($subop == "saveCat") { + $cat_title = db_escape_string($_GET["title"]); + $cat_id = db_escape_string($_GET["id"]); + + $result = db_query($link, "UPDATE ttrss_feed_categories SET + title = '$cat_title' WHERE id = '$cat_id' AND owner_uid = ".$_SESSION["uid"]); } diff --git a/prefs.js b/prefs.js index f6917f68..b0df20aa 100644 --- a/prefs.js +++ b/prefs.js @@ -685,6 +685,28 @@ function feedEditSave() { } +function feedCatEditSave() { + + if (!xmlhttp_ready(xmlhttp)) { + printLockingError(); + return + } + + notify(""); + + var cat_title = document.getElementById("iedit_title").value; + + xmlhttp.open("GET", "backend.php?op=pref-feeds&subop=saveCat&id=" + + param_escape(active_feed_cat) + "&title=" + param_escape(cat_title), + true); + xmlhttp.onreadystatechange=feedlist_callback; + xmlhttp.send(null); + + active_feed_cat = false; + +} + + function labelTest() { var sqlexp = document.getElementById("iedit_expr").value; -- 2.39.5