r82672 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r82671‎ | r82672 | r82673 >
Date:15:16, 23 February 2011
Author:jeroendedauw
Status:deferred
Tags:
Comment:
Fixed bug and layout tweak
Modified paths:
  • /trunk/extensions/ApprovedRevs/ApprovedRevs.hooks.php (modified) (history)
  • /trunk/extensions/ApprovedRevs/ApprovedRevs.i18n.php (modified) (history)

Diff [purge]

Index: trunk/extensions/ApprovedRevs/ApprovedRevs.i18n.php
@@ -38,7 +38,7 @@
3939 'approvedrevs-revisionnumber' => 'revision $1',
4040 'approvedrevs-approvedby' => 'approved by $1 on $2',
4141 'approvedrevs-difffromlatest' => 'diff from latest',
42 - 'approvedrevs-viewlatest' => 'view latest',
 42+ 'approvedrevs-viewlatest' => 'View latest',
4343 'approvedrevs-approvelatest' => 'approve latest',
4444 'approvedrevs-approvethisrev' => 'Approve this revision',
4545 'approvedrevs-viewlatestrev' => 'View the latest revision',
Index: trunk/extensions/ApprovedRevs/ApprovedRevs.hooks.php
@@ -200,29 +200,32 @@
201201 wfMsg( 'approvedrevs-approvedandlatest' )
202202 );
203203 } else {
204 - $text = wfMsg( 'approvedrevs-notlatest' );
 204+ $text = wfMsgHtml( 'approvedrevs-notlatest' );
 205+
205206 global $wgUser;
206207 $sk = $wgUser->getSkin();
207 - $curRevLink = $sk->link(
 208+ $text .= ' ' . $sk->link(
208209 $article->getTitle(),
209210 wfMsgHtml( 'approvedrevs-viewlatest' ),
210211 array(),
211212 array( 'oldid' => $article->getLatest() ),
212213 array( 'known', 'noclasses' )
213214 );
214 - $text .= ' ' . $curRevLink;
 215+
215216 $text = Xml::tags(
216217 'span',
217218 array( 'class' => 'notLatestMsg' ),
218219 $text
219220 );
220221 }
 222+
221223 global $wgOut;
222224 if ( $wgOut->getSubtitle() != '' ) {
223 - $wgOut->appendSubtitle( "<br />" . $text );
 225+ $wgOut->appendSubtitle( '<br />' . $text );
224226 } else {
225227 $wgOut->setSubtitle( $text );
226228 }
 229+
227230 return false;
228231 }
229232
@@ -558,15 +561,18 @@
559562 && $article->getTitle()->userCan( 'approverevisions' ) ) {
560563
561564 $approvedId = ApprovedRevs::getApprovedRevID( $article->getTitle() );
562 -
563 - if ( empty( $approvedId ) || $approvedId != $article->getRevIdFetched() ) {
 565+ $thisRevId = $wgRequest->getCheck( 'oldid' ) ? $wgRequest->getInt( 'oldid' ) : $article->getRevIdFetched();
 566+
 567+ if ( empty( $approvedId ) || $approvedId != $thisRevId ) {
 568+ $wgOut->addHTML( '<span style="margin-left:10.75px">' );
 569+
564570 if ( $egApprovedRevsBlankIfUnapproved && !$wgRequest->getCheck( 'oldid' ) ) {
565571 $wgOut->addHTML(
566572 htmlspecialchars( wfMsg( 'approvedrevs-noapprovedrevs' ) ) . '&#160;' .
567573 Xml::element( 'a',
568574 array( 'href' => $article->getTitle()->getLocalUrl(
569575 array(
570 - 'oldid' => $article->getRevIdFetched()
 576+ 'oldid' => $thisRevId
571577 )
572578 ) ),
573579 wfMsg( 'approvedrevs-viewlatestrev' )
@@ -578,12 +584,14 @@
579585 array( 'href' => $article->getTitle()->getLocalUrl(
580586 array(
581587 'action' => 'approve',
582 - 'oldid' => $article->getRevIdFetched()
 588+ 'oldid' => $thisRevId
583589 )
584590 ) ),
585591 wfMsg( 'approvedrevs-approvethisrev' )
586592 ) . '</b>' );
587593 }
 594+
 595+ $wgOut->addHTML( '</span>' );
588596 }
589597 }
590598

Status & tagging log