Skip to content

Commit

Permalink
ENHANCEMENT: use the grid field compoent GridFieldLevelup for pages l…
Browse files Browse the repository at this point in the history
…istveiw when the view is the children listing of a page
  • Loading branch information
normann committed May 7, 2012
1 parent f545f52 commit 4b6c21b
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion code/controllers/CMSMain.php
Expand Up @@ -668,12 +668,17 @@ public function getList($params, $parentID = 0) {

public function ListViewForm() {
$params = $this->request->requestVar('q');
$list = $this->getList($params, $this->request->requestVar('ParentID'));
$list = $this->getList($params, $parentID = $this->request->requestVar('ParentID'));
$gridFieldConfig = GridFieldConfig::create()->addComponents(
new GridFieldSortableHeader(),
new GridFieldDataColumns(),
new GridFieldPaginator(15)
);
if($parentID){
$gridFieldConfig->addComponent(
new GridFieldLevelup($parentID)
);
}
$gridField = new GridField('Page','Pages', $list, $gridFieldConfig);
$columns = $gridField->getConfig()->getComponentByType('GridFieldDataColumns');

Expand Down

0 comments on commit 4b6c21b

Please sign in to comment.