From: Andrew Dolgov Date: Wed, 13 Jan 2010 15:57:48 +0000 (+0300) Subject: misc prefs tweaks X-Git-Tag: 1.4.0~60 X-Git-Url: https://git.wh0rd.org/?a=commitdiff_plain;h=1a697fa300eb82d6c1dafe0ff3c77207623279a6;p=tt-rss.git misc prefs tweaks --- diff --git a/modules/pref-prefs.php b/modules/pref-prefs.php index b789720d..367dfe40 100644 --- a/modules/pref-prefs.php +++ b/modules/pref-prefs.php @@ -107,8 +107,6 @@ $theme_path = ""; } - $_SESSION["theme"] = $theme_path; - print "PREFS_THEME_CHANGED"; } else { print __("The configuration was saved."); @@ -146,11 +144,20 @@ $_SESSION["prefs_op_result"] = "reset-to-defaults"; + if ($_SESSION["profile"]) { + $profile_qpart = "profile = '" . $_SESSION["profile"] . "'"; + } else { + $profile_qpart = "profile IS NULL"; + } + db_query($link, "DELETE FROM ttrss_user_prefs - WHERE owner_uid = ".$_SESSION["uid"]); - initialize_user_prefs($link, $_SESSION["uid"]); + WHERE $profile_qpart AND owner_uid = ".$_SESSION["uid"]); + + initialize_user_prefs($link, $_SESSION["uid"], $_SESSION["profile"]); - print __("The configuration was reset to defaults."); + print "PREFS_THEME_CHANGED"; + +// print __("The configuration was reset to defaults."); return; @@ -183,9 +190,9 @@ $_SESSION["pwd_change_result"] = ""; */ - if ($_SESSION["prefs_op_result"] == "reset-to-defaults") { +/* if ($_SESSION["prefs_op_result"] == "reset-to-defaults") { print format_notice(__("The configuration was reset to defaults.")); - } +} */ # if ($_SESSION["prefs_op_result"] == "save-config") { # print format_notice(__("The configuration was saved.")); diff --git a/prefs.js b/prefs.js index cc0a8e97..27a86c9d 100644 --- a/prefs.js +++ b/prefs.js @@ -1270,8 +1270,13 @@ function validatePrefsReset() { new Ajax.Request("backend.php", { parameters: query, onComplete: function(transport) { - notify_info(transport.responseText); - selectTab(); + var msg = transport.responseText; + if (msg.match("PREFS_THEME_CHANGED")) { + window.location.reload(); + } else { + notify_info(msg); + selectTab(); + } } }); }