Index: branches/change-tagging/phase3/includes/ChangeTags.php |
— | — | @@ -4,9 +4,11 @@ |
5 | 5 | die; |
6 | 6 | |
7 | 7 | class ChangeTags { |
8 | | - static function formatSummaryRow( $tags, $page, &$classes ) { |
| 8 | + static function formatSummaryRow( $tags, $page ) { |
9 | 9 | if (!$tags) |
10 | | - return ''; |
| 10 | + return array('',array()); |
| 11 | + |
| 12 | + $classes = array(); |
11 | 13 | |
12 | 14 | $tags = explode( ',', $tags ); |
13 | 15 | $displayTags = array(); |
— | — | @@ -19,7 +21,7 @@ |
20 | 22 | $classes[] = "mw-tag-$tag"; |
21 | 23 | } |
22 | 24 | |
23 | | - return '(' . implode( ', ', $displayTags ) . ')'; |
| 25 | + return array( '(' . implode( ', ', $displayTags ) . ')', $classes ); |
24 | 26 | } |
25 | 27 | |
26 | 28 | ## Basic utility method to add tags to a particular change, given its rc_id, rev_id and/or log_id. |
Index: branches/change-tagging/phase3/includes/LogEventsList.php |
— | — | @@ -360,7 +360,8 @@ |
361 | 361 | } |
362 | 362 | |
363 | 363 | // Any tags... |
364 | | - $tagDisplay = ChangeTags::formatSummaryRow( $row->ts_tags, 'logevent', &$classes ); |
| 364 | + list($tagDisplay, $newClasses) = ChangeTags::formatSummaryRow( $row->ts_tags, 'logevent' ); |
| 365 | + $classes = array_merge( $classes, $newClasses ); |
365 | 366 | |
366 | 367 | if( $revert != '' ) { |
367 | 368 | $revert = '<span class="mw-logevent-actionlink">' . $revert . '</span>'; |
Index: branches/change-tagging/phase3/includes/ChangesList.php |
— | — | @@ -386,7 +386,9 @@ |
387 | 387 | } |
388 | 388 | |
389 | 389 | # Tags, if any. |
390 | | - $s .= ' ' . ChangeTags::formatSummaryRow( $rc->mAttribs['ts_tags'], 'changeslist', &$classes); |
| 390 | + list($tagSummary, $newClasses) = ChangeTags::formatSummaryRow( $rc->mAttribs['ts_tags'], 'changeslist' ); |
| 391 | + $classes = array_merge( $classes, $newClasses ); |
| 392 | + $s .= ' ' . $tagSummary; |
391 | 393 | |
392 | 394 | ## Classes |
393 | 395 | $classes = implode( ' ', $classes ); |
Index: branches/change-tagging/phase3/includes/specials/SpecialNewpages.php |
— | — | @@ -266,7 +266,8 @@ |
267 | 267 | $classes[] = 'not-patrolled'; |
268 | 268 | |
269 | 269 | # Tags, if any. |
270 | | - $tagDisplay = ChangeTags::formatSummaryRow( $result->ts_tags, 'newpages', &$classes ); |
| 270 | + list( $tagDisplay, $newClasses ) = ChangeTags::formatSummaryRow( $result->ts_tags, 'newpages' ); |
| 271 | + $classes = array_merge( $classes, $newClasses ); |
271 | 272 | |
272 | 273 | $css = count($classes) ? ' class="'.implode( " ", $classes).'"' : ''; |
273 | 274 | |
Index: branches/change-tagging/phase3/includes/specials/SpecialContributions.php |
— | — | @@ -530,7 +530,9 @@ |
531 | 531 | } |
532 | 532 | |
533 | 533 | # Tags, if any. |
534 | | - $ret .= ' ' . ChangeTags::formatSummaryRow( $row->ts_tags, 'contributions', &$classes ); |
| 534 | + list($tagSummary, $newClasses) = ChangeTags::formatSummaryRow( $row->ts_tags, 'contributions' ); |
| 535 | + $classes = array_merge( $classes, $newClasses ); |
| 536 | + $ret .= " $tagSummary"; |
535 | 537 | |
536 | 538 | // Let extensions add data |
537 | 539 | wfRunHooks( 'ContributionsLineEnding', array( &$this, &$ret, $row ) ); |
Index: branches/change-tagging/phase3/includes/PageHistory.php |
— | — | @@ -363,7 +363,9 @@ |
364 | 364 | } |
365 | 365 | |
366 | 366 | # Tags |
367 | | - $s .= ' ' . ChangeTags::formatSummaryRow( $row->ts_tags, 'history', &$classes ); |
| 367 | + list($tagSummary, $newClasses) = ChangeTags::formatSummaryRow( $row->ts_tags, 'history' ); |
| 368 | + $classes = array_merge( $classes, $newClasses ); |
| 369 | + $s .= " $tagSummary"; |
368 | 370 | |
369 | 371 | wfRunHooks( 'PageHistoryLineEnding', array( $this, &$row , &$s ) ); |
370 | 372 | |