t('Open/Closed')) + $form['type']['#options']; } /** * */ public function option_definition() { $options = parent::option_definition(); $options['type']['default'] = 'open-closed'; return $options; } /** * */ public function render($values) { $value = $values->{$this->field_alias}; if (!empty($this->options['not'])) { $value = !$value; } switch ($this->options['type']) { case 'yes-no': return $value ? t('Yes') : t('No'); case 'true-false': return $value ? t('True') : t('False'); case 'unicode-yes-no': return $value ? t('✔') : t('✖'); case 'enabled-disabled': return $value ? t('Enabled') : t('Disabled'); case 'boolean': return $value ? 1 : 0; case 'on-off': return $value ? t('On') : t('Off'); case 'custom': return $value ? $this->options['type_custom_true'] : $this->options['type_custom_false']; case 'open-closed': default: return $value ? t('Open') : t('Closed'); } } }