ENHANCEMENT: Add GridfieldLevelup component to files area

This commit is contained in:
Naomi Guyer 2012-06-26 15:53:39 +12:00 committed by Ingo Schommer
parent bb5e3e5fbd
commit ef651d9d93
2 changed files with 6 additions and 3 deletions

View File

@ -146,7 +146,8 @@ JS
new GridFieldPaginator(15),
new GridFieldEditButton(),
new GridFieldDeleteAction(),
new GridFieldDetailForm()
new GridFieldDetailForm(),
GridFieldLevelup::create($folder->ID)->setLinkSpec('admin/assets/show/%d')
);
$gridField = new GridField('File', $title, $this->getList(), $gridFieldConfig);

View File

@ -669,14 +669,16 @@ class CMSMain extends LeftAndMain implements CurrentPageIdentifier, PermissionPr
public function ListViewForm() {
$params = $this->request->requestVar('q');
$list = $this->getList($params, $parentID = $this->request->requestVar('ParentID'));
$gridFieldConfig = GridFieldConfig::create()->addComponents(
$gridFieldConfig = GridFieldConfig::create()->addComponents(
new GridFieldSortableHeader(),
new GridFieldDataColumns(),
new GridFieldPaginator(15)
);
if($parentID){
$gridFieldConfig->addComponent(
new GridFieldLevelup($parentID)
GridFieldLevelup::create($parentID)
->setLinkSpec('?ParentID=%d&view=list')
->setAttributes(array('data-pjax' => 'ListViewForm,Breadcrumbs'))
);
}
$gridField = new GridField('Page','Pages', $list, $gridFieldConfig);