mirror of
https://github.com/silverstripe/silverstripe-framework
synced 2024-10-22 12:05:37 +00:00
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:
parent
6195772779
commit
a78b5a2efb
@ -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(),
|
||||
|
@ -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,
|
||||
|
@ -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(),
|
||||
|
@ -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(),
|
||||
|
@ -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()
|
||||
|
@ -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,
|
||||
|
@ -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(),
|
||||
|
@ -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
|
||||
|
Loading…
x
Reference in New Issue
Block a user