'yes-no'); $options['not'] = array('definition bool' => 'reverse'); return $options; } function options_form(&$form, &$form_state) { parent::options_form($form, $form_state); $form['type'] = array( '#type' => 'select', '#title' => t('Output format'), '#options' => array( 'yes-no' => t('Yes/No'), 'true-false' => t('True/False'), 'on-off' => t('On/Off'), ), '#default_value' => $this->options['type'], ); $form['not'] = array( '#type' => 'checkbox', '#title' => t('Reverse'), '#description' => t('If checked, true will be displayed as false.'), '#default_value' => $this->options['not'], ); } function render($values) { $value = $values->{$this->field_alias}; if (!empty($this->options['not'])) { $value = !$value; } switch ($this->options['type']) { case 'yes-no': default: return $value ? t('Yes') : t('No'); case 'true-false': return $value ? t('True') : t('False'); case 'on-off': return $value ? t('On') : t('Off'); } } }