From: Raimond Spekking Date: Mon, 8 Nov 2010 21:21:32 +0000 (+0000) Subject: Add CSS classes (including namespace and pagename) to the enhanced recent changes... X-Git-Tag: 1.31.0-rc.0~33973 X-Git-Url: http://git.cyclocoop.org/%24image?a=commitdiff_plain;h=a2121f351b31c96e21936263e58b2bf3c4696684;p=lhc%2Fweb%2Fwiklou.git Add CSS classes (including namespace and pagename) to the enhanced recent changes/watchlist entries The old RC/WL have such classes since ages. --- diff --git a/RELEASE-NOTES b/RELEASE-NOTES index 3c52792c68..e0445e8ff5 100644 --- a/RELEASE-NOTES +++ b/RELEASE-NOTES @@ -199,6 +199,8 @@ LocalSettings.php. The specific bugs are listed below in the general notes. * (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 diff --git a/includes/ChangesList.php b/includes/ChangesList.php index 0a824d16a0..2d09a054d1 100644 --- a/includes/ChangesList.php +++ b/includes/ChangesList.php @@ -593,7 +593,7 @@ class EnhancedChangesList extends ChangesList { # 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 @@ class EnhancedChangesList extends ChangesList { wfProfileIn( __METHOD__ ); - $r = ''; + # 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 @@ class EnhancedChangesList extends ChangesList { extract( $rcObj->mAttribs ); $query['curid'] = $rc_cur_id; - $r = '
'; + 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 .= '
' . $this->spacerArrow() . ' '; # Flag and Timestamp if( $rc_type == RC_MOVE || $rc_type == RC_MOVE_OVER_REDIRECT ) {