Merge pull request #129 from halkyon/gridfield_headers

MINOR Use GridFieldToolbarHeader and GridFieldFilterHeader in AssetAdmin...
This commit is contained in:
Ingo Schommer 2012-05-16 00:34:44 -07:00
commit fb64cad34e

View File

@ -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' => '',