EditPage: Add text placeholders to view source page
authorDerk-Jan Hartman <hartman.wiki@gmail.com>
Mon, 24 Aug 2015 20:58:33 +0000 (22:58 +0200)
committerTheDJ <hartman.wiki@gmail.com>
Tue, 1 Sep 2015 12:46:41 +0000 (12:46 +0000)
These placeholders are already in use by the edit form, but were not
available to extensions. This gives us equal oppertunity to adapt the
contents surrounding the source textbox as we have in the editform.

I'm reusing the same placeholders. Most extensions fill these
placeholders through the showEditForm:initial hook however, so it
should not cause too many unexpected changes, since the readonly page
uses showReadOnlyForm:initial instead. I left out those that were very
specific to the editpage (afterEditTools etc).

This will be useful for Bug T110050.

Change-Id: Ia03265a907212ee7bac1b839dcdd4d2f24c79bbe

includes/EditPage.php

index 85a3014..05e0ac0 100644 (file)
@@ -655,6 +655,9 @@ class EditPage {
                        $this->getContextTitle()->getPrefixedText()
                ) );
                $wgOut->addBacklinkSubtitle( $this->getContextTitle() );
+               $wgOut->addHTML( $this->editFormPageTop );
+               $wgOut->addHTML( $this->editFormTextTop );
+
                $wgOut->addWikiText( $wgOut->formatPermissionsErrorMessage( $permErrors, 'edit' ) );
                $wgOut->addHTML( "<hr />\n" );
 
@@ -668,13 +671,16 @@ class EditPage {
                        $wgOut->addWikiMsg( 'viewsourcetext' );
                }
 
+               $wgOut->addHTML( $this->editFormTextBeforeContent );
                $this->showTextbox( $text, 'wpTextbox1', array( 'readonly' ) );
+               $wgOut->addHTML( $this->editFormTextAfterContent );
 
                $wgOut->addHTML( Html::rawElement( 'div', array( 'class' => 'templatesUsed' ),
                        Linker::formatTemplates( $this->getTemplates() ) ) );
 
                $wgOut->addModules( 'mediawiki.action.edit.collapsibleFooter' );
 
+               $wgOut->addHTML( $this->editFormTextBottom );
                if ( $this->mTitle->exists() ) {
                        $wgOut->returnToMain( null, $this->mTitle );
                }