War on cruft: commentBlock() usage, use a styled <span> for comments instead of mix...
authorBrion Vibber <brion@users.mediawiki.org>
Tue, 22 Feb 2005 06:04:03 +0000 (06:04 +0000)
committerBrion Vibber <brion@users.mediawiki.org>
Tue, 22 Feb 2005 06:04:03 +0000 (06:04 +0000)
Remove some unused functions in contribs

includes/ChangesList.php
includes/Linker.php
includes/PageHistory.php
includes/SpecialContributions.php
includes/SpecialIpblocklist.php
includes/SpecialLog.php
includes/SpecialNewpages.php
includes/SpecialUndelete.php
includes/SpecialUnusedimages.php
skins/common/common.css
skins/monobook/main.css

index 5749815..096fe01 100644 (file)
@@ -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 .= "<br />\n" ;
                }
                $r .= "</div>\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) {
index 7f39d4a..c8819e1 100644 (file)
@@ -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 " <em>($formatted)</em>";
+                       return " <span class='comment'>($formatted)</span>";
                }
        }
 
index 744de13..66ed592 100644 (file)
@@ -194,10 +194,7 @@ class PageHistory {
                $s .= $isminor ? ' <span class="minor">'.$message['minoreditletter'].'</span>': '' ;
 
 
-               if ( '' != $c && '*' != $c ) {
-                       $c = $this->mSkin->formatcomment( $c, $this->mTitle );
-                       $s .= " <em>($c)</em>";
-               }
+               $s .= $this->mSkin->commentBlock( $c, $this->mTitle );
                if ($notificationtimestamp && ($ts >= $notificationtimestamp)) {
                        $s .= wfMsg( 'updatedmarker' );
                }
index bda7a3c..c13a920 100644 (file)
@@ -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 = '<em>(' . $sk->formatComment( $comment, $page ) . ')</em> ';
-       }
+       $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
index cdc7f84..cd57458 100644 (file)
@@ -171,10 +171,7 @@ function wfAddRow( $block, $tag ) {
                  wfMsg( "unblocklink" ) . "</a>";
                $wgOut->addHTML( " ({$ublink})" );
        }
-       if ( "" != $block->mReason ) {
-               $wgOut->addHTML( " <em>(" . $sk->formatComment( $block->mReason ) .
-                 ")</em>" );
-       }
+       $wgOut->addHTML( $sk->commentBlock( $block->mReason ) );
        $wgOut->addHTML( "</li>\n" );
 }
 
index 1fb685a..76cfd5e 100644 (file)
@@ -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 = '(<em>' . $this->skin->formatComment( $s->log_comment ) . '</em>)';
-               }
+               $comment = $this->skin->commentBlock( $s->log_comment );
                $paramArray = LogPage::extractParams( $s->log_params );
                
                $action = LogPage::actionText( $s->log_type, $s->log_action, $titleLink, $paramArray );
index ca85ec4..c19ff75 100644 (file)
@@ -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 .= " <em>({$c})</em>";
-               }
+               $s .= $skin->commentBlock( $result->comment );
 
                return $s;
        }
index 616d5e8..f964d58 100644 (file)
@@ -413,8 +413,8 @@ class UndeleteForm {
                                        Title::makeTitle( NS_USER, $row->ar_user_text ),
                                        $userLink );
                        }
-                       $comment = $sk->formatComment( $row->ar_comment );
-                       $wgOut->addHTML( "<li>$checkBox $pageLink . . $userLink (<i>$comment</i>)</li>\n" );
+                       $comment = $sk->commentBlock( $row->ar_comment );
+                       $wgOut->addHTML( "<li>$checkBox $pageLink . . $userLink $comment</li>\n" );
 
                }
                $revisions->free();
index 947ab7a..6d6cb2f 100644 (file)
@@ -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 .= ' <i>(' . $skin->formatComment( $result->img_description ) . ')</i>';
-               }
+               . $skin->commentBlock( $result->img_description );
+               
                return $return;
        }
        
index 041ea69..35e0b47 100644 (file)
@@ -291,3 +291,6 @@ div.gallerytext {
         padding: 2px 4px;
 }       
 
+span.comment {
+       font-style: italic;
+}
index 97e2e70..34b5d70 100644 (file)
@@ -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;
+}