http://www.mediawiki.org/wiki/Special:Code/MediaWiki/76342
Revision: 76342
Author: raymond
Date: 2010-11-08 21:21:32 +0000 (Mon, 08 Nov 2010)
Log Message:
-----------
Add CSS classes (including namespace and pagename) to the enhanced recent
changes/watchlist entries
The old RC/WL have such classes since ages.
Modified Paths:
--------------
trunk/phase3/RELEASE-NOTES
trunk/phase3/includes/ChangesList.php
Modified: trunk/phase3/RELEASE-NOTES
===================================================================
--- trunk/phase3/RELEASE-NOTES 2010-11-08 21:07:10 UTC (rev 76341)
+++ trunk/phase3/RELEASE-NOTES 2010-11-08 21:21:32 UTC (rev 76342)
@@ -199,6 +199,8 @@
* (bug 20627) Installer should be in languages other than English
* Support for metadata in SVG files (title, description).
* Special:Search: Add CSS classes to 'none found' and 'create link' messages
+* Add CSS classes (including namespace and pagename) to the enhanced recent
+ changes/watchlist entries
=== Bug fixes in 1.17 ===
* (bug 17560) Half-broken deletion moved image files to deletion archive
Modified: trunk/phase3/includes/ChangesList.php
===================================================================
--- trunk/phase3/includes/ChangesList.php 2010-11-08 21:07:10 UTC (rev
76341)
+++ trunk/phase3/includes/ChangesList.php 2010-11-08 21:21:32 UTC (rev
76342)
@@ -593,7 +593,7 @@
# Process current cache
$ret = $this->recentChangesBlock();
$this->rc_cache = array();
- $ret .= Xml::element( 'h4', null, $date );
+ $ret .= Xml::element( 'h4', null, $date ) . "\n";
$this->lastdate = $date;
}
@@ -736,7 +736,15 @@
wfProfileIn( __METHOD__ );
- $r = '<table class="mw-enhanced-rc"><tr>';
+ # Add the namespace and title of the block as part of the class
+ if ( $block[0]->mAttribs['rc_log_type'] ) {
+ # Log entry
+ $classes = Sanitizer::escapeClass( 'mw-enhanced-rc
mw-changeslist-log-' . $block[0]->mAttribs['rc_log_type'] . '-' .
$block[0]->mAttribs['rc_title'] );
+ } else {
+ $classes = Sanitizer::escapeClass( 'mw-enhanced-rc
mw-changeslist-ns' . $block[0]->mAttribs['rc_namespace'] . '-' .
$block[0]->mAttribs['rc_title'] );
+ }
+ $r = Html::openElement( 'table', array( 'class' => $classes ) )
.
+ Html::openElement( 'tr' );
# Collate list of users
$userlinks = array();
@@ -1051,7 +1059,15 @@
extract( $rcObj->mAttribs );
$query['curid'] = $rc_cur_id;
- $r = '<table class="mw-enhanced-rc"><tr>';
+ if( $rc_log_type ) {
+ # Log entry
+ $classes = Sanitizer::escapeClass( 'mw-enhanced-rc
mw-changeslist-log-' . $rc_log_type . '-' . $rcObj->mAttribs['rc_title'] );
+ } else {
+ $classes = Sanitizer::escapeClass( 'mw-enhanced-rc
mw-changeslist-ns' . $rcObj->mAttribs['rc_namespace'] . '-' .
$rcObj->mAttribs['rc_title'] );
+ }
+ $r = Html::openElement( 'table', array( 'class' => $classes ) )
.
+ Html::openElement( 'tr' );
+
$r .= '<td class="mw-enhanced-rc">' . $this->spacerArrow() .
' ';
# Flag and Timestamp
if( $rc_type == RC_MOVE || $rc_type == RC_MOVE_OVER_REDIRECT ) {
_______________________________________________
MediaWiki-CVS mailing list
[email protected]
https://lists.wikimedia.org/mailman/listinfo/mediawiki-cvs