Permalink
Browse files

Merge pull request #129 from halkyon/gridfield_headers

MINOR Use GridFieldToolbarHeader and GridFieldFilterHeader in AssetAdmin...
  • Loading branch information...
2 parents 7b40c5f + 5b223aa commit fb64cad34e9402f73430e9ae5c50c8f529bff5b7 @chillu chillu committed May 16, 2012
Showing with 5 additions and 2 deletions.
  1. +5 −2 code/controllers/AssetAdmin.php
@@ -126,19 +126,22 @@ public function getEditForm($id = null, $fields = null) {
$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),
new GridFieldEditButton(),
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' => '',

0 comments on commit fb64cad

Please sign in to comment.