r82732 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r82731‎ | r82732 | r82733 >
Date:16:18, 24 February 2011
Author:jeroendedauw
Status:deferred
Tags:
Comment:
logic fix
Modified paths:
  • /trunk/extensions/ApprovedRevs/ApprovedRevs.hooks.php (modified) (history)

Diff [purge]

Index: trunk/extensions/ApprovedRevs/ApprovedRevs.hooks.php
@@ -562,11 +562,25 @@
563563
564564 $approvedId = ApprovedRevs::getApprovedRevID( $article->getTitle() );
565565
566 - if ( empty( $approvedId ) || ( $wgRequest->getCheck( 'oldid' ) && $wgRequest->getInt( 'oldid' ) != $approvedId ) ) {
 566+ if ( $egApprovedRevsBlankIfUnapproved &&
 567+ ( empty( $approvedId ) || ( $wgRequest->getCheck( 'oldid' ) && $wgRequest->getInt( 'oldid' ) != $approvedId ) ) ) {
567568 //var_dump($approvedId);var_dump($thisRevId);exit;
568569 $wgOut->addHTML( '<span style="margin-left:10.75px">' );
569570
570 - if ( $egApprovedRevsBlankIfUnapproved && !$wgRequest->getCheck( 'oldid' ) ) {
 571+ if ( $wgRequest->getCheck( 'oldid' ) ) {
 572+ $wgOut->addHTML( Xml::tags( 'span', array( 'id' => 'contentSub2' ),
 573+ Xml::element( 'a',
 574+ array( 'href' => $article->getTitle()->getLocalUrl(
 575+ array(
 576+ 'action' => 'approve',
 577+ 'oldid' => $wgRequest->getInt( 'oldid' )
 578+ )
 579+ ) ),
 580+ wfMsg( 'approvedrevs-approvethisrev' )
 581+ ) ) );
 582+
 583+ }
 584+ else {
571585 $wgOut->addHTML(
572586 htmlspecialchars( wfMsg( 'approvedrevs-noapprovedrevs' ) ) . '&#160;' .
573587 Xml::element( 'a',
@@ -579,18 +593,6 @@
580594 ) . '.'
581595 );
582596 }
583 - else {
584 - $wgOut->addHTML( Xml::tags( 'span', array( 'id' => 'contentSub2' ),
585 - Xml::element( 'a',
586 - array( 'href' => $article->getTitle()->getLocalUrl(
587 - array(
588 - 'action' => 'approve',
589 - 'oldid' => $wgRequest->getInt( 'oldid' )
590 - )
591 - ) ),
592 - wfMsg( 'approvedrevs-approvethisrev' )
593 - ) ) );
594 - }
595597
596598 $wgOut->addHTML( '</span>' );
597599 }

Status & tagging log