mirror of
https://github.com/silverstripe/silverstripe-userforms.git
synced 2024-10-22 17:05:42 +02:00
NEW added value top options
This commit is contained in:
parent
1e93da62d7
commit
2eb652f264
@ -40,7 +40,13 @@ class EditableMultipleOptionField extends EditableFormField {
|
|||||||
'callback' => function($record, $column, $grid) {
|
'callback' => function($record, $column, $grid) {
|
||||||
return TextField::create($column);
|
return TextField::create($column);
|
||||||
}
|
}
|
||||||
),
|
),
|
||||||
|
'Value' => array(
|
||||||
|
'title' => _t('EditableMultipleOptionField.VALUE', 'Value'),
|
||||||
|
'callback' => function($record, $column, $grid) {
|
||||||
|
return TextField::create($column);
|
||||||
|
}
|
||||||
|
),
|
||||||
'Default' => array(
|
'Default' => array(
|
||||||
'title' => _t('EditableMultipleOptionField.DEFAULT', 'Selected by default?'),
|
'title' => _t('EditableMultipleOptionField.DEFAULT', 'Selected by default?'),
|
||||||
'callback' => function($record, $column, $grid) {
|
'callback' => function($record, $column, $grid) {
|
||||||
@ -171,7 +177,7 @@ class EditableMultipleOptionField extends EditableFormField {
|
|||||||
*/
|
*/
|
||||||
protected function getOptionsMap() {
|
protected function getOptionsMap() {
|
||||||
$optionSet = $this->Options();
|
$optionSet = $this->Options();
|
||||||
$optionMap = $optionSet->map('EscapedTitle', 'Title');
|
$optionMap = $optionSet->map('Value', 'Title');
|
||||||
if($optionMap instanceof SS_Map) {
|
if($optionMap instanceof SS_Map) {
|
||||||
return $optionMap->toArray();
|
return $optionMap->toArray();
|
||||||
}
|
}
|
||||||
|
@ -15,7 +15,8 @@ class EditableOption extends DataObject {
|
|||||||
"Name" => "Varchar(255)",
|
"Name" => "Varchar(255)",
|
||||||
"Title" => "Varchar(255)",
|
"Title" => "Varchar(255)",
|
||||||
"Default" => "Boolean",
|
"Default" => "Boolean",
|
||||||
"Sort" => "Int"
|
"Sort" => "Int",
|
||||||
|
"Value" => "Varchar(255)",
|
||||||
);
|
);
|
||||||
|
|
||||||
private static $has_one = array(
|
private static $has_one = array(
|
||||||
|
Loading…
Reference in New Issue
Block a user