]> git.wh0rd.org Git - tt-rss.git/commitdiff
misc prefs tweaks
authorAndrew Dolgov <fox@bah.org.ru>
Wed, 13 Jan 2010 15:57:48 +0000 (18:57 +0300)
committerAndrew Dolgov <fox@bah.org.ru>
Wed, 13 Jan 2010 15:57:48 +0000 (18:57 +0300)
modules/pref-prefs.php
prefs.js

index b789720d4afa7a1dea25ac651e1ff42be0c58244..367dfe406857c8d77d9387c3c16f5fb0b9824525 100644 (file)
                                        $theme_path = "";
                                }
 
-                               $_SESSION["theme"] = $theme_path;
-
                                print "PREFS_THEME_CHANGED";
                        } else {
                                print __("The configuration was saved.");
 
                        $_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;
 
 
                                $_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."));
index cc0a8e978faf8f2c907df03b03798fd138d86087..27a86c9d3fc01d18b21d7a53ba8564e3fd892929 100644 (file)
--- 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();
+                                       }
                                } });
 
                }