]> git.wh0rd.org - tt-rss.git/blobdiff - classes/pref/prefs.php
only allow clearing data of active plugins
[tt-rss.git] / classes / pref / prefs.php
index bb82b355edac60376e5539cbed5d8d9273939ecb..eb84bde997f6ecb708ded3b573faad85cdd5fbbf 100644 (file)
@@ -42,8 +42,6 @@ class Pref_Prefs extends Handler_Protected {
 
                $_SESSION["prefs_cache"] = false;
 
-               $orig_theme = get_pref($this->link, "_THEME_ID");
-
                foreach (array_keys($_POST) as $pref_name) {
 
                        $pref_name = db_escape_string($pref_name);
@@ -62,11 +60,7 @@ class Pref_Prefs extends Handler_Protected {
 
                }
 
-               if ($orig_theme != get_pref($this->link, "_THEME_ID")) {
-                       print "PREFS_THEME_CHANGED";
-               } else {
-                       print __("The configuration was saved.");
-               }
+               print __("The configuration was saved.");
        }
 
        function getHelp() {
@@ -458,32 +452,6 @@ class Pref_Prefs extends Handler_Protected {
 
                                print "<tr><td colspan=\"3\"><h3>".__($active_section)."</h3></td></tr>";
 
-                               if ($line["section_id"] == 2) {
-                                       print "<tr><td width=\"40%\">".__("Select theme")."</td>";
-
-                                       $user_theme = get_pref($this->link, "_THEME_ID");
-                                       $themes = get_all_themes();
-
-                                       print "<td><select name=\"_THEME_ID\" dojoType=\"dijit.form.Select\">";
-                                       print "<option value='Default'>".__('Default')."</option>";
-                                       print "<option value='----------------' disabled=\"1\">--------</option>";
-
-                                       foreach ($themes as $t) {
-                                               $base = $t['base'];
-                                               $name = $t['name'];
-
-                                               if ($base == $user_theme) {
-                                                       $selected = "selected=\"1\"";
-                                               } else {
-                                                       $selected = "";
-                                               }
-
-                                               print "<option $selected value='$base'>$name</option>";
-
-                                       }
-
-                                       print "</select></td></tr>";
-                               }
                                $lnum = 0;
                        }
 
@@ -709,8 +677,10 @@ class Pref_Prefs extends Handler_Protected {
                                print "<td>" . htmlspecialchars($about[2]) . "</td>";
 
                                if (count($tmppluginhost->get_all($plugin)) > 0) {
-                                       print "<td><a href='#' onclick=\"clearPluginData('$name')\"
-                                               class='visibleLink'>".__("Clear data")."</a></td>";
+                                       if (in_array($name, $system_enabled)) {
+                                               print "<td><a href='#' onclick=\"clearPluginData('$name')\"
+                                                       class='visibleLink'>".__("Clear data")."</a></td>";
+                                       }
                                }
 
                                print "</tr>";
@@ -759,7 +729,9 @@ class Pref_Prefs extends Handler_Protected {
                                print "<td>" . htmlspecialchars($about[2]) . "</td>";
 
                                if (count($tmppluginhost->get_all($plugin)) > 0) {
-                                       print "<td><a href='#' onclick=\"clearPluginData('$name')\" class='visibleLink'>".__("Clear data")."</a></td>";
+                                       if (in_array($name, $system_enabled) || in_array($name, $user_enabled)) {
+                                               print "<td><a href='#' onclick=\"clearPluginData('$name')\" class='visibleLink'>".__("Clear data")."</a></td>";
+                                       }
                                }
 
                                print "</tr>";