From: Aaron Schulz Date: Sun, 9 Mar 2008 02:25:04 +0000 (+0000) Subject: Add $isPublic param to user link functions X-Git-Tag: 1.31.0-rc.0~49196 X-Git-Url: https://git.cyclocoop.org//%22?a=commitdiff_plain;h=629fb5849b24faa378a1bd54f8c9c683f9227995;p=lhc%2Fweb%2Fwiklou.git Add $isPublic param to user link functions --- diff --git a/includes/Linker.php b/includes/Linker.php index 91b6430e1a..2b232c1e63 100644 --- a/includes/Linker.php +++ b/includes/Linker.php @@ -923,10 +923,13 @@ class Linker { /** * Generate a user link if the current user is allowed to view it * @param $rev Revision object. + * @param $isPublic, bool, show only if all users can see it * @return string HTML */ - function revUserLink( $rev ) { - if( $rev->userCan( Revision::DELETED_USER ) ) { + function revUserLink( $rev, $isPublic = false ) { + if( $rev->isDeleted( Revision::DELETED_USER ) && $isPublic ) { + $link = wfMsgHtml( 'rev-deleted-user' ); + } else if( $rev->userCan( Revision::DELETED_USER ) ) { $link = $this->userLink( $rev->getRawUser(), $rev->getRawUserText() ); } else { $link = wfMsgHtml( 'rev-deleted-user' ); @@ -940,18 +943,20 @@ class Linker { /** * Generate a user tool link cluster if the current user is allowed to view it * @param $rev Revision object. + * @param $isPublic, bool, show only if all users can see it * @return string HTML */ - function revUserTools( $rev ) { - if( $rev->userCan( Revision::DELETED_USER ) ) { + function revUserTools( $rev, $isPublic = false ) { + if( $rev->isDeleted( Revision::DELETED_USER ) && $isPublic ) { + $link = wfMsgHtml( 'rev-deleted-user' ); + } else if( $rev->userCan( Revision::DELETED_USER ) ) { $link = $this->userLink( $rev->getRawUser(), $rev->getRawUserText() ) . - ' ' . - $this->userToolLinks( $rev->getRawUser(), $rev->getRawUserText() ); + ' ' . $this->userToolLinks( $rev->getRawUser(), $rev->getRawUserText() ); } else { $link = wfMsgHtml( 'rev-deleted-user' ); } if( $rev->isDeleted( Revision::DELETED_USER ) ) { - return '' . $link . ''; + return ' ' . $link . ''; } return $link; }