Skip to content

Instantly share code, notes, and snippets.

@thezenmonkey
Created February 25, 2014 16:05
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save thezenmonkey/9211890 to your computer and use it in GitHub Desktop.
Save thezenmonkey/9211890 to your computer and use it in GitHub Desktop.
<?php
$galleryManagerConfig
->removeComponentsByType('GridFieldDataColumns')
->removeComponentsByType('GridFieldSortableHeader')
->removeComponentsByType('GridFieldAddExistingAutocompleter')
->removeComponentsByType('GridFieldPaginator')
->removeComponentsByType('GridFieldPageCount')
->addComponents(
new GridFieldTitleHeader(),
new GridFieldOrderableRows(),
new GridFieldBulkImageUpload(),
new GridFieldEditableColumns(),
new GridFieldDeleteAction()
);
$galleryManagerConfig->getComponentByType('GridFieldBulkImageUpload')->setConfig( 'folderName', $this->Folder()->Name );
$galleryManagerConfig->getComponentByType('GridFieldEditableColumns')->setDisplayFields(array(
'Thumbnail' => function($record, $column, $grid) {
return new LiteralField($column, $record);
},
'Title' => function($record, $column, $grid) {
return new TextField($column);
},
'Caption' => function($record, $column, $grid) {
return new TextField($column);
}
));
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment