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

View File

@ -431,6 +431,13 @@ JS;
$stageURLField->setValue(Controller::join_links($record->AbsoluteLink(), '?Stage=stage')); $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 // getAllCMSActions can be used to completely redefine the action list
if($record->hasMethod('getAllCMSActions')) { if($record->hasMethod('getAllCMSActions')) {
$actions = $record->getAllCMSActions(); $actions = $record->getAllCMSActions();