浏览代码

Boolean option widgets now default to checkboxes

pdontthink 17 年之前
父节点
当前提交
6602a2a04a
共有 2 个文件被更改,包括 4 次插入6 次删除
  1. 2 2
      functions/options.php
  2. 2 4
      templates/default/options.tpl

+ 2 - 2
functions/options.php

@@ -549,12 +549,12 @@ class SquirrelOption {
      *                          constructed as a checkbox,
      *                          otherwise it will be a set of
      *                          Yes/No radio buttons (OPTIONAL;
-     *                          default is FALSE (radio buttons)).
+     *                          default is TRUE (checkbox)).
      *
      * @return string html formated boolean widget
      *
      */
-    function createWidget_Boolean($checkbox=FALSE) {
+    function createWidget_Boolean($checkbox=TRUE) {
 
         global $oTemplate, $nbsp;
 

+ 2 - 4
templates/default/options.tpl

@@ -46,10 +46,8 @@ foreach ($options as $option) {
             echo   "<tr>\n" .
                    " <td class=\"optionName\">\n  ";
 
-//FIXME: use the following two lines instead if we make the default boolean type checkbox
-            //if ($opt->type == SMOPT_TYPE_BOOLEAN_CHECKBOX
-            // || $opt->type == SMOPT_TYPE_BOOLEAN) {
-            if ($opt->type == SMOPT_TYPE_BOOLEAN_CHECKBOX) {
+            if ($opt->type == SMOPT_TYPE_BOOLEAN_CHECKBOX
+             || $opt->type == SMOPT_TYPE_BOOLEAN) {
                 echo '<label for="new_' . $opt->name . '">'
                    . $opt->caption . '</label>';
             } else {