mirror of
https://github.com/symbiote/silverstripe-gridfieldextensions.git
synced 2024-10-22 17:05:39 +02:00
Merge pull request #68 from NobrainerWeb/master
Make the setEmptyString configurable
This commit is contained in:
commit
bb6748e414
5
_config/gridfieldextensions.yml
Normal file
5
_config/gridfieldextensions.yml
Normal file
@ -0,0 +1,5 @@
|
|||||||
|
---
|
||||||
|
name: gridfieldextensions
|
||||||
|
---
|
||||||
|
GridFieldAddNewMultiClass:
|
||||||
|
showEmptyString: true
|
@ -11,6 +11,9 @@ class GridFieldAddNewMultiClass implements GridField_HTMLProvider, GridField_URL
|
|||||||
'handleAdd'
|
'handleAdd'
|
||||||
);
|
);
|
||||||
|
|
||||||
|
// Should we add an empty string to the add class dropdown?
|
||||||
|
private static $showEmptyString = true;
|
||||||
|
|
||||||
private $fragment;
|
private $fragment;
|
||||||
|
|
||||||
private $title;
|
private $title;
|
||||||
@ -155,7 +158,9 @@ class GridFieldAddNewMultiClass implements GridField_HTMLProvider, GridField_URL
|
|||||||
GridFieldExtensions::include_requirements();
|
GridFieldExtensions::include_requirements();
|
||||||
|
|
||||||
$field = new DropdownField(sprintf('%s[ClassName]', __CLASS__), '', $classes);
|
$field = new DropdownField(sprintf('%s[ClassName]', __CLASS__), '', $classes);
|
||||||
|
if (Config::inst()->get('GridFieldAddNewMultiClass', 'showEmptyString')) {
|
||||||
$field->setEmptyString(_t('GridFieldExtensions.SELECTTYPETOCREATE', '(Select type to create)'));
|
$field->setEmptyString(_t('GridFieldExtensions.SELECTTYPETOCREATE', '(Select type to create)'));
|
||||||
|
}
|
||||||
$field->addExtraClass('no-change-track');
|
$field->addExtraClass('no-change-track');
|
||||||
|
|
||||||
$data = new ArrayData(array(
|
$data = new ArrayData(array(
|
||||||
|
Loading…
Reference in New Issue
Block a user