diff --git a/code/GridFieldBulkManager.php b/code/GridFieldBulkManager.php index dc1a1ea..0035012 100644 --- a/code/GridFieldBulkManager.php +++ b/code/GridFieldBulkManager.php @@ -171,33 +171,23 @@ class GridFieldBulkManager implements GridField_HTMLProvider, GridField_ColumnPr $dropDownActionList = DropdownField::create('bulkActionName', '') ->setSource( array('edit' => 'Edit','unlink' => 'UnLink','delete' => 'Delete') ); - /* - $actionButton = FormAction::create('doBulkAction', 'GO') - ->setAttribute('id', 'doBulkActionButton') - //->addExtraClass('cms-panel-link') - ->setAttribute('data-icon', 'pencil') - ->setAttribute('data-url', $gridField->Link('bulkEdit')) - ->setAttribute('href', $gridField->Link('bulkEdit').'/edit') - ->setUseButtonTag(true); - */ - $actionButtonHTML = ' - - GO - '; - - $toggleSelectAllHTML = ' - Select all - '; - - $html = '
'. - $dropDownActionList->FieldHolder(). - //$actionButton->Field(). - $actionButtonHTML. - $toggleSelectAllHTML. - '
'; + + $templateData = new ArrayData(array( + 'Menu' => $dropDownActionList->FieldHolder(), + 'Button' => array( + 'Label' => 'Go', + 'Link' => $gridField->Link('bulkediting').'/edit', + 'DataURL' => $gridField->Link('bulkediting') + ), + 'Select' => array( + 'Label' => 'Select all' + ) + )); + $args = array('Colspan' => count($gridField->getColumns())-1); + return array( - 'bulk-edit-tools' => $html + 'header' => $templateData->renderWith('BulkManagerButtons', $args) ); } diff --git a/css/GridFieldBulkManager.css b/css/GridFieldBulkManager.css index 5765653..f213088 100644 --- a/css/GridFieldBulkManager.css +++ b/css/GridFieldBulkManager.css @@ -10,8 +10,13 @@ #bulkManagerOptions { - float: right; - margin: 0 0 0 20px; + /*float: right; + margin: 0 0 0 20px;*/ +} + +#bulkManagerOptions th.bulkmanagerselect +{ + text-align: center; } #bulkActionName @@ -19,6 +24,11 @@ display: inline-block; border: none; box-shadow: none; + + padding: 0; + margin: 0; + + color: #000; } #bulkActionName #bulkActionName_chzn @@ -26,6 +36,11 @@ width: auto !important; } +#bulkActionName .chzn-drop +{ + width: 95% !important; +} + .cms table.ss-gridfield-table tbody td a.tempDisabledEditLink { background: url('../../framework/admin/images/btn-icon/document--pencil.png') no-repeat 2px 0px; diff --git a/templates/BulkManagerButtons.ss b/templates/BulkManagerButtons.ss new file mode 100644 index 0000000..2d0be7d --- /dev/null +++ b/templates/BulkManagerButtons.ss @@ -0,0 +1,14 @@ + + + + $Menu + + $Button.Label + + + + + + + + \ No newline at end of file