Index: trunk/extensions/GlobalUsage/SpecialGlobalUsage.php |
— | — | @@ -167,6 +167,10 @@ |
168 | 168 | |
169 | 169 | /** |
170 | 170 | * 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 |
171 | 175 | */ |
172 | 176 | public static function onImagePageAfterImageLinks( $imagePage, &$html ) { |
173 | 177 | if ( !self::hasResults( $imagePage ) ) |
— | — | @@ -179,9 +183,11 @@ |
180 | 184 | |
181 | 185 | $guHtml = ''; |
182 | 186 | 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( |
184 | 190 | 'globalusage-on-wiki', 'parseinline', |
185 | | - $targetName, WikiMap::getWikiName( $wiki ) ) . "\n<ul>"; |
| 191 | + $targetName, $wikiName ) . "\n<ul>"; |
186 | 192 | foreach ( $result as $item ) |
187 | 193 | $guHtml .= "\t<li>" . self::formatItem( $item ) . "</li>\n"; |
188 | 194 | $guHtml .= "</ul></li>\n"; |
— | — | @@ -195,7 +201,6 @@ |
196 | 202 | $html .= wfMsgExt( 'globalusage-more', 'parse', $targetName ); |
197 | 203 | } |
198 | 204 | |
199 | | - |
200 | 205 | return true; |
201 | 206 | } |
202 | 207 | |