Add bulkUpload btn template + move to top

This commit is contained in:
colymba 2013-04-16 21:33:50 +03:00
parent 3a3d33ffdc
commit 6110d81c94
2 changed files with 14 additions and 12 deletions

View File

@ -159,20 +159,19 @@ class GridFieldBulkImageUpload implements GridField_HTMLProvider, GridField_URLH
Requirements::css(BULK_EDIT_TOOLS_PATH . '/css/GridFieldBulkImageUpload.css');
/*
$data = new ArrayData(array(
'NewLink' => $gridField->Link('bulkimageupload'),
'ButtonName' => 'Bulk Upload'
));
*/
$html = '
<a id="bulkImageUploadGFButton" href="'.$gridField->Link('bulkimageupload').'" class="action action-detail ss-ui-action-constructive ss-ui-button ui-button ui-widget ui-state-default ui-corner-all new new-link" data-icon="add">
Bulk Upload
</a>';
$targetFragment = 'before';
if ( $gridField->getConfig()->getComponentByType('GridFieldButtonRow') )
{
$targetFragment = 'buttons-before-right';
}
$bulkUploadBtn = new ArrayData(array(
'Link' => $gridField->Link('bulkimageupload'),
'Label' => 'Bulk Upload',
));
return array(
//'bulk-edit-tools' => $data->renderWith('GridFieldAddNewbutton')
'bulk-edit-tools' => $html
$targetFragment => $bulkUploadBtn->renderWith('BulkUploadButton')
);
}

View File

@ -0,0 +1,3 @@
<a id="bulkImageUploadGFButton" href="$Link" class="action action-detail ss-ui-action-constructive ss-ui-button ui-button ui-widget ui-state-default ui-corner-all new new-link" data-icon="add">
$Label
</a>