http://www.mediawiki.org/wiki/Special:Code/MediaWiki/90101
Revision: 90101
Author: brion
Date: 2011-06-14 23:50:40 +0000 (Tue, 14 Jun 2011)
Log Message:
-----------
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'.
Modified Paths:
--------------
trunk/phase3/includes/ImagePage.php
trunk/phase3/includes/Linker.php
trunk/phase3/includes/specials/SpecialListfiles.php
Modified: trunk/phase3/includes/ImagePage.php
===================================================================
--- trunk/phase3/includes/ImagePage.php 2011-06-14 23:46:39 UTC (rev 90100)
+++ trunk/phase3/includes/ImagePage.php 2011-06-14 23:50:40 UTC (rev 90101)
@@ -1111,7 +1111,7 @@
if ( $file->isDeleted( File::DELETED_COMMENT ) ) {
$row .= '<span class="history-deleted">' . wfMsgHtml(
'rev-deleted-comment' ) . '</span>';
} else {
- $row .= $this->skin->commentBlock( $description,
$this->title, false, false );
+ $row .= $this->skin->commentBlock( $description,
$this->title );
}
$row .= '</td>';
Modified: trunk/phase3/includes/Linker.php
===================================================================
--- trunk/phase3/includes/Linker.php 2011-06-14 23:46:39 UTC (rev 90100)
+++ trunk/phase3/includes/Linker.php 2011-06-14 23:50:40 UTC (rev 90101)
@@ -1343,10 +1343,10 @@
* @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 @@
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 " <span class=\"comment\">($formatted)</span>";
}
}
@@ -1377,7 +1374,7 @@
if ( $rev->isDeleted( Revision::DELETED_COMMENT ) && $isPublic
) {
$block = " <span class=\"comment\">" . wfMsgHtml(
'rev-deleted-comment' ) . "</span>";
} 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 = " <span class=\"comment\">" . wfMsgHtml(
'rev-deleted-comment' ) . "</span>";
Modified: trunk/phase3/includes/specials/SpecialListfiles.php
===================================================================
--- trunk/phase3/includes/specials/SpecialListfiles.php 2011-06-14 23:46:39 UTC
(rev 90100)
+++ trunk/phase3/includes/specials/SpecialListfiles.php 2011-06-14 23:50:40 UTC
(rev 90101)
@@ -221,7 +221,7 @@
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;
}
_______________________________________________
MediaWiki-CVS mailing list
[email protected]
https://lists.wikimedia.org/mailman/listinfo/mediawiki-cvs