ENHANCEMENT Adding SilverStripe navigator to CMSMain->getEditForm() if not already present through LeftandMain->getEditForm() (in case custom $fields parameter is passed into the method)

This commit is contained in:
Ingo Schommer 2011-08-12 17:03:11 +02:00
parent 4eebf7f0be
commit aefda19ffa
1 changed files with 7 additions and 0 deletions

View File

@ -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();