]> git.wh0rd.org Git - tt-rss.git/commitdiff
print_radio() fixes
authorAndrew Dolgov <fox@madoka.spb.ru>
Thu, 17 Nov 2005 05:34:52 +0000 (06:34 +0100)
committerAndrew Dolgov <fox@madoka.spb.ru>
Thu, 17 Nov 2005 05:34:52 +0000 (06:34 +0100)
backend.php
functions.php

index f37c51bd80b5ee17598fe2442c496cf051f837ec..2a488e88acac7073b4678992738186d6a28206e5 100644 (file)
 
                                        $type_name = db_fetch_result($result, 0, "type_name");
 
+//                                     print "$pref_name : $type_name : $value<br>";
+
                                        if ($type_name == "bool") {
-                                               if ($value == 1) {
+                                               if ($value == "1") {
                                                        $value = "true";
                                                } else {
                                                        $value = "false";
 
                } else if ($subop == "Reset to defaults") {
 
+                       db_query($link, "UPDATE ttrss_prefs SET value = def_value");
+
                        header("Location: prefs.php");
 
                } else {
index 75fc8003c1d6d04f066f270609588f0430f70c36..08a00246f1d826670f79249d935200c06fa148c0 100644 (file)
                foreach ($values as $v) {
                
                        if ($v == $default)
-                               $sel = "checked value=\"1\"";
+                               $sel = "checked";
                         else
-                               $sel = "value=\"0\"";
+                               $sel = "";
+
+                       if ($v == "Yes") {
+                               $sel .= " value=\"1\"";
+                       } else {
+                               $sel .= " value=\"0\"";
+                       }
                        
                        print "<input type=\"radio\" $sel $attributes name=\"$id\">&nbsp;$v&nbsp;";