From aefda19ffa38ee23b1ca5391bdfd66d5a8650565 Mon Sep 17 00:00:00 2001 From: Ingo Schommer Date: Fri, 12 Aug 2011 17:03:11 +0200 Subject: [PATCH] ENHANCEMENT Adding SilverStripe navigator to CMSMain->getEditForm() if not already present through LeftandMain->getEditForm() (in case custom $fields parameter is passed into the method) --- code/controller/CMSMain.php | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/code/controller/CMSMain.php b/code/controller/CMSMain.php index 5de891fc..39db1246 100755 --- a/code/controller/CMSMain.php +++ b/code/controller/CMSMain.php @@ -431,6 +431,13 @@ JS; $stageURLField->setValue(Controller::join_links($record->AbsoluteLink(), '?Stage=stage')); } + // Added in-line to the form, but plucked into different view by LeftAndMain.Preview.js upon load + if(in_array('CMSPreviewable', class_implements($record)) && !$fields->fieldByName('SilverStripeNavigator')) { + $navField = new LiteralField('SilverStripeNavigator', $this->getSilverStripeNavigator()); + $navField->setAllowHTML(true); + $fields->push($navField); + } + // getAllCMSActions can be used to completely redefine the action list if($record->hasMethod('getAllCMSActions')) { $actions = $record->getAllCMSActions();