* (bug 8140) Add dedicated CSS classes to Special:Newpages elements
authorRaimond Spekking <raymond@users.mediawiki.org>
Mon, 9 Aug 2010 19:04:14 +0000 (19:04 +0000)
committerRaimond Spekking <raymond@users.mediawiki.org>
Mon, 9 Aug 2010 19:04:14 +0000 (19:04 +0000)
Especially needed for transclution of this special page to hide unneeded elements.

RELEASE-NOTES
includes/specials/SpecialNewpages.php

index efbb10d..3bd9e30 100644 (file)
@@ -142,6 +142,7 @@ it from source control: http://www.mediawiki.org/wiki/Download_from_SVN
 * The HTML ID's generated for sections are now much prettier when they contain
   punctuation or non-English letters, so a section named "Hello?" will now
   result in a URL ending in "#Hello?" rather than "#Hello.3F".
+* (bug 8140) Add dedicated CSS classes to Special:Newpages elements
 
 === Bug fixes in 1.17 ===
 * (bug 17560) Half-broken deletion moved image files to deletion archive
index e0bd309..c49ce99 100644 (file)
@@ -267,7 +267,9 @@ class SpecialNewpages extends IncludableSpecialPage {
                $dm = $wgContLang->getDirMark();
 
                $title = Title::makeTitleSafe( $result->rc_namespace, $result->rc_title );
-               $time = htmlspecialchars( $wgLang->timeAndDate( $result->rc_timestamp, true ) );
+               $time = Html::rawElement( 'span', array( 'class' => 'mw-newpages-time' ),
+                       htmlspecialchars( $wgLang->timeAndDate( $result->rc_timestamp, true ) )
+               );
 
                $query = array( 'redirect' => 'no' );
 
@@ -277,17 +279,21 @@ class SpecialNewpages extends IncludableSpecialPage {
                $plink = $this->skin->linkKnown(
                        $title,
                        null,
-                       array(),
+                       array( 'class' => 'mw-newpages-pagename' ),
                        $query
                );
-               $hist = $this->skin->linkKnown(
+               $histLink = $this->skin->linkKnown(
                        $title,
                        wfMsgHtml( 'hist' ),
                        array(),
                        array( 'action' => 'history' )
                );
-               $length = wfMsgExt( 'nbytes', array( 'parsemag', 'escape' ),
-                       $wgLang->formatNum( $result->length ) );
+               $hist = Html::rawElement( 'span', array( 'class' => 'mw-newpages-history' ), wfMsg( 'parentheses', $histLink ) );
+
+               $length = Html::rawElement( 'span', array( 'class' => 'mw-newpages-length' ),
+                               '[' . wfMsgExt( 'nbytes', array( 'parsemag', 'escape' ), $wgLang->formatNum( $result->length ) ) .
+                               ']'
+               );
                $ulink = $this->skin->userLink( $result->rc_user, $result->rc_user_text ) . ' ' .
                        $this->skin->userToolLinks( $result->rc_user, $result->rc_user_text );
                $comment = $this->skin->commentBlock( $result->rc_comment );
@@ -305,7 +311,7 @@ class SpecialNewpages extends IncludableSpecialPage {
 
                $css = count($classes) ? ' class="'.implode( " ", $classes).'"' : '';
 
-               return "<li{$css}>{$time} {$dm}{$plink} ({$hist}) {$dm}[{$length}] {$dm}{$ulink} {$comment} {$tagDisplay}</li>\n";
+               return "<li{$css}>{$time} {$dm}{$plink} {$hist} {$dm}{$length} {$dm}{$ulink} {$comment} {$tagDisplay}</li>\n";
        }
 
        /**