Skip to content
This repository
Browse code

ENHANCEMENT: Add GridfieldLevelup component to files area

  • Loading branch information...
commit ef651d9d931e3f82d935156b8d82889ac0a57123 1 parent bb5e3e5
Naomi Guyer authored June 26, 2012 chillu committed June 26, 2012
3  code/controllers/AssetAdmin.php
@@ -146,7 +146,8 @@ public function getEditForm($id = null, $fields = null) {
146 146
 			new GridFieldPaginator(15),
147 147
 			new GridFieldEditButton(),
148 148
 			new GridFieldDeleteAction(),
149  
-			new GridFieldDetailForm()
  149
+			new GridFieldDetailForm(),
  150
+			GridFieldLevelup::create($folder->ID)->setLinkSpec('admin/assets/show/%d')
150 151
 		);
151 152
 
152 153
 		$gridField = new GridField('File', $title, $this->getList(), $gridFieldConfig);
6  code/controllers/CMSMain.php
@@ -669,14 +669,16 @@ public function getList($params, $parentID = 0) {
669 669
 	public function ListViewForm() {
670 670
 		$params = $this->request->requestVar('q');
671 671
 		$list = $this->getList($params, $parentID = $this->request->requestVar('ParentID'));
672  
-		$gridFieldConfig = GridFieldConfig::create()->addComponents(
  672
+		$gridFieldConfig = GridFieldConfig::create()->addComponents(			
673 673
 			new GridFieldSortableHeader(),
674 674
 			new GridFieldDataColumns(),
675 675
 			new GridFieldPaginator(15)
676 676
 		);
677 677
 		if($parentID){
678 678
 			$gridFieldConfig->addComponent(
679  
-				new GridFieldLevelup($parentID)
  679
+				GridFieldLevelup::create($parentID)
  680
+					->setLinkSpec('?ParentID=%d&view=list')
  681
+					->setAttributes(array('data-pjax' => 'ListViewForm,Breadcrumbs'))
680 682
 			);
681 683
 		}
682 684
 		$gridField = new GridField('Page','Pages', $list, $gridFieldConfig);

0 notes on commit ef651d9

Please sign in to comment.
Something went wrong with that request. Please try again.