r60926 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r60925‎ | r60926 | r60927 >
Date:09:51, 11 January 2010
Author:raymond
Status:ok
Tags:
Comment:
Add a CSS class to the li element to allow styling for individual projects
Modified paths:
  • /trunk/extensions/GlobalUsage/SpecialGlobalUsage.php (modified) (history)

Diff [purge]

Index: trunk/extensions/GlobalUsage/SpecialGlobalUsage.php
@@ -167,6 +167,10 @@
168168
169169 /**
170170 * Show a global usage section on the image page
 171+ *
 172+ * @param object $imagePage The ImagePage
 173+ * @param string $html HTML to add to the image page as global usage section
 174+ * @return bool
171175 */
172176 public static function onImagePageAfterImageLinks( $imagePage, &$html ) {
173177 if ( !self::hasResults( $imagePage ) )
@@ -179,9 +183,11 @@
180184
181185 $guHtml = '';
182186 foreach ( $query->getSingleImageResult() as $wiki => $result ) {
183 - $guHtml .= '<li>' . wfMsgExt(
 187+ $wikiName = WikiMap::getWikiName( $wiki );
 188+ $escWikiName = Sanitizer::escapeClass( $wikiName );
 189+ $guHtml .= "<li class='mw-gu-onwiki-$escWikiName'>" . wfMsgExt(
184190 'globalusage-on-wiki', 'parseinline',
185 - $targetName, WikiMap::getWikiName( $wiki ) ) . "\n<ul>";
 191+ $targetName, $wikiName ) . "\n<ul>";
186192 foreach ( $result as $item )
187193 $guHtml .= "\t<li>" . self::formatItem( $item ) . "</li>\n";
188194 $guHtml .= "</ul></li>\n";
@@ -195,7 +201,6 @@
196202 $html .= wfMsgExt( 'globalusage-more', 'parse', $targetName );
197203 }
198204
199 -
200205 return true;
201206 }
202207

Status & tagging log