misc prefs tweaks

This commit is contained in:
Andrew Dolgov 2010-01-13 18:57:48 +03:00
parent de0a6d930a
commit 1a697fa300
2 changed files with 22 additions and 10 deletions

View File

@ -107,8 +107,6 @@
$theme_path = ""; $theme_path = "";
} }
$_SESSION["theme"] = $theme_path;
print "PREFS_THEME_CHANGED"; print "PREFS_THEME_CHANGED";
} else { } else {
print __("The configuration was saved."); print __("The configuration was saved.");
@ -146,11 +144,20 @@
$_SESSION["prefs_op_result"] = "reset-to-defaults"; $_SESSION["prefs_op_result"] = "reset-to-defaults";
db_query($link, "DELETE FROM ttrss_user_prefs if ($_SESSION["profile"]) {
WHERE owner_uid = ".$_SESSION["uid"]); $profile_qpart = "profile = '" . $_SESSION["profile"] . "'";
initialize_user_prefs($link, $_SESSION["uid"]); } else {
$profile_qpart = "profile IS NULL";
}
print __("The configuration was reset to defaults."); db_query($link, "DELETE FROM ttrss_user_prefs
WHERE $profile_qpart AND owner_uid = ".$_SESSION["uid"]);
initialize_user_prefs($link, $_SESSION["uid"], $_SESSION["profile"]);
print "PREFS_THEME_CHANGED";
// print __("The configuration was reset to defaults.");
return; return;
@ -183,9 +190,9 @@
$_SESSION["pwd_change_result"] = ""; */ $_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.")); print format_notice(__("The configuration was reset to defaults."));
} } */
# if ($_SESSION["prefs_op_result"] == "save-config") { # if ($_SESSION["prefs_op_result"] == "save-config") {
# print format_notice(__("The configuration was saved.")); # print format_notice(__("The configuration was saved."));

View File

@ -1270,8 +1270,13 @@ function validatePrefsReset() {
new Ajax.Request("backend.php", { new Ajax.Request("backend.php", {
parameters: query, parameters: query,
onComplete: function(transport) { onComplete: function(transport) {
notify_info(transport.responseText); var msg = transport.responseText;
selectTab(); if (msg.match("PREFS_THEME_CHANGED")) {
window.location.reload();
} else {
notify_info(msg);
selectTab();
}
} }); } });
} }