http://www.mediawiki.org/wiki/Special:Code/MediaWiki/58352
Revision: 58352 Author: aaron Date: 2009-10-30 02:23:58 +0000 (Fri, 30 Oct 2009) Log Message: ----------- A few cleanups for r58351 Modified Paths: -------------- trunk/phase3/includes/Article.php trunk/phase3/includes/diff/DifferenceInterface.php Modified: trunk/phase3/includes/Article.php =================================================================== --- trunk/phase3/includes/Article.php 2009-10-30 02:14:22 UTC (rev 58351) +++ trunk/phase3/includes/Article.php 2009-10-30 02:23:58 UTC (rev 58352) @@ -3456,11 +3456,10 @@ $cdel = ''; // User can delete revisions or view deleted revisions... - $canHide = $wgUser->isAllowed('deleterevision'); + $canHide = $wgUser->isAllowed( 'deleterevision' ); if( $canHide || ($revision->getVisibility() && $wgUser->isAllowed('deletedhistory')) ) { - // Is this hidden from Sysops? if( !$revision->userCan( Revision::DELETED_RESTRICTED ) ) { - $cdel = $sk->revDeleteLinkDisabled( $canHide ); + $cdel = $sk->revDeleteLinkDisabled( $canHide ); // rev was hidden from Sysops } else { $query = array( 'type' => 'revision', Modified: trunk/phase3/includes/diff/DifferenceInterface.php =================================================================== --- trunk/phase3/includes/diff/DifferenceInterface.php 2009-10-30 02:14:22 UTC (rev 58351) +++ trunk/phase3/includes/diff/DifferenceInterface.php 2009-10-30 02:23:58 UTC (rev 58352) @@ -312,40 +312,38 @@ $newminor = ChangesList::flag( 'minor' ); } - $rdel = ''; $ldel = ''; + $rdel = $ldel = ''; # Handle RevisionDelete links... - if( $wgUser->isAllowed( 'deletedhistory' ) ) { - $canHide = $wgUser->isAllowed( 'deleterevision' ); - // Don't show useless link to people who cannot hide revisions - if( $canHide || $this->mOldRev->getVisibility() ) { - if( !$this->mOldRev->userCan( Revision::DELETED_RESTRICTED ) ) { - $ldel = $sk->revDeleteLinkDisabled( $canHide ); // revision was hidden from sysops - } else { - $query = array( - 'type' => 'revision', - 'target' => $this->mOldRev->mTitle->getPrefixedDbkey(), - 'ids' => $this->mOldRev->getId() - ); - $ldel = $sk->revDeleteLink( $query, - $this->mOldRev->isDeleted( Revision::DELETED_RESTRICTED ), $canHide ); - } - $ldel = " $ldel "; + $canHide = $wgUser->isAllowed( 'deleterevision' ); + // Don't show useless link to people who cannot hide revisions + if( $canHide || ($this->mOldRev->getVisibility() && $wgUser->isAllowed('deletedhistory')) ) { + if( !$this->mOldRev->userCan( Revision::DELETED_RESTRICTED ) ) { + $ldel = $sk->revDeleteLinkDisabled( $canHide ); // revision was hidden from sysops + } else { + $query = array( + 'type' => 'revision', + 'target' => $this->mOldRev->mTitle->getPrefixedDbkey(), + 'ids' => $this->mOldRev->getId() + ); + $ldel = $sk->revDeleteLink( $query, + $this->mOldRev->isDeleted( Revision::DELETED_RESTRICTED ), $canHide ); } - // Don't show useless link to people who cannot hide revisions - if( $this->mNewRev->getVisibility() || $wgUser->isAllowed( 'deleterevision' ) ) { - if( !$this->mNewRev->userCan( Revision::DELETED_RESTRICTED ) ) { - $rdel = $sk->revDeleteLinkDisabled( $canHide ); // revision was hidden from sysops - } else { - $query = array( - 'type' => 'revision', - 'target' => $this->mNewRev->mTitle->getPrefixedDbkey(), - 'ids' => $this->mNewRev->getId() - ); - $rdel = $sk->revDeleteLink( $query, - $this->mNewRev->isDeleted( Revision::DELETED_RESTRICTED ), $canHide ); - } - $rdel = " $rdel "; + $ldel = " $ldel "; + } + // Don't show useless link to people who cannot hide revisions + if( $canHide || ($this->mNewRev->getVisibility() && $wgUser->isAllowed('deletedhistory')) ) { + if( !$this->mNewRev->userCan( Revision::DELETED_RESTRICTED ) ) { + $rdel = $sk->revDeleteLinkDisabled( $canHide ); // revision was hidden from sysops + } else { + $query = array( + 'type' => 'revision', + 'target' => $this->mNewRev->mTitle->getPrefixedDbkey(), + 'ids' => $this->mNewRev->getId() + ); + $rdel = $sk->revDeleteLink( $query, + $this->mNewRev->isDeleted( Revision::DELETED_RESTRICTED ), $canHide ); } + $rdel = " $rdel "; } $oldHeader = '<div id="mw-diff-otitle1"><strong>'.$this->mOldtitle.'</strong></div>' . _______________________________________________ MediaWiki-CVS mailing list MediaWiki-CVS@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-cvs