Permalink
Browse files

ENHANCEMENT Adding SilverStripe navigator to CMSMain->getEditForm() i…

…f not already present through LeftandMain->getEditForm() (in case custom $fields parameter is passed into the method)
  • Loading branch information...
1 parent 4eebf7f commit aefda19ffa38ee23b1ca5391bdfd66d5a8650565 @chillu chillu committed Aug 12, 2011
Showing with 7 additions and 0 deletions.
  1. +7 −0 code/controller/CMSMain.php
View
7 code/controller/CMSMain.php
@@ -431,6 +431,13 @@ public function getEditForm($id = null, $fields = null) {
$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();

0 comments on commit aefda19

Please sign in to comment.