Move BulkManager commands to header

BulkManager has it's own header and template
This commit is contained in:
colymba 2013-04-16 23:38:35 +03:00
parent 6110d81c94
commit 5b79b94496
3 changed files with 46 additions and 27 deletions

View File

@ -171,33 +171,23 @@ class GridFieldBulkManager implements GridField_HTMLProvider, GridField_ColumnPr
$dropDownActionList = DropdownField::create('bulkActionName', '') $dropDownActionList = DropdownField::create('bulkActionName', '')
->setSource( array('edit' => 'Edit','unlink' => 'UnLink','delete' => 'Delete') ); ->setSource( array('edit' => 'Edit','unlink' => 'UnLink','delete' => 'Delete') );
/*
$actionButton = FormAction::create('doBulkAction', 'GO') $templateData = new ArrayData(array(
->setAttribute('id', 'doBulkActionButton') 'Menu' => $dropDownActionList->FieldHolder(),
//->addExtraClass('cms-panel-link') 'Button' => array(
->setAttribute('data-icon', 'pencil') 'Label' => 'Go',
->setAttribute('data-url', $gridField->Link('bulkEdit')) 'Link' => $gridField->Link('bulkediting').'/edit',
->setAttribute('href', $gridField->Link('bulkEdit').'/edit') 'DataURL' => $gridField->Link('bulkediting')
->setUseButtonTag(true); ),
*/ 'Select' => array(
$actionButtonHTML = ' 'Label' => 'Select all'
<a id="doBulkActionButton" href="'.$gridField->Link('bulkediting').'/edit'.'" data-url="'.$gridField->Link('bulkediting').'" class="action ss-ui-button cms-panel-link" data-icon="pencil"> )
GO ));
</a>';
$toggleSelectAllHTML = '
<span>Select all <input id="toggleSelectAll" type="checkbox" title="select all" name="toggleSelectAll" /></span>
';
$html = '<div id="bulkManagerOptions">'.
$dropDownActionList->FieldHolder().
//$actionButton->Field().
$actionButtonHTML.
$toggleSelectAllHTML.
'</div>';
$args = array('Colspan' => count($gridField->getColumns())-1);
return array( return array(
'bulk-edit-tools' => $html 'header' => $templateData->renderWith('BulkManagerButtons', $args)
); );
} }

View File

@ -10,8 +10,13 @@
#bulkManagerOptions #bulkManagerOptions
{ {
float: right; /*float: right;
margin: 0 0 0 20px; margin: 0 0 0 20px;*/
}
#bulkManagerOptions th.bulkmanagerselect
{
text-align: center;
} }
#bulkActionName #bulkActionName
@ -19,6 +24,11 @@
display: inline-block; display: inline-block;
border: none; border: none;
box-shadow: none; box-shadow: none;
padding: 0;
margin: 0;
color: #000;
} }
#bulkActionName #bulkActionName_chzn #bulkActionName #bulkActionName_chzn
@ -26,6 +36,11 @@
width: auto !important; width: auto !important;
} }
#bulkActionName .chzn-drop
{
width: 95% !important;
}
.cms table.ss-gridfield-table tbody td a.tempDisabledEditLink .cms table.ss-gridfield-table tbody td a.tempDisabledEditLink
{ {
background: url('../../framework/admin/images/btn-icon/document--pencil.png') no-repeat 2px 0px; background: url('../../framework/admin/images/btn-icon/document--pencil.png') no-repeat 2px 0px;

View File

@ -0,0 +1,14 @@
<tr id="bulkManagerOptions">
<th class="extra bulkmanagerheading" colspan="$Colspan">
$Menu
<a id="doBulkActionButton" href="$Button.Link" data-url="$Button.DataURL" class="action ss-ui-button cms-panel-link" data-icon="pencil">
$Button.Label
</a>
</th>
<th class="extra bulkmanagerselect">
<input id="toggleSelectAll" type="checkbox" title="$Select.Label" name="toggleSelectAll" />
</th>
</tr>