mirror of
https://github.com/silverstripe/silverstripe-cms
synced 2024-10-22 08:05:56 +02:00
MINOR Use GridFieldToolbarHeader and GridFieldFilterHeader in AssetAdmin GridField, set title of the table to the current folder title.
This commit is contained in:
parent
7b40c5f0a1
commit
5b223aa3b5
@ -126,11 +126,13 @@ JS
|
||||
$form = parent::getEditForm($id, $fields);
|
||||
$folder = ($id && is_numeric($id)) ? DataObject::get_by_id('Folder', $id, false) : $this->currentPage();
|
||||
$fields = $form->Fields();
|
||||
|
||||
$title = ($folder && $folder->exists()) ? $folder->Title : _t('AssetAdmin.FILES', 'Files');
|
||||
$fields->push(new HiddenField('ID', false, $folder->ID));
|
||||
|
||||
// File listing
|
||||
$gridFieldConfig = GridFieldConfig::create()->addComponents(
|
||||
new GridFieldToolbarHeader(),
|
||||
new GridFieldFilterHeader(),
|
||||
new GridFieldSortableHeader(),
|
||||
new GridFieldDataColumns(),
|
||||
new GridFieldPaginator(15),
|
||||
@ -138,7 +140,8 @@ JS
|
||||
new GridFieldDeleteAction(),
|
||||
new GridFieldDetailForm()
|
||||
);
|
||||
$gridField = new GridField('File','Files', $this->getList(), $gridFieldConfig);
|
||||
|
||||
$gridField = new GridField('File', $title, $this->getList(), $gridFieldConfig);
|
||||
$columns = $gridField->getConfig()->getComponentByType('GridFieldDataColumns');
|
||||
$columns->setDisplayFields(array(
|
||||
'StripThumbnail' => '',
|
||||
|
Loading…
Reference in New Issue
Block a user