From: Raimond Spekking Date: Sat, 23 Apr 2011 13:23:08 +0000 (+0000) Subject: Embrace comment with () only when really needed. In Special:ListFiles and ImagePage... X-Git-Tag: 1.31.0-rc.0~30612 X-Git-Url: http://git.cyclocoop.org/clavettes/images/siteon3.jpg?a=commitdiff_plain;h=629df89813e0cb277eeeb94205f819df53413c01;p=lhc%2Fweb%2Fwiklou.git Embrace comment with () only when really needed. In Special:ListFiles and ImagePage the comment is shown alone in a table cell -> no () needed --- diff --git a/includes/ImagePage.php b/includes/ImagePage.php index ad3a5a73eb..6d4aedf114 100644 --- a/includes/ImagePage.php +++ b/includes/ImagePage.php @@ -1097,7 +1097,7 @@ class ImageHistoryList { if ( $file->isDeleted( File::DELETED_COMMENT ) ) { $row .= '' . wfMsgHtml( 'rev-deleted-comment' ) . ''; } else { - $row .= $this->skin->commentBlock( $description, $this->title ); + $row .= $this->skin->commentBlock( $description, $this->title, false, false ); } $row .= ''; diff --git a/includes/Linker.php b/includes/Linker.php index 7c9031ac41..b430db1be7 100644 --- a/includes/Linker.php +++ b/includes/Linker.php @@ -1292,10 +1292,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 ) { + static function commentBlock( $comment, $title = null, $local = false, $embraced = true ) { // '*' 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 @@ -1303,7 +1303,10 @@ class Linker { return ''; } else { $formatted = self::formatComment( $comment, $title, $local ); - return " ($formatted)"; + if ( $embraced ) { + $formatted = wfMessage( 'parentheses', $formatted ); + } + return Html::rawElement( 'span', array( 'class' => 'comment' ), $formatted ); } } diff --git a/includes/specials/SpecialListfiles.php b/includes/specials/SpecialListfiles.php index 9bc38cdf73..ca6e8aa3b2 100644 --- a/includes/specials/SpecialListfiles.php +++ b/includes/specials/SpecialListfiles.php @@ -215,7 +215,7 @@ class ImageListPager extends TablePager { case 'img_size': return $this->getSkin()->formatSize( $value ); case 'img_description': - return $this->getSkin()->commentBlock( $value ); + return $this->getSkin()->commentBlock( $value, null, false, false ); case 'count': return intval($value)+1; }