mirror of
https://github.com/silverstripe/silverstripe-userforms.git
synced 2024-10-22 17:05:42 +02:00
leave escaping of value to template
This commit is contained in:
parent
6e69972c35
commit
4b2669242d
@ -22,7 +22,7 @@ class EditableCheckboxGroupField extends EditableMultipleOptionField
|
|||||||
// Set the default checked items
|
// Set the default checked items
|
||||||
$defaultCheckedItems = $this->getDefaultOptions();
|
$defaultCheckedItems = $this->getDefaultOptions();
|
||||||
if ($defaultCheckedItems->count()) {
|
if ($defaultCheckedItems->count()) {
|
||||||
$field->setDefaultItems($defaultCheckedItems->map('EscapedValue')->keys());
|
$field->setDefaultItems($defaultCheckedItems->map('Value')->keys());
|
||||||
}
|
}
|
||||||
|
|
||||||
$this->doUpdateFormField($field);
|
$this->doUpdateFormField($field);
|
||||||
|
@ -38,7 +38,7 @@ class EditableDropdown extends EditableMultipleOptionField
|
|||||||
// Set default
|
// Set default
|
||||||
$defaultOption = $this->getDefaultOptions()->first();
|
$defaultOption = $this->getDefaultOptions()->first();
|
||||||
if ($defaultOption) {
|
if ($defaultOption) {
|
||||||
$field->setValue($defaultOption->EscapedValue);
|
$field->setValue($defaultOption->Value);
|
||||||
}
|
}
|
||||||
$this->doUpdateFormField($field);
|
$this->doUpdateFormField($field);
|
||||||
return $field;
|
return $field;
|
||||||
|
@ -75,16 +75,15 @@ class EditableOption extends DataObject
|
|||||||
return $this->canEdit($member);
|
return $this->canEdit($member);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @deprecated 5.0 Use "$Title.XML" in templates instead
|
||||||
|
* @return string
|
||||||
|
*/
|
||||||
public function getEscapedTitle()
|
public function getEscapedTitle()
|
||||||
{
|
{
|
||||||
return Convert::raw2att($this->Title);
|
return Convert::raw2att($this->Title);
|
||||||
}
|
}
|
||||||
|
|
||||||
public function getEscapedValue()
|
|
||||||
{
|
|
||||||
return Convert::raw2att($this->Value);
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @param Member $member
|
* @param Member $member
|
||||||
* @return bool
|
* @return bool
|
||||||
|
@ -34,7 +34,7 @@ class EditableRadioField extends EditableMultipleOptionField
|
|||||||
// Set default item
|
// Set default item
|
||||||
$defaultOption = $this->getDefaultOptions()->first();
|
$defaultOption = $this->getDefaultOptions()->first();
|
||||||
if ($defaultOption) {
|
if ($defaultOption) {
|
||||||
$field->setValue($defaultOption->EscapedValue);
|
$field->setValue($defaultOption->Value);
|
||||||
}
|
}
|
||||||
$this->doUpdateFormField($field);
|
$this->doUpdateFormField($field);
|
||||||
return $field;
|
return $field;
|
||||||
|
Loading…
Reference in New Issue
Block a user