mirror of
https://github.com/colymba/GridFieldBulkEditingTools.git
synced 2024-10-22 09:05:57 +00:00
FEATURE: Actions are now acquired from config
(This allows actions to be added or removed - for cases such as Versioned DataObjects)
This commit is contained in:
parent
cf47c6d69a
commit
66a43c890a
@ -34,6 +34,12 @@ class GridFieldBulkManager implements GridField_HTMLProvider, GridField_ColumnPr
|
|||||||
{
|
{
|
||||||
if ( $editableFields != null ) $this->setConfig ( 'editableFields', $editableFields );
|
if ( $editableFields != null ) $this->setConfig ( 'editableFields', $editableFields );
|
||||||
$this->config['fieldsClassBlacklist'] = $this->forbiddenFieldsClasses;
|
$this->config['fieldsClassBlacklist'] = $this->forbiddenFieldsClasses;
|
||||||
|
|
||||||
|
$this->config['actions'] = array(
|
||||||
|
'edit' => _t('GridFieldBulkTools.EDIT_SELECT_LABEL', 'Edit'),
|
||||||
|
'unlink' => _t('GridFieldBulkTools.UNLINK_SELECT_LABEL', 'UnLink'),
|
||||||
|
'delete' => _t('GridFieldBulkTools.DELETE_SELECT_LABEL', 'Delete')
|
||||||
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -170,11 +176,7 @@ class GridFieldBulkManager implements GridField_HTMLProvider, GridField_ColumnPr
|
|||||||
Requirements::javascript(BULK_EDIT_TOOLS_PATH . '/javascript/GridFieldBulkManager.js');
|
Requirements::javascript(BULK_EDIT_TOOLS_PATH . '/javascript/GridFieldBulkManager.js');
|
||||||
|
|
||||||
$dropDownActionList = DropdownField::create('bulkActionName', '')
|
$dropDownActionList = DropdownField::create('bulkActionName', '')
|
||||||
->setSource( array(
|
->setSource($this->config['actions'])
|
||||||
'edit' => _t('GridFieldBulkTools.EDIT_SELECT_LABEL', 'Edit'),
|
|
||||||
'unlink' => _t('GridFieldBulkTools.UNLINK_SELECT_LABEL', 'UnLink'),
|
|
||||||
'delete' => _t('GridFieldBulkTools.DELETE_SELECT_LABEL', 'Delete')
|
|
||||||
))
|
|
||||||
->setAttribute('class', 'bulkActionName')
|
->setAttribute('class', 'bulkActionName')
|
||||||
->setAttribute('id', '');
|
->setAttribute('id', '');
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user