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(
|
$attributes = array(
|
||||||
'type' => 'text',
|
'type' => 'text',
|
||||||
'class' => $this->extraClass() . " text",
|
'class' => 'text' . ($this->extraClass() ? $this->extraClass() : ''),
|
||||||
'id' => $this->id(),
|
'id' => $this->id(),
|
||||||
'name' => $this->Name(),
|
'name' => $this->Name(),
|
||||||
'value' => $this->Value(),
|
'value' => $this->Value(),
|
||||||
|
@ -21,7 +21,7 @@ class AutocompleteTextField extends TextField {
|
|||||||
function Field() {
|
function Field() {
|
||||||
// Requirements::javascript(SAPPHIRE_DIR . '/javascript/AutocompleteTextField.js');
|
// Requirements::javascript(SAPPHIRE_DIR . '/javascript/AutocompleteTextField.js');
|
||||||
$attributes = array(
|
$attributes = array(
|
||||||
'class' => "{$this->class} text " . $this->extraClass(),
|
'class' => "{$this->class} text" . ($this->extraClass() ? $this->extraClass() : ''),
|
||||||
'type' => 'text',
|
'type' => 'text',
|
||||||
'id' => $this->id(),
|
'id' => $this->id(),
|
||||||
'name' => $this->name,
|
'name' => $this->name,
|
||||||
|
@ -16,7 +16,7 @@ class CheckboxField extends FormField {
|
|||||||
function Field() {
|
function Field() {
|
||||||
$attributes = array(
|
$attributes = array(
|
||||||
'type' => 'checkbox',
|
'type' => 'checkbox',
|
||||||
'class' => $this->extraClass(),
|
'class' => ($this->extraClass() ? $this->extraClass() : ''),
|
||||||
'id' => $this->id(),
|
'id' => $this->id(),
|
||||||
'name' => $this->Name(),
|
'name' => $this->Name(),
|
||||||
'value' => 1,
|
'value' => 1,
|
||||||
@ -117,7 +117,7 @@ class CheckboxField_Disabled extends CheckboxField {
|
|||||||
function Field() {
|
function Field() {
|
||||||
$attributes = array(
|
$attributes = array(
|
||||||
'type' => 'checkbox',
|
'type' => 'checkbox',
|
||||||
'class' => $this->extraClass() . " text",
|
'class' => 'text' . ($this->extraClass() ? $this->extraClass() : ''),
|
||||||
'id' => $this->id(),
|
'id' => $this->id(),
|
||||||
'name' => $this->Name(),
|
'name' => $this->Name(),
|
||||||
'tabindex' => $this->getTabIndex(),
|
'tabindex' => $this->getTabIndex(),
|
||||||
|
@ -28,7 +28,7 @@ class ConfirmedFormAction extends FormAction {
|
|||||||
function Field() {
|
function Field() {
|
||||||
$attributes = array(
|
$attributes = array(
|
||||||
'type' => 'submit',
|
'type' => 'submit',
|
||||||
'class' => $this->extraClass(),
|
'class' => ($this->extraClass() ? $this->extraClass() : ''),
|
||||||
'id' => $this->id(),
|
'id' => $this->id(),
|
||||||
'name' => $this->Name(),
|
'name' => $this->Name(),
|
||||||
'value' => $this->attrTitle(),
|
'value' => $this->attrTitle(),
|
||||||
|
@ -89,7 +89,7 @@ class DropdownField extends FormField {
|
|||||||
}
|
}
|
||||||
|
|
||||||
$attributes = array(
|
$attributes = array(
|
||||||
'class' => trim($this->extraClass()) ? $this->extraClass() : null,
|
'class' => ($this->extraClass() ? $this->extraClass() : ''),
|
||||||
'id' => $this->id(),
|
'id' => $this->id(),
|
||||||
'name' => $this->name,
|
'name' => $this->name,
|
||||||
'tabindex' => $this->getTabIndex()
|
'tabindex' => $this->getTabIndex()
|
||||||
|
@ -64,7 +64,7 @@ class FormAction extends FormField {
|
|||||||
function Field() {
|
function Field() {
|
||||||
if($this->useButtonTag) {
|
if($this->useButtonTag) {
|
||||||
$attributes = array(
|
$attributes = array(
|
||||||
'class' => 'action' . ($this->extraClass() ? (' ' . $this->extraClass()) : ''),
|
'class' => 'action' . ($this->extraClass() ? $this->extraClass() : ''),
|
||||||
'id' => $this->id(),
|
'id' => $this->id(),
|
||||||
'type' => 'submit',
|
'type' => 'submit',
|
||||||
'name' => $this->action
|
'name' => $this->action
|
||||||
@ -73,7 +73,7 @@ class FormAction extends FormField {
|
|||||||
return $this->createTag('button', $attributes, $this->attrTitle());
|
return $this->createTag('button', $attributes, $this->attrTitle());
|
||||||
} else {
|
} else {
|
||||||
$attributes = array(
|
$attributes = array(
|
||||||
'class' => 'action' . ($this->extraClass() ? (' ' . $this->extraClass()) : ''),
|
'class' => 'action' . ($this->extraClass() ? $this->extraClass() : ''),
|
||||||
'id' => $this->id(),
|
'id' => $this->id(),
|
||||||
'type' => 'submit',
|
'type' => 'submit',
|
||||||
'name' => $this->action,
|
'name' => $this->action,
|
||||||
|
@ -18,7 +18,7 @@ class TextField extends FormField {
|
|||||||
function Field() {
|
function Field() {
|
||||||
$attributes = array(
|
$attributes = array(
|
||||||
'type' => 'text',
|
'type' => 'text',
|
||||||
'class' => $this->extraClass() . ' text',
|
'class' => 'text' . ($this->extraClass() ? $this->extraClass() : ''),
|
||||||
'id' => $this->id(),
|
'id' => $this->id(),
|
||||||
'name' => $this->Name(),
|
'name' => $this->Name(),
|
||||||
'value' => $this->Value(),
|
'value' => $this->Value(),
|
||||||
|
@ -38,7 +38,7 @@ class TextareaField extends FormField {
|
|||||||
if($this->readonly) {
|
if($this->readonly) {
|
||||||
$attributes = array(
|
$attributes = array(
|
||||||
'id' => $this->id(),
|
'id' => $this->id(),
|
||||||
'class' => 'readonly' . (trim($this->extraClass()) ? (' ' . $this->extraClass()) : ''),
|
'class' => 'readonly' . ($this->extraClass() ? $this->extraClass() : ''),
|
||||||
'name' => $this->name,
|
'name' => $this->name,
|
||||||
'tabindex' => $this->getTabIndex(),
|
'tabindex' => $this->getTabIndex(),
|
||||||
'readonly' => 'readonly'
|
'readonly' => 'readonly'
|
||||||
@ -53,7 +53,7 @@ class TextareaField extends FormField {
|
|||||||
} else {
|
} else {
|
||||||
$attributes = array(
|
$attributes = array(
|
||||||
'id' => $this->id(),
|
'id' => $this->id(),
|
||||||
'class' => (trim($this->extraClass()) ? $this->extraClass() : ''),
|
'class' => ($this->extraClass() ? $this->extraClass() : ''),
|
||||||
'name' => $this->name,
|
'name' => $this->name,
|
||||||
'rows' => $this->rows,
|
'rows' => $this->rows,
|
||||||
'cols' => $this->cols
|
'cols' => $this->cols
|
||||||
|
Loading…
x
Reference in New Issue
Block a user