Browse files

ENHANCEMENT: use the grid field compoent GridFieldLevelup for pages l…

…istveiw when the view is the children listing of a page
  • Loading branch information...
1 parent f545f52 commit 4b6c21b940670735d154a6dcffde3dd2dba49829 @normann normann committed May 7, 2012
Showing with 6 additions and 1 deletion.
  1. +6 −1 code/controllers/CMSMain.php
View
7 code/controllers/CMSMain.php
@@ -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');

0 comments on commit 4b6c21b

Please sign in to comment.