r75406 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r75405‎ | r75406 | r75407 >
Date:00:33, 26 October 2010
Author:yaron
Status:deferred
Tags:
Comment:
Fixed bad display when hitting "show preview" or "show changes"; changed code to not overwrite existing subtitle, but rather append to it, when printing "this is [not] the latest revision" notice
Modified paths:
  • /trunk/extensions/ApprovedRevs/ApprovedRevs.hooks.php (modified) (history)

Diff [purge]

Index: trunk/extensions/ApprovedRevs/ApprovedRevs.hooks.php
@@ -19,8 +19,7 @@
2020 */
2121 static public function setApprovedRevForParsing( &$parser, &$text, &$stripState ) {
2222 global $wgRequest;
23 - $action = $wgRequest->getVal( 'action' );
24 - if ( $action == 'submit' ) {
 23+ if ( $wgRequest->getCheck( 'wpSave' ) ) {
2524 $title = $parser->getTitle();
2625 if ( ! ApprovedRevs::pageIsApprovable( $title ) ) {
2726 return true;
@@ -110,7 +109,11 @@
111110 if ( $egApprovedRevsBlankIfUnapproved ) {
112111 $content = '';
113112 global $wgOut;
114 - $wgOut->setSubtitle( wfMsg( 'approvedrevs-blankpageshown' ) );
 113+ if ( $wgOut->getSubtitle() != '' ) {
 114+ $wgOut->appendSubtitle( "<br />" . wfMsg( 'approvedrevs-blankpageshown' ) );
 115+ } else {
 116+ $wgOut->setSubtitle( wfMsg( 'approvedrevs-blankpageshown' ) );
 117+ }
115118 }
116119 }
117120 return true;
@@ -154,7 +157,11 @@
155158 $text .= ' ' . $curRevLink;
156159 }
157160 global $wgOut;
158 - $wgOut->setSubtitle( $text );
 161+ if ( $wgOut->getSubtitle() != '' ) {
 162+ $wgOut->appendSubtitle( "<br />" . $text );
 163+ } else {
 164+ $wgOut->setSubtitle( $text );
 165+ }
159166 return false;
160167 }
161168

Status & tagging log