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', '')
->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 = '
<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>';
$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)
);
}

View File

@ -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;

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>