Skip to content

Commit

Permalink
ENHANCEMENT: Add GridfieldLevelup component to files area
Browse files Browse the repository at this point in the history
  • Loading branch information
adrexia authored and chillu committed Jun 26, 2012
1 parent bb5e3e5 commit ef651d9
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 3 deletions.
3 changes: 2 additions & 1 deletion code/controllers/AssetAdmin.php
Expand Up @@ -146,7 +146,8 @@ public function getEditForm($id = null, $fields = null) {
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);
Expand Down
6 changes: 4 additions & 2 deletions code/controllers/CMSMain.php
Expand Up @@ -669,14 +669,16 @@ public function getList($params, $parentID = 0) {
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);
Expand Down

0 comments on commit ef651d9

Please sign in to comment.