diff --git a/forms/CheckboxField.php b/forms/CheckboxField.php index fc7529e9e..6d9d7344b 100755 --- a/forms/CheckboxField.php +++ b/forms/CheckboxField.php @@ -101,4 +101,31 @@ class CheckboxField_Readonly extends ReadonlyField { $this->value = ($val) ? 'Yes' : 'No'; } } + +/** + * Single checkbox field, disabled + * @package forms + * @subpackage fields-basic + */ +class CheckboxField_Disabled extends CheckboxField { + + protected $disabled = true; + + /** + * Returns a single checkbox field - used by templates. + */ + function Field() { + $attributes = array( + 'type' => 'checkbox', + 'class' => $this->extraClass() . " text", + 'id' => $this->id(), + 'name' => $this->Name(), + 'tabindex' => $this->getTabIndex(), + 'checked' => ($this->value) ? 'checked' : false, + 'disabled' => 'disabled' + ); + + return $this->createTag('input', $attributes); + } +} ?> \ No newline at end of file diff --git a/forms/CheckboxFieldDisabled.php b/forms/CheckboxFieldDisabled.php deleted file mode 100755 index 2c187202a..000000000 --- a/forms/CheckboxFieldDisabled.php +++ /dev/null @@ -1,30 +0,0 @@ - 'checkbox', - 'class' => $this->extraClass() . " text", - 'id' => $this->id(), - 'name' => $this->Name(), - 'tabindex' => $this->getTabIndex(), - 'checked' => ($this->value) ? 'checked' : false, - 'disabled' => 'disabled' - ); - - return $this->createTag('input', $attributes); - } -} - - -?> \ No newline at end of file