Permalink
Browse files

MINOR Adding temporary preview view to CMSPageEditController->getEdit…

…Form()
  • Loading branch information...
1 parent e33576d commit 42b31d4410b192f166c1384b85419c6eb043540a @chillu chillu committed May 1, 2011
Showing with 9 additions and 1 deletion.
  1. +9 −1 code/controller/CMSPageEditController.php
@@ -7,7 +7,15 @@ class CMSPageEditController extends CMSMain {
function getEditForm($id = null, $fields = null) {
$record = $this->getRecord($id ? $id : $this->currentPageID());
- return parent::getEditForm($record, ($record) ? $record->getCMSFields() : null);
+ $form = parent::getEditForm($record, ($record) ? $record->getCMSFields() : null);
+
+ // TODO Replace with preview button
+ $form->Fields()->addFieldToTab(
+ 'Root.Main',
+ new LiteralField('SwitchView', sprintf('<div class="cms-switch-view field"><label>Preview:</label><div class="middleColumn">%s</div></div>', $this->SwitchView()))
+ );
+
+ return $form;
}
}

0 comments on commit 42b31d4

Please sign in to comment.