r70773 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r70772‎ | r70773 | r70774 >
Date:19:04, 9 August 2010
Author:raymond
Status:ok
Tags:
Comment:
* (bug 8140) Add dedicated CSS classes to Special:Newpages elements
Especially needed for transclution of this special page to hide unneeded elements.
Modified paths:
  • /trunk/phase3/RELEASE-NOTES (modified) (history)
  • /trunk/phase3/includes/specials/SpecialNewpages.php (modified) (history)

Diff [purge]

Index: trunk/phase3/includes/specials/SpecialNewpages.php
@@ -267,7 +267,9 @@
268268 $dm = $wgContLang->getDirMark();
269269
270270 $title = Title::makeTitleSafe( $result->rc_namespace, $result->rc_title );
271 - $time = htmlspecialchars( $wgLang->timeAndDate( $result->rc_timestamp, true ) );
 271+ $time = Html::rawElement( 'span', array( 'class' => 'mw-newpages-time' ),
 272+ htmlspecialchars( $wgLang->timeAndDate( $result->rc_timestamp, true ) )
 273+ );
272274
273275 $query = array( 'redirect' => 'no' );
274276
@@ -277,17 +279,21 @@
278280 $plink = $this->skin->linkKnown(
279281 $title,
280282 null,
281 - array(),
 283+ array( 'class' => 'mw-newpages-pagename' ),
282284 $query
283285 );
284 - $hist = $this->skin->linkKnown(
 286+ $histLink = $this->skin->linkKnown(
285287 $title,
286288 wfMsgHtml( 'hist' ),
287289 array(),
288290 array( 'action' => 'history' )
289291 );
290 - $length = wfMsgExt( 'nbytes', array( 'parsemag', 'escape' ),
291 - $wgLang->formatNum( $result->length ) );
 292+ $hist = Html::rawElement( 'span', array( 'class' => 'mw-newpages-history' ), wfMsg( 'parentheses', $histLink ) );
 293+
 294+ $length = Html::rawElement( 'span', array( 'class' => 'mw-newpages-length' ),
 295+ '[' . wfMsgExt( 'nbytes', array( 'parsemag', 'escape' ), $wgLang->formatNum( $result->length ) ) .
 296+ ']'
 297+ );
292298 $ulink = $this->skin->userLink( $result->rc_user, $result->rc_user_text ) . ' ' .
293299 $this->skin->userToolLinks( $result->rc_user, $result->rc_user_text );
294300 $comment = $this->skin->commentBlock( $result->rc_comment );
@@ -305,7 +311,7 @@
306312
307313 $css = count($classes) ? ' class="'.implode( " ", $classes).'"' : '';
308314
309 - return "<li{$css}>{$time} {$dm}{$plink} ({$hist}) {$dm}[{$length}] {$dm}{$ulink} {$comment} {$tagDisplay}</li>\n";
 315+ return "<li{$css}>{$time} {$dm}{$plink} {$hist} {$dm}{$length} {$dm}{$ulink} {$comment} {$tagDisplay}</li>\n";
310316 }
311317
312318 /**
Index: trunk/phase3/RELEASE-NOTES
@@ -142,6 +142,7 @@
143143 * The HTML ID's generated for sections are now much prettier when they contain
144144 punctuation or non-English letters, so a section named "Hello?" will now
145145 result in a URL ending in "#Hello?" rather than "#Hello.3F".
 146+* (bug 8140) Add dedicated CSS classes to Special:Newpages elements
146147
147148 === Bug fixes in 1.17 ===
148149 * (bug 17560) Half-broken deletion moved image files to deletion archive

Follow-up revisions

RevisionCommit summaryAuthorDate
r70774Follow-up r70773 per Niklas suggestion.raymond19:25, 9 August 2010

Status & tagging log