From 4b6c21b940670735d154a6dcffde3dd2dba49829 Mon Sep 17 00:00:00 2001 From: Normann Lou Date: Mon, 7 May 2012 13:42:56 +1200 Subject: [PATCH] ENHANCEMENT: use the grid field compoent GridFieldLevelup for pages listveiw when the view is the children listing of a page --- code/controllers/CMSMain.php | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/code/controllers/CMSMain.php b/code/controllers/CMSMain.php index 3c5ac1b7..146d534f 100644 --- a/code/controllers/CMSMain.php +++ b/code/controllers/CMSMain.php @@ -668,12 +668,17 @@ class CMSMain extends LeftAndMain implements CurrentPageIdentifier, PermissionPr 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');