Genderize Special:Preferences
[lhc/web/wiklou.git] / includes / EditPage.php
index 89daf52..292d2b7 100644 (file)
@@ -480,6 +480,7 @@ class EditPage {
                        throw new PermissionsError( $action, $permErrors );
                }
 
+               $wgOut->setRobotPolicy( 'noindex,nofollow' );
                $wgOut->setPageTitle( wfMessage( 'viewsource-title', $this->getContextTitle()->getPrefixedText() ) );
                $wgOut->addBacklinkSubtitle( $this->getContextTitle() );
                $wgOut->addWikiText( $wgOut->formatPermissionsErrorMessage( $permErrors, 'edit' ) );
@@ -2194,30 +2195,8 @@ class EditPage {
                        $wgOut->addWikiMsg( 'talkpagetext' );
                }
 
-               # Optional notices on a per-namespace and per-page basis
-               $editnotice_ns = 'editnotice-' . $this->mTitle->getNamespace();
-               $editnotice_ns_message = wfMessage( $editnotice_ns );
-               if ( $editnotice_ns_message->exists() ) {
-                       $wgOut->addWikiText( $editnotice_ns_message->plain() );
-               }
-               if ( MWNamespace::hasSubpages( $this->mTitle->getNamespace() ) ) {
-                       $parts = explode( '/', $this->mTitle->getDBkey() );
-                       $editnotice_base = $editnotice_ns;
-                       while ( count( $parts ) > 0 ) {
-                               $editnotice_base .= '-' . array_shift( $parts );
-                               $editnotice_base_msg = wfMessage( $editnotice_base );
-                               if ( $editnotice_base_msg->exists() ) {
-                                       $wgOut->addWikiText( $editnotice_base_msg->plain() );
-                               }
-                       }
-               } else {
-                       # Even if there are no subpages in namespace, we still don't want / in MW ns.
-                       $editnoticeText = $editnotice_ns . '-' . str_replace( '/', '-', $this->mTitle->getDBkey() );
-                       $editnoticeMsg = wfMessage( $editnoticeText );
-                       if ( $editnoticeMsg->exists() ) {
-                               $wgOut->addWikiText( $editnoticeMsg->plain() );
-                       }
-               }
+               // Add edit notices
+               $wgOut->addHTML( implode( "\n", $this->mTitle->getEditNotices() ) );
 
                if ( $this->isConflict ) {
                        $wgOut->wrapWikiMsg( "<div class='mw-explainconflict'>\n$1\n</div>", 'explainconflict' );
@@ -2780,7 +2759,9 @@ HTML
                        wfMessage( 'newwindow' )->parse();
                $wgOut->addHTML( "      <span class='cancelLink'>{$cancel}</span>\n" );
                $wgOut->addHTML( "      <span class='editHelp'>{$edithelp}</span>\n" );
-               $wgOut->addHTML( "</div><!-- editButtons -->\n</div><!-- editOptions -->\n" );
+               $wgOut->addHTML( "</div><!-- editButtons -->\n" );
+               wfRunHooks( 'EditPage::showStandardInputs:options', array( $this, $wgOut, &$tabindex ) );
+               $wgOut->addHTML( "</div><!-- editOptions -->\n" );
        }
 
        /**
@@ -2930,6 +2911,12 @@ HTML
                try {
                        $content = $this->toEditContent( $this->textbox1 );
 
+                       $previewHTML = '';
+                       if ( !wfRunHooks( 'AlternateEditPreview', array( $this, &$content, &$previewHTML, &$this->mParserOutput ) ) ) {
+                               wfProfileOut( __METHOD__ );
+                               return $previewHTML;
+                       }
+
                        if ( $this->mTriedSave && !$this->mTokenOk ) {
                                if ( $this->mTokenOkExceptSuffix ) {
                                        $note = wfMessage( 'token_suffix_mismatch' )->plain() ;