mirror of
https://github.com/colymba/GridFieldBulkEditingTools.git
synced 2024-10-22 11:05:57 +02:00
Merge pull request #69 from daniquilez/patch-3
display edit all only when the action is enabled.
This commit is contained in:
commit
619346fc32
@ -232,11 +232,17 @@ class GridFieldBulkUpload implements GridField_HTMLProvider, GridField_URLHandle
|
|||||||
->setAttribute('data-url', $gridField->Link('bulkupload/cancel'))
|
->setAttribute('data-url', $gridField->Link('bulkupload/cancel'))
|
||||||
->setUseButtonTag(true);
|
->setUseButtonTag(true);
|
||||||
|
|
||||||
$editAllButton = FormAction::create('EditAll', _t('GRIDFIELD_BULK_UPLOAD.EDIT_ALL_BTN_LABEL', 'Edit all'))
|
$bulkManager_config = $bulkManager->first()->getConfig();
|
||||||
->addExtraClass('bulkUploadEditButton')
|
$bulkManager_actions = $bulkManager_config['actions'];
|
||||||
->setAttribute('data-icon', 'pencil')
|
if(array_key_exists('bulkedit' , $bulkManager_actions)){
|
||||||
->setAttribute('data-url', $gridField->Link('bulkupload/edit'))
|
$editAllButton = FormAction::create('EditAll', _t('GRIDFIELD_BULK_UPLOAD.EDIT_ALL_BTN_LABEL', 'Edit all'))
|
||||||
->setUseButtonTag(true);
|
->addExtraClass('bulkUploadEditButton')
|
||||||
|
->setAttribute('data-icon', 'pencil')
|
||||||
|
->setAttribute('data-url', $gridField->Link('bulkupload/edit'))
|
||||||
|
->setUseButtonTag(true);
|
||||||
|
}else{
|
||||||
|
$editAllButton = '';
|
||||||
|
}
|
||||||
}
|
}
|
||||||
else{
|
else{
|
||||||
$cancelButton = '';
|
$cancelButton = '';
|
||||||
@ -298,4 +304,4 @@ class GridFieldBulkUpload implements GridField_HTMLProvider, GridField_URLHandle
|
|||||||
|
|
||||||
return $handler->handleRequest($request, DataModel::inst());
|
return $handler->handleRequest($request, DataModel::inst());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user