Index: modules/field/modules/list/list.module
===================================================================
RCS file: /cvs/drupal/drupal/modules/field/modules/list/list.module,v
retrieving revision 1.26
diff -u -p -r1.26 list.module
--- modules/field/modules/list/list.module	11 Feb 2010 17:44:47 -0000	1.26
+++ modules/field/modules/list/list.module	15 Feb 2010 02:39:38 -0000
@@ -120,6 +120,27 @@ function list_field_settings_form($field
     '#access' => empty($settings['allowed_values_function']),
   );
 
+  if ($field['type'] == 'list_boolean') {
+    $form['allowed_values'] = array(
+      '#type' => 'markup',
+      '#description' => '',
+      '#input' => TRUE,
+      '#value_callback' => 'list_boolean_allowed_values_callback',
+    );
+    $form['allowed_values']['off'] = array(
+      '#type' => 'textfield',
+      '#title' => t('Off value'),
+      '#required' => FALSE,
+      '#description' => t('If left empty, "0" will be used.'),
+    );
+    $form['allowed_values']['on'] = array(
+      '#type' => 'textfield',
+      '#title' => t('On value'),
+      '#required' => FALSE,
+      '#description' => t('If left empty, "1" will be used.'),
+    );
+  }
+
   // Alter the description for allowed values depending on the widget type.
   if ($instance['widget']['type'] == 'options_onoff') {
     $form['allowed_values']['#description'] .= '<p>' . t("For a 'single on/off checkbox' widget, define the 'off' value first, then the 'on' value in the <strong>Allowed values</strong> section. Note that the checkbox will be labeled with the label of the 'on' value.") . '</p>';
@@ -177,6 +198,18 @@ function list_allowed_values_setting_val
 }
 
 /**
+* Form element #value_callback: assembles the allowed values for 'boolean' fields.
+*/
+function list_boolean_allowed_values_callback($element, $edit = FALSE) {
+  if ($edit !== FALSE) {
+    $on = $edit['on'];
+    $off = $edit['off'];
+    $edit = "0|$off\n1|$on";
+    return $edit;
+  }
+}
+
+/**
  * Implements hook_field_update_field().
  */
 function list_field_update_field($field, $prior_field, $has_data) {
