From: Brion Vibber Date: Tue, 22 Feb 2005 06:04:03 +0000 (+0000) Subject: War on cruft: commentBlock() usage, use a styled for comments instead of mix... X-Git-Tag: 1.5.0alpha1~703 X-Git-Url: http://git.cyclocoop.org/%40spipnet%40?a=commitdiff_plain;h=d6739493f7a99c58bc8dd017e48f0a4d7ac2acff;p=lhc%2Fweb%2Fwiklou.git War on cruft: commentBlock() usage, use a styled for comments instead of mix of and Remove some unused functions in contribs --- diff --git a/includes/ChangesList.php b/includes/ChangesList.php index 57498153e3..096fe0106d 100644 --- a/includes/ChangesList.php +++ b/includes/ChangesList.php @@ -105,9 +105,8 @@ class ChangesList { $r .= $rcObj->usertalklink ; # Comment - if ( $rc_comment != '' && $rc_type != RC_MOVE && $rc_type != RC_MOVE_OVER_REDIRECT ) { - $rc_comment=$this->skin->formatComment($rc_comment, $rcObj->getTitle()); - $r .= $wgContLang->emphasize( ' ('.$rc_comment.')' ); + if ( $rc_type != RC_MOVE && $rc_type != RC_MOVE_OVER_REDIRECT ) { + $r .= $this->skin->commentBlock( $rc_comment, $rcObj->getTitle() ); } if ($rcObj->numberofWatchingusers > 0) { @@ -263,10 +262,7 @@ class ChangesList { $r .= $rcObj->lastlink ; $r .= ') . . '.$rcObj->userlink ; $r .= $rcObj->usertalklink ; - if ( $rc_comment != '' ) { - $rc_comment=$this->skin->formatComment($rc_comment, $rcObj->getTitle()); - $r .= $wgContLang->emphasize( ' ('.$rc_comment.')' ) ; - } + $r .= $this->skin->commentBlock( $rc_comment, $rcObj->getTitle() ); $r .= "
\n" ; } $r .= "\n" ; @@ -443,9 +439,8 @@ class ChangesList { if($userTalkLink) $s.=' ('.$userTalkLink.')'; # Add comment - if ( '' != $rc_comment && '*' != $rc_comment && $rc_type != RC_MOVE && $rc_type != RC_MOVE_OVER_REDIRECT ) { - $rc_comment = $this->skin->formatComment($rc_comment,$rc->getTitle()); - $s .= $wgContLang->emphasize(' (' . $rc_comment . ')'); + if ( $rc_type != RC_MOVE && $rc_type != RC_MOVE_OVER_REDIRECT ) { + $s .= $this->skin->commentBlock( $rc_comment, $rc->getTitle() ); } if ($rc->numberofWatchingusers > 0) { diff --git a/includes/Linker.php b/includes/Linker.php index 7f39d4a46a..c8819e17af 100644 --- a/includes/Linker.php +++ b/includes/Linker.php @@ -780,11 +780,11 @@ class Linker { * @access public */ function commentBlock( $comment, $title = NULL ) { - if( $comment == '' ) { + if( $comment == '' || $comment == '*' ) { return ''; } else { $formatted = $this->formatComment( $comment, $title ); - return " ($formatted)"; + return " ($formatted)"; } } diff --git a/includes/PageHistory.php b/includes/PageHistory.php index 744de137ff..66ed592896 100644 --- a/includes/PageHistory.php +++ b/includes/PageHistory.php @@ -194,10 +194,7 @@ class PageHistory { $s .= $isminor ? ' '.$message['minoreditletter'].'': '' ; - if ( '' != $c && '*' != $c ) { - $c = $this->mSkin->formatcomment( $c, $this->mTitle ); - $s .= " ($c)"; - } + $s .= $this->mSkin->commentBlock( $c, $this->mTitle ); if ($notificationtimestamp && ($ts >= $notificationtimestamp)) { $s .= wfMsg( 'updatedmarker' ); } diff --git a/includes/SpecialContributions.php b/includes/SpecialContributions.php index bda7a3cb20..c13a920a55 100644 --- a/includes/SpecialContributions.php +++ b/includes/SpecialContributions.php @@ -201,9 +201,7 @@ function ucListEdit( $sk, $ns, $t, $ts, $topmark, $comment, $isminor, $isnew, $t } $histlink='('.$sk->makeKnownLinkObj( $page, $messages['hist'], 'action=history' ) . ')'; - if( $comment ) { - $comment = '(' . $sk->formatComment( $comment, $page ) . ') '; - } + $comment = $sk->commentBlock( $comment, $page ); $d = $wgLang->timeanddate( $ts, true ); if ($isminor) { @@ -216,32 +214,6 @@ function ucListEdit( $sk, $ns, $t, $ts, $topmark, $comment, $isminor, $isnew, $t wfProfileOut( $fname ); } -/** - * - */ -function ucCountLink( $lim, $d ) { - global $wgUser, $wgContLang, $wgRequest; - - $target = $wgRequest->getText( 'target' ); - $sk = $wgUser->getSkin(); - $s = $sk->makeKnownLink( $wgContLang->specialPage( "Contributions" ), - "{$lim}", "target={$target}&days={$d}&limit={$lim}" ); - return $s; -} - -/** - * - */ -function ucDaysLink( $lim, $d ) { - global $wgUser, $wgContLang, $wgRequest; - - $target = $wgRequest->getText( 'target' ); - $sk = $wgUser->getSkin(); - $s = $sk->makeKnownLink( $wgContLang->specialPage( 'Contributions' ), - "{$d}", "target={$target}&days={$d}&limit={$lim}" ); - return $s; -} - /** * Generates a form used to restrict display of contributions * to a specific namespace diff --git a/includes/SpecialIpblocklist.php b/includes/SpecialIpblocklist.php index cdc7f8418d..cd57458748 100644 --- a/includes/SpecialIpblocklist.php +++ b/includes/SpecialIpblocklist.php @@ -171,10 +171,7 @@ function wfAddRow( $block, $tag ) { wfMsg( "unblocklink" ) . ""; $wgOut->addHTML( " ({$ublink})" ); } - if ( "" != $block->mReason ) { - $wgOut->addHTML( " (" . $sk->formatComment( $block->mReason ) . - ")" ); - } + $wgOut->addHTML( $sk->commentBlock( $block->mReason ) ); $wgOut->addHTML( "\n" ); } diff --git a/includes/SpecialLog.php b/includes/SpecialLog.php index 1fb685ac03..76cfd5ef80 100644 --- a/includes/SpecialLog.php +++ b/includes/SpecialLog.php @@ -257,11 +257,7 @@ class LogViewer { $titleLink = $this->skin->makeBrokenLinkObj( $title ); } $userLink = $this->skin->makeLinkObj( $user, htmlspecialchars( $s->user_name ) ); - if( '' === $s->log_comment ) { - $comment = ''; - } else { - $comment = '(' . $this->skin->formatComment( $s->log_comment ) . ')'; - } + $comment = $this->skin->commentBlock( $s->log_comment ); $paramArray = LogPage::extractParams( $s->log_params ); $action = LogPage::actionText( $s->log_type, $s->log_action, $titleLink, $paramArray ); diff --git a/includes/SpecialNewpages.php b/includes/SpecialNewpages.php index ca85ec4b7f..c19ff75c4f 100644 --- a/includes/SpecialNewpages.php +++ b/includes/SpecialNewpages.php @@ -61,7 +61,6 @@ class NewPagesPage extends QueryPage { $ut = $result->user_text; $length = wfMsg( "nbytes", $wgLang->formatNum( $result->length ) ); - $c = $skin->formatComment($result->comment ); if ( $u == 0 ) { # not by a logged-in user $ul = $ut; @@ -83,9 +82,7 @@ class NewPagesPage extends QueryPage { $s = "{$d} {$link} ({$length}) . . {$ul}"; - if ( "" != $c && "*" != $c ) { - $s .= " ({$c})"; - } + $s .= $skin->commentBlock( $result->comment ); return $s; } diff --git a/includes/SpecialUndelete.php b/includes/SpecialUndelete.php index 616d5e8a3e..f964d58792 100644 --- a/includes/SpecialUndelete.php +++ b/includes/SpecialUndelete.php @@ -413,8 +413,8 @@ class UndeleteForm { Title::makeTitle( NS_USER, $row->ar_user_text ), $userLink ); } - $comment = $sk->formatComment( $row->ar_comment ); - $wgOut->addHTML( "
  • $checkBox $pageLink . . $userLink ($comment)
  • \n" ); + $comment = $sk->commentBlock( $row->ar_comment ); + $wgOut->addHTML( "
  • $checkBox $pageLink . . $userLink $comment
  • \n" ); } $revisions->free(); diff --git a/includes/SpecialUnusedimages.php b/includes/SpecialUnusedimages.php index 947ab7a38d..6d6cb2fcbd 100644 --- a/includes/SpecialUnusedimages.php +++ b/includes/SpecialUnusedimages.php @@ -44,12 +44,10 @@ class UnusedimagesPage extends QueryPage { # Last modified date . ' . . '.$wgLang->timeanddate($result->value) # Link to username - . ' . . '.$skin->makeLinkObj( Title::makeTitle( NS_USER, $result->img_user_text ), $result->img_user_text); - + . ' . . '.$skin->makeLinkObj( Title::makeTitle( NS_USER, $result->img_user_text ), $result->img_user_text) # If there is a description, show it - if($result->img_description != '') { - $return .= ' (' . $skin->formatComment( $result->img_description ) . ')'; - } + . $skin->commentBlock( $result->img_description ); + return $return; } diff --git a/skins/common/common.css b/skins/common/common.css index 041ea695c5..35e0b47078 100644 --- a/skins/common/common.css +++ b/skins/common/common.css @@ -291,3 +291,6 @@ div.gallerytext { padding: 2px 4px; } +span.comment { + font-style: italic; +} diff --git a/skins/monobook/main.css b/skins/monobook/main.css index 97e2e704cc..34b5d70b77 100644 --- a/skins/monobook/main.css +++ b/skins/monobook/main.css @@ -1077,4 +1077,8 @@ div.gallerybox div.thumb { div.gallerytext { font-size: 94%; padding: 2px 4px; -} \ No newline at end of file +} + +span.comment { + font-style: italic; +}