From 87786e84dd9ae558e4748eddabb407e3a1ca3b9c Mon Sep 17 00:00:00 2001 From: Brion Vibber Date: Tue, 14 Jun 2011 23:50:40 +0000 Subject: [PATCH] Revert r86764, r89134, r86827 -- added a second opaque boolean parameter to Linker::commentBlock() which appeared to mostly just turn it into Linker::formatComment(). commentBlock() exists for the sole purpose of embedding a comment into parentheses if it exists so you can append it to a line of text -- if you're not putting stuff in parentheses, don't use commentBlock() because you're not generating a parenthesized comment block. Opaque boolean parameters are also very poor form, especially when tacking on multiple ones. There was already a nasty optional '$local' boolean param, forcing all uses of this other parameter to add *two* parameters, making illegible stuff like 'false, false'. --- includes/ImagePage.php | 2 +- includes/Linker.php | 11 ++++------- includes/specials/SpecialListfiles.php | 2 +- 3 files changed, 6 insertions(+), 9 deletions(-) diff --git a/includes/ImagePage.php b/includes/ImagePage.php index effd829e47..f962a995a0 100644 --- a/includes/ImagePage.php +++ b/includes/ImagePage.php @@ -1111,7 +1111,7 @@ class ImageHistoryList { if ( $file->isDeleted( File::DELETED_COMMENT ) ) { $row .= '' . wfMsgHtml( 'rev-deleted-comment' ) . ''; } else { - $row .= $this->skin->commentBlock( $description, $this->title, false, false ); + $row .= $this->skin->commentBlock( $description, $this->title ); } $row .= ''; diff --git a/includes/Linker.php b/includes/Linker.php index 4d913e7f08..bd8ad3c1bc 100644 --- a/includes/Linker.php +++ b/includes/Linker.php @@ -1343,10 +1343,10 @@ class Linker { * @param $comment String * @param $title Mixed: Title object (to generate link to section in autocomment) or null * @param $local Boolean: whether section links should refer to local page - * @param $embraced Boolean: whether the formatted comment should be embraced with () + * * @return string */ - static function commentBlock( $comment, $title = null, $local = false, $embraced = true ) { + static function commentBlock( $comment, $title = null, $local = false ) { // '*' used to be the comment inserted by the software way back // in antiquity in case none was provided, here for backwards // compatability, acc. to brion -ævar @@ -1354,10 +1354,7 @@ class Linker { return ''; } else { $formatted = self::formatComment( $comment, $title, $local ); - if ( $embraced ) { - $formatted = wfMessage( 'parentheses' )->rawParams( $formatted )->escaped(); - } - return Html::rawElement( 'span', array( 'class' => 'comment' ), $formatted ); + return " ($formatted)"; } } @@ -1377,7 +1374,7 @@ class Linker { if ( $rev->isDeleted( Revision::DELETED_COMMENT ) && $isPublic ) { $block = " " . wfMsgHtml( 'rev-deleted-comment' ) . ""; } else if ( $rev->userCan( Revision::DELETED_COMMENT ) ) { - $block = ' ' . self::commentBlock( $rev->getComment( Revision::FOR_THIS_USER ), + $block = self::commentBlock( $rev->getComment( Revision::FOR_THIS_USER ), $rev->getTitle(), $local ); } else { $block = " " . wfMsgHtml( 'rev-deleted-comment' ) . ""; diff --git a/includes/specials/SpecialListfiles.php b/includes/specials/SpecialListfiles.php index 8cc6e36839..205dd57df0 100644 --- a/includes/specials/SpecialListfiles.php +++ b/includes/specials/SpecialListfiles.php @@ -221,7 +221,7 @@ class ImageListPager extends TablePager { case 'img_size': return $this->getSkin()->formatSize( $value ); case 'img_description': - return $this->getSkin()->commentBlock( $value, null, false, false ); + return $this->getSkin()->commentBlock( $value ); case 'count': return intval( $value ) + 1; } -- 2.20.1