function PopupForm()
 {
     $form = new Form($this, "{$this->name}/PopupForm", new FieldList($headerWrap = new CompositeField(new LiteralField('Heading', sprintf('<h3 class="htmleditorfield-mediaform-heading insert">%s</h3>', 'Edit Source'))), $codeField = new CodeEditorField('TinyMCESource', '')), new FieldList(ResetFormAction::create('cancel', 'Cancel')->addExtraClass('ss-ui-action-destructive')->setUseButtonTag(true), FormAction::create('update', 'Update')->addExtraClass('ss-ui-action-constructive')->setAttribute('data-icon', 'accept')->setUseButtonTag(true)));
     $headerWrap->addExtraClass('CompositeField composite cms-content-header nolabel ');
     //	$contentComposite->addExtraClass('tinymce-codeeditor-field content');
     $codeField->addExtraClass('nolabel stacked');
     $form->unsetValidator();
     $form->loadDataFrom($this);
     $form->addExtraClass('htmleditorfield-form htmleditorfield-codeform cms-dialog-content');
     //	$this->extend('updateLinkForm', $form);
     return $form;
 }
 public function updateCMSFields(FieldList $fields)
 {
     if (permission::check('ADMIN')) {
         $fields->addFieldToTab('Root.AdditionalCode', $codeField = new CodeEditorField('AdditionalCode', 'Additional HTML/JS/CSS Code', 50));
         $codeField->addExtraClass('stacked');
         $codeField->setRows(45);
         $codeField->setMode('html');
     }
     if ($this->owner->ClassName == "Page") {
         $fields->addFieldToTab("Root.Columns", new HTMLEditorField("LeftColumn", "Left Column Content"));
         $fields->addFieldToTab("Root.Columns", new HTMLEditorField("CenterColumn", "Center Column Content"));
         $fields->addFieldToTab("Root.Columns", new HTMLEditorField("RightColumn", "Right Column Content"));
         $fields->addFieldToTab("Root.Sidebar", new HTMLEditorField("SidebarContent", "Sidebar Content"));
     }
     return $fields;
 }