mirror of
https://github.com/silverstripe/silverstripe-userforms.git
synced 2024-06-28 15:39:22 +02:00
Merge pull request #294 from tractorcow/pulls/fix-compat
BUG Fix compatibility with php 5.3.3
This commit is contained in:
commit
0868c7ad54
|
@ -1,8 +1,6 @@
|
||||||
<?php
|
<?php
|
||||||
|
|
||||||
use SilverStripe\Forms\SegmentField;
|
use SilverStripe\Forms\SegmentField;
|
||||||
use SilverStripe\Forms\SegmentFieldModifier\IDSegmentFieldModifier;
|
|
||||||
use SilverStripe\Forms\SegmentFieldModifier\SlugSegmentFieldModifier;
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Represents the base class of a editable form field
|
* Represents the base class of a editable form field
|
||||||
|
@ -212,20 +210,21 @@ class EditableFormField extends DataObject {
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
$allowedClasses = array_keys($this->getEditableFieldClasses(false));
|
$allowedClasses = array_keys($this->getEditableFieldClasses(false));
|
||||||
|
$self = $this;
|
||||||
$editableColumns = new GridFieldEditableColumns();
|
$editableColumns = new GridFieldEditableColumns();
|
||||||
$editableColumns->setDisplayFields(array(
|
$editableColumns->setDisplayFields(array(
|
||||||
'Display' => '',
|
'Display' => '',
|
||||||
'ConditionFieldID' => function($record, $column, $grid) use ($allowedClasses) {
|
'ConditionFieldID' => function($record, $column, $grid) use ($allowedClasses, $self) {
|
||||||
return DropdownField::create(
|
return DropdownField::create(
|
||||||
$column,
|
$column,
|
||||||
'',
|
'',
|
||||||
EditableFormField::get()
|
EditableFormField::get()
|
||||||
->filter(array(
|
->filter(array(
|
||||||
'ParentID' => $this->ParentID,
|
'ParentID' => $self->ParentID,
|
||||||
'ClassName' => $allowedClasses
|
'ClassName' => $allowedClasses
|
||||||
))
|
))
|
||||||
->exclude(array(
|
->exclude(array(
|
||||||
'ID' => $this->ID
|
'ID' => $self->ID
|
||||||
))
|
))
|
||||||
->map('ID', 'Title')
|
->map('ID', 'Title')
|
||||||
);
|
);
|
||||||
|
@ -237,8 +236,8 @@ class EditableFormField extends DataObject {
|
||||||
'FieldValue' => function($record, $column, $grid) {
|
'FieldValue' => function($record, $column, $grid) {
|
||||||
return TextField::create($column);
|
return TextField::create($column);
|
||||||
},
|
},
|
||||||
'ParentID' => function($record, $column, $grid) {
|
'ParentID' => function($record, $column, $grid) use ($self) {
|
||||||
return HiddenField::create($column, '', $this->ID);
|
return HiddenField::create($column, '', $self->ID);
|
||||||
}
|
}
|
||||||
));
|
));
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue
Block a user