code/pages/WikiPage.php
public function EditForm() {
		// make sure to load fresh from db
		$record = DataObject::get_by_id('WikiPage', $this->data()->ID);
		$formatter = $record->getFormatter();

		$editorField = $formatter->getEditingField($record);
		$helpLink = $formatter->getHelpUrl();


		$fields = FieldList::create(
						new LiteralField('Preview', '<div data-url="'.$this->Link('livepreview').'" id="editorPreview"></div>'),
						new LiteralField('DialogContent', '<div id="dialogContent" style="display:none;"></div>'),
						$editorField,
						new DropdownField('EditorType', _t('WikiPage.EDITORTYPE', 'Editor Type'), $this->data()->getEditorTypeOptions()),
						new HiddenField('LockUpdate', '', $this->data()->Link('updatelock')),
						new HiddenField('LockLength', '', $this->config()->get('lock_time') - 10)
		);
		

		if ($helpLink) {
			$fields->push(new LiteralField('HelpLink', '<a target="_blank" href="' . $helpLink . '">' . _t('WikiPage.EDITOR_HELP_LINK', 'Editor Help') . '</a>'));
		}

		$actions = null;
		if (!WikiPage::$auto_publish) {
			$actions = FieldList::create(
							new FormAction('save', _t('WikiPage.SAVE', 'Save')),
							new FormAction('done', _t('WikiPage.DONE', 'Done (Draft)')),
							new FormAction('publish', _t('WikiPage.PUBLISH', 'Publish'))
			);
		} else {
			$actions = FieldList::create(
							new FormAction('save', _t('WikiPage.SAVE', 'Save')),
							new FormAction('publish', _t('WikiPage.FINISHED', 'Finished'))
			);
		}

		$actions->push(new FormAction('cancel', _t('WikiPage.CANCEL_EDIT', 'Cancel')));
		$actions->push(new FormAction('revert', _t('WikiPage.REVERT_EDIT', 'Revert')));

		if (Permission::check(MANAGE_WIKI_PAGES)) {
			$actions->push(new FormAction('addpage_t', _t('WikiPage.ADD_PAGE', 'New Page')));
			$actions->push(new FormAction('delete', _t('WikiPage.DELETE_PAGE', 'Delete Page')));
		}

		$form = new Form($this, "EditForm", $fields, $actions);
		$form->loadDataFrom($record);
        
        $this->extend('updateWikiEditForm', $form);
		return $form;
	}
public function EditForm() {
		// make sure to load fresh from db
		$record = DataObject::get_by_id('WikiPage', $this->data()->ID);
		$formatter = $record->getFormatter();

		$editorField = $formatter->getEditingField($record);
		$helpLink = $formatter->getHelpUrl();


		$fields = FieldList::create(
						new LiteralField('Preview', '<div data-url="'.$this->Link('livepreview').'" id="editorPreview"></div>'),
						new LiteralField('DialogContent', '<div id="dialogContent" style="display:none;"></div>'),
						$editorField,
						new DropdownField('EditorType', _t('WikiPage.EDITORTYPE', 'Editor Type'), $this->data()->getEditorTypeOptions()),
						new HiddenField('LockUpdate', '', $this->data()->Link('updatelock')),
						new HiddenField('LockLength', '', $this->config()->get('lock_time') - 10)
		);
		

		if ($helpLink) {
			$fields->push(new LiteralField('HelpLink', '<a target="_blank" href="' . $helpLink . '">' . _t('WikiPage.EDITOR_HELP_LINK', 'Editor Help') . '</a>'));
		}

		$actions = null;
		if (!WikiPage::$auto_publish) {
			$actions = FieldList::create(
							new FormAction('save', _t('WikiPage.SAVE', 'Save')),
							new FormAction('done', _t('WikiPage.DONE', 'Done (Draft)')),
							new FormAction('publish', _t('WikiPage.PUBLISH', 'Publish'))
			);
		} else {
			$actions = FieldList::create(
							new FormAction('save', _t('WikiPage.SAVE', 'Save')),
							new FormAction('publish', _t('WikiPage.FINISHED', 'Finished'))
			);
		}

		$actions->push(new FormAction('cancel', _t('WikiPage.CANCEL_EDIT', 'Cancel')));
		$actions->push(new FormAction('revert', _t('WikiPage.REVERT_EDIT', 'Revert')));

		if (Permission::check(MANAGE_WIKI_PAGES)) {
			$actions->push(new FormAction('addpage_t', _t('WikiPage.ADD_PAGE', 'New Page')));
			$actions->push(new FormAction('delete', _t('WikiPage.DELETE_PAGE', 'Delete Page')));
		}

		$form = new Form($this, "EditForm", $fields, $actions);
		$form->loadDataFrom($record);
        
        $this->extend('updateWikiEditForm', $form);
		return $form;
	}
public function EditForm ( ) { // make sure to load fresh from db $ record = DataObject :: get_by_id ( 'WikiPage' , $ this -> data ( ) -> ID ) ; $ formatter = $ record -> getFormatter ( ) ; $ editorField = $ formatter -> getEditingField ( $ record ) ; $ helpLink = $ formatter -> getHelpUrl ( ) ; $ fields = FieldList :: create ( new LiteralField ( 'Preview' , '<div data-url="' . $ this -> Link ( 'livepreview' ) . '" id="editorPreview"></div>' ) , new LiteralField ( 'DialogContent' , '<div id="dialogContent" style="display:none;"></div>' ) , $ editorField , new DropdownField ( 'EditorType' , _t ( 'WikiPage.EDITORTYPE' , 'Editor Type' ) , $ this -> data ( ) -> getEditorTypeOptions ( ) ) , new HiddenField ( 'LockUpdate' , '' , $ this -> data ( ) -> Link ( 'updatelock' ) ) , new HiddenField ( 'LockLength' , '' , $ this -> config ( ) -> get ( 'lock_time' ) - 10 ) ) ; if ( $ helpLink ) { $ fields -> push ( new LiteralField ( 'HelpLink' , '<a target="_blank" href="' . $ helpLink . '">' . _t ( 'WikiPage.EDITOR_HELP_LINK' , 'Editor Help' ) . '</a>' ) ) ; } $ actions = null ; if ( ! WikiPage :: $ auto_publish ) { $ actions = FieldList :: create ( new FormAction ( 'save' , _t ( 'WikiPage.SAVE' , 'Save' ) ) , new FormAction ( 'done' , _t ( 'WikiPage.DONE' , 'Done (Draft)' ) ) , new FormAction ( 'publish' , _t ( 'WikiPage.PUBLISH' , 'Publish' ) ) ) ; } else { $ actions = FieldList :: create ( new FormAction ( 'save' , _t ( 'WikiPage.SAVE' , 'Save' ) ) , new FormAction ( 'publish' , _t ( 'WikiPage.FINISHED' , 'Finished' ) ) ) ; } $ actions -> push ( new FormAction ( 'cancel' , _t ( 'WikiPage.CANCEL_EDIT' , 'Cancel' ) ) ) ; $ actions -> push ( new FormAction ( 'revert' , _t ( 'WikiPage.REVERT_EDIT' , 'Revert' ) ) ) ; if ( Permission :: check ( MANAGE_WIKI_PAGES ) ) { $ actions -> push ( new FormAction ( 'addpage_t' , _t ( 'WikiPage.ADD_PAGE' , 'New Page' ) ) ) ; $ actions -> push ( new FormAction ( 'delete' , _t ( 'WikiPage.DELETE_PAGE' , 'Delete Page' ) ) ) ; } $ form = new Form ( $ this , "EditForm" , $ fields , $ actions ) ; $ form -> loadDataFrom ( $ record ) ; $ this -> extend ( 'updateWikiEditForm' , $ form ) ; return $ form ; }
Creates the form used for editing the page's content

@return Form
Creates the form used for editing the page s content