BUGFIX Fixed extra class addition on various FormField->Field() methods

git-svn-id: svn://svn.silverstripe.com/silverstripe/open/modules/sapphire/trunk@64601 467b73ca-7a2a-4603-9d3b-597d59a354a9
This commit is contained in:
Sean Harvey 2008-10-21 20:58:11 +00:00
parent 6195772779
commit a78b5a2efb
8 changed files with 11 additions and 11 deletions

View File

@ -40,7 +40,7 @@ class AjaxUniqueTextField extends TextField {
$attributes = array(
'type' => 'text',
'class' => $this->extraClass() . " text",
'class' => 'text' . ($this->extraClass() ? $this->extraClass() : ''),
'id' => $this->id(),
'name' => $this->Name(),
'value' => $this->Value(),

View File

@ -21,7 +21,7 @@ class AutocompleteTextField extends TextField {
function Field() {
// Requirements::javascript(SAPPHIRE_DIR . '/javascript/AutocompleteTextField.js');
$attributes = array(
'class' => "{$this->class} text " . $this->extraClass(),
'class' => "{$this->class} text" . ($this->extraClass() ? $this->extraClass() : ''),
'type' => 'text',
'id' => $this->id(),
'name' => $this->name,

View File

@ -16,7 +16,7 @@ class CheckboxField extends FormField {
function Field() {
$attributes = array(
'type' => 'checkbox',
'class' => $this->extraClass(),
'class' => ($this->extraClass() ? $this->extraClass() : ''),
'id' => $this->id(),
'name' => $this->Name(),
'value' => 1,
@ -117,7 +117,7 @@ class CheckboxField_Disabled extends CheckboxField {
function Field() {
$attributes = array(
'type' => 'checkbox',
'class' => $this->extraClass() . " text",
'class' => 'text' . ($this->extraClass() ? $this->extraClass() : ''),
'id' => $this->id(),
'name' => $this->Name(),
'tabindex' => $this->getTabIndex(),

View File

@ -28,7 +28,7 @@ class ConfirmedFormAction extends FormAction {
function Field() {
$attributes = array(
'type' => 'submit',
'class' => $this->extraClass(),
'class' => ($this->extraClass() ? $this->extraClass() : ''),
'id' => $this->id(),
'name' => $this->Name(),
'value' => $this->attrTitle(),

View File

@ -89,7 +89,7 @@ class DropdownField extends FormField {
}
$attributes = array(
'class' => trim($this->extraClass()) ? $this->extraClass() : null,
'class' => ($this->extraClass() ? $this->extraClass() : ''),
'id' => $this->id(),
'name' => $this->name,
'tabindex' => $this->getTabIndex()

View File

@ -64,7 +64,7 @@ class FormAction extends FormField {
function Field() {
if($this->useButtonTag) {
$attributes = array(
'class' => 'action' . ($this->extraClass() ? (' ' . $this->extraClass()) : ''),
'class' => 'action' . ($this->extraClass() ? $this->extraClass() : ''),
'id' => $this->id(),
'type' => 'submit',
'name' => $this->action
@ -73,7 +73,7 @@ class FormAction extends FormField {
return $this->createTag('button', $attributes, $this->attrTitle());
} else {
$attributes = array(
'class' => 'action' . ($this->extraClass() ? (' ' . $this->extraClass()) : ''),
'class' => 'action' . ($this->extraClass() ? $this->extraClass() : ''),
'id' => $this->id(),
'type' => 'submit',
'name' => $this->action,

View File

@ -18,7 +18,7 @@ class TextField extends FormField {
function Field() {
$attributes = array(
'type' => 'text',
'class' => $this->extraClass() . ' text',
'class' => 'text' . ($this->extraClass() ? $this->extraClass() : ''),
'id' => $this->id(),
'name' => $this->Name(),
'value' => $this->Value(),

View File

@ -38,7 +38,7 @@ class TextareaField extends FormField {
if($this->readonly) {
$attributes = array(
'id' => $this->id(),
'class' => 'readonly' . (trim($this->extraClass()) ? (' ' . $this->extraClass()) : ''),
'class' => 'readonly' . ($this->extraClass() ? $this->extraClass() : ''),
'name' => $this->name,
'tabindex' => $this->getTabIndex(),
'readonly' => 'readonly'
@ -53,7 +53,7 @@ class TextareaField extends FormField {
} else {
$attributes = array(
'id' => $this->id(),
'class' => (trim($this->extraClass()) ? $this->extraClass() : ''),
'class' => ($this->extraClass() ? $this->extraClass() : ''),
'name' => $this->name,
'rows' => $this->rows,
'cols' => $this->cols