Merge pull request #69 from daniquilez/patch-3

display edit all only when the action is enabled.
This commit is contained in:
Thierry François 2014-05-22 18:54:30 +03:00
commit 619346fc32

View File

@ -232,11 +232,17 @@ class GridFieldBulkUpload implements GridField_HTMLProvider, GridField_URLHandle
->setAttribute('data-url', $gridField->Link('bulkupload/cancel'))
->setUseButtonTag(true);
$bulkManager_config = $bulkManager->first()->getConfig();
$bulkManager_actions = $bulkManager_config['actions'];
if(array_key_exists('bulkedit' , $bulkManager_actions)){
$editAllButton = FormAction::create('EditAll', _t('GRIDFIELD_BULK_UPLOAD.EDIT_ALL_BTN_LABEL', 'Edit all'))
->addExtraClass('bulkUploadEditButton')
->setAttribute('data-icon', 'pencil')
->setAttribute('data-url', $gridField->Link('bulkupload/edit'))
->setUseButtonTag(true);
}else{
$editAllButton = '';
}
}
else{
$cancelButton = '';